CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
SurveyAlignment Class Referenceabstract

#include <SurveyAlignment.h>

Inheritance diagram for SurveyAlignment:
SurveyAlignmentPoints SurveyAlignmentSensor

Public Member Functions

void iterate (unsigned int nIteration, const std::string &fileName, bool bias=false)
 Run the iteration: find residuals, write to output, shift sensors. More...
 
 SurveyAlignment (const align::Alignables &sensors, const std::vector< align::StructureType > &levels)
 Constructor to set the sensors and residual levels. More...
 
virtual ~SurveyAlignment ()
 

Protected Member Functions

virtual void findAlignPars (bool bias=false)=0
 Find the alignment parameters for all sensors. More...
 
virtual void shiftSensors ()
 Apply the alignment parameters to all sensors. More...
 

Protected Attributes

const std::vector< align::StructureType > & theLevels
 
const align::AlignablestheSensors
 

Detailed Description

Alignment using only survey info (no tracks) as a proof of principle.

Date
2007/05/03 20:58:58
Revision
1.4
Author
Chung Khim Lae

Definition at line 16 of file SurveyAlignment.h.

Constructor & Destructor Documentation

◆ SurveyAlignment()

SurveyAlignment::SurveyAlignment ( const align::Alignables sensors,
const std::vector< align::StructureType > &  levels 
)

Constructor to set the sensors and residual levels.

Definition at line 9 of file SurveyAlignment.cc.

10  : theSensors(sensors), theLevels(levels) {}

◆ ~SurveyAlignment()

virtual SurveyAlignment::~SurveyAlignment ( )
inlinevirtual

Definition at line 22 of file SurveyAlignment.h.

22 {}

Member Function Documentation

◆ findAlignPars()

virtual void SurveyAlignment::findAlignPars ( bool  bias = false)
protectedpure virtual

Find the alignment parameters for all sensors.

Implemented in SurveyAlignmentPoints, and SurveyAlignmentSensor.

Referenced by iterate().

◆ iterate()

void SurveyAlignment::iterate ( unsigned int  nIteration,
const std::string &  fileName,
bool  bias = false 
)

Run the iteration: find residuals, write to output, shift sensors.

Definition at line 36 of file SurveyAlignment.cc.

36  {
37  static const double tolerance = 1e-4; // convergence criteria
38 
40 
41  out.write(0);
42 
43  for (unsigned int i = 1; i <= nIteration; ++i) {
44  std::cout << "***** Iteration " << i << " *****\n";
45  findAlignPars(bias);
46  shiftSensors();
47  out.write(i);
48 
49  // Check convergence
50 
51  double parChi2 = 0.;
52 
53  unsigned int nSensor = theSensors.size();
54 
55  for (unsigned int j = 0; j < nSensor; ++j) {
56  AlignmentParameters* alignPar = theSensors[j]->alignmentParameters();
57 
58  const AlgebraicVector& par = alignPar->parameters();
59  const AlgebraicSymMatrix& cov = alignPar->covariance();
60 
61  int dummy;
62 
63  parChi2 += cov.inverse(dummy).similarity(par);
64  }
65 
66  parChi2 /= static_cast<double>(nSensor);
67  std::cout << "chi2 = " << parChi2 << std::endl;
68  if (parChi2 < tolerance)
69  break; // converges, so exit loop
70  }
71 }

References gather_cfg::cout, AlignmentParameters::covariance(), MillePedeFileConverter_cfg::e, MillePedeFileConverter_cfg::fileName, findAlignPars(), mps_fire::i, dqmiolumiharvest::j, MillePedeFileConverter_cfg::out, AlignmentParameters::parameters(), shiftSensors(), theSensors, and tolerance.

◆ shiftSensors()

void SurveyAlignment::shiftSensors ( )
protectedvirtual

Apply the alignment parameters to all sensors.

Definition at line 12 of file SurveyAlignment.cc.

12  {
13  unsigned int nSensor = theSensors.size();
14 
15  for (unsigned int i = 0; i < nSensor; ++i) {
16  Alignable* ali = theSensors[i];
17 
18  const AlignableSurface& surf = ali->surface();
19  const AlgebraicVector& pars = ali->alignmentParameters()->parameters();
20 
22 
23  angles(1) = pars[3];
24  angles(2) = pars[4];
25  angles(3) = pars[5];
26 
28 
29  rectify(rot); // correct for rounding errors
30 
31  ali->move(surf.toGlobal(align::LocalVector(pars[0], pars[1], pars[2])));
33  }
34 }

References Alignable::alignmentParameters(), particleFlowDisplacedVertex_cfi::angles, mps_fire::i, Alignable::move(), AlignmentParameters::parameters(), align::rectify(), makeMuonMisalignmentScenario::rot, Alignable::rotateInGlobalFrame(), Alignable::surface(), theSensors, AlignableSurface::toGlobal(), and align::toMatrix().

Referenced by iterate().

Member Data Documentation

◆ theLevels

const std::vector<align::StructureType>& SurveyAlignment::theLevels
protected

◆ theSensors

const align::Alignables& SurveyAlignment::theSensors
protected
Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:355
Alignable::rotateInGlobalFrame
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
SurveyAlignment::theLevels
const std::vector< align::StructureType > & theLevels
Definition: SurveyAlignment.h:39
Alignable
Definition: Alignable.h:27
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
AlignmentParameters
Definition: AlignmentParameters.h:35
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
align::rectify
void rectify(RotationType &)
Correct a rotation matrix for rounding errors.
Definition: Utilities.cc:185
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
SurveyOutput
Definition: SurveyOutput.h:21
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:27
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
align::EulerAngles
AlgebraicVector EulerAngles
Definition: Definitions.h:34
Alignable::move
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
SurveyAlignment::findAlignPars
virtual void findAlignPars(bool bias=false)=0
Find the alignment parameters for all sensors.
AlignmentParameters::covariance
const AlgebraicSymMatrix & covariance(void) const
Get parameter covariance matrix.
Definition: AlignmentParameters.cc:67
particleFlowDisplacedVertex_cfi.angles
angles
Definition: particleFlowDisplacedVertex_cfi.py:84
AlignableSurface
Definition: AlignableSurface.h:20
SurveyAlignment::theSensors
const align::Alignables & theSensors
Definition: SurveyAlignment.h:38
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
align::toMatrix
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:34
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
dummy
Definition: DummySelector.h:38
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
AlignmentParameters::parameters
const AlgebraicVector & parameters(void) const
Get alignment parameters.
Definition: AlignmentParameters.cc:64
Alignable::alignmentParameters
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:58
SurveyAlignment::shiftSensors
virtual void shiftSensors()
Apply the alignment parameters to all sensors.
Definition: SurveyAlignment.cc:12
jets_cff.levels
levels
Definition: jets_cff.py:23
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37