CMS 3D CMS Logo

AlignableCSCStation.cc
Go to the documentation of this file.
1 
11 
12 
13 
15 AlignableCSCStation::AlignableCSCStation( const std::vector<AlignableCSCRing*>& cscRings )
17 {
18 
19  theCSCRings.insert( theCSCRings.end(), cscRings.begin(), cscRings.end() );
20 
21  // maintain also list of components
22  for (const auto& ring: cscRings) {
23  const auto mother = ring->mother();
24  this->addComponent(ring); // components will be deleted by dtor of AlignableComposite
25  ring->setMother(mother); // restore previous behaviour where mother is not set
26  }
27 
30 }
31 
32 
35 {
36 
37  if (i >= size() )
38  throw cms::Exception("LogicError") << "CSC Ring index (" << i << ") out of range";
39 
40  return *theCSCRings[i];
41 
42 }
43 
44 
48 {
49 
51 
52 }
53 
54 
55 
58 {
59 
60  float zz = 0.;
61 
62  for ( std::vector<AlignableCSCRing*>::iterator ilayer = theCSCRings.begin();
63  ilayer != theCSCRings.end(); ilayer++ )
64  zz += (*ilayer)->globalPosition().z();
65 
66  zz /= static_cast<float>(theCSCRings.size());
67 
68  return PositionType( 0.0, 0.0, zz );
69 
70 }
71 
72 
75 {
76  return RotationType();
77 }
78 
79 
80 // /// Twists all components by given angle
81 // void AlignableCSCStation::twist(float rad)
82 // {
83 // for ( std::vector<AlignableCSCRing*>::iterator iter = theCSCRings.begin();
84 // iter != theCSCRings.end(); iter++ )
85 // (*iter)->twist(rad);
86 
87 // }
88 
89 
91 std::ostream &operator << (std::ostream& os, const AlignableCSCStation& b )
92 {
93 
94  os << "This CSC Station contains " << b.theCSCRings.size() << " CSC rings" << std::endl;
95  os << "(phi, r, z) = (" << b.globalPosition().phi() << ","
96  << b.globalPosition().perp() << "," << b.globalPosition().z();
97  os << "), orientation:" << std::endl<< b.globalRotation() << std::endl;
98  return os;
99 
100 }
101 
102 
104 void AlignableCSCStation::dump( void ) const
105 {
106 
107  edm::LogInfo("AlignableDump") << (*this);
108  for ( std::vector<AlignableCSCRing*>::const_iterator iRing = theCSCRings.begin();
109  iRing != theCSCRings.end(); iRing++ )
110  edm::LogInfo("AlignableDump") << (**iRing);
111 
112 }
AlignableCSCStation(const std::vector< AlignableCSCRing * > &cscRings)
The constructor simply copies the vector of CSC Rings and computes the surface from them...
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
T perp() const
Definition: PV3DBase.h:72
void dump(void) const override
Recursive printout of the muon CSC Station structure.
AlignableCSCRing & ring(int i)
Return Alignable CSC Ring at given index.
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
void setSurface(const AlignableSurface &s)
friend std::ostream & operator<<(std::ostream &, const AlignableCSCStation &)
Printout muon CSC Station information (not recursive)
T z() const
Definition: PV3DBase.h:64
AlignableSurface computeSurface()
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:97
std::vector< AlignableCSCRing * > theCSCRings
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:34
align::PositionType PositionType
Definition: Alignable.h:33
CompConstraintType compConstraintType_
Definition: Alignable.h:255
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:94
void addComponent(Alignable *component) final
int size() const
Return number of direct components.
Definition: Alignable.h:71