CMS 3D CMS Logo

AlignableGEMRing.cc
Go to the documentation of this file.
1 /* AlignableGEMRing
2  * \author Hyunyong Kim - TAMU
3  */
6 
7 AlignableGEMRing::AlignableGEMRing(const std::vector<AlignableGEMSuperChamber*>& GEMSuperChambers)
8  : AlignableComposite(GEMSuperChambers[0]->id(), align::AlignableGEMRing) {
9  theGEMSuperChambers.insert(theGEMSuperChambers.end(), GEMSuperChambers.begin(), GEMSuperChambers.end());
10 
11  for (const auto& chamber : GEMSuperChambers) {
12  const auto mother = chamber->mother();
13  this->addComponent(chamber);
14  chamber->setMother(mother);
15  }
16 
19 }
20 
22  if (i >= size())
23  throw cms::Exception("LogicError") << "GEM Super Chamber index (" << i << ") out of range";
24 
25  return *theGEMSuperChambers[i];
26 }
27 
30 }
31 
33  float zz = 0.;
34 
35  for (std::vector<AlignableGEMSuperChamber*>::iterator ichamber = theGEMSuperChambers.begin();
36  ichamber != theGEMSuperChambers.end();
37  ichamber++)
38  zz += (*ichamber)->globalPosition().z();
39 
40  zz /= static_cast<float>(theGEMSuperChambers.size());
41 
42  return PositionType(0.0, 0.0, zz);
43 }
44 
46 
47 std::ostream& operator<<(std::ostream& os, const AlignableGEMRing& b) {
48  os << "This GEM Ring contains " << b.theGEMSuperChambers.size() << " GEM Super chambers" << std::endl;
49  os << "(phi, r, z) = (" << b.globalPosition().phi() << "," << b.globalPosition().perp() << ","
50  << b.globalPosition().z();
51  os << "), orientation:" << std::endl << b.globalRotation() << std::endl;
52  return os;
53 }
54 
55 void AlignableGEMRing::dump(void) const {
56  edm::LogInfo("AlignableDump") << (*this);
57  for (std::vector<AlignableGEMSuperChamber*>::const_iterator iChamber = theGEMSuperChambers.begin();
58  iChamber != theGEMSuperChambers.end();
59  iChamber++)
60  edm::LogInfo("AlignableDump") << (**iChamber);
61 }
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
RotationType computeOrientation()
PositionType computePosition()
std::vector< AlignableGEMSuperChamber * > theGEMSuperChambers
void setSurface(const AlignableSurface &s)
Log< level::Info, false > LogInfo
void dump(void) const override
Recursive printout of alignable structure.
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:31
AlignableSurface computeSurface()
int size() const
Return number of direct components.
Definition: Alignable.h:68
align::PositionType PositionType
Definition: Alignable.h:30
CompConstraintType compConstraintType_
Definition: Alignable.h:246
AlignableGEMSuperChamber & superChamber(int i)
AlignableGEMRing(const std::vector< AlignableGEMSuperChamber *> &GEMSuperChambers)
void addComponent(Alignable *component) final
std::ostream & operator<<(std::ostream &os, const AlignableGEMRing &b)