CMS 3D CMS Logo

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