CMS 3D CMS Logo

Public Member Functions | Protected Member Functions

SurveyAlignmentPoints Class Reference

#include <SurveyAlignmentPoints.h>

Inheritance diagram for SurveyAlignmentPoints:
SurveyAlignment

List of all members.

Public Member Functions

 SurveyAlignmentPoints (const align::Alignables &sensors, const std::vector< align::StructureType > &levels)
 Constructor to set the sensors and residual levels in base class.

Protected Member Functions

virtual void findAlignPars (bool bias=false)
 Find the alignment parameters for all sensors.

Detailed Description

Survey alignment using point residuals.

The local residuals for survey points are found for each sensor. The alignment parameters are found using the HIP algorithm.

Date:
2007/10/08 16:38:03
Revision:
1.4
Author:
Chung Khim Lae

Definition at line 18 of file SurveyAlignmentPoints.h.


Constructor & Destructor Documentation

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

Constructor to set the sensors and residual levels in base class.

Definition at line 8 of file SurveyAlignmentPoints.cc.

                                                                                         :
  SurveyAlignment(sensors, levels)
{
}

Member Function Documentation

void SurveyAlignmentPoints::findAlignPars ( bool  bias = false) [protected, virtual]

Find the alignment parameters for all sensors.

Implements SurveyAlignment.

Definition at line 14 of file SurveyAlignmentPoints.cc.

References SurveyDet::derivatives(), alignCSCRings::e, i, j, prof2calltree::l, SurveyResidual::pointsResidual(), Alignable::setAlignmentParameters(), Alignable::survey(), SurveyAlignment::theLevels, SurveyAlignment::theSensors, SurveyResidual::valid(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

{
  unsigned int nSensor = theSensors.size();

  for (unsigned int i = 0; i < nSensor; ++i)
  {
    Alignable* ali = theSensors[i];

    AlgebraicSymMatrix sumJVJT(6, 0); // 6 by 6 symmetric matrix init to 0
    AlgebraicVector    sumJVe(6, 0);  // init to 0

    for (unsigned int l = 0; l < theLevels.size(); ++l)
    {
      SurveyResidual res(*ali, theLevels[l], bias);

      if ( !res.valid() ) continue;

      align::LocalVectors residuals = res.pointsResidual();

      unsigned int nPoints = residuals.size();

      for (unsigned int j = 0; j < nPoints; ++j)
      {
        AlgebraicMatrix J = ali->survey()->derivatives(j);
        AlgebraicSymMatrix V(3, 1); // identity for now
        AlgebraicVector e(3); // local residual

        const align::LocalVector& lr = residuals[j];

        e(1) = lr.x(); e(2) = lr.y(); e(3) = lr.z();
        V /= 1e-4 * 1e-4;
        sumJVe  += J * (V * e);
        sumJVJT += V.similarity(J);
      }
    }

    int dummy;
    sumJVJT.invert(dummy); // sumJVJT = sumJVJT^-1
    sumJVe = -sumJVJT * sumJVe;

    ali->setAlignmentParameters( new SurveyParameters(ali, sumJVe, sumJVJT) );
  }
}