CMS 3D CMS Logo

AlignableModifier.h
Go to the documentation of this file.
1 #ifndef Alignment_TrackerAlignment_AlignableModifier_H
2 #define Alignment_TrackerAlignment_AlignableModifier_H
3 
4 #include <vector>
5 #include <string>
6 #include <utility>
7 
9 
13 
14 class Alignable;
15 
16 namespace CLHEP {
17  class DRand48Engine;
18 }
19 namespace edm {
20  class ParameterSet;
21 }
22 
24 public:
27 
30 
32  bool modify(Alignable* alignable, const edm::ParameterSet& pSet);
33 
35  bool isPropagated(const std::string& parameterName) const;
36 
38  void moveAlignable(Alignable* alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ);
39 
41  void moveAlignableLocal(Alignable* alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ);
42 
44  void rotateAlignable(
45  Alignable* alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ);
46 
49  Alignable* alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ);
50 
52  void addAlignmentPositionError(Alignable* alignable, float dx, float dy, float dz);
53 
55  void addAlignmentPositionErrorLocal(Alignable* alignable, float dx, float dy, float dz);
56 
58  void addAlignmentPositionErrorFromRotation(Alignable* alignable, float phiX, float phiY, float phiZ);
59 
61  void addAlignmentPositionErrorFromLocalRotation(Alignable* alignable, float phiX, float phiY, float phiZ);
62 
65 
68 
70  void setDistribution(const std::string& distr);
71 
73  void setSeed(long seed);
74 
76  const std::vector<float> gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const;
78  const std::vector<float> flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const;
82  void randomise(std::vector<double>& rnd, bool gaussian) const;
83 
84 private:
85  typedef std::pair<std::string, std::vector<double> > DeformationMemberType;
86  void addDeformation(
87  Alignable* alignable, const DeformationMemberType& deformation, bool random, bool gaussian, double scale);
88 
90  CLHEP::DRand48Engine* theDRand48Engine;
91 
93  void init_();
94 
95  int m_modified; // Indicates if a modification was performed
96 
97  // All parameters (see AlignableModifier::init() for definitions)
101  long seed_;
103  double phiX_, phiY_, phiZ_;
105  double dX_, dY_, dZ_;
108  double twist_, shear_;
109 };
110 
111 #endif //AlignableModifier_H
void addAlignmentPositionErrorFromLocalRotation(Alignable *alignable, float phiX, float phiY, float phiZ)
Add alignment position error resulting from rotation in local frame.
void rotateAlignableLocal(Alignable *alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ)
Rotate alignable in local space according to parameters.
void setSeed(long seed)
Resets the generator seed according to the argument.
void addAlignmentPositionError(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in global frame) to Alignable.
~AlignableModifier()
Destructor.
void init_()
Initialisation of all parameters.
void addAlignmentPositionErrorLocal(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in local frame) to Alignable.
bool isPropagated(const std::string &parameterName) const
Check if given parameter should be propagated.
std::string distribution_
void addDeformation(Alignable *alignable, const DeformationMemberType &deformation, bool random, bool gaussian, double scale)
const std::vector< float > flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (flat distribution)
void moveAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in global space according to parameters.
AlignableModifier()
Constructor.
void setDistribution(const std::string &distr)
Decodes string and sets distribution accordingly (&#39;fixed&#39;, &#39;flat&#39; or &#39;gaussian&#39;). ...
CLHEP::DRand48Engine * theDRand48Engine
Unique random number generator.
void randomise(std::vector< double > &rnd, bool gaussian) const
const std::vector< float > gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (gaussian distribution)
DeformationMemberType deformation_
void rotateAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ)
Rotate alignable in global space according to parameters.
bool modify(Alignable *alignable, const edm::ParameterSet &pSet)
Modify given set of alignables according to parameters.
void addAlignmentPositionErrorFromRotation(Alignable *alignable, float phiX, float phiY, float phiZ)
Add alignment position error resulting from rotation in global frame.
HLT enums.
void moveAlignableLocal(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in local space according to parameters.
std::pair< std::string, std::vector< double > > DeformationMemberType