CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numParameters() const =0
How many parameters does this calibration define?
tuple cfg
Definition: looper.py:293
IntegratedCalibrationBase(const edm::ParameterSet &cfg)
Values and their parameter index.
define event information passed to algorithms
tuple result
Definition: query.py:137
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
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")