00001 #ifndef Alignment_TrackerAlignment_AlignableModifier_H
00002 #define Alignment_TrackerAlignment_AlignableModifier_H
00003
00004 #include <vector>
00005 #include <string>
00006 #include <utility>
00007
00008 #include "CondFormats/Alignment/interface/Definitions.h"
00009
00013
00014 class Alignable;
00015
00016 namespace CLHEP { class DRand48Engine; }
00017 namespace edm { class ParameterSet; }
00018
00019 class AlignableModifier
00020 {
00021
00022 public:
00023
00025 AlignableModifier();
00026
00028 ~AlignableModifier();
00029
00031 bool modify( Alignable* alignable, const edm::ParameterSet& pSet );
00032
00034 bool isPropagated( const std::string& parameterName ) const;
00035
00037 void moveAlignable( Alignable* alignable, bool random, bool gaussian,
00038 float sigmaX, float sigmaY, float sigmaZ );
00039
00041 void moveAlignableLocal( Alignable* alignable, bool random, bool gaussian,
00042 float sigmaX, float sigmaY, float sigmaZ );
00043
00045 void rotateAlignable( Alignable* alignable, bool random, bool gaussian,
00046 float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ );
00047
00049 void rotateAlignableLocal( Alignable* alignable, bool random, bool gaussian,
00050 float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ );
00051
00053 void addAlignmentPositionError( Alignable* alignable,
00054 float dx, float dy, float dz );
00055
00057 void addAlignmentPositionErrorLocal( Alignable* alignable,
00058 float dx, float dy, float dz );
00059
00061 void addAlignmentPositionErrorFromRotation( Alignable* alignable,
00062 float phiX, float phiY, float phiZ );
00063
00065 void addAlignmentPositionErrorFromLocalRotation( Alignable* alignable,
00066 float phiX, float phiY, float phiZ );
00067
00069 void addAlignmentPositionErrorFromRotation( Alignable* alignable,
00070 align::RotationType& );
00071
00073 void addAlignmentPositionErrorFromLocalRotation( Alignable* alignable,
00074 align::RotationType& );
00075
00077 void setDistribution( const std::string& distr );
00078
00080 void setSeed( long seed );
00081
00083 const std::vector<float> gaussianRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const;
00085 const std::vector<float> flatRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const;
00089 void randomise(std::vector<double> &rnd, bool gaussian) const;
00090
00091 private:
00092 typedef std::pair<std::string,std::vector<double> > DeformationMemberType;
00093 void addDeformation(Alignable *alignable, const DeformationMemberType &deformation,
00094 bool random, bool gaussian, double scale);
00095
00097 CLHEP::DRand48Engine* theDRand48Engine;
00098
00100 void init_();
00101
00102 int m_modified;
00103
00104
00105 std::string distribution_;
00106 bool random_, gaussian_, setError_;
00107 bool setRotations_,setTranslations_;
00108 long seed_;
00109 double scaleError_,scale_;
00110 double phiX_, phiY_, phiZ_;
00111 double phiXlocal_, phiYlocal_, phiZlocal_;
00112 double dX_, dY_, dZ_;
00113 double dXlocal_, dYlocal_, dZlocal_;
00114 DeformationMemberType deformation_;
00115 double twist_, shear_;
00116
00117 };
00118
00119 #endif //AlignableModifier_H