#include <Alignment/MuonAlignment/interface/AlignableDTBarrel.h>
Public Member Functions | |
AlignableDTBarrel (const std::vector< AlignableDTWheel * > dtWheels) | |
The constructor simply copies the vector of wheels and computes the surface from them. | |
AlignmentErrors * | alignmentErrors () const |
Return vector of alignment errors. | |
Alignments * | alignments () const |
Return alignment data. | |
virtual std::vector< Alignable * > | components () const |
Return vector of direct components. | |
RotationType | computeOrientation () |
Just initialize to default given by default constructor of a RotationType. | |
PositionType | computePosition () |
Compute average z position from all components (x and y forced to 0). | |
AlignableSurface | computeSurface () |
Returns surface corresponding to current position and orientation, as given by average on all components. | |
void | dump (void) |
Recursive printout of the muon Barrel structure. | |
AlignableDTWheel & | wheel (int i) |
Return AlignableBarrelLayer at given index. | |
~AlignableDTBarrel () | |
Clean delete of the vector and its elements. | |
Private Attributes | |
std::vector< AlignableDTWheel * > | theDTWheels |
Friends | |
std::ostream & | operator<< (std::ostream &, const AlignableDTBarrel &) |
Printout muon Barrel information (not recursive). |
The alignable muon DT barrel.
Misalignment can be de-/reactivated (forwarded to components).
Definition at line 30 of file AlignableDTBarrel.h.
AlignableDTBarrel::AlignableDTBarrel | ( | const std::vector< AlignableDTWheel * > | dtWheels | ) |
The constructor simply copies the vector of wheels and computes the surface from them.
Definition at line 17 of file AlignableDTBarrel.cc.
References computeSurface(), AlignableComposite::setSurface(), and theDTWheels.
00018 : AlignableComposite(dtWheels[0]->id(), align::AlignableDTBarrel) 00019 { 00020 00021 theDTWheels.insert( theDTWheels.end(), dtWheels.begin(), dtWheels.end() ); 00022 00023 setSurface( computeSurface() ); 00024 00025 }
AlignableDTBarrel::~AlignableDTBarrel | ( | ) |
Clean delete of the vector and its elements.
Definition at line 29 of file AlignableDTBarrel.cc.
References iter, and theDTWheels.
00030 { 00031 for ( std::vector<AlignableDTWheel*>::iterator iter = theDTWheels.begin(); 00032 iter != theDTWheels.end(); iter++) 00033 delete *iter; 00034 00035 }
AlignmentErrors * AlignableDTBarrel::alignmentErrors | ( | void | ) | const [virtual] |
Return vector of alignment errors.
Reimplemented from AlignableComposite.
Definition at line 132 of file AlignableDTBarrel.cc.
References components(), edmNew::copy(), i, AlignmentErrors::m_alignError, and python::multivaluedict::sort().
00133 { 00134 00135 std::vector<Alignable*> comp = this->components(); 00136 AlignmentErrors* m_alignmentErrors = new AlignmentErrors(); 00137 00138 // Add components recursively 00139 for ( std::vector<Alignable*>::iterator i=comp.begin(); i!=comp.end(); i++ ) 00140 { 00141 AlignmentErrors* tmpAlignmentErrors = (*i)->alignmentErrors(); 00142 std::copy( tmpAlignmentErrors->m_alignError.begin(), tmpAlignmentErrors->m_alignError.end(), 00143 std::back_inserter(m_alignmentErrors->m_alignError) ); 00144 delete tmpAlignmentErrors; 00145 } 00146 00147 std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end(), 00148 lessAlignmentDetId<AlignTransformError>() ); 00149 00150 return m_alignmentErrors; 00151 00152 }
Alignments * AlignableDTBarrel::alignments | ( | void | ) | const [virtual] |
Return alignment data.
Reimplemented from AlignableComposite.
Definition at line 110 of file AlignableDTBarrel.cc.
References components(), edmNew::copy(), i, Alignments::m_align, and python::multivaluedict::sort().
00111 { 00112 00113 std::vector<Alignable*> comp = this->components(); 00114 Alignments* m_alignments = new Alignments(); 00115 // Add components recursively 00116 for ( std::vector<Alignable*>::iterator i=comp.begin(); i!=comp.end(); i++ ) 00117 { 00118 Alignments* tmpAlignments = (*i)->alignments(); 00119 std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(), 00120 std::back_inserter(m_alignments->m_align) ); 00121 delete tmpAlignments; 00122 } 00123 00124 std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end(), 00125 lessAlignmentDetId<AlignTransform>() ); 00126 00127 return m_alignments; 00128 00129 }
virtual std::vector<Alignable*> AlignableDTBarrel::components | ( | ) | const [inline, virtual] |
Return vector of direct components.
Reimplemented from AlignableComposite.
Definition at line 39 of file AlignableDTBarrel.h.
References HLT_VtxMuL3::result, and theDTWheels.
Referenced by alignmentErrors(), and alignments().
00040 { 00041 00042 std::vector<Alignable*> result; 00043 result.insert( result.end(), theDTWheels.begin(), theDTWheels.end() ); 00044 return result; 00045 00046 }
AlignableDTBarrel::RotationType AlignableDTBarrel::computeOrientation | ( | ) |
Just initialize to default given by default constructor of a RotationType.
Definition at line 78 of file AlignableDTBarrel.cc.
Referenced by computeSurface().
00079 { 00080 return RotationType(); 00081 }
AlignableDTBarrel::PositionType AlignableDTBarrel::computePosition | ( | ) |
Compute average z position from all components (x and y forced to 0).
Definition at line 61 of file AlignableDTBarrel.cc.
References theDTWheels, and PV3DBase< T, PVType, FrameType >::z().
Referenced by computeSurface().
00062 { 00063 00064 float zz = 0.; 00065 00066 for ( std::vector<AlignableDTWheel*>::iterator ilayer = theDTWheels.begin(); 00067 ilayer != theDTWheels.end(); ilayer++ ) 00068 zz += (*ilayer)->globalPosition().z(); 00069 00070 zz /= static_cast<float>(theDTWheels.size()); 00071 00072 return PositionType( 0.0, 0.0, zz ); 00073 00074 }
AlignableSurface AlignableDTBarrel::computeSurface | ( | ) |
Returns surface corresponding to current position and orientation, as given by average on all components.
Definition at line 51 of file AlignableDTBarrel.cc.
References computeOrientation(), and computePosition().
Referenced by AlignableDTBarrel().
00052 { 00053 00054 return AlignableSurface( computePosition(), computeOrientation() ); 00055 00056 }
Recursive printout of the muon Barrel structure.
Recursive printout of whole Half Barrel structure.
Definition at line 99 of file AlignableDTBarrel.cc.
References theDTWheels.
00100 { 00101 00102 edm::LogInfo("AlignableDump") << (*this); 00103 for ( std::vector<AlignableDTWheel*>::iterator iWheel = theDTWheels.begin(); 00104 iWheel != theDTWheels.end(); iWheel++ ) 00105 (*iWheel)->dump(); 00106 00107 }
AlignableDTWheel & AlignableDTBarrel::wheel | ( | int | i | ) |
Return AlignableBarrelLayer at given index.
Definition at line 38 of file AlignableDTBarrel.cc.
References Exception, Alignable::size(), and theDTWheels.
00039 { 00040 00041 if (i >= size() ) 00042 throw cms::Exception("LogicError") << "Wheel index (" << i << ") out of range"; 00043 00044 return *theDTWheels[i]; 00045 00046 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const AlignableDTBarrel & | b | |||
) | [friend] |
Printout muon Barrel information (not recursive).
Definition at line 86 of file AlignableDTBarrel.cc.
00087 { 00088 00089 os << "This DTBarrel contains " << b.theDTWheels.size() << " Barrel wheels" << std::endl; 00090 os << "(phi, r, z) = (" << b.globalPosition().phi() << "," 00091 << b.globalPosition().perp() << "," << b.globalPosition().z(); 00092 os << "), orientation:" << std::endl<< b.globalRotation() << std::endl; 00093 return os; 00094 00095 }
std::vector<AlignableDTWheel*> AlignableDTBarrel::theDTWheels [private] |
Definition at line 74 of file AlignableDTBarrel.h.
Referenced by AlignableDTBarrel(), components(), computePosition(), dump(), operator<<(), wheel(), and ~AlignableDTBarrel().