CMS 3D CMS Logo

AlignableDTStation.cc
Go to the documentation of this file.
1 
11 
12 
13 
15 AlignableDTStation::AlignableDTStation( const std::vector<AlignableDTChamber*>& dtChambers )
16  : AlignableComposite(dtChambers[0]->id(), align::AlignableDTStation)
17 {
18 
19  theDTChambers.insert( theDTChambers.end(), dtChambers.begin(), dtChambers.end() );
20 
21  // maintain also list of components
22  for (const auto& chamber: dtChambers) {
23  const auto mother = chamber->mother();
24  this->addComponent(chamber); // components will be deleted by dtor of AlignableComposite
25  chamber->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") << "DT Chamber index (" << i << ") out of range";
39 
40  return *theDTChambers[i];
41 
42 }
43 
44 
48 {
49 
51 
52 }
53 
54 
55 
58 {
59 
60  float zz = 0.;
61 
62  for ( std::vector<AlignableDTChamber*>::iterator ilayer = theDTChambers.begin();
63  ilayer != theDTChambers.end(); ilayer++ )
64  zz += (*ilayer)->globalPosition().z();
65 
66  zz /= static_cast<float>(theDTChambers.size());
67 
68  return PositionType( 0.0, 0.0, zz );
69 
70 }
71 
72 
75 {
76  return RotationType();
77 }
78 
79 
80 
82 std::ostream &operator << (std::ostream& os, const AlignableDTStation& b )
83 {
84 
85  os << "This DT Station contains " << b.theDTChambers.size() << " DT chambers" << std::endl;
86  os << "(phi, r, z) = (" << b.globalPosition().phi() << ","
87  << b.globalPosition().perp() << "," << b.globalPosition().z();
88  os << "), orientation:" << std::endl<< b.globalRotation() << std::endl;
89  return os;
90 
91 }
92 
93 
95 void AlignableDTStation::dump( void ) const
96 {
97 
98  edm::LogInfo("AlignableDump") << (*this);
99  for ( std::vector<AlignableDTChamber*>::const_iterator iChamber = theDTChambers.begin();
100  iChamber != theDTChambers.end(); iChamber++ )
101  edm::LogInfo("AlignableDump") << (**iChamber);
102 
103 }
A muon DT Chamber( an AlignableDet )
AlignableSurface computeSurface()
T perp() const
Definition: PV3DBase.h:72
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
AlignableDTChamber & chamber(int i)
Return Alignable DT Chamber at given index.
void setSurface(const AlignableSurface &s)
friend std::ostream & operator<<(std::ostream &, const AlignableDTStation &)
Printout muon DT Station information (not recursive)
T z() const
Definition: PV3DBase.h:64
std::vector< AlignableDTChamber * > theDTChambers
AlignableDTStation(const std::vector< AlignableDTChamber * > &dtChambers)
The constructor simply copies the vector of DT Chambers and computes the surface from them...
void dump(void) const override
Recursive printout of the muon DT Station structure.
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:97
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
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