1 |
sixie |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
//
|
3 |
|
|
// ElectronEnergyRegression
|
4 |
|
|
//
|
5 |
|
|
// Helper Class for applying electron energy regression calculation
|
6 |
|
|
//
|
7 |
|
|
//--------------------------------------------------------------------------------------------------
|
8 |
|
|
|
9 |
|
|
#ifndef MITPHYSICS_UTILS_ELECTRONENERGYREGRESSIONEVALUATE_H
|
10 |
|
|
#define MITPHYSICS_UTILS_ELECTRONENERGYREGRESSIONEVALUATE_H
|
11 |
|
|
|
12 |
|
|
// For applying regression
|
13 |
|
|
#include "CondFormats/EgammaObjects/interface/GBRForest.h"
|
14 |
|
|
#include "TFile.h"
|
15 |
|
|
|
16 |
|
|
namespace mithep {
|
17 |
|
|
class ElectronEnergyRegression{
|
18 |
|
|
public:
|
19 |
|
|
ElectronEnergyRegression();
|
20 |
|
|
~ElectronEnergyRegression();
|
21 |
|
|
|
22 |
|
|
enum ElectronEnergyRegressionType {
|
23 |
|
|
kNoTrkVar,
|
24 |
sixie |
1.2 |
kWithTrkVarV1,
|
25 |
|
|
kWithTrkVarV2
|
26 |
sixie |
1.1 |
};
|
27 |
|
|
|
28 |
|
|
void initialize(std::string weightsFile,
|
29 |
|
|
ElectronEnergyRegression::ElectronEnergyRegressionType type);
|
30 |
|
|
|
31 |
|
|
bool isInitialized() const {return fIsInitialized;}
|
32 |
|
|
|
33 |
|
|
// Evaluates regression without tracker variables
|
34 |
|
|
double regressionValueNoTrkVar(
|
35 |
|
|
double SCRawEnergy,
|
36 |
|
|
double scEta,
|
37 |
|
|
double scPhi,
|
38 |
|
|
double R9,
|
39 |
|
|
double etawidth,
|
40 |
|
|
double phiwidth,
|
41 |
|
|
double NClusters,
|
42 |
|
|
double HoE,
|
43 |
|
|
double rho,
|
44 |
|
|
double vertices,
|
45 |
|
|
double EtaSeed,
|
46 |
|
|
double PhiSeed,
|
47 |
|
|
double ESeed,
|
48 |
|
|
double E3x3Seed,
|
49 |
|
|
double E5x5Seed,
|
50 |
|
|
double see,
|
51 |
|
|
double spp,
|
52 |
|
|
double sep,
|
53 |
|
|
double EMaxSeed,
|
54 |
|
|
double E2ndSeed,
|
55 |
|
|
double ETopSeed,
|
56 |
|
|
double EBottomSeed,
|
57 |
|
|
double ELeftSeed,
|
58 |
|
|
double ERightSeed,
|
59 |
|
|
double E2x5MaxSeed,
|
60 |
|
|
double E2x5TopSeed,
|
61 |
|
|
double E2x5BottomSeed,
|
62 |
|
|
double E2x5LeftSeed,
|
63 |
|
|
double E2x5RightSeed,
|
64 |
|
|
double IEtaSeed,
|
65 |
|
|
double IPhiSeed,
|
66 |
|
|
double EtaCrySeed,
|
67 |
|
|
double PhiCrySeed,
|
68 |
|
|
double PreShowerOverRaw,
|
69 |
|
|
bool printDebug = false);
|
70 |
|
|
|
71 |
|
|
// Evaluates regression without tracker variables
|
72 |
|
|
double regressionUncertaintyNoTrkVar(
|
73 |
|
|
double SCRawEnergy,
|
74 |
|
|
double scEta,
|
75 |
|
|
double scPhi,
|
76 |
|
|
double R9,
|
77 |
|
|
double etawidth,
|
78 |
|
|
double phiwidth,
|
79 |
|
|
double NClusters,
|
80 |
|
|
double HoE,
|
81 |
|
|
double rho,
|
82 |
|
|
double vertices,
|
83 |
|
|
double EtaSeed,
|
84 |
|
|
double PhiSeed,
|
85 |
|
|
double ESeed,
|
86 |
|
|
double E3x3Seed,
|
87 |
|
|
double E5x5Seed,
|
88 |
|
|
double see,
|
89 |
|
|
double spp,
|
90 |
|
|
double sep,
|
91 |
|
|
double EMaxSeed,
|
92 |
|
|
double E2ndSeed,
|
93 |
|
|
double ETopSeed,
|
94 |
|
|
double EBottomSeed,
|
95 |
|
|
double ELeftSeed,
|
96 |
|
|
double ERightSeed,
|
97 |
|
|
double E2x5MaxSeed,
|
98 |
|
|
double E2x5TopSeed,
|
99 |
|
|
double E2x5BottomSeed,
|
100 |
|
|
double E2x5LeftSeed,
|
101 |
|
|
double E2x5RightSeed,
|
102 |
|
|
double IEtaSeed,
|
103 |
|
|
double IPhiSeed,
|
104 |
|
|
double EtaCrySeed,
|
105 |
|
|
double PhiCrySeed,
|
106 |
|
|
double PreShowerOverRaw,
|
107 |
|
|
bool printDebug = false);
|
108 |
|
|
|
109 |
|
|
// Evaluates regression using tracker variables
|
110 |
sixie |
1.2 |
double regressionValueWithTrkVarV1( std::vector<double> &inputvars,
|
111 |
|
|
bool printDebug = false );
|
112 |
sixie |
1.1 |
|
113 |
|
|
|
114 |
|
|
// Evaluates regression using tracker variables
|
115 |
sixie |
1.2 |
double regressionUncertaintyWithTrkVarV1( std::vector<double> &inputvars,
|
116 |
|
|
bool printDebug = false );
|
117 |
sixie |
1.1 |
|
118 |
|
|
// Evaluates regression using tracker variables
|
119 |
|
|
double regressionValueWithTrkVarV2( std::vector<double> &inputvars,
|
120 |
|
|
bool printDebug = false );
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
// Evaluates regression using tracker variables
|
124 |
|
|
double regressionUncertaintyWithTrkVarV2( std::vector<double> &inputvars,
|
125 |
|
|
bool printDebug = false );
|
126 |
|
|
|
127 |
|
|
private:
|
128 |
|
|
bool fIsInitialized;
|
129 |
|
|
ElectronEnergyRegression::ElectronEnergyRegressionType fVersionType;
|
130 |
|
|
GBRForest *forestCorrection_eb; // Pointer to the GBRForest for barrel
|
131 |
|
|
GBRForest *forestCorrection_ee; // Pointer to the GBRForest for endcap
|
132 |
|
|
|
133 |
|
|
GBRForest *forestUncertainty_eb;
|
134 |
|
|
GBRForest *forestUncertainty_ee;
|
135 |
|
|
};
|
136 |
|
|
}
|
137 |
|
|
#endif
|