CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignableCSCRing.cc
Go to the documentation of this file.
1 
11 
12 
13 
15 AlignableCSCRing::AlignableCSCRing( const std::vector<AlignableCSCChamber*>& cscChambers )
16  : AlignableComposite(cscChambers[0]->id(), align::AlignableCSCRing)
17 {
18 
19  theCSCChambers.insert( theCSCChambers.end(), cscChambers.begin(), cscChambers.end() );
20 
22 
23 }
24 
25 
28 {
29  for ( std::vector<AlignableCSCChamber*>::iterator iter = theCSCChambers.begin();
30  iter != theCSCChambers.end(); iter++)
31  delete *iter;
32 
33 }
34 
37 {
38 
39  if (i >= size() )
40  throw cms::Exception("LogicError") << "CSC Chamber index (" << i << ") out of range";
41 
42  return *theCSCChambers[i];
43 
44 }
45 
46 
50 {
51 
53 
54 }
55 
56 
57 
60 {
61 
62  float zz = 0.;
63 
64  for ( std::vector<AlignableCSCChamber*>::iterator ichamber = theCSCChambers.begin();
65  ichamber != theCSCChambers.end(); ichamber++ )
66  zz += (*ichamber)->globalPosition().z();
67 
68  zz /= static_cast<float>(theCSCChambers.size());
69 
70  return PositionType( 0.0, 0.0, zz );
71 
72 }
73 
74 
77 {
78  return RotationType();
79 }
80 
81 
82 // /// Twists all components by given angle
83 // void AlignableCSCRing::twist(float rad)
84 // {
85 // for ( std::vector<AlignableCSCChamber*>::iterator iter = theCSCChambers.begin();
86 // iter != theCSCChambers.end(); iter++ )
87 // (*iter)->twist(rad);
88 
89 // }
90 
91 
93 std::ostream &operator << (std::ostream& os, const AlignableCSCRing& b )
94 {
95 
96  os << "This CSC Ring contains " << b.theCSCChambers.size() << " CSC chambers" << std::endl;
97  os << "(phi, r, z) = (" << b.globalPosition().phi() << ","
98  << b.globalPosition().perp() << "," << b.globalPosition().z();
99  os << "), orientation:" << std::endl<< b.globalRotation() << std::endl;
100  return os;
101 
102 }
103 
104 
106 void AlignableCSCRing::dump( void ) const
107 {
108 
109  edm::LogInfo("AlignableDump") << (*this);
110  for ( std::vector<AlignableCSCChamber*>::const_iterator iChamber = theCSCChambers.begin();
111  iChamber != theCSCChambers.end(); iChamber++ )
112  edm::LogInfo("AlignableDump") << (**iChamber);
113 
114 }
int i
Definition: DBlmapReader.cc:9
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:137
AlignableCSCRing(const std::vector< AlignableCSCChamber * > &cscChambers)
The constructor simply copies the vector of CSC Chambers and computes the surface from them...
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
~AlignableCSCRing()
Clean delete of the vector and its elements.
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
void setSurface(const AlignableSurface &s)
T z() const
Definition: PV3DBase.h:64
std::vector< AlignableCSCChamber * > theCSCChambers
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:36
align::PositionType PositionType
Definition: Alignable.h:35
AlignableSurface computeSurface()
void dump(void) const
Recursive printout of the muon CSC Ring structure.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:134
AlignableCSCChamber & chamber(int i)
Return Alignable CSC Chamber at given index.
int size() const
Return number of direct components.
Definition: Alignable.h:67
A muon CSC Chamber( an AlignableDet )