CMS 3D CMS Logo

SurveyAlignmentSensor.cc
Go to the documentation of this file.
4 
6 
8  const std::vector<align::StructureType>& levels)
9  : SurveyAlignment(sensors, levels) {}
10 
12  unsigned int nSensor = theSensors.size();
13 
14  for (unsigned int i = 0; i < nSensor; ++i) {
15  Alignable* ali = theSensors[i];
16 
17  AlgebraicVector par(6, 0);
18  AlgebraicSymMatrix cov(6, 0);
19 
20  for (unsigned int l = 0; l < theLevels.size(); ++l) {
21  SurveyResidual res(*ali, theLevels[l], bias);
22 
23  if (!res.valid())
24  continue;
25 
26  AlgebraicSymMatrix invCov = res.inverseCovariance();
27 
28  par += invCov * res.sensorResidual();
29  cov += invCov;
30  }
31 
32  int dummy;
33  cov.invert(dummy); // cov = cov^-1
34  par = -cov * par;
35 
36  ali->setAlignmentParameters(new SurveyParameters(ali, par, cov));
37  }
38 }
const align::Alignables & theSensors
const std::vector< align::StructureType > & theLevels
void findAlignPars(bool bias=false) override
Find the alignment parameters for all sensors.
Definition: Electron.h:6
SurveyAlignmentSensor(const align::Alignables &sensors, const std::vector< align::StructureType > &levels)
Constructor to set the sensors and residual levels in base class.
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:123
CLHEP::HepVector AlgebraicVector
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
CLHEP::HepSymMatrix AlgebraicSymMatrix