CMS 3D CMS Logo

AlignableDTWheel.cc
Go to the documentation of this file.
1 
11 
12 
13 
15 AlignableDTWheel::AlignableDTWheel( const std::vector<AlignableDTStation*>& dtStations )
16  : AlignableComposite(dtStations[0]->id(), align::AlignableDTWheel)
17 {
18 
19  theDTStations.insert( theDTStations.end(), dtStations.begin(), dtStations.end() );
20 
21  // maintain also list of components
22  for (const auto& station: dtStations) {
23  const auto mother = station->mother();
24  this->addComponent(station); // components will be deleted by dtor of AlignableComposite
25  station->setMother(mother); // restore previous behaviour where mother is not set
26  }
27 
30 }
31 
34 {
35 
36  if (i >= size() )
37  throw cms::Exception("LogicError") << "Station index (" << i << ") out of range";
38 
39  return *theDTStations[i];
40 
41 }
42 
43 
47 {
48 
50 
51 }
52 
53 
54 
57 {
58 
59  float zz = 0.;
60 
61  for ( std::vector<AlignableDTStation*>::iterator ilayer = theDTStations.begin();
62  ilayer != theDTStations.end(); ilayer++ )
63  zz += (*ilayer)->globalPosition().z();
64 
65  zz /= static_cast<float>(theDTStations.size());
66 
67  return PositionType( 0.0, 0.0, zz );
68 
69 }
70 
71 
74 {
75  return RotationType();
76 }
77 
78 
80 std::ostream &operator << (std::ostream& os, const AlignableDTWheel& b )
81 {
82 
83  os << "This DTWheel contains " << b.theDTStations.size() << " DT stations" << std::endl;
84  os << "(phi, r, z) = (" << b.globalPosition().phi() << ","
85  << b.globalPosition().perp() << "," << b.globalPosition().z();
86  os << "), orientation:" << std::endl<< b.globalRotation() << std::endl;
87  return os;
88 
89 }
90 
91 
93 void AlignableDTWheel::dump( void ) const
94 {
95 
96  edm::LogInfo("AlignableDump") << (*this);
97  for ( std::vector<AlignableDTStation*>::const_iterator iStation = theDTStations.begin();
98  iStation != theDTStations.end(); iStation++ )
99  (*iStation)->dump();
100 
101 }
T perp() const
Definition: PV3DBase.h:72
friend std::ostream & operator<<(std::ostream &, const AlignableDTWheel &)
Printout muon DT wheel information (not recursive)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
AlignableDTWheel(const std::vector< AlignableDTStation * > &dtStations)
The constructor simply copies the vector of stations and computes the surface from them...
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
void dump(void) const override
Recursive printout of the muon DT wheel structure.
AlignableDTStation & station(int i)
Return Alignable DT Station at given index.
AlignableSurface computeSurface()
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
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:97
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:34
align::PositionType PositionType
Definition: Alignable.h:33
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
std::vector< AlignableDTStation * > theDTStations
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