CMS 3D CMS Logo

ElectronEnergyCalibrator.h
Go to the documentation of this file.
1 #ifndef ElectronEnergyCalibrator_H
2 #define ElectronEnergyCalibrator_H
3 
5 #include <string>
6 #include <vector>
7 #include <fstream>
8 #include <sstream>
9 #include <iostream>
10 
11 namespace edm {
12  class StreamID;
13 }
14 
16 {
17  double nRunMin;
18  double nRunMax;
19  double corrCat0;
20  double corrCat1;
21  double corrCat2;
22  double corrCat3;
23  double corrCat4;
24  double corrCat5;
25  double corrCat6;
26  double corrCat7;
27 };
28 
30 {
31  double ptMin;
32  double ptMax;
33  double corrCat0;
34  double corrCat1;
35  double corrCat2;
36  double corrCat3;
37  double corrCat4;
38  double corrCat5;
39 };
40 
42 {
43  public:
45  const std::string pathLinData,
46  const std::string dataset,
47  int correctionsType,
48  bool applyLinearityCorrection,
49  double lumiRatio,
50  bool isMC,
51  bool updateEnergyErrors,
52  bool verbose,
53  bool synchronization
54  ) :
55  pathData_(pathData),
56  pathLinData_(pathLinData),
57  dataset_(dataset),
58  correctionsType_(correctionsType),
59  applyLinearityCorrection_(applyLinearityCorrection),
60  lumiRatio_(lumiRatio),
61  isMC_(isMC),
62  updateEnergyErrors_(updateEnergyErrors),
63  verbose_(verbose),
64  synchronization_(synchronization) {
65  init();
66  }
67 
68  void calibrate(SimpleElectron &electron, edm::StreamID const&);
69  void correctLinearity(SimpleElectron &electron);
70 
71  private:
72  void init();
73  void splitString( const std::string &fullstr,
74  std::vector<std::string> &elements,
75  const std::string &delimiter
76  );
77  double stringToDouble(const std::string &str);
78 
79  double newEnergy_ ;
80  double newEnergyError_ ;
81 
87  double lumiRatio_;
88  bool isMC_;
90  bool verbose_;
92 
93  correctionValues corrValArray[100];
95  linearityCorrectionValues linCorrValArray[100];
96  int nCorrValRaw, nLinCorrValRaw;
97 };
98 
99 #endif
100 
std::vector< std::string > splitString(const std::string &fLine)
HLT enums.
ElectronEnergyCalibrator(const std::string pathData, const std::string pathLinData, const std::string dataset, int correctionsType, bool applyLinearityCorrection, double lumiRatio, bool isMC, bool updateEnergyErrors, bool verbose, bool synchronization)