CMS 3D CMS Logo

AlignableGEMStation.cc
Go to the documentation of this file.
1 /* AlignableGEMStation
2  * \author Hyunyong Kim - TAMU
3  */
6 
7 AlignableGEMStation::AlignableGEMStation(const std::vector<AlignableGEMRing*>& GEMRings)
8  : AlignableComposite(GEMRings[0]->id(), align::AlignableGEMStation) {
9  theGEMRings.insert(theGEMRings.end(), GEMRings.begin(), GEMRings.end());
10 
11  for (const auto& ring : GEMRings) {
12  const auto mother = ring->mother();
13  this->addComponent(ring);
15  }
16 
19 }
20 
22  if (i >= size())
23  throw cms::Exception("LogicError") << "GEM Ring index (" << i << ") out of range";
24 
25  return *theGEMRings[i];
26 }
27 
30 }
31 
33  float zz = 0.;
34 
35  for (std::vector<AlignableGEMRing*>::iterator ilayer = theGEMRings.begin(); ilayer != theGEMRings.end(); ilayer++)
36  zz += (*ilayer)->globalPosition().z();
37 
38  zz /= static_cast<float>(theGEMRings.size());
39 
40  return PositionType(0.0, 0.0, zz);
41 }
42 
44 
45 std::ostream& operator<<(std::ostream& os, const AlignableGEMStation& b) {
46  os << "This GEM Station contains " << b.theGEMRings.size() << " GEM rings" << std::endl;
47  os << "(phi, r, z) = (" << b.globalPosition().phi() << "," << b.globalPosition().perp() << ","
48  << b.globalPosition().z();
49  os << "), orientation:" << std::endl << b.globalRotation() << std::endl;
50  return os;
51 }
52 
53 void AlignableGEMStation::dump(void) const {
54  edm::LogInfo("AlignableDump") << (*this);
55  for (std::vector<AlignableGEMRing*>::const_iterator iRing = theGEMRings.begin(); iRing != theGEMRings.end(); iRing++)
56  edm::LogInfo("AlignableDump") << (**iRing);
57 }
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
RotationType computeOrientation()
void dump(void) const override
Recursive printout of alignable structure.
AlignableGEMRing & ring(int i)
std::vector< AlignableGEMRing * > theGEMRings
void setSurface(const AlignableSurface &s)
AlignableGEMStation(const std::vector< AlignableGEMRing *> &GEMRings)
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
PositionType computePosition()
CompConstraintType compConstraintType_
Definition: Alignable.h:246
std::ostream & operator<<(std::ostream &os, const AlignableGEMStation &b)
AlignableSurface computeSurface()
void addComponent(Alignable *component) final