![]() |
![]() |
00001 #ifndef Alignment_CommonAlignment_Alignable_H 00002 #define Alignment_CommonAlignment_Alignable_H 00003 00004 #include "Alignment/CommonAlignment/interface/AlignableSurface.h" 00005 #include "Alignment/CommonAlignment/interface/StructureType.h" 00006 #include "DataFormats/DetId/interface/DetId.h" 00007 00008 class AlignmentErrors; 00009 class AlignmentParameters; 00010 class AlignmentPositionError; 00011 class Alignments; 00012 00024 class AlignmentParameters; 00025 class SurveyDet; 00026 00027 class Alignable 00028 { 00029 00030 public: 00031 00032 typedef align::Scalar Scalar; 00033 typedef align::PositionType PositionType; 00034 typedef align::RotationType RotationType; 00035 typedef align::GlobalVector GlobalVector; 00036 typedef align::LocalVector LocalVector; 00037 typedef align::Alignables Alignables; 00038 typedef align::StructureType StructureType; 00039 00042 Alignable( align::ID, const AlignableSurface& ); 00043 00046 Alignable( align::ID, const RotationType& ); 00047 00049 virtual ~Alignable(); 00050 00052 void setAlignmentParameters( AlignmentParameters* dap ); 00053 00055 AlignmentParameters* alignmentParameters() const { return theAlignmentParameters; } 00056 00059 virtual void addComponent( Alignable* ) = 0; 00060 00062 virtual Alignables components() const = 0; 00063 00065 const int size() const { return components().size(); } 00066 00069 const Alignables& deepComponents() const { return theDeepComponents; } 00070 00075 virtual void recursiveComponents(Alignables &result) const = 0; 00076 00080 bool firstCompsWithParams(Alignables ¶mComps) const; 00081 00083 Alignable* mother() const { return theMother; } 00084 00086 void setMother( Alignable* mother ) { theMother = mother; } 00087 00089 virtual void move( const GlobalVector& displacement) = 0; 00090 00094 virtual void rotateInGlobalFrame( const RotationType& rotation) = 0; 00095 00097 virtual void rotateInLocalFrame( const RotationType& rotation); 00098 00100 virtual void rotateAroundGlobalAxis( const GlobalVector& axis, Scalar radians ); 00101 00103 virtual void rotateAroundLocalAxis( const LocalVector& axis, Scalar radians ); 00104 00106 virtual void rotateAroundGlobalX( Scalar radians ); 00107 00109 virtual void rotateAroundLocalX( Scalar radians ); 00110 00112 virtual void rotateAroundGlobalY( Scalar radians ); 00113 00115 virtual void rotateAroundLocalY( Scalar radians ); 00116 00118 virtual void rotateAroundGlobalZ( Scalar radians ); 00119 00121 virtual void rotateAroundLocalZ( Scalar radians); 00122 00124 const AlignableSurface& surface() const { return theSurface; } 00125 00127 const PositionType& globalPosition() const { return surface().position(); } 00128 00130 const RotationType& globalRotation() const { return surface().rotation(); } 00131 00133 const GlobalVector& displacement() const { return theDisplacement; } 00134 00136 const RotationType& rotation() const { return theRotation; } 00137 00139 virtual void 00140 setAlignmentPositionError( const AlignmentPositionError& ape ) = 0; 00141 00143 virtual void 00144 addAlignmentPositionError( const AlignmentPositionError& ape ) = 0; 00145 00149 virtual void 00150 addAlignmentPositionErrorFromRotation( const RotationType& rotation ) = 0; 00151 00155 virtual void 00156 addAlignmentPositionErrorFromLocalRotation( const RotationType& rotation ) = 0; 00157 00159 virtual StructureType alignableObjectId() const = 0; 00160 00163 const DetId& geomDetId() const { return theDetId; } 00164 00166 align::ID id() const { return theId; } 00167 00169 virtual void dump() const = 0; 00170 00172 virtual Alignments* alignments() const = 0; 00173 00175 virtual AlignmentErrors* alignmentErrors() const = 0; 00176 00178 const SurveyDet* survey() const { return theSurvey; } 00179 00181 void setSurvey( const SurveyDet* ); 00182 00183 protected: 00184 00185 void addDisplacement( const GlobalVector& displacement ); 00186 void addRotation( const RotationType& rotation ); 00187 00188 protected: 00189 00190 DetId theDetId; // used to check if Alignable is associated to a GeomDet 00191 // ugly way to keep AlignableNavigator happy for now 00192 00193 align::ID theId; // real ID as int, above DetId should be removed 00194 00195 AlignableSurface theSurface; // Global position and orientation of surface 00196 00197 GlobalVector theDisplacement; // total linear displacement 00198 RotationType theRotation; // total angular displacement 00199 00200 Alignables theDeepComponents; // list of lowest daughters 00201 // contain itself if Alignable is a unit 00202 00203 private: 00205 Alignable() {}; 00206 00207 AlignmentParameters* theAlignmentParameters; 00208 00209 Alignable* theMother; // Pointer to container 00210 00211 const SurveyDet* theSurvey; // Pointer to survey info; owned by class 00212 00213 }; 00214 00215 #endif