CMS 3D CMS Logo

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