CMS 3D CMS Logo

IntegratedCalibrationBase.cc
Go to the documentation of this file.
1 
13 
14 // Already included in header:
15 //#include <vector>
16 //#include <utility>
17 
18 //============================================================================
20  : name_(cfg.getParameter<std::string>("calibrationName")) {}
21 
22 //============================================================================
23 std::vector<IntegratedCalibrationBase::Values> IntegratedCalibrationBase::derivatives(
24  const TrackingRecHit &hit,
25  const TrajectoryStateOnSurface &tsos,
26  const edm::EventSetup &setup,
27  const EventInfo &eventInfo) const {
28  // Prepare result vector, initialised all with 0.:
29  std::vector<Values> result(this->numParameters(), Values(0., 0.));
30 
31  // Get non-zero derivatives and their index:
32  std::vector<ValuesIndexPair> derivsIndexPairs;
33  const unsigned int numNonZero = this->derivatives(derivsIndexPairs, hit, tsos, setup, eventInfo);
34 
35  // Put non-zero values into result:
36  for (unsigned int i = 0; i < numNonZero; ++i) {
37  const ValuesIndexPair &valuesIndex = derivsIndexPairs[i];
38  result[valuesIndex.second] = valuesIndex.first;
39  }
40 
41  return result;
42 }
IntegratedCalibrationBase(const edm::ParameterSet &cfg)
Values and their parameter index.
define event information passed to algorithms
std::pair< Values, unsigned int > ValuesIndexPair
x- and y-values
std::pair< double, double > Values
virtual unsigned int numParameters() const =0
How many parameters does this calibration define?
virtual std::vector< Values > derivatives(const TrackingRecHit &hit, const TrajectoryStateOnSurface &tsos, const edm::EventSetup &setup, const EventInfo &eventInfo) const