CMS 3D CMS Logo

AlignableDTWheel.cc
Go to the documentation of this file.
1 
10 
12 AlignableDTWheel::AlignableDTWheel(const std::vector<AlignableDTStation*>& dtStations)
13  : AlignableComposite(dtStations[0]->id(), align::AlignableDTWheel) {
14  theDTStations.insert(theDTStations.end(), dtStations.begin(), dtStations.end());
15 
16  // maintain also list of components
17  for (const auto& station : dtStations) {
18  const auto mother = station->mother();
19  this->addComponent(station); // components will be deleted by dtor of AlignableComposite
20  station->setMother(mother); // restore previous behaviour where mother is not set
21  }
22 
25 }
26 
29  if (i >= size())
30  throw cms::Exception("LogicError") << "Station index (" << i << ") out of range";
31 
32  return *theDTStations[i];
33 }
34 
39 }
40 
43  float zz = 0.;
44 
45  for (std::vector<AlignableDTStation*>::iterator ilayer = theDTStations.begin(); ilayer != theDTStations.end();
46  ilayer++)
47  zz += (*ilayer)->globalPosition().z();
48 
49  zz /= static_cast<float>(theDTStations.size());
50 
51  return PositionType(0.0, 0.0, zz);
52 }
53 
56 
58 std::ostream& operator<<(std::ostream& os, const AlignableDTWheel& b) {
59  os << "This DTWheel contains " << b.theDTStations.size() << " DT stations" << std::endl;
60  os << "(phi, r, z) = (" << b.globalPosition().phi() << "," << b.globalPosition().perp() << ","
61  << b.globalPosition().z();
62  os << "), orientation:" << std::endl << b.globalRotation() << std::endl;
63  return os;
64 }
65 
67 void AlignableDTWheel::dump(void) const {
68  edm::LogInfo("AlignableDump") << (*this);
69  for (std::vector<AlignableDTStation*>::const_iterator iStation = theDTStations.begin();
70  iStation != theDTStations.end();
71  iStation++)
72  (*iStation)->dump();
73 }
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
std::ostream & operator<<(std::ostream &os, const AlignableDTWheel &b)
Output Wheel information.
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)
Log< level::Info, false > LogInfo
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:31
int size() const
Return number of direct components.
Definition: Alignable.h:68
align::PositionType PositionType
Definition: Alignable.h:30
void dump(void) const override
Recursive printout of the muon DT wheel structure.
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
std::vector< AlignableDTStation * > theDTStations
CompConstraintType compConstraintType_
Definition: Alignable.h:246
void addComponent(Alignable *component) final
AlignableDTWheel(const std::vector< AlignableDTStation *> &dtStations)
The constructor simply copies the vector of stations and computes the surface from them...