CMS 3D CMS Logo

AlignableCSCStation.cc
Go to the documentation of this file.
1 
10 
12 AlignableCSCStation::AlignableCSCStation(const std::vector<AlignableCSCRing*>& cscRings)
13  : AlignableComposite(cscRings[0]->id(), align::AlignableCSCStation) {
14  theCSCRings.insert(theCSCRings.end(), cscRings.begin(), cscRings.end());
15 
16  // maintain also list of components
17  for (const auto& ring : cscRings) {
18  const auto mother = ring->mother();
19  this->addComponent(ring); // components will be deleted by dtor of AlignableComposite
20  ring->setMother(mother); // restore previous behaviour where mother is not set
21  }
22 
25 }
26 
29  if (i >= size())
30  throw cms::Exception("LogicError") << "CSC Ring index (" << i << ") out of range";
31 
32  return *theCSCRings[i];
33 }
34 
39 }
40 
43  float zz = 0.;
44 
45  for (std::vector<AlignableCSCRing*>::iterator ilayer = theCSCRings.begin(); ilayer != theCSCRings.end(); ilayer++)
46  zz += (*ilayer)->globalPosition().z();
47 
48  zz /= static_cast<float>(theCSCRings.size());
49 
50  return PositionType(0.0, 0.0, zz);
51 }
52 
55 
56 // /// Twists all components by given angle
57 // void AlignableCSCStation::twist(float rad)
58 // {
59 // for ( std::vector<AlignableCSCRing*>::iterator iter = theCSCRings.begin();
60 // iter != theCSCRings.end(); iter++ )
61 // (*iter)->twist(rad);
62 
63 // }
64 
66 std::ostream& operator<<(std::ostream& os, const AlignableCSCStation& b) {
67  os << "This CSC Station contains " << b.theCSCRings.size() << " CSC rings" << std::endl;
68  os << "(phi, r, z) = (" << b.globalPosition().phi() << "," << b.globalPosition().perp() << ","
69  << b.globalPosition().z();
70  os << "), orientation:" << std::endl << b.globalRotation() << std::endl;
71  return os;
72 }
73 
75 void AlignableCSCStation::dump(void) const {
76  edm::LogInfo("AlignableDump") << (*this);
77  for (std::vector<AlignableCSCRing*>::const_iterator iRing = theCSCRings.begin(); iRing != theCSCRings.end(); iRing++)
78  edm::LogInfo("AlignableDump") << (**iRing);
79 }
TkRotation< Scalar >
AlignableCSCStation::ring
AlignableCSCRing & ring(int i)
Return Alignable CSC Ring at given index.
Definition: AlignableCSCStation.cc:28
mps_fire.i
i
Definition: mps_fire.py:428
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
MessageLogger.h
align
Definition: AlignableIndexer.h:30
AlignableCSCStation
Definition: AlignableCSCStation.h:28
AlignableCSCStation::dump
void dump(void) const override
Recursive printout of the muon CSC Station structure.
Definition: AlignableCSCStation.cc:75
AlignableCSCStation::computePosition
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
Definition: AlignableCSCStation.cc:42
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
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
AlignableCSCRing
Definition: AlignableCSCRing.h:28
operator<<
std::ostream & operator<<(std::ostream &os, const AlignableCSCStation &b)
Output Station information.
Definition: AlignableCSCStation.cc:66
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
AlignableCSCStation::AlignableCSCStation
AlignableCSCStation(const std::vector< AlignableCSCRing * > &cscRings)
The constructor simply copies the vector of CSC Rings and computes the surface from them.
Definition: AlignableCSCStation.cc:12
AlignableCSCStation::computeSurface
AlignableSurface computeSurface()
Definition: AlignableCSCStation.cc:37
AlignableCSCStation::theCSCRings
std::vector< AlignableCSCRing * > theCSCRings
Definition: AlignableCSCStation.h:50
Alignable::setMother
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
AlignableCSCStation.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
Alignable::mother
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
AlignableCSCStation::computeOrientation
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
Definition: AlignableCSCStation.cc:54
Alignable::size
int size() const
Return number of direct components.
Definition: Alignable.h:68