10 const std::vector<StructureType>& levels):
20 for (
unsigned int i = 0;
i < nSensor; ++
i)
29 angles(1) = pars[3]; angles(2) = pars[4]; angles(3) = pars[5];
44 static const double tolerance = 1
e-4;
50 for (
unsigned int i = 1;
i <= nIteration; ++
i)
52 std::cout <<
"***** Iteration " <<
i <<
" *****\n";
63 for (
unsigned int j = 0;
j < nSensor; ++
j)
72 parChi2 += cov.inverse(dummy).similarity(par);
75 parChi2 /=
static_cast<double>(nSensor);
76 std::cout <<
"chi2 = " << parChi2 << std::endl;
77 if (parChi2 < tolerance)
break;
void iterate(unsigned int nIteration, const std::string &fileName, bool bias=false)
Run the iteration: find residuals, write to output, shift sensors.
const align::Alignables & theSensors
virtual void findAlignPars(bool bias=false)=0
Find the alignment parameters for all sensors.
std::vector< Alignable * > Alignables
void write(unsigned int iter)
write out variables
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
virtual void shiftSensors()
Apply the alignment parameters to all sensors.
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
const AlgebraicVector & parameters(void) const
Get alignment parameters.
SurveyAlignment(const align::Alignables &sensors, const std::vector< align::StructureType > &levels)
Constructor to set the sensors and residual levels.
void rectify(RotationType &)
Correct a rotation matrix for rounding errors.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
CLHEP::HepSymMatrix AlgebraicSymMatrix
const AlgebraicSymMatrix & covariance(void) const
Get parameter covariance matrix.