CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignableDTBarrel.cc
Go to the documentation of this file.
1 
14 
15 
17 AlignableDTBarrel::AlignableDTBarrel( const std::vector<AlignableDTWheel*>& dtWheels )
18  : AlignableComposite(dtWheels[0]->id(), align::AlignableDTBarrel)
19 {
20 
21  theDTWheels.insert( theDTWheels.end(), dtWheels.begin(), dtWheels.end() );
22 
24 
25 }
26 
27 
30 {
31  for ( std::vector<AlignableDTWheel*>::iterator iter = theDTWheels.begin();
32  iter != theDTWheels.end(); iter++)
33  delete *iter;
34 
35 }
36 
39 {
40 
41  if (i >= size() )
42  throw cms::Exception("LogicError") << "Wheel index (" << i << ") out of range";
43 
44  return *theDTWheels[i];
45 
46 }
47 
48 
52 {
53 
55 
56 }
57 
58 
59 
62 {
63 
64  float zz = 0.;
65 
66  for ( std::vector<AlignableDTWheel*>::iterator ilayer = theDTWheels.begin();
67  ilayer != theDTWheels.end(); ilayer++ )
68  zz += (*ilayer)->globalPosition().z();
69 
70  zz /= static_cast<float>(theDTWheels.size());
71 
72  return PositionType( 0.0, 0.0, zz );
73 
74 }
75 
76 
79 {
80  return RotationType();
81 }
82 
83 
84 
86 std::ostream &operator << (std::ostream& os, const AlignableDTBarrel& b )
87 {
88 
89  os << "This DTBarrel contains " << b.theDTWheels.size() << " Barrel wheels" << std::endl;
90  os << "(phi, r, z) = (" << b.globalPosition().phi() << ","
91  << b.globalPosition().perp() << "," << b.globalPosition().z();
92  os << "), orientation:" << std::endl<< b.globalRotation() << std::endl;
93  return os;
94 
95 }
96 
97 
99 void AlignableDTBarrel::dump( void ) const
100 {
101 
102  edm::LogInfo("AlignableDump") << (*this);
103  for ( std::vector<AlignableDTWheel*>::const_iterator iWheel = theDTWheels.begin();
104  iWheel != theDTWheels.end(); iWheel++ )
105  (*iWheel)->dump();
106 
107 }
108 
109 //__________________________________________________________________________________________________
111 {
112 
113  std::vector<Alignable*> comp = this->components();
114  Alignments* m_alignments = new Alignments();
115  // Add components recursively
116  for ( std::vector<Alignable*>::iterator i=comp.begin(); i!=comp.end(); i++ )
117  {
118  Alignments* tmpAlignments = (*i)->alignments();
119  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
120  std::back_inserter(m_alignments->m_align) );
121  delete tmpAlignments;
122  }
123 
124  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end(),
126 
127  return m_alignments;
128 
129 }
130 
131 //__________________________________________________________________________________________________
133 {
134 
135  std::vector<Alignable*> comp = this->components();
136  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
137 
138  // Add components recursively
139  for ( std::vector<Alignable*>::iterator i=comp.begin(); i!=comp.end(); i++ )
140  {
141  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
142  std::copy( tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
143  std::back_inserter(m_alignmentErrors->m_alignError) );
144  delete tmpAlignmentErrorsExtended;
145  }
146 
147  std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end(),
149 
150  return m_alignmentErrors;
151 
152 }
153 
154 
int i
Definition: DBlmapReader.cc:9
PositionType computePosition()
Compute average z position from all components (x and y forced to 0)
T perp() const
Definition: PV3DBase.h:72
Alignments * alignments() const
Return alignment data.
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
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
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
~AlignableDTBarrel()
Clean delete of the vector and its elements.
AlignableDTBarrel(const std::vector< AlignableDTWheel * > &dtWheels)
The constructor simply copies the vector of wheels and computes the surface from them.
virtual std::vector< Alignable * > components() const
Return vector of direct components.
RotationType computeOrientation()
Just initialize to default given by default constructor of a RotationType.
void setSurface(const AlignableSurface &s)
T z() const
Definition: PV3DBase.h:64
std::vector< AlignableDTWheel * > theDTWheels
AlignableDTWheel & wheel(int i)
Return AlignableBarrelLayer at given index.
void dump(void) const
Recursive printout of the muon Barrel structure.
AlignableSurface computeSurface()
std::vector< AlignTransformErrorExtended > m_alignError
double b
Definition: hdecay.h:120
align::RotationType RotationType
Definition: Alignable.h:36
align::PositionType PositionType
Definition: Alignable.h:35
AlignmentErrorsExtended * alignmentErrors() const
Return vector of alignment errors.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
int size() const
Return number of direct components.
Definition: Alignable.h:67