test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignableDTStation.cc
Go to the documentation of this file.
1 
11 
12 
13 
15 AlignableDTStation::AlignableDTStation( const std::vector<AlignableDTChamber*>& dtChambers )
16  : AlignableComposite(dtChambers[0]->id(), align::AlignableDTStation)
17 {
18 
19  theDTChambers.insert( theDTChambers.end(), dtChambers.begin(), dtChambers.end() );
20 
22 
23 }
24 
25 
28 {
29  for ( std::vector<AlignableDTChamber*>::iterator iter = theDTChambers.begin();
30  iter != theDTChambers.end(); iter++)
31  delete *iter;
32 
33 }
34 
37 {
38 
39  if (i >= size() )
40  throw cms::Exception("LogicError") << "DT Chamber index (" << i << ") out of range";
41 
42  return *theDTChambers[i];
43 
44 }
45 
46 
50 {
51 
53 
54 }
55 
56 
57 
60 {
61 
62  float zz = 0.;
63 
64  for ( std::vector<AlignableDTChamber*>::iterator ilayer = theDTChambers.begin();
65  ilayer != theDTChambers.end(); ilayer++ )
66  zz += (*ilayer)->globalPosition().z();
67 
68  zz /= static_cast<float>(theDTChambers.size());
69 
70  return PositionType( 0.0, 0.0, zz );
71 
72 }
73 
74 
77 {
78  return RotationType();
79 }
80 
81 
82 
84 std::ostream &operator << (std::ostream& os, const AlignableDTStation& b )
85 {
86 
87  os << "This DT Station contains " << b.theDTChambers.size() << " DT chambers" << std::endl;
88  os << "(phi, r, z) = (" << b.globalPosition().phi() << ","
89  << b.globalPosition().perp() << "," << b.globalPosition().z();
90  os << "), orientation:" << std::endl<< b.globalRotation() << std::endl;
91  return os;
92 
93 }
94 
95 
97 void AlignableDTStation::dump( void ) const
98 {
99 
100  edm::LogInfo("AlignableDump") << (*this);
101  for ( std::vector<AlignableDTChamber*>::const_iterator iChamber = theDTChambers.begin();
102  iChamber != theDTChambers.end(); iChamber++ )
103  edm::LogInfo("AlignableDump") << (**iChamber);
104 
105 }
A muon DT Chamber( an AlignableDet )
int i
Definition: DBlmapReader.cc:9
AlignableSurface computeSurface()
T perp() const
Definition: PV3DBase.h:72
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
~AlignableDTStation()
Clean delete of the vector and its elements.
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:137
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
AlignableDTChamber & chamber(int i)
Return Alignable DT Chamber at given index.
void setSurface(const AlignableSurface &s)
T z() const
Definition: PV3DBase.h:64
std::vector< AlignableDTChamber * > theDTChambers
AlignableDTStation(const std::vector< AlignableDTChamber * > &dtChambers)
The constructor simply copies the vector of DT Chambers and computes the surface from them...
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:36
align::PositionType PositionType
Definition: Alignable.h:35
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:134
void dump(void) const
Recursive printout of the muon DT Station structure.
int size() const
Return number of direct components.
Definition: Alignable.h:67