test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 { class DRand48Engine; }
17 namespace edm { class ParameterSet; }
18 
20 {
21 
22 public:
23 
26 
29 
31  bool modify( Alignable* alignable, const edm::ParameterSet& pSet );
32 
34  bool isPropagated( const std::string& parameterName ) const;
35 
37  void moveAlignable( Alignable* alignable, bool random, bool gaussian,
38  float sigmaX, float sigmaY, float sigmaZ );
39 
41  void moveAlignableLocal( Alignable* alignable, bool random, bool gaussian,
42  float sigmaX, float sigmaY, float sigmaZ );
43 
45  void rotateAlignable( Alignable* alignable, bool random, bool gaussian,
46  float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ );
47 
49  void rotateAlignableLocal( Alignable* alignable, bool random, bool gaussian,
50  float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ );
51 
53  void addAlignmentPositionError( Alignable* alignable,
54  float dx, float dy, float dz );
55 
57  void addAlignmentPositionErrorLocal( Alignable* alignable,
58  float dx, float dy, float dz );
59 
62  float phiX, float phiY, float phiZ );
63 
66  float phiX, float phiY, float phiZ );
67 
71 
75 
77  void setDistribution( const std::string& distr );
78 
80  void setSeed( long seed );
81 
83  const std::vector<float> gaussianRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const;
85  const std::vector<float> flatRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const;
89  void randomise(std::vector<double> &rnd, bool gaussian) const;
90 
91 private:
92  typedef std::pair<std::string,std::vector<double> > DeformationMemberType;
93  void addDeformation(Alignable *alignable, const DeformationMemberType &deformation,
94  bool random, bool gaussian, double scale);
95 
97  CLHEP::DRand48Engine* theDRand48Engine;
98 
100  void init_();
101 
102  int m_modified; // Indicates if a modification was performed
103 
104  // All parameters (see AlignableModifier::init() for definitions)
108  long seed_;
110  double phiX_, phiY_, phiZ_;
112  double dX_, dY_, dZ_;
115  double twist_, shear_;
116 
117 };
118 
119 #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.
const std::vector< float > gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (gaussian distribution)
void init_()
Initialisation of all parameters.
TRandom random
Definition: MVATrainer.cc:138
void addAlignmentPositionErrorLocal(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in local frame) to Alignable.
std::string distribution_
void addDeformation(Alignable *alignable, const DeformationMemberType &deformation, bool random, bool gaussian, double scale)
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.
const std::vector< float > flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (flat distribution)
void randomise(std::vector< double > &rnd, bool gaussian) const
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.
std::pair< std::string, std::vector< double > > DeformationMemberType
bool isPropagated(const std::string &parameterName) const
Check if given parameter should be propagated.
void moveAlignableLocal(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in local space according to parameters.