CMS 3D CMS Logo

AlignableModifier.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <cctype>
3 
4 #include "CLHEP/Random/DRand48Engine.h"
5 #include "CLHEP/Random/RandGauss.h"
6 #include "CLHEP/Random/Randomize.h"
7 
13 
16 
19 
20 //__________________________________________________________________________________________________
22  : distribution_(""),
23  random_(false),
24  gaussian_(false),
25  setError_(false),
26  setRotations_(false),
27  setTranslations_(false),
28  seed_(0),
29  scaleError_(0.),
30  scale_(0.),
31  phiX_(0.),
32  phiY_(0.),
33  phiZ_(0.),
34  phiXlocal_(0.),
35  phiYlocal_(0.),
36  phiZlocal_(0.),
37  dX_(0.),
38  dY_(0.),
39  dZ_(0.),
40  dXlocal_(0.),
41  dYlocal_(0.),
42  dZlocal_(0.),
43  twist_(0.),
44  shear_(0.) {
45  theDRand48Engine = new CLHEP::DRand48Engine();
46 }
47 
48 //__________________________________________________________________________________________________
50 
51 //__________________________________________________________________________________________________
53  // Initialize all known parameters (according to ORCA's MisalignmentScenario.cc)
54  distribution_ = ""; // Switch for distributions ("fixed","flat","gaussian")
55  setError_ = false; // Apply alignment errors
56  setRotations_ = true; // Apply rotations
57  setTranslations_ = true; // Apply translations
58  scale_ = 1.; // Scale to apply to all movements
59  scaleError_ = 1.; // Scale to apply to alignment errors
60  phiX_ = 0.; // Rotation angle around X [rad]
61  phiY_ = 0.; // Rotation angle around Y [rad]
62  phiZ_ = 0.; // Rotation angle around Z [rad]
63  phiXlocal_ = 0.; // Local rotation angle around X [rad]
64  phiYlocal_ = 0.; // Local rotation angle around Y [rad]
65  phiZlocal_ = 0.; // Local rotation angle around Z [rad]
66  dX_ = 0.; // X displacement [cm]
67  dY_ = 0.; // Y displacement [cm]
68  dZ_ = 0.; // Z displacement [cm]
69  dXlocal_ = 0.; // Local X displacement [cm]
70  dYlocal_ = 0.; // Local Y displacement [cm]
71  dZlocal_ = 0.; // Local Z displacement [cm]
72  deformation_.first.clear(); // SurfaceDeformation: type
73  deformation_.second.clear(); //SurfaceDeformation: parameter vector
74  twist_ = 0.; // Twist angle [rad]
75  shear_ = 0.; // Shear angle [rad]
76 
77  // These are set through 'distribution'
78  random_ = true; // Use random distributions
79  gaussian_ = true; // Use gaussian distribution (otherwise flat)
80 }
81 
82 //__________________________________________________________________________________________________
83 // Return true if given parameter name should be propagated down
84 bool AlignableModifier::isPropagated(const std::string& parameterName) const {
85  if (parameterName == "distribution" || parameterName == "setError" || parameterName == "scaleError" ||
86  parameterName == "setRotations" || parameterName == "setTranslations" || parameterName == "scale")
87  return true;
88 
89  return false;
90 }
91 
92 //__________________________________________________________________________________________________
94 bool AlignableModifier::modify(Alignable* alignable, const edm::ParameterSet& pSet) {
95  // Initialize parameters
96  this->init_();
97  int rotX_ = 0, rotY_ = 0, rotZ_ = 0; // To check correct backward compatibility
98 
99  // Reset counter
100  m_modified = 0;
101 
102  // Retrieve parameters
103  std::ostringstream error;
104  std::vector<std::string> parameterNames = pSet.getParameterNames();
105  for (std::vector<std::string>::iterator iParam = parameterNames.begin(); iParam != parameterNames.end(); ++iParam) {
106  if ((*iParam) == "distribution")
107  distribution_ = pSet.getParameter<std::string>(*iParam);
108  else if ((*iParam) == "setError")
109  setError_ = pSet.getParameter<bool>(*iParam);
110  else if ((*iParam) == "setRotations")
111  setRotations_ = pSet.getParameter<bool>(*iParam);
112  else if ((*iParam) == "setTranslations")
113  setTranslations_ = pSet.getParameter<bool>(*iParam);
114  else if ((*iParam) == "scale")
115  scale_ = pSet.getParameter<double>(*iParam);
116  else if ((*iParam) == "scaleError")
117  scaleError_ = pSet.getParameter<double>(*iParam);
118  else if ((*iParam) == "phiX")
119  phiX_ = pSet.getParameter<double>(*iParam);
120  else if ((*iParam) == "phiY")
121  phiY_ = pSet.getParameter<double>(*iParam);
122  else if ((*iParam) == "phiZ")
123  phiZ_ = pSet.getParameter<double>(*iParam);
124  else if ((*iParam) == "dX")
125  dX_ = pSet.getParameter<double>(*iParam);
126  else if ((*iParam) == "dY")
127  dY_ = pSet.getParameter<double>(*iParam);
128  else if ((*iParam) == "dZ")
129  dZ_ = pSet.getParameter<double>(*iParam);
130  else if ((*iParam) == "dXlocal")
131  dXlocal_ = pSet.getParameter<double>(*iParam);
132  else if ((*iParam) == "dYlocal")
133  dYlocal_ = pSet.getParameter<double>(*iParam);
134  else if ((*iParam) == "dZlocal")
135  dZlocal_ = pSet.getParameter<double>(*iParam);
136  else if ((*iParam) == "twist")
137  twist_ = pSet.getParameter<double>(*iParam);
138  else if ((*iParam) == "shear")
139  shear_ = pSet.getParameter<double>(*iParam);
140  else if ((*iParam) == "localX") {
141  phiXlocal_ = pSet.getParameter<double>(*iParam);
142  rotX_++;
143  } else if ((*iParam) == "localY") {
144  phiYlocal_ = pSet.getParameter<double>(*iParam);
145  rotY_++;
146  } else if ((*iParam) == "localZ") {
147  phiZlocal_ = pSet.getParameter<double>(*iParam);
148  rotZ_++;
149  } else if ((*iParam) == "phiXlocal") {
150  phiXlocal_ = pSet.getParameter<double>(*iParam);
151  rotX_++;
152  } else if ((*iParam) == "phiYlocal") {
153  phiYlocal_ = pSet.getParameter<double>(*iParam);
154  rotY_++;
155  } else if ((*iParam) == "phiZlocal") {
156  phiZlocal_ = pSet.getParameter<double>(*iParam);
157  rotZ_++;
158  } else if ((*iParam) == "deformation") {
159  const edm::ParameterSet deform(pSet.getParameter<edm::ParameterSet>(*iParam));
160  deformation_.first = deform.getParameter<std::string>("type");
161  deformation_.second = deform.getParameter<std::vector<double> >("parameters");
162  } else if (pSet.existsAs<edm::ParameterSet>(*iParam)) {
163  // Other PSets than 'deformation' must refer to hierarchy structures, i.e. their name
164  // is a level name followed by 's' or ending with a digit (see
165  // MisalignmentScenarioBuilder::getParameterSet_). Pitfall is to forget the trailing 's'!
166  // 'Muon' is an especially allowed case used in MuonScenarioBuilder::moveMuon(..),
167  // also check that we do not have any mistyping like 'deformations' or 'deformation2'
168  const auto lastCharacter = (iParam->empty() ? '_' : (*iParam)[iParam->size() - 1]);
169  if ((lastCharacter != 's' && !isdigit(lastCharacter) && (*iParam) != "Muon") ||
170  iParam->find("deformation") != std::string::npos) {
171  throw cms::Exception("BadConfig") << "@SUB=AlignableModifier::modify(..):\n"
172  << "I see parameter '" << *iParam << "' of type PSet, "
173  << "but expect either 'deformation' or a level name "
174  << "with 's' or a digit at the end.\n";
175  } // other PSets should now be hierarchy levels and thus be OK to ignore here
176  } else {
177  if (!error.str().length())
178  error << "Unknown parameter name(s): ";
179  error << " " << *iParam;
180  }
181  }
182 
183  // Check if both 'localN' and 'phiNlocal' have been used
184  if (rotX_ == 2)
185  throw cms::Exception("BadConfig") << "Found both localX and phiXlocal";
186  if (rotY_ == 2)
187  throw cms::Exception("BadConfig") << "Found both localY and phiYlocal";
188  if (rotZ_ == 2)
189  throw cms::Exception("BadConfig") << "Found both localZ and phiZlocal";
190 
191  // Check error
192  if (error.str().length())
193  throw cms::Exception("BadConfig") << error.str();
194 
195  // Decode distribution
197 
198  //if (scale_) { NO! Different random sequence if only parts scale to zero!
199 
200  // Apply displacements
202  this->moveAlignable(alignable, random_, gaussian_, scale_ * dX_, scale_ * dY_, scale_ * dZ_);
203 
204  // Apply local displacements
207 
208  // Apply rotations
210  this->rotateAlignable(alignable, random_, gaussian_, scale_ * phiX_, scale_ * phiY_, scale_ * phiZ_);
211 
212  // Apply local rotations
214  this->rotateAlignableLocal(
216 
217  // Apply twist
218  if (std::abs(twist_) > 0)
219  edm::LogError("NotImplemented") << "Twist is not implemented yet";
220 
221  // Apply shear
222  if (std::abs(shear_) > 0)
223  edm::LogError("NotImplemented") << "Shear is not implemented yet";
224 
225  if (!deformation_.first.empty()) {
226  this->addDeformation(alignable, deformation_, random_, gaussian_, scale_);
227  }
228 
229  // Apply error - first add scale_ to error
230  scaleError_ *= scale_;
231  if (setError_ && scaleError_) {
232  // Alignment Position Error for flat distribution: 1 sigma
233  if (!gaussian_)
234  scaleError_ *= 0.68;
235 
236  // Error on displacement
239 
240  // Error on local displacements
244 
245  // Error on rotations
248  alignable, scaleError_ * phiX_, scaleError_ * phiY_, scaleError_ * phiZ_);
249 
250  // Error on local rotations
254  // Do we need to add any APE for deformations?
255  // Probably we would do so if there wouldn't be data, but only MC to play with... ;-)
256  }
257  // } // end if (scale_)
258 
259  return (m_modified > 0);
260 }
261 
262 //__________________________________________________________________________________________________
264  if (distr == "fixed")
265  random_ = false;
266  else if (distr == "flat") {
267  random_ = true;
268  gaussian_ = false;
269  } else if (distr == "gaussian") {
270  random_ = true;
271  gaussian_ = true;
272  }
273 }
274 
275 //__________________________________________________________________________________________________
278  long m_seed;
279 
280  if (seed > 0)
281  m_seed = seed;
282  else {
284  m_seed = rng->mySeed();
285  }
286 
287  LogDebug("PrintArgs") << "Setting generator seed to " << m_seed;
288 
289  theDRand48Engine->setSeed(m_seed);
290 }
291 
292 //__________________________________________________________________________________________________
296  Alignable* alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ) {
297  std::ostringstream message;
298 
299  // Get movement vector according to arguments
300  GlobalVector moveV(sigmaX, sigmaY, sigmaZ); // Default: fixed
301  if (random) {
302  std::vector<float> randomNumbers;
303  message << "random ";
304  if (gaussian) {
305  randomNumbers = this->gaussianRandomVector(sigmaX, sigmaY, sigmaZ);
306  message << "gaussian ";
307  } else {
308  randomNumbers = this->flatRandomVector(sigmaX, sigmaY, sigmaZ);
309  message << "flat ";
310  }
311  moveV = GlobalVector(randomNumbers[0], randomNumbers[1], randomNumbers[2]);
312  }
313 
314  message << " move with sigma " << sigmaX << " " << sigmaY << " " << sigmaZ;
315 
316  LogDebug("PrintArgs") << message.str(); // Arguments
317 
318  LogDebug("PrintMovement") << "applied displacement: " << moveV; // Actual movements
319  alignable->move(moveV);
320  m_modified++;
321 }
322 
323 //__________________________________________________________________________________________________
327  Alignable* alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ) {
328  std::ostringstream message;
329 
330  // Get movement vector according to arguments
331  align::LocalVector moveV(sigmaX, sigmaY, sigmaZ); // Default: fixed
332  if (random) {
333  std::vector<float> randomNumbers;
334  message << "random ";
335  if (gaussian) {
336  randomNumbers = this->gaussianRandomVector(sigmaX, sigmaY, sigmaZ);
337  message << "gaussian ";
338  } else {
339  randomNumbers = this->flatRandomVector(sigmaX, sigmaY, sigmaZ);
340  message << "flat ";
341  }
342  moveV = align::LocalVector(randomNumbers[0], randomNumbers[1], randomNumbers[2]);
343  }
344 
345  message << " move with sigma " << sigmaX << " " << sigmaY << " " << sigmaZ;
346 
347  LogDebug("PrintArgs") << message.str(); // Arguments
348 
349  LogDebug("PrintMovement") << "applied local displacement: " << moveV; // Actual movements
350  alignable->move(alignable->surface().toGlobal(moveV));
351  m_modified++;
352 }
353 
354 //__________________________________________________________________________________________________
356  const AlignableModifier::DeformationMemberType& deformation,
357  bool random,
358  bool gaussian,
359  double scale) {
360  const SurfaceDeformationFactory::Type deformType =
362 
363  // Scale and randomize
364  // (need a little hack since ySplit must not be treated)!
365  const bool rndNotLast = (deformType == SurfaceDeformationFactory::kTwoBowedSurfaces);
366  std::vector<double> rndDeformation(deformation.second.begin(), deformation.second.end() - (rndNotLast ? 1 : 0));
367  for (unsigned int i = 0; i < rndDeformation.size(); ++i) {
368  rndDeformation[i] *= scale;
369  }
370  if (random) {
371  this->randomise(rndDeformation, gaussian);
372  }
373  if (rndNotLast) { // put back ySplit at the end
374  rndDeformation.push_back(deformation.second.back());
375  }
376 
377  // auto_ptr has exception safe delete (in contrast to bare pointer)
378  const std::unique_ptr<SurfaceDeformation> surfDef(SurfaceDeformationFactory::create(deformType, rndDeformation));
379 
380  alignable->addSurfaceDeformation(surfDef.get(), true); // true to propagate down
381  ++m_modified;
382 }
383 
384 //__________________________________________________________________________________________________
388  Alignable* alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ) {
389  std::ostringstream message;
390 
391  // Get rotation vector according to arguments
392  GlobalVector rotV(sigmaPhiX, sigmaPhiY, sigmaPhiZ); // Default: fixed
393  if (random) {
394  std::vector<float> randomNumbers;
395  message << "random ";
396  if (gaussian) {
397  randomNumbers = this->gaussianRandomVector(sigmaPhiX, sigmaPhiY, sigmaPhiZ);
398  message << "gaussian ";
399  } else {
400  randomNumbers = flatRandomVector(sigmaPhiX, sigmaPhiY, sigmaPhiZ);
401  message << "flat ";
402  }
403  rotV = GlobalVector(randomNumbers[0], randomNumbers[1], randomNumbers[2]);
404  }
405 
406  message << "global rotation by angles " << sigmaPhiX << " " << sigmaPhiY << " " << sigmaPhiZ;
407 
408  LogDebug("PrintArgs") << message.str(); // Arguments
409 
410  LogDebug("PrintMovement") << "applied rotation angles: " << rotV; // Actual movements
411  if (std::abs(sigmaPhiX))
412  alignable->rotateAroundGlobalX(rotV.x());
413  if (std::abs(sigmaPhiY))
414  alignable->rotateAroundGlobalY(rotV.y());
415  if (std::abs(sigmaPhiZ))
416  alignable->rotateAroundGlobalZ(rotV.z());
417  m_modified++;
418 }
419 
420 //__________________________________________________________________________________________________
424  Alignable* alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ) {
425  std::ostringstream message;
426 
427  // Get rotation vector according to arguments
428  align::LocalVector rotV(sigmaPhiX, sigmaPhiY, sigmaPhiZ); // Default: fixed
429  if (random) {
430  std::vector<float> randomNumbers;
431  message << "random ";
432  if (gaussian) {
433  randomNumbers = this->gaussianRandomVector(sigmaPhiX, sigmaPhiY, sigmaPhiZ);
434  message << "gaussian ";
435  } else {
436  randomNumbers = flatRandomVector(sigmaPhiX, sigmaPhiY, sigmaPhiZ);
437  message << "flat ";
438  }
439  rotV = align::LocalVector(randomNumbers[0], randomNumbers[1], randomNumbers[2]);
440  }
441 
442  message << "local rotation by angles " << sigmaPhiX << " " << sigmaPhiY << " " << sigmaPhiZ;
443 
444  LogDebug("PrintArgs") << message.str(); // Arguments
445 
446  LogDebug("PrintMovement") << "applied local rotation angles: " << rotV; // Actual movements
447  if (std::abs(sigmaPhiX))
448  alignable->rotateAroundLocalX(rotV.x());
449  if (std::abs(sigmaPhiY))
450  alignable->rotateAroundLocalY(rotV.y());
451  if (std::abs(sigmaPhiZ))
452  alignable->rotateAroundLocalZ(rotV.z());
453  m_modified++;
454 }
455 
456 //__________________________________________________________________________________________________
457 const std::vector<float> AlignableModifier::gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const {
458  // Get absolute value if negative arguments
459  if (sigmaX < 0) {
460  edm::LogWarning("BadConfig") << " taking absolute value for gaussian sigma_x";
462  }
463  if (sigmaY < 0) {
464  edm::LogWarning("BadConfig") << " taking absolute value for gaussian sigma_y";
466  }
467  if (sigmaZ < 0) {
468  edm::LogWarning("BadConfig") << " taking absolute value for gaussian sigma_z";
470  }
471 
472  // Pass by reference, otherwise pointer is deleted!
473  CLHEP::RandGauss aGaussObjX(*theDRand48Engine, 0., sigmaX);
474  CLHEP::RandGauss aGaussObjY(*theDRand48Engine, 0., sigmaY);
475  CLHEP::RandGauss aGaussObjZ(*theDRand48Engine, 0., sigmaZ);
476 
477  std::vector<float> randomVector;
478  randomVector.push_back(aGaussObjX.fire());
479  randomVector.push_back(aGaussObjY.fire());
480  randomVector.push_back(aGaussObjZ.fire());
481 
482  return randomVector;
483 }
484 
485 //__________________________________________________________________________________________________
486 const std::vector<float> AlignableModifier::flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const {
487  // Get absolute value if negative arguments
488  if (sigmaX < 0) {
489  edm::LogWarning("BadConfig") << " taking absolute value for flat sigma_x";
491  }
492  if (sigmaY < 0) {
493  edm::LogWarning("BadConfig") << " taking absolute value for flat sigma_y";
495  }
496  if (sigmaZ < 0) {
497  edm::LogWarning("BadConfig") << " taking absolute value for flat sigma_z";
499  }
500 
501  CLHEP::RandFlat aFlatObjX(*theDRand48Engine, -sigmaX, sigmaX);
502  CLHEP::RandFlat aFlatObjY(*theDRand48Engine, -sigmaY, sigmaY);
503  CLHEP::RandFlat aFlatObjZ(*theDRand48Engine, -sigmaZ, sigmaZ);
504 
505  std::vector<float> randomVector;
506  randomVector.push_back(aFlatObjX.fire());
507  randomVector.push_back(aFlatObjY.fire());
508  randomVector.push_back(aFlatObjZ.fire());
509 
510  return randomVector;
511 }
512 
513 //__________________________________________________________________________________________________
514 void AlignableModifier::randomise(std::vector<double>& rnd, bool gaussian) const {
515  for (unsigned int i = 0; i < rnd.size(); ++i) {
516  if (rnd[i] < 0.) {
517  edm::LogWarning("BadConfig") << " taking absolute value to randomise " << i;
518  rnd[i] = std::abs(rnd[i]);
519  }
520 
521  if (gaussian) {
522  CLHEP::RandGauss aGaussObj(*theDRand48Engine, 0., rnd[i]);
523  rnd[i] = aGaussObj.fire();
524  } else {
525  CLHEP::RandFlat aFlatObj(*theDRand48Engine, -rnd[i], rnd[i]);
526  rnd[i] = aFlatObj.fire();
527  }
528  }
529 }
530 
531 //__________________________________________________________________________________________________
532 void AlignableModifier::addAlignmentPositionError(Alignable* alignable, float dx, float dy, float dz) {
533  LogDebug("PrintArgs") << "Adding an AlignmentPositionError of size " << dx << " " << dy << " " << dz;
534 
536  alignable->addAlignmentPositionError(ape, true);
537 }
538 
539 //__________________________________________________________________________________________________
540 void AlignableModifier::addAlignmentPositionErrorLocal(Alignable* alignable, float dx, float dy, float dz) {
541  LogDebug("PrintArgs") << "Adding a local AlignmentPositionError of size " << dx << " " << dy << " " << dz;
542 
543  AlgebraicSymMatrix as(3, 0); //3x3, zeroed
544  as[0][0] = dx * dx;
545  as[1][1] = dy * dy;
546  as[2][2] = dz * dz; //diagonals
547  align::RotationType rt = alignable->globalRotation(); //get rotation
548  AlgebraicMatrix am(3, 3);
549  am[0][0] = rt.xx();
550  am[0][1] = rt.xy();
551  am[0][2] = rt.xz();
552  am[1][0] = rt.yx();
553  am[1][1] = rt.yy();
554  am[1][2] = rt.yz();
555  am[2][0] = rt.zx();
556  am[2][1] = rt.zy();
557  am[2][2] = rt.zz();
558  as = as.similarityT(am); //rotate error matrix
559 
560  GlobalError ge(asSMatrix<3>(as));
561  GlobalErrorExtended gee(ge.cxx(),
562  ge.cyx(),
563  ge.czx(),
564  0.,
565  0.,
566  0.,
567  ge.cyy(),
568  ge.czy(),
569  0.,
570  0.,
571  0.,
572  ge.czz(),
573  0.,
574  0.,
575  0.,
576  0.,
577  0.,
578  0.,
579  0.,
580  0.,
581  0.);
582  AlignmentPositionError ape(gee);
583 
584  alignable->addAlignmentPositionError(ape, true); // propagate down to components
585 }
586 
587 //__________________________________________________________________________________________________
588 void AlignableModifier::addAlignmentPositionErrorFromRotation(Alignable* alignable, float phiX, float phiY, float phiZ) {
589  align::RotationType rotx(Basic3DVector<float>(1.0, 0.0, 0.0), phiX);
590  align::RotationType roty(Basic3DVector<float>(0.0, 1.0, 0.0), phiY);
591  align::RotationType rotz(Basic3DVector<float>(0.0, 0.0, 1.0), phiZ);
592  align::RotationType rot = rotz * roty * rotx;
593 
594  this->addAlignmentPositionErrorFromRotation(alignable, rot);
595 }
596 
597 //__________________________________________________________________________________________________
599  float phiX,
600  float phiY,
601  float phiZ) {
602  align::RotationType rotx(Basic3DVector<float>(1.0, 0.0, 0.0), phiX);
603  align::RotationType roty(Basic3DVector<float>(0.0, 1.0, 0.0), phiY);
604  align::RotationType rotz(Basic3DVector<float>(0.0, 0.0, 1.0), phiZ);
605  align::RotationType rot = rotz * roty * rotx;
606 
608 }
609 
610 //__________________________________________________________________________________________________
612  LogDebug("PrintArgs") << "Adding an AlignmentPositionError from Rotation" << std::endl << rotation;
613 
614  alignable->addAlignmentPositionErrorFromRotation(rotation, true); // propagate down to components
615 }
616 
617 //__________________________________________________________________________________________________
620  LogDebug("PrintArgs") << "Adding an AlignmentPositionError from Local Rotation" << std::endl << rotation;
621 
622  // true: propagate down to components
624 }
Vector3DBase
Definition: Vector3DBase.h:8
AlignableModifier::scale_
double scale_
Definition: AlignableModifier.h:102
Alignable::addAlignmentPositionErrorFromLocalRotation
virtual void addAlignmentPositionErrorFromLocalRotation(const RotationType &rotation, bool propagateDown)=0
TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
funct::false
false
Definition: Factorize.h:34
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
AlignableModifier::phiX_
double phiX_
Definition: AlignableModifier.h:103
AlignableModifier::rotateAlignableLocal
void rotateAlignableLocal(Alignable *alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ)
Rotate alignable in local space according to parameters.
Definition: AlignableModifier.cc:423
AlignableModifier::~AlignableModifier
~AlignableModifier()
Destructor.
Definition: AlignableModifier.cc:49
RandomNumberGenerator.h
AlignableModifier::addAlignmentPositionErrorLocal
void addAlignmentPositionErrorLocal(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in local frame) to Alignable.
Definition: AlignableModifier.cc:540
AlignableModifier::isPropagated
bool isPropagated(const std::string &parameterName) const
Check if given parameter should be propagated.
Definition: AlignableModifier.cc:84
Alignable
Definition: Alignable.h:27
hcal_runs.rt
rt
Definition: hcal_runs.py:76
Alignable::rotateAroundGlobalX
virtual void rotateAroundGlobalX(Scalar radians)
Rotation around global x-axis.
Definition: Alignable.cc:148
AlignableModifier::setTranslations_
bool setTranslations_
Definition: AlignableModifier.h:100
AlignableModifier::init_
void init_()
Initialisation of all parameters.
Definition: AlignableModifier.cc:52
AlignableModifier::flatRandomVector
const std::vector< float > flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (flat distribution)
Definition: AlignableModifier.cc:486
SurfaceDeformationFactory::kTwoBowedSurfaces
Definition: SurfaceDeformationFactory.h:20
AlignableModifier::phiZlocal_
double phiZlocal_
Definition: AlignableModifier.h:104
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
edm::RandomNumberGenerator::mySeed
virtual std::uint32_t mySeed() const =0
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
AlignableModifier::distribution_
std::string distribution_
Definition: AlignableModifier.h:98
relativeConstraints.error
error
Definition: relativeConstraints.py:53
AlignableModifier::phiZ_
double phiZ_
Definition: AlignableModifier.h:103
Alignable::rotateAroundGlobalZ
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
Definition: Alignable.cc:176
AlignableModifier::phiY_
double phiY_
Definition: AlignableModifier.h:103
AlignableModifier::phiYlocal_
double phiYlocal_
Definition: AlignableModifier.h:104
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GlobalErrorBase::czy
T czy() const
Definition: GlobalErrorBase.h:105
AlignableModifier::moveAlignable
void moveAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in global space according to parameters.
Definition: AlignableModifier.cc:295
GlobalErrorBase::cyy
T cyy() const
Definition: GlobalErrorBase.h:101
AlignableModifier.h
AlignableModifier::theDRand48Engine
CLHEP::DRand48Engine * theDRand48Engine
Unique random number generator.
Definition: AlignableModifier.h:90
AlignableModifier::dYlocal_
double dYlocal_
Definition: AlignableModifier.h:106
Service.h
Alignable::addAlignmentPositionError
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
AlignableModifier::dX_
double dX_
Definition: AlignableModifier.h:105
AlignableModifier::setRotations_
bool setRotations_
Definition: AlignableModifier.h:100
AlignableModifier::random_
bool random_
Definition: AlignableModifier.h:99
AlignableSurface::toGlobal
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
Definition: AlignableSurface.cc:15
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
AlignableModifier::deformation_
DeformationMemberType deformation_
Definition: AlignableModifier.h:107
Alignable::rotateAroundGlobalY
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
Definition: Alignable.cc:162
GlobalErrorBase::cxx
T cxx() const
Definition: GlobalErrorBase.h:97
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AlignableModifier::addDeformation
void addDeformation(Alignable *alignable, const DeformationMemberType &deformation, bool random, bool gaussian, double scale)
Definition: AlignableModifier.cc:355
Alignable::addAlignmentPositionErrorFromRotation
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)=0
SurfaceDeformation.h
edm::LogWarning
Definition: MessageLogger.h:141
AlignableModifier::dXlocal_
double dXlocal_
Definition: AlignableModifier.h:106
AlignableModifier::shear_
double shear_
Definition: AlignableModifier.h:108
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
AlignableModifier::AlignableModifier
AlignableModifier()
Constructor.
Definition: AlignableModifier.cc:21
edm::ParameterSet
Definition: ParameterSet.h:36
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
edm::LogError
Definition: MessageLogger.h:183
AlignableModifier::gaussianRandomVector
const std::vector< float > gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (gaussian distribution)
Definition: AlignableModifier.cc:457
GlobalErrorBase::cyx
T cyx() const
Definition: GlobalErrorBase.h:99
SurfaceDeformationFactory::Type
Type
Definition: SurfaceDeformationFactory.h:17
AlignableModifier::phiXlocal_
double phiXlocal_
Definition: AlignableModifier.h:104
AlignableComposite.h
AlignableModifier::rotateAlignable
void rotateAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ)
Rotate alignable in global space according to parameters.
Definition: AlignableModifier.cc:387
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition: ParameterSet.cc:656
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Alignable::rotateAroundLocalZ
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
Definition: Alignable.cc:183
edm::Service< edm::RandomNumberGenerator >
AlignableModifier::setDistribution
void setDistribution(const std::string &distr)
Decodes string and sets distribution accordingly ('fixed', 'flat' or 'gaussian').
Definition: AlignableModifier.cc:263
AlignableModifier::m_modified
int m_modified
Definition: AlignableModifier.h:95
GlobalErrorBase< double, ErrorMatrixTag >
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
PVValHelper::dy
Definition: PVValidationHelpers.h:49
align::LocalVector
Vector3DBase< Scalar, LocalTag > LocalVector
Definition: Definitions.h:32
AlignableModifier::dY_
double dY_
Definition: AlignableModifier.h:105
AlignableModifier::moveAlignableLocal
void moveAlignableLocal(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in local space according to parameters.
Definition: AlignableModifier.cc:326
AlignableModifier::addAlignmentPositionErrorFromRotation
void addAlignmentPositionErrorFromRotation(Alignable *alignable, float phiX, float phiY, float phiZ)
Add alignment position error resulting from rotation in global frame.
Definition: AlignableModifier.cc:588
Alignable::rotateAroundLocalX
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
Definition: Alignable.cc:155
Alignable::move
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
fftjetvertexadder_cfi.sigmaX
sigmaX
Definition: fftjetvertexadder_cfi.py:30
SurfaceDeformationFactory.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
AlignableModifier::twist_
double twist_
Definition: AlignableModifier.h:108
AlignableModifier::randomise
void randomise(std::vector< double > &rnd, bool gaussian) const
Definition: AlignableModifier.cc:514
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
fftjetvertexadder_cfi.sigmaY
sigmaY
Definition: fftjetvertexadder_cfi.py:31
SurfaceDeformationFactory::surfaceDeformationType
Type surfaceDeformationType(const std::string &typeString)
convert string to 'Type' - exception if string is not known
Definition: SurfaceDeformationFactory.cc:14
PVValHelper::dz
Definition: PVValidationHelpers.h:50
AlignableModifier::dZ_
double dZ_
Definition: AlignableModifier.h:105
AlignableModifier::dZlocal_
double dZlocal_
Definition: AlignableModifier.h:106
Alignable::rotateAroundLocalY
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
Definition: Alignable.cc:169
Exception
Definition: hltDiff.cc:246
AlignmentPositionError.h
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
GlobalErrorBase::czz
T czz() const
Definition: GlobalErrorBase.h:107
AlignableModifier::DeformationMemberType
std::pair< std::string, std::vector< double > > DeformationMemberType
Definition: AlignableModifier.h:85
AlignableModifier::modify
bool modify(Alignable *alignable, const edm::ParameterSet &pSet)
Modify given set of alignables according to parameters.
Definition: AlignableModifier.cc:94
cms::Exception
Definition: Exception.h:70
GlobalErrorBaseExtended< double, ErrorMatrixTag >
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
AlignableModifier::setError_
bool setError_
Definition: AlignableModifier.h:99
ParameterSet.h
fftjetvertexadder_cfi.sigmaZ
sigmaZ
Definition: fftjetvertexadder_cfi.py:32
AlignmentPositionError
Definition: AlignmentPositionError.h:10
AlignableModifier::gaussian_
bool gaussian_
Definition: AlignableModifier.h:99
PVValHelper::dx
Definition: PVValidationHelpers.h:48
Alignable::addSurfaceDeformation
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
AlignableModifier::scaleError_
double scaleError_
Definition: AlignableModifier.h:102
Basic3DVector< float >
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
AlignableModifier::setSeed
void setSeed(long seed)
Resets the generator seed according to the argument.
Definition: AlignableModifier.cc:277
Alignable::globalRotation
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
SurfaceDeformationFactory::create
SurfaceDeformation * create(int type, const std::vector< double > &params)
Definition: SurfaceDeformationFactory.cc:40
GlobalErrorBase::czx
T czx() const
Definition: GlobalErrorBase.h:103
AlignableModifier::addAlignmentPositionError
void addAlignmentPositionError(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in global frame) to Alignable.
Definition: AlignableModifier.cc:532
AlignableModifier::addAlignmentPositionErrorFromLocalRotation
void addAlignmentPositionErrorFromLocalRotation(Alignable *alignable, float phiX, float phiY, float phiZ)
Add alignment position error resulting from rotation in local frame.
Definition: AlignableModifier.cc:598