CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonIDMVA.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 // $Id $
3 //
4 // MuonIDMVA
5 //
6 // Helper Class for Muon Identification MVA
7 //
8 // Authors: S.Xie
9 // Original based on MitPhysics/Utils/interface/MuonIDMVA.h?view=markup
10 // Modified by DLE
11 //--------------------------------------------------------------------------------------------------
12 
13 #ifndef MUONIDMVA_H
14 #define MUONIDMVA_H
15 
16 #include "TString.h"
18 
19 class TRandom3;
20 namespace TMVA {
21  class Reader;
22 }
23 
24 class MuonIDMVA {
25  public:
26  MuonIDMVA();
27  ~MuonIDMVA();
28 
29  void Initialize(TString methodName, unsigned int version,
30  TString Subdet0Pt10To14p5Weights ,
31  TString Subdet1Pt10To14p5Weights ,
32  TString Subdet0Pt14p5To20Weights,
33  TString Subdet1Pt14p5To20Weights,
34  TString Subdet0Pt20ToInfWeights,
35  TString Subdet1Pt20ToInfWeights);
36 
37  Bool_t IsInitialized() const { return fIsInitialized; }
38  Double_t MVAValue(HWW&, const unsigned int mu, const unsigned int vertex);
39  Double_t MVAValue( Double_t MuPt , Double_t MuEta,
40  Double_t MuTkNchi2,
41  Double_t MuGlobalNchi2,
42  Double_t MuNValidHits,
43  Double_t MuNTrackerHits,
44  Double_t MuNPixelHits,
45  Double_t MuNMatches,
46  Double_t MuD0,
47  Double_t MuIP3d,
48  Double_t MuIP3dSig,
49  Double_t MuTrkKink,
50  Double_t MuSegmentCompatibility,
51  Double_t MuCaloCompatibility,
52  Double_t MuHadEnergyOverPt,
53  Double_t MuHoEnergyOverPt,
54  Double_t MuEmEnergyOverPt,
55  Double_t MuHadS9EnergyOverPt,
56  Double_t MuHoS9EnergyOverPt,
57  Double_t MuEmS9EnergyOverPt,
58  Double_t MuTrkIso03OverPt,
59  Double_t MuEMIso03OverPt,
60  Double_t MuHadIso03OverPt,
61  Double_t MuTrkIso05OverPt,
62  Double_t MuEMIso05OverPt,
63  Double_t MuHadIso05OverPt,
64  Bool_t printDebug = kFALSE
65  );
66 
67 
85  };
86 
87  static const Double_t MuonEffectiveArea(EMuonEffectiveAreaType type, Double_t Eta) {
88 
89  Double_t EffectiveArea = 0;
90  if (fabs(Eta) < 1.0) {
91  if (type == kMuChargedIso03) EffectiveArea = 0.000;
92  if (type == kMuNeutralIso03) EffectiveArea = 0.080;
93  if (type == kMuChargedIso04) EffectiveArea = 0.000;
94  if (type == kMuNeutralIso04) EffectiveArea = 0.163;
95  if (type == kMuHadEnergy) EffectiveArea = 0.000;
96  if (type == kMuHoEnergy) EffectiveArea = 0.000;
97  if (type == kMuEmEnergy) EffectiveArea = 0.000;
98  if (type == kMuHadS9Energy) EffectiveArea = 0.016;
99  if (type == kMuHoS9Energy) EffectiveArea = 0.000;
100  if (type == kMuEmS9Energy) EffectiveArea = 0.000;
101  if (type == kMuTrkIso03) EffectiveArea = 0.000;
102  if (type == kMuEMIso03) EffectiveArea = 0.080;
103  if (type == kMuHadIso03) EffectiveArea = 0.025;
104  if (type == kMuTrkIso05) EffectiveArea = 0.000;
105  if (type == kMuEMIso05) EffectiveArea = 0.290;
106  if (type == kMuHadIso05) EffectiveArea = 0.091;
107  } else if (fabs(Eta) >= 1.0 && fabs(Eta) < 1.479 ) {
108  if (type == kMuChargedIso03) EffectiveArea = 0.000;
109  if (type == kMuNeutralIso03) EffectiveArea = 0.083;
110  if (type == kMuChargedIso04) EffectiveArea = 0.000;
111  if (type == kMuNeutralIso04) EffectiveArea = 0.168;
112  if (type == kMuHadEnergy) EffectiveArea = 0.005;
113  if (type == kMuHoEnergy) EffectiveArea = 0.000;
114  if (type == kMuEmEnergy) EffectiveArea = 0.000;
115  if (type == kMuHadS9Energy) EffectiveArea = 0.041;
116  if (type == kMuHoS9Energy) EffectiveArea = 0.000;
117  if (type == kMuEmS9Energy) EffectiveArea = 0.000;
118  if (type == kMuTrkIso03) EffectiveArea = 0.000;
119  if (type == kMuEMIso03) EffectiveArea = 0.043;
120  if (type == kMuHadIso03) EffectiveArea = 0.028;
121  if (type == kMuTrkIso05) EffectiveArea = 0.000;
122  if (type == kMuEMIso05) EffectiveArea = 0.184;
123  if (type == kMuHadIso05) EffectiveArea = 0.106;
124  } else if (fabs(Eta) >= 1.479 && fabs(Eta) < 2.0 ) {
125  if (type == kMuChargedIso03) EffectiveArea = 0.000;
126  if (type == kMuNeutralIso03) EffectiveArea = 0.060;
127  if (type == kMuChargedIso04) EffectiveArea = 0.000;
128  if (type == kMuNeutralIso04) EffectiveArea = 0.131;
129  if (type == kMuHadEnergy) EffectiveArea = 0.020;
130  if (type == kMuHoEnergy) EffectiveArea = 0.000;
131  if (type == kMuEmEnergy) EffectiveArea = 0.000;
132  if (type == kMuHadS9Energy) EffectiveArea = 0.072;
133  if (type == kMuHoS9Energy) EffectiveArea = 0.000;
134  if (type == kMuEmS9Energy) EffectiveArea = 0.000;
135  if (type == kMuTrkIso03) EffectiveArea = 0.000;
136  if (type == kMuEMIso03) EffectiveArea = 0.025;
137  if (type == kMuHadIso03) EffectiveArea = 0.036;
138  if (type == kMuTrkIso05) EffectiveArea = 0.000;
139  if (type == kMuEMIso05) EffectiveArea = 0.124;
140  if (type == kMuHadIso05) EffectiveArea = 0.140;
141  } else if (fabs(Eta) >= 2.0 && fabs(Eta) < 2.25 ) {
142  if (type == kMuChargedIso03) EffectiveArea = 0.000;
143  if (type == kMuNeutralIso03) EffectiveArea = 0.066;
144  if (type == kMuChargedIso04) EffectiveArea = 0.000;
145  if (type == kMuNeutralIso04) EffectiveArea = 0.149;
146  if (type == kMuHadEnergy) EffectiveArea = 0.056;
147  if (type == kMuHoEnergy) EffectiveArea = 0.000;
148  if (type == kMuEmEnergy) EffectiveArea = 0.000;
149  if (type == kMuHadS9Energy) EffectiveArea = 0.148;
150  if (type == kMuHoS9Energy) EffectiveArea = 0.000;
151  if (type == kMuEmS9Energy) EffectiveArea = 0.000;
152  if (type == kMuTrkIso03) EffectiveArea = 0.000;
153  if (type == kMuEMIso03) EffectiveArea = 0.025;
154  if (type == kMuHadIso03) EffectiveArea = 0.050;
155  if (type == kMuTrkIso05) EffectiveArea = 0.000;
156  if (type == kMuEMIso05) EffectiveArea = 0.120;
157  if (type == kMuHadIso05) EffectiveArea = 0.186;
158  } else if (fabs(Eta) >= 2.25 && fabs(Eta) < 2.4 ) {
159  if (type == kMuChargedIso03) EffectiveArea = 0.000;
160  if (type == kMuNeutralIso03) EffectiveArea = 0.098;
161  if (type == kMuChargedIso04) EffectiveArea = 0.000;
162  if (type == kMuNeutralIso04) EffectiveArea = 0.200;
163  if (type == kMuHadEnergy) EffectiveArea = 0.093;
164  if (type == kMuHoEnergy) EffectiveArea = 0.000;
165  if (type == kMuEmEnergy) EffectiveArea = 0.000;
166  if (type == kMuHadS9Energy) EffectiveArea = 0.260;
167  if (type == kMuHoS9Energy) EffectiveArea = 0.000;
168  if (type == kMuEmS9Energy) EffectiveArea = 0.000;
169  if (type == kMuTrkIso03) EffectiveArea = 0.000;
170  if (type == kMuEMIso03) EffectiveArea = 0.027;
171  if (type == kMuHadIso03) EffectiveArea = 0.060;
172  if (type == kMuTrkIso05) EffectiveArea = 0.000;
173  if (type == kMuEMIso05) EffectiveArea = 0.139;
174  if (type == kMuHadIso05) EffectiveArea = 0.228;
175  }
176  return EffectiveArea;
177  }
178 
179 
180  protected:
181  TMVA::Reader *fTMVAReader[6];
182  TString fMethodname;
184 
191  Float_t fMVAVar_MuD0;
192  Float_t fMVAVar_MuIP3d;
213 
214 };
215 
216 #endif
217 
Float_t fMVAVar_MuEMIso05OverPt
Definition: MuonIDMVA.h:211
type
Definition: HCALResponse.h:21
Float_t fMVAVar_MuIP3dSig
Definition: MuonIDMVA.h:193
Float_t fMVAVar_MuChargedIso03OverPt
Definition: MuonIDMVA.h:203
Float_t fMVAVar_MuGlobalNchi2
Definition: MuonIDMVA.h:186
Float_t fMVAVar_MuEMIso03OverPt
Definition: MuonIDMVA.h:208
TString fMethodname
Definition: MuonIDMVA.h:182
EMuonEffectiveAreaType
Definition: MuonIDMVA.h:68
Bool_t fIsInitialized
Definition: MuonIDMVA.h:183
void Initialize(TString methodName, unsigned int version, TString Subdet0Pt10To14p5Weights, TString Subdet1Pt10To14p5Weights, TString Subdet0Pt14p5To20Weights, TString Subdet1Pt14p5To20Weights, TString Subdet0Pt20ToInfWeights, TString Subdet1Pt20ToInfWeights)
Definition: MuonIDMVA.cc:35
Float_t fMVAVar_MuHoEnergyOverPt
Definition: MuonIDMVA.h:198
Float_t fMVAVar_MuCaloCompatibility
Definition: MuonIDMVA.h:196
Float_t fMVAVar_MuHadEnergyOverPt
Definition: MuonIDMVA.h:197
~MuonIDMVA()
Definition: MuonIDMVA.cc:27
Float_t fMVAVar_MuTrkIso03OverPt
Definition: MuonIDMVA.h:207
Float_t fMVAVar_MuNeutralIso03OverPt
Definition: MuonIDMVA.h:204
Float_t fMVAVar_MuNPixelHits
Definition: MuonIDMVA.h:189
Float_t fMVAVar_MuNMatches
Definition: MuonIDMVA.h:190
Float_t fMVAVar_MuNeutralIso04OverPt
Definition: MuonIDMVA.h:206
Float_t fMVAVar_MuEmS9EnergyOverPt
Definition: MuonIDMVA.h:202
Float_t fMVAVar_MuHadIso05OverPt
Definition: MuonIDMVA.h:212
Float_t fMVAVar_MuTrkKink
Definition: MuonIDMVA.h:194
Bool_t IsInitialized() const
Definition: MuonIDMVA.h:37
Float_t fMVAVar_MuD0
Definition: MuonIDMVA.h:191
Float_t fMVAVar_MuTrkIso05OverPt
Definition: MuonIDMVA.h:210
Float_t fMVAVar_MuHadIso03OverPt
Definition: MuonIDMVA.h:209
static const Double_t MuonEffectiveArea(EMuonEffectiveAreaType type, Double_t Eta)
Definition: MuonIDMVA.h:87
Float_t fMVAVar_MuSegmentCompatibility
Definition: MuonIDMVA.h:195
const int mu
Definition: Constants.h:22
Definition: HWW.h:11
Float_t fMVAVar_MuChargedIso04OverPt
Definition: MuonIDMVA.h:205
Float_t fMVAVar_MuEmEnergyOverPt
Definition: MuonIDMVA.h:199
Float_t fMVAVar_MuHadS9EnergyOverPt
Definition: MuonIDMVA.h:200
TMVA::Reader * fTMVAReader[6]
Definition: MuonIDMVA.h:181
Float_t fMVAVar_MuIP3d
Definition: MuonIDMVA.h:192
Float_t fMVAVar_MuNTrackerHits
Definition: MuonIDMVA.h:188
Float_t fMVAVar_MuHoS9EnergyOverPt
Definition: MuonIDMVA.h:201
Float_t fMVAVar_MuNValidHits
Definition: MuonIDMVA.h:187
Double_t MVAValue(HWW &, const unsigned int mu, const unsigned int vertex)
Definition: MuonIDMVA.cc:211
Float_t fMVAVar_MuTkNchi2
Definition: MuonIDMVA.h:185