CMS 3D CMS Logo

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