CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
18  compConstraintType_ = Alignable::CompConstraintType::POSITION_Z;
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 }
RotationType computeOrientation()
T perp() const
Definition: PV3DBase.h:69
uint16_t *__restrict__ id
PositionType computePosition()
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
std::vector< AlignableGEMSuperChamber * > theGEMSuperChambers
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
void setSurface(const AlignableSurface &s)
T z() const
Definition: PV3DBase.h:61
Log< level::Info, false > LogInfo
void dump(void) const override
Recursive printout of alignable structure.
double b
Definition: hdecay.h:118
align::RotationType RotationType
Definition: Alignable.h:31
AlignableSurface computeSurface()
align::PositionType PositionType
Definition: Alignable.h:30
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
AlignableGEMSuperChamber & superChamber(int i)
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
AlignableGEMRing(const std::vector< AlignableGEMSuperChamber * > &GEMSuperChambers)