File indexing completed on 2024-04-06 11:56:05
0001 #ifndef Alignment_TrackerAlignment_AlignableModifier_H
0002 #define Alignment_TrackerAlignment_AlignableModifier_H
0003
0004 #include <vector>
0005 #include <string>
0006 #include <utility>
0007
0008 #include "CondFormats/Alignment/interface/Definitions.h"
0009
0010
0011
0012
0013
0014 class Alignable;
0015
0016 namespace CLHEP {
0017 class DRand48Engine;
0018 }
0019 namespace edm {
0020 class ParameterSet;
0021 }
0022
0023 class AlignableModifier {
0024 public:
0025
0026 AlignableModifier();
0027
0028
0029 ~AlignableModifier();
0030
0031
0032 bool modify(Alignable* alignable, const edm::ParameterSet& pSet);
0033
0034
0035 bool isPropagated(const std::string& parameterName) const;
0036
0037
0038 void moveAlignable(Alignable* alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ);
0039
0040
0041 void moveAlignableLocal(Alignable* alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ);
0042
0043
0044 void rotateAlignable(
0045 Alignable* alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ);
0046
0047
0048 void rotateAlignableLocal(
0049 Alignable* alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ);
0050
0051
0052 void addAlignmentPositionError(Alignable* alignable, float dx, float dy, float dz);
0053
0054
0055 void addAlignmentPositionErrorLocal(Alignable* alignable, float dx, float dy, float dz);
0056
0057
0058 void addAlignmentPositionErrorFromRotation(Alignable* alignable, float phiX, float phiY, float phiZ);
0059
0060
0061 void addAlignmentPositionErrorFromLocalRotation(Alignable* alignable, float phiX, float phiY, float phiZ);
0062
0063
0064 void addAlignmentPositionErrorFromRotation(Alignable* alignable, align::RotationType&);
0065
0066
0067 void addAlignmentPositionErrorFromLocalRotation(Alignable* alignable, align::RotationType&);
0068
0069
0070 void setDistribution(const std::string& distr);
0071
0072
0073 void setSeed(long seed);
0074
0075
0076 const std::vector<float> gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const;
0077
0078 const std::vector<float> flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const;
0079
0080
0081
0082 void randomise(std::vector<double>& rnd, bool gaussian) const;
0083
0084 private:
0085 typedef std::pair<std::string, std::vector<double> > DeformationMemberType;
0086 void addDeformation(
0087 Alignable* alignable, const DeformationMemberType& deformation, bool random, bool gaussian, double scale);
0088
0089
0090 CLHEP::DRand48Engine* theDRand48Engine;
0091
0092
0093 void init_();
0094
0095 int m_modified;
0096
0097
0098 std::string distribution_;
0099 bool random_, gaussian_, setError_;
0100 bool setRotations_, setTranslations_;
0101 long seed_;
0102 double scaleError_, scale_;
0103 double phiX_, phiY_, phiZ_;
0104 double phiXlocal_, phiYlocal_, phiZlocal_;
0105 double dX_, dY_, dZ_;
0106 double dXlocal_, dYlocal_, dZlocal_;
0107 DeformationMemberType deformation_;
0108 double twist_, shear_;
0109 };
0110
0111 #endif