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 }
TkRotation< Scalar >
AlignableDTWheel::station
AlignableDTStation & station(int i)
Return Alignable DT Station at given index.
Definition: AlignableDTWheel.cc:28
mps_fire.i
i
Definition: mps_fire.py:355
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
operator<<
std::ostream & operator<<(std::ostream &os, const AlignableDTWheel &b)
Output Wheel information.
Definition: AlignableDTWheel.cc:58
MessageLogger.h
align
Definition: AlignableIndexer.h:30
edm::LogInfo
Definition: MessageLogger.h:254
AlignableComposite
Definition: AlignableComposite.h:25
Alignable::CompConstraintType::POSITION_Z
AlignableComposite::setSurface
void setSurface(const AlignableSurface &s)
Definition: AlignableComposite.h:112
AlignableDTWheel::computeSurface
AlignableSurface computeSurface()
Definition: AlignableDTWheel.cc:37
AlignableDTWheel.h
AlignableDTStation
Definition: AlignableDTStation.h:27
Alignable::PositionType
align::PositionType PositionType
Definition: Alignable.h:30
Alignable::compConstraintType_
CompConstraintType compConstraintType_
Definition: Alignable.h:246
AlignableComposite::addComponent
void addComponent(Alignable *component) final
Definition: AlignableComposite.cc:53
Point3DBase< Scalar, GlobalTag >
b
double b
Definition: hdecay.h:118
AlignableDTWheel::dump
void dump(void) const override
Recursive printout of the muon DT wheel structure.
Definition: AlignableDTWheel.cc:67
AlignableDTWheel::computePosition
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
Definition: AlignableDTWheel.cc:42
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
Alignable::setMother
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
AlignableSurface
Definition: AlignableSurface.h:20
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
AlignableDTWheel::computeOrientation
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
Definition: AlignableDTWheel.cc:55
AlignableDTWheel::theDTStations
std::vector< AlignableDTStation * > theDTStations
Definition: AlignableDTWheel.h:47
AlignableDTWheel
Definition: AlignableDTWheel.h:27
AlignableDTWheel::AlignableDTWheel
AlignableDTWheel(const std::vector< AlignableDTStation * > &dtStations)
The constructor simply copies the vector of stations and computes the surface from them.
Definition: AlignableDTWheel.cc:12
Alignable::mother
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
Alignable::size
int size() const
Return number of direct components.
Definition: Alignable.h:68