CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignableCSCStation.cc
Go to the documentation of this file.
1 
11 
12 
13 
15 AlignableCSCStation::AlignableCSCStation( const std::vector<AlignableCSCRing*> cscRings )
16  : AlignableComposite(cscRings[0]->id(), align::AlignableCSCStation)
17 {
18 
19  theCSCRings.insert( theCSCRings.end(), cscRings.begin(), cscRings.end() );
20 
22 
23 }
24 
25 
28 {
29  for ( std::vector<AlignableCSCRing*>::iterator iter = theCSCRings.begin();
30  iter != theCSCRings.end(); iter++)
31  delete *iter;
32 
33 }
34 
37 {
38 
39  if (i >= size() )
40  throw cms::Exception("LogicError") << "CSC Ring index (" << i << ") out of range";
41 
42  return *theCSCRings[i];
43 
44 }
45 
46 
50 {
51 
53 
54 }
55 
56 
57 
60 {
61 
62  float zz = 0.;
63 
64  for ( std::vector<AlignableCSCRing*>::iterator ilayer = theCSCRings.begin();
65  ilayer != theCSCRings.end(); ilayer++ )
66  zz += (*ilayer)->globalPosition().z();
67 
68  zz /= static_cast<float>(theCSCRings.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 AlignableCSCStation::twist(float rad)
84 // {
85 // for ( std::vector<AlignableCSCRing*>::iterator iter = theCSCRings.begin();
86 // iter != theCSCRings.end(); iter++ )
87 // (*iter)->twist(rad);
88 
89 // }
90 
91 
93 std::ostream &operator << (std::ostream& os, const AlignableCSCStation& b )
94 {
95 
96  os << "This CSC Station contains " << b.theCSCRings.size() << " CSC rings" << 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 AlignableCSCStation::dump( void ) const
107 {
108 
109  edm::LogInfo("AlignableDump") << (*this);
110  for ( std::vector<AlignableCSCRing*>::const_iterator iRing = theCSCRings.begin();
111  iRing != theCSCRings.end(); iRing++ )
112  edm::LogInfo("AlignableDump") << (**iRing);
113 
114 }
int i
Definition: DBlmapReader.cc:9
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
T perp() const
Definition: PV3DBase.h:71
AlignableCSCRing & ring(int i)
Return Alignable CSC Ring at given index.
AlignableCSCStation(const std::vector< AlignableCSCRing * > cscRings)
The constructor simply copies the vector of CSC Rings and computes the surface from them...
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
~AlignableCSCStation()
Clean delete of the vector and its elements.
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
void dump(void) const
Recursive printout of the muon CSC Station structure.
void setSurface(const AlignableSurface &s)
T z() const
Definition: PV3DBase.h:63
AlignableSurface computeSurface()
std::vector< AlignableCSCRing * > theCSCRings
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:36
align::PositionType PositionType
Definition: Alignable.h:35
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
int size() const
Return number of direct components.
Definition: Alignable.h:67