00001 #ifndef Alignment_TrackerAlignment_AlignableModifier_H
00002 #define Alignment_TrackerAlignment_AlignableModifier_H
00003
00004
00005
00006
00007 #include "CondFormats/Alignment/interface/Definitions.h"
00008
00012
00013 class Alignable;
00014
00015 namespace CLHEP { class DRand48Engine; }
00016 namespace edm { class ParameterSet; }
00017
00018 class AlignableModifier
00019 {
00020
00021 public:
00022
00024 AlignableModifier();
00025
00027 ~AlignableModifier();
00028
00030 bool modify( Alignable* alignable, const edm::ParameterSet& pSet );
00031
00033 const bool isPropagated( const std::string& parameterName ) const;
00034
00036 void moveAlignable( Alignable* alignable, bool random, bool gaussian,
00037 float sigmaX, float sigmaY, float sigmaZ );
00038
00040 void moveAlignableLocal( Alignable* alignable, bool random, bool gaussian,
00041 float sigmaX, float sigmaY, float sigmaZ );
00042
00044 void rotateAlignable( Alignable* alignable, bool random, bool gaussian,
00045 float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ );
00046
00048 void rotateAlignableLocal( Alignable* alignable, bool random, bool gaussian,
00049 float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ );
00050
00052 void addAlignmentPositionError( Alignable* alignable,
00053 float dx, float dy, float dz );
00054
00056 void addAlignmentPositionErrorLocal( Alignable* alignable,
00057 float dx, float dy, float dz );
00058
00060 void addAlignmentPositionErrorFromRotation( Alignable* alignable,
00061 float phiX, float phiY, float phiZ );
00062
00064 void addAlignmentPositionErrorFromLocalRotation( Alignable* alignable,
00065 float phiX, float phiY, float phiZ );
00066
00068 void addAlignmentPositionErrorFromRotation( Alignable* alignable,
00069 align::RotationType& );
00070
00072 void addAlignmentPositionErrorFromLocalRotation( Alignable* alignable,
00073 align::RotationType& );
00074
00076 void setDistribution( const std::string& distr );
00077
00079 void setSeed( long seed );
00080
00082 const std::vector<float> gaussianRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const;
00084 const std::vector<float> flatRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const;
00085
00086 private:
00087
00089 CLHEP::DRand48Engine* theDRand48Engine;
00090
00092 void init_();
00093
00094 int m_modified;
00095
00096
00097 std::string distribution_;
00098 bool random_, gaussian_, setError_;
00099 bool setRotations_,setTranslations_;
00100 long seed_;
00101 double scaleError_,scale_;
00102 double phiX_, phiY_, phiZ_;
00103 double phiXlocal_, phiYlocal_, phiZlocal_;
00104 double dX_, dY_, dZ_;
00105 double dXlocal_, dYlocal_, dZlocal_;
00106 double twist_, shear_;
00107
00108 };
00109
00110 #endif //AlignableModifier_H