CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/Alignment/CommonAlignmentAlgorithm/src/IntegratedCalibrationBase.cc

Go to the documentation of this file.
00001 
00011 #include "Alignment/CommonAlignmentAlgorithm/interface/IntegratedCalibrationBase.h"
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 
00014 // Already included in header:
00015 //#include <vector>
00016 //#include <utility>
00017 
00018 //============================================================================
00019 IntegratedCalibrationBase::IntegratedCalibrationBase(const edm::ParameterSet &cfg) 
00020   : name_(cfg.getParameter<std::string>("calibrationName"))
00021 {
00022 }
00023   
00024 //============================================================================
00025 std::vector<IntegratedCalibrationBase::Values>
00026 IntegratedCalibrationBase::derivatives(const TransientTrackingRecHit &hit,
00027                                        const TrajectoryStateOnSurface &tsos,
00028                                        const edm::EventSetup &setup,
00029                                        const EventInfo &eventInfo) const
00030 {
00031   // Prepare result vector, initialised all with 0.:
00032   std::vector<Values> result(this->numParameters(), Values(0.,0.));
00033 
00034   // Get non-zero derivatives and their index:
00035   std::vector<ValuesIndexPair> derivsIndexPairs;
00036   const unsigned int numNonZero = this->derivatives(derivsIndexPairs,
00037                                                     hit, tsos, setup,
00038                                                     eventInfo);
00039 
00040   // Put non-zero values into result:
00041   for (unsigned int i = 0; i < numNonZero; ++i) {
00042     const ValuesIndexPair &valuesIndex = derivsIndexPairs[i];
00043     result[valuesIndex.second] = valuesIndex.first;
00044   }
00045 
00046   return result;
00047 }