Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:24

0001 #include "Alignment/CommonAlignment/interface/Alignable.h"
0002 #include "Alignment/CommonAlignment/interface/SurveyResidual.h"
0003 #include "Alignment/SurveyAnalysis/interface/SurveyParameters.h"
0004 
0005 #include "Alignment/SurveyAnalysis/interface/SurveyAlignmentSensor.h"
0006 
0007 SurveyAlignmentSensor::SurveyAlignmentSensor(const align::Alignables& sensors,
0008                                              const std::vector<align::StructureType>& levels)
0009     : SurveyAlignment(sensors, levels) {}
0010 
0011 void SurveyAlignmentSensor::findAlignPars(bool bias) {
0012   unsigned int nSensor = theSensors.size();
0013 
0014   for (unsigned int i = 0; i < nSensor; ++i) {
0015     Alignable* ali = theSensors[i];
0016 
0017     AlgebraicVector par(6, 0);
0018     AlgebraicSymMatrix cov(6, 0);
0019 
0020     for (unsigned int l = 0; l < theLevels.size(); ++l) {
0021       SurveyResidual res(*ali, theLevels[l], bias);
0022 
0023       if (!res.valid())
0024         continue;
0025 
0026       AlgebraicSymMatrix invCov = res.inverseCovariance();
0027 
0028       par += invCov * res.sensorResidual();
0029       cov += invCov;
0030     }
0031 
0032     int dummy;
0033     cov.invert(dummy);  // cov = cov^-1
0034     par = -cov * par;
0035 
0036     ali->setAlignmentParameters(new SurveyParameters(ali, par, cov));
0037   }
0038 }