Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:13

0001 #include "Alignment/CommonAlignment/interface/Alignable.h"
0002 #include "Alignment/CommonAlignment/interface/SurveyDet.h"
0003 #include "Alignment/CommonAlignment/interface/SurveyResidual.h"
0004 #include "Alignment/SurveyAnalysis/interface/SurveyParameters.h"
0005 
0006 #include "Alignment/SurveyAnalysis/interface/SurveyAlignmentPoints.h"
0007 
0008 SurveyAlignmentPoints::SurveyAlignmentPoints(const align::Alignables& sensors,
0009                                              const std::vector<align::StructureType>& levels)
0010     : SurveyAlignment(sensors, levels) {}
0011 
0012 void SurveyAlignmentPoints::findAlignPars(bool bias) {
0013   unsigned int nSensor = theSensors.size();
0014 
0015   for (unsigned int i = 0; i < nSensor; ++i) {
0016     Alignable* ali = theSensors[i];
0017 
0018     AlgebraicSymMatrix sumJVJT(6, 0);  // 6 by 6 symmetric matrix init to 0
0019     AlgebraicVector sumJVe(6, 0);      // init to 0
0020 
0021     for (unsigned int l = 0; l < theLevels.size(); ++l) {
0022       SurveyResidual res(*ali, theLevels[l], bias);
0023 
0024       if (!res.valid())
0025         continue;
0026 
0027       align::LocalVectors residuals = res.pointsResidual();
0028 
0029       unsigned int nPoints = residuals.size();
0030 
0031       for (unsigned int j = 0; j < nPoints; ++j) {
0032         AlgebraicMatrix J = ali->survey()->derivatives(j);
0033         AlgebraicSymMatrix V(3, 1);  // identity for now
0034         AlgebraicVector e(3);        // local residual
0035 
0036         const align::LocalVector& lr = residuals[j];
0037 
0038         e(1) = lr.x();
0039         e(2) = lr.y();
0040         e(3) = lr.z();
0041         V /= 1e-4 * 1e-4;
0042         sumJVe += J * (V * e);
0043         sumJVJT += V.similarity(J);
0044       }
0045     }
0046 
0047     int dummy;
0048     sumJVJT.invert(dummy);  // sumJVJT = sumJVJT^-1
0049     sumJVe = -sumJVJT * sumJVe;
0050 
0051     ali->setAlignmentParameters(new SurveyParameters(ali, sumJVe, sumJVJT));
0052   }
0053 }