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 }
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
AlignableGEMStation::AlignableGEMStation
AlignableGEMStation(const std::vector< AlignableGEMRing * > &GEMRings)
Definition: AlignableGEMStation.cc:7
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
operator<<
std::ostream & operator<<(std::ostream &os, const AlignableGEMStation &b)
Definition: AlignableGEMStation.cc:45
AlignableGEMStation::dump
void dump(void) const override
Recursive printout of alignable structure.
Definition: AlignableGEMStation.cc:53
AlignableGEMStation::theGEMRings
std::vector< AlignableGEMRing * > theGEMRings
Definition: AlignableGEMStation.h:36
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
AlignableGEMRing
Definition: AlignableGEMRing.h:16
AlignableGEMStation::computeOrientation
RotationType computeOrientation()
Definition: AlignableGEMStation.cc:43
Point3DBase< Scalar, GlobalTag >
b
double b
Definition: hdecay.h:118
AlignableGEMStation
Definition: AlignableGEMStation.h:19
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
AlignableGEMStation::ring
AlignableGEMRing & ring(int i)
Definition: AlignableGEMStation.cc:21
AlignableGEMStation::computePosition
PositionType computePosition()
Definition: AlignableGEMStation.cc:32
Alignable::setMother
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
AlignableGEMStation.h
AlignableSurface
Definition: AlignableSurface.h:20
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
edm::Log
Definition: MessageLogger.h:70
AlignableGEMStation::computeSurface
AlignableSurface computeSurface()
Definition: AlignableGEMStation.cc:28
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