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 
24 //============================================================================
25 std::vector<IntegratedCalibrationBase::Values>
27  const TrajectoryStateOnSurface &tsos,
28  const edm::EventSetup &setup,
29  const EventInfo &eventInfo) const
30 {
31  // Prepare result vector, initialised all with 0.:
32  std::vector<Values> result(this->numParameters(), Values(0.,0.));
33 
34  // Get non-zero derivatives and their index:
35  std::vector<ValuesIndexPair> derivsIndexPairs;
36  const unsigned int numNonZero = this->derivatives(derivsIndexPairs,
37  hit, tsos, setup,
38  eventInfo);
39 
40  // Put non-zero values into result:
41  for (unsigned int i = 0; i < numNonZero; ++i) {
42  const ValuesIndexPair &valuesIndex = derivsIndexPairs[i];
43  result[valuesIndex.second] = valuesIndex.first;
44  }
45 
46  return result;
47 }
IntegratedCalibrationBase(const edm::ParameterSet &cfg)
Values and their parameter index.
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
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
eventInfo
add run, event number and lumi section