CMS 3D CMS Logo

AlignableDTStation.cc
Go to the documentation of this file.
1 
10 
12 AlignableDTStation::AlignableDTStation(const std::vector<AlignableDTChamber*>& dtChambers)
13  : AlignableComposite(dtChambers[0]->id(), align::AlignableDTStation) {
14  theDTChambers.insert(theDTChambers.end(), dtChambers.begin(), dtChambers.end());
15 
16  // maintain also list of components
17  for (const auto& chamber : dtChambers) {
18  const auto mother = chamber->mother();
19  this->addComponent(chamber); // components will be deleted by dtor of AlignableComposite
20  chamber->setMother(mother); // restore previous behaviour where mother is not set
21  }
22 
25 }
26 
29  if (i >= size())
30  throw cms::Exception("LogicError") << "DT Chamber index (" << i << ") out of range";
31 
32  return *theDTChambers[i];
33 }
34 
39 }
40 
43  float zz = 0.;
44 
45  for (std::vector<AlignableDTChamber*>::iterator ilayer = theDTChambers.begin(); ilayer != theDTChambers.end();
46  ilayer++)
47  zz += (*ilayer)->globalPosition().z();
48 
49  zz /= static_cast<float>(theDTChambers.size());
50 
51  return PositionType(0.0, 0.0, zz);
52 }
53 
56 
58 std::ostream& operator<<(std::ostream& os, const AlignableDTStation& b) {
59  os << "This DT Station contains " << b.theDTChambers.size() << " DT chambers" << 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 AlignableDTStation::dump(void) const {
68  edm::LogInfo("AlignableDump") << (*this);
69  for (std::vector<AlignableDTChamber*>::const_iterator iChamber = theDTChambers.begin();
70  iChamber != theDTChambers.end();
71  iChamber++)
72  edm::LogInfo("AlignableDump") << (**iChamber);
73 }
TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:428
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
MessageLogger.h
align
Definition: AlignableIndexer.h:30
AlignableDTStation::chamber
AlignableDTChamber & chamber(int i)
Return Alignable DT Chamber at given index.
Definition: AlignableDTStation.cc:28
AlignableDTStation::AlignableDTStation
AlignableDTStation(const std::vector< AlignableDTChamber * > &dtChambers)
The constructor simply copies the vector of DT Chambers and computes the surface from them.
Definition: AlignableDTStation.cc:12
AlignableDTStation::computeSurface
AlignableSurface computeSurface()
Definition: AlignableDTStation.cc:37
AlignableComposite
Definition: AlignableComposite.h:25
Alignable::CompConstraintType::POSITION_Z
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlignableComposite::setSurface
void setSurface(const AlignableSurface &s)
Definition: AlignableComposite.h:112
AlignableDTStation::computeOrientation
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
Definition: AlignableDTStation.cc:55
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
AlignableDTStation::computePosition
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
Definition: AlignableDTStation.cc:42
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
operator<<
std::ostream & operator<<(std::ostream &os, const AlignableDTStation &b)
Output Station information.
Definition: AlignableDTStation.cc:58
AlignableDTStation.h
Alignable::setMother
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
AlignableDTStation::theDTChambers
std::vector< AlignableDTChamber * > theDTChambers
Definition: AlignableDTStation.h:47
AlignableDTStation::dump
void dump(void) const override
Recursive printout of the muon DT Station structure.
Definition: AlignableDTStation.cc:67
AlignableSurface
Definition: AlignableSurface.h:20
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
AlignableDTChamber
A muon DT Chamber( an AlignableDet )
Definition: AlignableDTChamber.h:24
edm::Log
Definition: MessageLogger.h:70
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