CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
24  compConstraintType_ = Alignable::CompConstraintType::POSITION_Z;
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 }
T perp() const
Definition: PV3DBase.h:69
uint16_t *__restrict__ id
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
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:138
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
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:61
Log< level::Info, false > LogInfo
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
double b
Definition: hdecay.h:118
align::RotationType RotationType
Definition: Alignable.h:31
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
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
void addComponent(Alignable *component) final
int size() const
Return number of direct components.
Definition: Alignable.h:68