CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignableModifier.cc
Go to the documentation of this file.
1 #include "CLHEP/Random/DRand48Engine.h"
2 #include "CLHEP/Random/RandGauss.h"
3 #include "CLHEP/Random/Randomize.h"
4 
10 
13 
14 
15 //__________________________________________________________________________________________________
17 {
18 
19  theDRand48Engine = new CLHEP::DRand48Engine();
20 
21 }
22 
23 
24 //__________________________________________________________________________________________________
26 {
27 
28  delete theDRand48Engine;
29 
30 }
31 
32 //__________________________________________________________________________________________________
34 {
35 
36  // Initialize all known parameters (according to ORCA's MisalignmentScenario.cc)
37  distribution_ = ""; // Switch for distributions ("fixed","flat","gaussian")
38  setError_ = false; // Apply alignment errors
39  setRotations_ = true; // Apply rotations
40  setTranslations_ = true; // Apply translations
41  scale_ = 1.; // Scale to apply to all movements
42  scaleError_ = 1.; // Scale to apply to alignment errors
43  phiX_ = 0.; // Rotation angle around X [rad]
44  phiY_ = 0.; // Rotation angle around Y [rad]
45  phiZ_ = 0.; // Rotation angle around Z [rad]
46  phiXlocal_ = 0.; // Local rotation angle around X [rad]
47  phiYlocal_ = 0.; // Local rotation angle around Y [rad]
48  phiZlocal_ = 0.; // Local rotation angle around Z [rad]
49  dX_ = 0.; // X displacement [cm]
50  dY_ = 0.; // Y displacement [cm]
51  dZ_ = 0.; // Z displacement [cm]
52  dXlocal_ = 0.; // Local X displacement [cm]
53  dYlocal_ = 0.; // Local Y displacement [cm]
54  dZlocal_ = 0.; // Local Z displacement [cm]
55  twist_ = 0.; // Twist angle [rad]
56  shear_ = 0.; // Shear angle [rad]
57 
58  // These are set through 'distribution'
59  random_ = true; // Use random distributions
60  gaussian_ = true; // Use gaussian distribution (otherwise flat)
61 
62 }
63 
64 //__________________________________________________________________________________________________
65 // Return true if given parameter name should be propagated down
66 const bool AlignableModifier::isPropagated( const std::string& parameterName ) const
67 {
68 
69  if ( parameterName == "distribution" ||
70  parameterName == "setError" ||
71  parameterName == "scaleError" ||
72  parameterName == "setRotations" ||
73  parameterName == "setTranslations" ||
74  parameterName == "scale"
75  ) return true;
76 
77  return false;
78 
79 }
80 
81 
82 //__________________________________________________________________________________________________
84 bool AlignableModifier::modify( Alignable* alignable, const edm::ParameterSet& pSet )
85 {
86 
87  // Initialize parameters
88  this->init_();
89  int rotX_=0, rotY_=0, rotZ_=0; // To check correct backward compatibility
90 
91 
92  // Reset counter
93  m_modified = 0;
94 
95  // Retrieve parameters
96  std::ostringstream error;
97  std::vector<std::string> parameterNames = pSet.getParameterNames();
98  for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
99  iParam != parameterNames.end(); iParam++ ) {
100  if ( (*iParam) == "distribution" ) distribution_ = pSet.getParameter<std::string>( *iParam );
101  else if ( (*iParam) == "setError" ) setError_ = pSet.getParameter<bool>( *iParam );
102  else if ( (*iParam) == "setRotations") setRotations_ = pSet.getParameter<bool>( *iParam );
103  else if ( (*iParam) == "setTranslations") setTranslations_ = pSet.getParameter<bool>( *iParam );
104  else if ( (*iParam) == "scale" ) scale_ = pSet.getParameter<double>( *iParam );
105  else if ( (*iParam) == "scaleError" ) scaleError_ = pSet.getParameter<double>( *iParam );
106  else if ( (*iParam) == "phiX" ) phiX_ = pSet.getParameter<double>( *iParam );
107  else if ( (*iParam) == "phiY" ) phiY_ = pSet.getParameter<double>( *iParam );
108  else if ( (*iParam) == "phiZ" ) phiZ_ = pSet.getParameter<double>( *iParam );
109  else if ( (*iParam) == "dX" ) dX_ = pSet.getParameter<double>( *iParam );
110  else if ( (*iParam) == "dY" ) dY_ = pSet.getParameter<double>( *iParam );
111  else if ( (*iParam) == "dZ" ) dZ_ = pSet.getParameter<double>( *iParam );
112  else if ( (*iParam) == "dXlocal" ) dXlocal_ = pSet.getParameter<double>( *iParam );
113  else if ( (*iParam) == "dYlocal" ) dYlocal_ = pSet.getParameter<double>( *iParam );
114  else if ( (*iParam) == "dZlocal" ) dZlocal_ = pSet.getParameter<double>( *iParam );
115  else if ( (*iParam) == "twist" ) twist_ = pSet.getParameter<double>( *iParam );
116  else if ( (*iParam) == "shear" ) shear_ = pSet.getParameter<double>( *iParam );
117  else if ( (*iParam) == "localX" ) { phiXlocal_=pSet.getParameter<double>( *iParam ); rotX_++; }
118  else if ( (*iParam) == "localY" ) { phiYlocal_=pSet.getParameter<double>( *iParam ); rotY_++; }
119  else if ( (*iParam) == "localZ" ) { phiZlocal_=pSet.getParameter<double>( *iParam ); rotZ_++; }
120  else if ( (*iParam) == "phiXlocal" ) { phiXlocal_=pSet.getParameter<double>( *iParam ); rotX_++; }
121  else if ( (*iParam) == "phiYlocal" ) { phiYlocal_=pSet.getParameter<double>( *iParam ); rotY_++; }
122  else if ( (*iParam) == "phiZlocal" ) { phiZlocal_=pSet.getParameter<double>( *iParam ); rotZ_++; }
123  else if ( !pSet.existsAs<edm::ParameterSet>(*iParam) ) { // PSets are OK to ignore
124  if ( !error.str().length() ) error << "Unknown parameter name(s): ";
125  error << " " << *iParam;
126  }
127  }
128 
129  // Check if both 'localN' and 'phiNlocal' have been used
130  if ( rotX_==2 ) throw cms::Exception("BadConfig") << "Found both localX and phiXlocal";
131  if ( rotY_==2 ) throw cms::Exception("BadConfig") << "Found both localY and phiYlocal";
132  if ( rotZ_==2 ) throw cms::Exception("BadConfig") << "Found both localZ and phiZlocal";
133 
134  // Check error
135  if ( error.str().length() )
136  throw cms::Exception("BadConfig") << error.str();
137 
138  // Decode distribution
140 
141  //if (scale_) { NO! Different random sequence if only parts scale to zero!
142 
143  // Apply displacements
144  if ( std::abs(dX_) + std::abs(dY_) + std::abs(dZ_) > 0 && setTranslations_ )
145  this->moveAlignable( alignable, random_, gaussian_, scale_*dX_, scale_*dY_, scale_*dZ_ );
146 
147  // Apply local displacements
149  this->moveAlignableLocal( alignable, random_, gaussian_,
151 
152  // Apply rotations
154  this->rotateAlignable( alignable, random_, gaussian_,
156 
157  // Apply local rotations
159  this->rotateAlignableLocal( alignable, random_, gaussian_,
161 
162  // Apply twist
163  if ( std::abs(twist_) > 0 )
164  edm::LogError("NotImplemented") << "Twist is not implemented yet";
165 
166  // Apply shear
167  if ( std::abs(shear_) > 0 )
168  edm::LogError("NotImplemented") << "Shear is not implemented yet";
169 
170  // Apply error - first add scale_ to error
171  scaleError_ *= scale_;
172  if ( setError_ && scaleError_ ) {
173  // Alignment Position Error for flat distribution: 1 sigma
174  if ( !gaussian_ ) scaleError_ *= 0.68;
175 
176 
177  // Error on displacement
178  if ( std::abs(dX_) + std::abs(dY_) + std::abs(dZ_) > 0 && setTranslations_ )
179  this->addAlignmentPositionError( alignable,
180  scaleError_*dX_, scaleError_*dY_, scaleError_*dZ_ );
181 
182  // Error on local displacements
183  if ( std::abs(dXlocal_) + std::abs(dYlocal_) + std::abs(dZlocal_) > 0 && setTranslations_ )
184  this->addAlignmentPositionErrorLocal( alignable,
185  scaleError_*dXlocal_, scaleError_*dYlocal_,
186  scaleError_*dZlocal_ );
187 
188  // Error on rotations
189  if ( std::abs(phiX_) + std::abs(phiY_) + std::abs(phiZ_) > 0 && setRotations_ )
190  this->addAlignmentPositionErrorFromRotation( alignable,
191  scaleError_*phiX_, scaleError_*phiY_,
192  scaleError_*phiZ_ );
193 
194  // Error on local rotations
195  if ( std::abs(phiXlocal_) + std::abs(phiYlocal_) + std::abs(phiZlocal_) > 0
196  && setRotations_ )
198  scaleError_*phiXlocal_,
199  scaleError_*phiYlocal_,
200  scaleError_*phiZlocal_ );
201  }
202  // } // end if (scale_)
203 
204  return ( m_modified > 0 );
205 
206 }
207 
208 
209 //__________________________________________________________________________________________________
210 void AlignableModifier::setDistribution( const std::string& distr )
211 {
212 
213  if ( distr == "fixed" ) random_ = false;
214  else if ( distr == "flat" ) {
215  random_ = true;
216  gaussian_ = false;
217  } else if ( distr == "gaussian" ) {
218  random_ = true;
219  gaussian_ = true;
220  }
221 
222 }
223 
224 
225 //__________________________________________________________________________________________________
227 void AlignableModifier::setSeed( const long seed )
228 {
229 
230  long m_seed;
231 
232  if ( seed > 0 ) m_seed = seed;
233  else {
235  m_seed = rng->mySeed();
236  }
237 
238  LogDebug("PrintArgs") << "Setting generator seed to " << m_seed;
239 
240  theDRand48Engine->setSeed( m_seed );
241 
242 }
243 
244 //__________________________________________________________________________________________________
247 void AlignableModifier::moveAlignable( Alignable* alignable, bool random, bool gaussian,
248  float sigmaX, float sigmaY, float sigmaZ )
249 {
250 
251 
252  std::ostringstream message;
253 
254  // Get movement vector according to arguments
255  GlobalVector moveV( sigmaX, sigmaY, sigmaZ ); // Default: fixed
256  if ( random ) {
257  std::vector<float> randomNumbers;
258  message << "random ";
259  if (gaussian) {
260  randomNumbers = this->gaussianRandomVector( sigmaX, sigmaY, sigmaZ );
261  message << "gaussian ";
262  } else {
263  randomNumbers = this->flatRandomVector( sigmaX, sigmaY, sigmaZ );
264  message << "flat ";
265  }
266  moveV = GlobalVector( randomNumbers[0], randomNumbers[1], randomNumbers[2] );
267  }
268 
269  message << " move with sigma " << sigmaX << " " << sigmaY << " " << sigmaZ;
270 
271  LogDebug("PrintArgs") << message.str(); // Arguments
272 
273  LogDebug("PrintMovement") << "applied displacement: " << moveV; // Actual movements
274  alignable->move(moveV);
275  m_modified++;
276 
277 
278 }
279 
280 //__________________________________________________________________________________________________
283 void AlignableModifier::moveAlignableLocal( Alignable* alignable, bool random, bool gaussian,
284  float sigmaX, float sigmaY, float sigmaZ )
285 {
286 
287 
288  std::ostringstream message;
289 
290  // Get movement vector according to arguments
291  align::LocalVector moveV( sigmaX, sigmaY, sigmaZ ); // Default: fixed
292  if ( random ) {
293  std::vector<float> randomNumbers;
294  message << "random ";
295  if (gaussian) {
296  randomNumbers = this->gaussianRandomVector( sigmaX, sigmaY, sigmaZ );
297  message << "gaussian ";
298  } else {
299  randomNumbers = this->flatRandomVector( sigmaX, sigmaY, sigmaZ );
300  message << "flat ";
301  }
302  moveV = align::LocalVector( randomNumbers[0], randomNumbers[1], randomNumbers[2] );
303  }
304 
305  message << " move with sigma " << sigmaX << " " << sigmaY << " " << sigmaZ;
306 
307  LogDebug("PrintArgs") << message.str(); // Arguments
308 
309  LogDebug("PrintMovement") << "applied local displacement: " << moveV; // Actual movements
310  alignable->move( alignable->surface().toGlobal(moveV) );
311  m_modified++;
312 
313 
314 }
315 
316 
317 //__________________________________________________________________________________________________
320 void AlignableModifier::rotateAlignable( Alignable* alignable, bool random, bool gaussian,
321  float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ )
322 {
323 
324 
325  std::ostringstream message;
326 
327  // Get rotation vector according to arguments
328  GlobalVector rotV( sigmaPhiX, sigmaPhiY, sigmaPhiZ ); // Default: fixed
329  if ( random ) {
330  std::vector<float> randomNumbers;
331  message << "random ";
332  if (gaussian) {
333  randomNumbers = this->gaussianRandomVector( sigmaPhiX, sigmaPhiY, sigmaPhiZ );
334  message << "gaussian ";
335  } else {
336  randomNumbers = flatRandomVector( sigmaPhiX, sigmaPhiY, sigmaPhiZ );
337  message << "flat ";
338  }
339  rotV = GlobalVector( randomNumbers[0], randomNumbers[1], randomNumbers[2] );
340  }
341 
342  message << "global rotation by angles " << sigmaPhiX << " " << sigmaPhiY << " " << sigmaPhiZ;
343 
344  LogDebug("PrintArgs") << message.str(); // Arguments
345 
346  LogDebug("PrintMovement") << "applied rotation angles: " << rotV; // Actual movements
347  if ( std::abs(sigmaPhiX) ) alignable->rotateAroundGlobalX( rotV.x() );
348  if ( std::abs(sigmaPhiY) ) alignable->rotateAroundGlobalY( rotV.y() );
349  if ( std::abs(sigmaPhiZ) ) alignable->rotateAroundGlobalZ( rotV.z() );
350  m_modified++;
351 
352 
353 }
354 
355 //__________________________________________________________________________________________________
358 void
360  float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ )
361 {
362 
363 
364  std::ostringstream message;
365 
366  // Get rotation vector according to arguments
367  align::LocalVector rotV( sigmaPhiX, sigmaPhiY, sigmaPhiZ ); // Default: fixed
368  if ( random ) {
369  std::vector<float> randomNumbers;
370  message << "random ";
371  if (gaussian) {
372  randomNumbers = this->gaussianRandomVector( sigmaPhiX, sigmaPhiY, sigmaPhiZ );
373  message << "gaussian ";
374  } else {
375  randomNumbers = flatRandomVector( sigmaPhiX, sigmaPhiY, sigmaPhiZ );
376  message << "flat ";
377  }
378  rotV = align::LocalVector( randomNumbers[0], randomNumbers[1], randomNumbers[2] );
379  }
380 
381  message << "local rotation by angles " << sigmaPhiX << " " << sigmaPhiY << " " << sigmaPhiZ;
382 
383  LogDebug("PrintArgs") << message.str(); // Arguments
384 
385  LogDebug("PrintMovement") << "applied local rotation angles: " << rotV; // Actual movements
386  if ( std::abs(sigmaPhiX) ) alignable->rotateAroundLocalX( rotV.x() );
387  if ( std::abs(sigmaPhiY) ) alignable->rotateAroundLocalY( rotV.y() );
388  if ( std::abs(sigmaPhiZ) ) alignable->rotateAroundLocalZ( rotV.z() );
389  m_modified++;
390 
391 
392 }
393 
394 
395 //__________________________________________________________________________________________________
396 const std::vector<float>
397 AlignableModifier::gaussianRandomVector( float sigmaX, float sigmaY, float sigmaZ ) const
398 {
399 
400  // Get absolute value if negative arguments
401  if ( sigmaX < 0 ) {
402  edm::LogWarning("BadConfig") << " taking absolute value for gaussian sigma_x";
403  sigmaX = std::abs(sigmaX);
404  }
405  if ( sigmaY < 0 ) {
406  edm::LogWarning("BadConfig") << " taking absolute value for gaussian sigma_y";
407  sigmaY = std::abs(sigmaY);
408  }
409  if ( sigmaZ < 0 ) {
410  edm::LogWarning("BadConfig") << " taking absolute value for gaussian sigma_z";
411  sigmaZ = std::abs(sigmaZ);
412  }
413 
414  // Pass by reference, otherwise pointer is deleted!
415  CLHEP::RandGauss aGaussObjX( *theDRand48Engine, 0., sigmaX );
416  CLHEP::RandGauss aGaussObjY( *theDRand48Engine, 0., sigmaY );
417  CLHEP::RandGauss aGaussObjZ( *theDRand48Engine, 0., sigmaZ );
418 
419  std::vector<float> randomVector;
420  randomVector.push_back( aGaussObjX.fire() );
421  randomVector.push_back( aGaussObjY.fire() );
422  randomVector.push_back( aGaussObjZ.fire() );
423 
424  return randomVector;
425 
426 }
427 
428 
429 //__________________________________________________________________________________________________
430 const std::vector<float>
431 AlignableModifier::flatRandomVector( float sigmaX,float sigmaY, float sigmaZ ) const
432 {
433 
434  // Get absolute value if negative arguments
435  if ( sigmaX < 0 ) {
436  edm::LogWarning("BadConfig") << " taking absolute value for flat sigma_x";
437  sigmaX = std::abs(sigmaX);
438  }
439  if ( sigmaY < 0 ) {
440  edm::LogWarning("BadConfig") << " taking absolute value for flat sigma_y";
441  sigmaY = std::abs(sigmaY);
442  }
443  if ( sigmaZ < 0 ) {
444  edm::LogWarning("BadConfig") << " taking absolute value for flat sigma_z";
445  sigmaZ = std::abs(sigmaZ);
446  }
447 
448  CLHEP::RandFlat aFlatObjX( *theDRand48Engine, -sigmaX, sigmaX );
449  CLHEP::RandFlat aFlatObjY( *theDRand48Engine, -sigmaY, sigmaY );
450  CLHEP::RandFlat aFlatObjZ( *theDRand48Engine, -sigmaZ, sigmaZ );
451 
452  std::vector<float> randomVector;
453  randomVector.push_back( aFlatObjX.fire() );
454  randomVector.push_back( aFlatObjY.fire() );
455  randomVector.push_back( aFlatObjZ.fire() );
456 
457  return randomVector;
458 
459 }
460 
461 
462 
463 //__________________________________________________________________________________________________
465  float dx, float dy, float dz )
466 {
467 
468  LogDebug("PrintArgs") << "Adding an AlignmentPositionError of size "
469  << dx << " " << dy << " " << dz;
470 
471  AlignmentPositionError ape(dx,dy,dz);
472  alignable->addAlignmentPositionError( ape, true );
473 
474 }
475 
476 
477 //__________________________________________________________________________________________________
479  float dx, float dy, float dz )
480 {
481 
482  LogDebug("PrintArgs") << "Adding a local AlignmentPositionError of size "
483  << dx << " " << dy << " " << dz;
484 
485  AlgebraicSymMatrix as(3,0); //3x3, zeroed
486  as[0][0] = dx*dx; as[1][1] = dy*dy; as[2][2] = dz*dz; //diagonals
487  align::RotationType rt = alignable->globalRotation(); //get rotation
488  AlgebraicMatrix am(3,3);
489  am[0][0]=rt.xx(); am[0][1]=rt.xy(); am[0][2]=rt.xz();
490  am[1][0]=rt.yx(); am[1][1]=rt.yy(); am[1][2]=rt.yz();
491  am[2][0]=rt.zx(); am[2][1]=rt.zy(); am[2][2]=rt.zz();
492  as=as.similarityT(am); //rotate error matrix
493 
494  GlobalError ge( as );
495  AlignmentPositionError ape( ge );
496 
497  alignable->addAlignmentPositionError( ape, true ); // propagate down to components
498 
499 }
500 
501 
502 
503 //__________________________________________________________________________________________________
505  float phiX, float phiY,
506  float phiZ )
507 {
508 
509  align::RotationType rotx( Basic3DVector<float>(1.0, 0.0, 0.0), phiX );
510  align::RotationType roty( Basic3DVector<float>(0.0, 1.0, 0.0), phiY );
511  align::RotationType rotz( Basic3DVector<float>(0.0, 0.0, 1.0), phiZ );
512  align::RotationType rot = rotz * roty * rotx;
513 
514  this->addAlignmentPositionErrorFromRotation( alignable, rot );
515 
516 }
517 
518 
519 //__________________________________________________________________________________________________
521  float phiX, float phiY,
522  float phiZ )
523 {
524 
525  align::RotationType rotx( Basic3DVector<float>(1.0, 0.0, 0.0), phiX );
526  align::RotationType roty( Basic3DVector<float>(0.0, 1.0, 0.0), phiY );
527  align::RotationType rotz( Basic3DVector<float>(0.0, 0.0, 1.0), phiZ );
528  align::RotationType rot = rotz * roty * rotx;
529 
530  this->addAlignmentPositionErrorFromLocalRotation( alignable, rot );
531 
532 }
533 
534 
535 //__________________________________________________________________________________________________
537  align::RotationType& rotation )
538 {
539 
540  LogDebug("PrintArgs") << "Adding an AlignmentPositionError from Rotation" << std::endl
541  << rotation;
542 
543  alignable->addAlignmentPositionErrorFromRotation(rotation, true); // propagate down to components
544 
545 }
546 
547 
548 //__________________________________________________________________________________________________
550  align::RotationType& rotation )
551 {
552 
553  LogDebug("PrintArgs") << "Adding an AlignmentPositionError from Local Rotation" << std::endl
554  << rotation;
555 
556  // true: propagate down to components
557  alignable->addAlignmentPositionErrorFromLocalRotation(rotation, true);
558 
559 }
560 
#define LogDebug(id)
T xx() const
T getParameter(std::string const &) const
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.
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:180
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
Definition: Alignable.cc:185
void setSeed(long seed)
Resets the generator seed according to the argument.
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)=0
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)
T y() const
Definition: PV3DBase.h:57
T yx() const
#define abs(x)
Definition: mlp_lapack.h:159
void init_()
Initialisation of all parameters.
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
TRandom random
Definition: MVATrainer.cc:138
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
void addAlignmentPositionErrorLocal(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in local frame) to Alignable.
std::string distribution_
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
Definition: Alignable.cc:172
T zx() const
T xy() const
virtual void addAlignmentPositionErrorFromLocalRotation(const RotationType &rotation, bool propagateDown)=0
void moveAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in global space according to parameters.
AlignableModifier()
Constructor.
T zz() const
CLHEP::HepMatrix AlgebraicMatrix
void setDistribution(const std::string &distr)
Decodes string and sets distribution accordingly (&#39;fixed&#39;, &#39;flat&#39; or &#39;gaussian&#39;). ...
T z() const
Definition: PV3DBase.h:58
T zy() const
CLHEP::DRand48Engine * theDRand48Engine
Unique random number generator.
std::vector< std::string > getParameterNames() const
const std::vector< float > flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (flat distribution)
T yy() const
const bool isPropagated(const std::string &parameterName) const
Check if given parameter should be propagated.
Vector3DBase< Scalar, LocalTag > LocalVector
Definition: Definitions.h:34
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
void rotateAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ)
Rotate alignable in global space according to parameters.
virtual void rotateAroundGlobalX(Scalar radians)
Rotation around global x-axis.
Definition: Alignable.cc:120
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.
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
Definition: Alignable.cc:159
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
Definition: Alignable.cc:146
string message
Definition: argparse.py:126
T xz() const
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
Definition: Alignable.cc:133
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
CLHEP::HepSymMatrix AlgebraicSymMatrix
void moveAlignableLocal(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in local space according to parameters.
T x() const
Definition: PV3DBase.h:56
virtual uint32_t mySeed() const =0
Exists for backward compatibility.
T yz() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10