CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
AntiElectronIDMVA2 Class Reference

#include <AntiElectronIDMVA2.h>

Public Member Functions

 AntiElectronIDMVA2 ()
 
void Initialize_from_file (const std::string &methodName, const std::string &oneProngNoEleMatch_BL, const std::string &oneProng0Pi0_BL, const std::string &oneProng1pi0woGSF_BL, const std::string &oneProng1pi0wGSFwoPfEleMva_BL, const std::string &oneProng1pi0wGSFwPfEleMva_BL, const std::string &oneProngNoEleMatch_EC, const std::string &oneProng0Pi0_EC, const std::string &oneProng1pi0woGSF_EC, const std::string &oneProng1pi0wGSFwoPfEleMva_EC, const std::string &oneProng1pi0wGSFwPfEleMva_EC)
 
void Initialize_from_string (const std::string &methodName, const std::string &oneProngNoEleMatch_BL, const std::string &oneProng0Pi0_BL, const std::string &oneProng1pi0woGSF_BL, const std::string &oneProng1pi0wGSFwoPfEleMva_BL, const std::string &oneProng1pi0wGSFwPfEleMva_BL, const std::string &oneProngNoEleMatch_EC, const std::string &oneProng0Pi0_EC, const std::string &oneProng1pi0woGSF_EC, const std::string &oneProng1pi0wGSFwoPfEleMva_EC, const std::string &oneProng1pi0wGSFwPfEleMva_EC)
 
double MVAValue (Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauPt, Float_t TauSignalPFChargedCands, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauHasGsf, Float_t TauVisMass, Float_t TauEmFraction, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecPFMvaOutput, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecEarlyBrem, Float_t ElecLateBrem, Float_t ElecFbrem, Float_t ElecChi2KF, Float_t ElecChi2GSF, Float_t ElecNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
 
double MVAValue (Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauPt, Float_t TauSignalPFChargedCands, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauHasGsf, Float_t TauVisMass, Float_t TauEmFraction, Float_t GammaEtaMom, Float_t GammaPhiMom, Float_t GammaEnFrac, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecPFMvaOutput, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecEarlyBrem, Float_t ElecLateBrem, Float_t ElecFbrem, Float_t ElecChi2KF, Float_t ElecChi2GSF, Float_t ElecNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
 
double MVAValue (const reco::PFTau &thePFTau, const reco::GsfElectron &theGsfEle)
 
double MVAValue (const reco::PFTau &thePFTau)
 
 ~AntiElectronIDMVA2 ()
 

Private Member Functions

void bookMVAs ()
 

Private Attributes

Float_t Elec_Chi2GSF_
 
Float_t Elec_Chi2KF_
 
Float_t Elec_EarlyBrem_
 
Float_t Elec_Ee_
 
Float_t Elec_EeOverPout_
 
Float_t Elec_Egamma_
 
Float_t Elec_EgammaOverPdif_
 
Float_t Elec_Eta_
 
Float_t Elec_EtotOverPin_
 
Float_t Elec_Fbrem_
 
Float_t Elec_GSFTrackEta_
 
Float_t Elec_GSFTracklnPt_
 
Float_t Elec_GSFTrackResol_
 
Float_t Elec_LateBrem_
 
Float_t Elec_NumHits_
 
Float_t Elec_PFMvaOutput_
 
Float_t Elec_Pin_
 
Float_t Elec_Pout_
 
Float_t Elec_Pt_
 
TMVA::Reader * fTMVAReader_ [10]
 
Float_t GammadEta_
 
Float_t GammadPhi_
 
Float_t GammadPt_
 
Bool_t isInitialized_
 
std::string methodName_
 
Float_t Tau_EmFraction_
 
Float_t Tau_EtaAtEcalEntrance_
 
Float_t Tau_GammaEnFrac_
 
Float_t Tau_GammaEtaMom_
 
Float_t Tau_GammaPhiMom_
 
Float_t Tau_HadrEoP_
 
Float_t Tau_HadrHoP_
 
Float_t Tau_HadrMva_
 
Float_t Tau_HasGsf_
 
Float_t Tau_NumChargedCands_
 
Float_t Tau_NumGammaCands_
 
Float_t Tau_Pt_
 
Float_t Tau_VisMass_
 
int verbosity_
 

Detailed Description

Definition at line 27 of file AntiElectronIDMVA2.h.

Constructor & Destructor Documentation

AntiElectronIDMVA2::AntiElectronIDMVA2 ( )

Definition at line 7 of file AntiElectronIDMVA2.cc.

References fTMVAReader_, i, and verbosity_.

8  : isInitialized_(kFALSE),
9  methodName_("BDT")
10 {
11  for ( unsigned i = 0; i < 10; ++i ) {
12  fTMVAReader_[i] = 0;
13  }
14 
15  verbosity_ = 1;
16 }
int i
Definition: DBlmapReader.cc:9
TMVA::Reader * fTMVAReader_[10]
AntiElectronIDMVA2::~AntiElectronIDMVA2 ( )

Definition at line 18 of file AntiElectronIDMVA2.cc.

References fTMVAReader_, and i.

19 {
20  for ( unsigned i = 0; i < 10; ++i ) {
21  if ( fTMVAReader_[i] ) delete fTMVAReader_[i];
22  }
23 }
int i
Definition: DBlmapReader.cc:9
TMVA::Reader * fTMVAReader_[10]

Member Function Documentation

void AntiElectronIDMVA2::bookMVAs ( )
private

Definition at line 108 of file AntiElectronIDMVA2.cc.

References Elec_Chi2GSF_, Elec_Chi2KF_, Elec_EarlyBrem_, Elec_Ee_, Elec_EeOverPout_, Elec_Egamma_, Elec_EgammaOverPdif_, Elec_Eta_, Elec_EtotOverPin_, Elec_Fbrem_, Elec_GSFTrackEta_, Elec_GSFTracklnPt_, Elec_GSFTrackResol_, Elec_LateBrem_, Elec_NumHits_, Elec_PFMvaOutput_, Elec_Pin_, Elec_Pout_, Elec_Pt_, fTMVAReader_, GammadEta_, GammadPhi_, GammadPt_, k_NoEleMatch_BL, k_NoEleMatch_EC, k_wGwGSFwoPFMVA_BL, k_wGwGSFwoPFMVA_EC, k_wGwGSFwPFMVA_BL, k_wGwGSFwPFMVA_EC, k_wGwoGSF_BL, k_wGwoGSF_EC, k_woG_BL, k_woG_EC, Tau_EmFraction_, Tau_EtaAtEcalEntrance_, Tau_GammaEnFrac_, Tau_GammaEtaMom_, Tau_GammaPhiMom_, Tau_HadrEoP_, Tau_HadrHoP_, Tau_HadrMva_, Tau_HasGsf_, Tau_NumChargedCands_, Tau_NumGammaCands_, Tau_Pt_, Tau_VisMass_, and verbosity_.

Referenced by Initialize_from_file(), and Initialize_from_string().

109 {
110  //TMVA::Tools::Instance();
111 
112  GammadEta_ = 0.;
113  GammadPhi_ = 0.;
114  GammadPt_ = 0.;
115 
117  Tau_Pt_ = 0.;
118  Tau_HasGsf_ = 0.;
119  Tau_EmFraction_ = 0.;
121  Tau_NumGammaCands_ = 0.;
122  Tau_HadrHoP_ = 0.;
123  Tau_HadrEoP_ = 0.;
124  Tau_VisMass_ = 0.;
125  Tau_GammaEtaMom_ = 0.;
126  Tau_GammaPhiMom_ = 0.;
127  Tau_GammaEnFrac_ = 0.;
128  Tau_HadrMva_ = 0.;
129 
130  Elec_Eta_ = 0.;
131  Elec_Pt_ = 0.;
132  Elec_PFMvaOutput_ = 0.;
133  Elec_Ee_ = 0.;
134  Elec_Egamma_ = 0.;
135  Elec_Pin_ = 0.;
136  Elec_Pout_ = 0.;
137  Elec_EtotOverPin_ = 0.;
138  Elec_EeOverPout_ = 0.;
140  Elec_EarlyBrem_ = 0.;
141  Elec_LateBrem_ = 0.;
142  Elec_Fbrem_ = 0.;
143  Elec_Chi2KF_ = 0.;
144  Elec_Chi2GSF_ = 0.;
145  Elec_NumHits_ = 0.;
146  Elec_GSFTrackResol_ = 0.;
147  Elec_GSFTracklnPt_ = 0.;
148  Elec_GSFTrackEta_ = 0.;
149 
150 
151  TMVA::Reader* readerNoEleMatch_BL = new TMVA::Reader( "!Color:Silent:Error" );
152  readerNoEleMatch_BL->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
153  readerNoEleMatch_BL->AddVariable("Tau_Pt", &Tau_Pt_);
154  readerNoEleMatch_BL->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
155  readerNoEleMatch_BL->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
156  readerNoEleMatch_BL->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
157  readerNoEleMatch_BL->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
158  readerNoEleMatch_BL->AddVariable("Tau_VisMass", &Tau_VisMass_);
159  readerNoEleMatch_BL->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
160  readerNoEleMatch_BL->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
161  readerNoEleMatch_BL->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
162  readerNoEleMatch_BL->SetVerbose(verbosity_);
163 
164  TMVA::Reader* readerwoG_BL = new TMVA::Reader( "!Color:Silent:Error" );
165  readerwoG_BL->AddVariable("Elec_EtotOverPin", &Elec_EtotOverPin_);
166  readerwoG_BL->AddVariable("Elec_LateBrem", &Elec_LateBrem_);
167  readerwoG_BL->AddVariable("Elec_Fbrem", &Elec_Fbrem_);
168  readerwoG_BL->AddVariable("Elec_Chi2KF", &Elec_Chi2KF_);
169  readerwoG_BL->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
170  readerwoG_BL->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
171  readerwoG_BL->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
172  readerwoG_BL->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
173  readerwoG_BL->AddVariable("Tau_Pt", &Tau_Pt_);
174  readerwoG_BL->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
175  readerwoG_BL->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
176  readerwoG_BL->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
177  readerwoG_BL->AddVariable("Tau_VisMass", &Tau_VisMass_);
178  readerwoG_BL->SetVerbose(verbosity_);
179 
180  TMVA::Reader* readerwGwoGSF_BL = new TMVA::Reader( "!Color:Silent:Error" );
181  readerwGwoGSF_BL->AddVariable("Elec_EtotOverPin", &Elec_EtotOverPin_);
182  readerwGwoGSF_BL->AddVariable("Elec_EgammaOverPdif", &Elec_EgammaOverPdif_);
183  readerwGwoGSF_BL->AddVariable("Elec_LateBrem", &Elec_LateBrem_);
184  readerwGwoGSF_BL->AddVariable("Elec_Fbrem", &Elec_Fbrem_);
185  readerwGwoGSF_BL->AddVariable("Elec_Chi2GSF", &Elec_Chi2GSF_);
186  readerwGwoGSF_BL->AddVariable("Elec_NumHits", &Elec_NumHits_);
187  readerwGwoGSF_BL->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
188  readerwGwoGSF_BL->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
189  readerwGwoGSF_BL->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
190  readerwGwoGSF_BL->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
191  readerwGwoGSF_BL->AddVariable("Tau_Pt", &Tau_Pt_);
192  readerwGwoGSF_BL->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
193  readerwGwoGSF_BL->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
194  readerwGwoGSF_BL->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
195  readerwGwoGSF_BL->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
196  readerwGwoGSF_BL->AddVariable("Tau_VisMass", &Tau_VisMass_);
197  readerwGwoGSF_BL->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
198  readerwGwoGSF_BL->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
199  readerwGwoGSF_BL->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
200  readerwGwoGSF_BL->SetVerbose(verbosity_);
201 
202  TMVA::Reader* readerwGwGSFwoPFMVA_BL = new TMVA::Reader( "!Color:Silent:Error" );
203  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_Fbrem", &Elec_Fbrem_);
204  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_Chi2KF", &Elec_Chi2KF_);
205  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_Chi2GSF", &Elec_Chi2GSF_);
206  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_NumHits", &Elec_NumHits_);
207  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
208  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
209  readerwGwGSFwoPFMVA_BL->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
210  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
211  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_Pt", &Tau_Pt_);
212  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
213  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
214  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
215  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
216  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_VisMass", &Tau_VisMass_);
217  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
218  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
219  readerwGwGSFwoPFMVA_BL->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
220  readerwGwGSFwoPFMVA_BL->SetVerbose(verbosity_);
221 
222  TMVA::Reader* readerwGwGSFwPFMVA_BL = new TMVA::Reader( "!Color:Silent:Error" );
223  readerwGwGSFwPFMVA_BL->AddVariable("Elec_EtotOverPin", &Elec_EtotOverPin_);
224  readerwGwGSFwPFMVA_BL->AddVariable("Elec_EeOverPout", &Elec_EeOverPout_);
225  readerwGwGSFwPFMVA_BL->AddVariable("Elec_LateBrem", &Elec_LateBrem_);
226  readerwGwGSFwPFMVA_BL->AddVariable("Elec_Chi2GSF", &Elec_Chi2GSF_);
227  readerwGwGSFwPFMVA_BL->AddVariable("Elec_NumHits", &Elec_NumHits_);
228  readerwGwGSFwPFMVA_BL->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
229  readerwGwGSFwPFMVA_BL->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
230  readerwGwGSFwPFMVA_BL->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
231  readerwGwGSFwPFMVA_BL->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
232  readerwGwGSFwPFMVA_BL->AddVariable("Tau_Pt", &Tau_Pt_);
233  readerwGwGSFwPFMVA_BL->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
234  readerwGwGSFwPFMVA_BL->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
235  readerwGwGSFwPFMVA_BL->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
236  readerwGwGSFwPFMVA_BL->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
237  readerwGwGSFwPFMVA_BL->AddVariable("Tau_VisMass", &Tau_VisMass_);
238  readerwGwGSFwPFMVA_BL->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
239  readerwGwGSFwPFMVA_BL->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
240  readerwGwGSFwPFMVA_BL->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
241  readerwGwGSFwPFMVA_BL->SetVerbose(verbosity_);
242 
243  TMVA::Reader* readerNoEleMatch_EC = new TMVA::Reader( "!Color:Silent:Error" );
244  readerNoEleMatch_EC->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
245  readerNoEleMatch_EC->AddVariable("Tau_Pt", &Tau_Pt_);
246  readerNoEleMatch_EC->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
247  readerNoEleMatch_EC->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
248  readerNoEleMatch_EC->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
249  readerNoEleMatch_EC->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
250  readerNoEleMatch_EC->AddVariable("Tau_VisMass", &Tau_VisMass_);
251  readerNoEleMatch_EC->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
252  readerNoEleMatch_EC->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
253  readerNoEleMatch_EC->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
254  readerNoEleMatch_EC->SetVerbose(verbosity_);
255 
256  TMVA::Reader* readerwoG_EC = new TMVA::Reader( "!Color:Silent:Error" );
257  readerwoG_EC->AddVariable("Elec_EtotOverPin", &Elec_EtotOverPin_);
258  readerwoG_EC->AddVariable("Elec_LateBrem", &Elec_LateBrem_);
259  readerwoG_EC->AddVariable("Elec_Fbrem", &Elec_Fbrem_);
260  readerwoG_EC->AddVariable("Elec_Chi2KF", &Elec_Chi2KF_);
261  readerwoG_EC->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
262  readerwoG_EC->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
263  readerwoG_EC->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
264  readerwoG_EC->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
265  readerwoG_EC->AddVariable("Tau_Pt", &Tau_Pt_);
266  readerwoG_EC->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
267  readerwoG_EC->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
268  readerwoG_EC->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
269  readerwoG_EC->AddVariable("Tau_VisMass", &Tau_VisMass_);
270  readerwoG_EC->SetVerbose(verbosity_);
271 
272  TMVA::Reader* readerwGwoGSF_EC = new TMVA::Reader( "!Color:Silent:Error" );
273  readerwGwoGSF_EC->AddVariable("Elec_EtotOverPin", &Elec_EtotOverPin_);
274  readerwGwoGSF_EC->AddVariable("Elec_EgammaOverPdif", &Elec_EgammaOverPdif_);
275  readerwGwoGSF_EC->AddVariable("Elec_LateBrem", &Elec_LateBrem_);
276  readerwGwoGSF_EC->AddVariable("Elec_Fbrem", &Elec_Fbrem_);
277  readerwGwoGSF_EC->AddVariable("Elec_Chi2GSF", &Elec_Chi2GSF_);
278  readerwGwoGSF_EC->AddVariable("Elec_NumHits", &Elec_NumHits_);
279  readerwGwoGSF_EC->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
280  readerwGwoGSF_EC->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
281  readerwGwoGSF_EC->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
282  readerwGwoGSF_EC->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
283  readerwGwoGSF_EC->AddVariable("Tau_Pt", &Tau_Pt_);
284  readerwGwoGSF_EC->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
285  readerwGwoGSF_EC->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
286  readerwGwoGSF_EC->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
287  readerwGwoGSF_EC->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
288  readerwGwoGSF_EC->AddVariable("Tau_VisMass", &Tau_VisMass_);
289  readerwGwoGSF_EC->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
290  readerwGwoGSF_EC->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
291  readerwGwoGSF_EC->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
292  readerwGwoGSF_EC->SetVerbose(verbosity_);
293 
294  TMVA::Reader* readerwGwGSFwoPFMVA_EC = new TMVA::Reader( "!Color:Silent:Error" );
295  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_Fbrem", &Elec_Fbrem_);
296  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_Chi2KF", &Elec_Chi2KF_);
297  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_Chi2GSF", &Elec_Chi2GSF_);
298  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_NumHits", &Elec_NumHits_);
299  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
300  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
301  readerwGwGSFwoPFMVA_EC->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
302  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
303  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_Pt", &Tau_Pt_);
304  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
305  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
306  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
307  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
308  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_VisMass", &Tau_VisMass_);
309  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
310  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
311  readerwGwGSFwoPFMVA_EC->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
312  readerwGwGSFwoPFMVA_EC->SetVerbose(verbosity_);
313 
314  TMVA::Reader* readerwGwGSFwPFMVA_EC = new TMVA::Reader( "!Color:Silent:Error" );
315  readerwGwGSFwPFMVA_EC->AddVariable("Elec_EtotOverPin", &Elec_EtotOverPin_);
316  readerwGwGSFwPFMVA_EC->AddVariable("Elec_EeOverPout", &Elec_EeOverPout_);
317  readerwGwGSFwPFMVA_EC->AddVariable("Elec_LateBrem", &Elec_LateBrem_);
318  readerwGwGSFwPFMVA_EC->AddVariable("Elec_Chi2GSF", &Elec_Chi2GSF_);
319  readerwGwGSFwPFMVA_EC->AddVariable("Elec_NumHits", &Elec_NumHits_);
320  readerwGwGSFwPFMVA_EC->AddVariable("Elec_GSFTrackResol", &Elec_GSFTrackResol_);
321  readerwGwGSFwPFMVA_EC->AddVariable("Elec_GSFTracklnPt", &Elec_GSFTracklnPt_);
322  readerwGwGSFwPFMVA_EC->AddVariable("Elec_GSFTrackEta", &Elec_GSFTrackEta_);
323  readerwGwGSFwPFMVA_EC->AddVariable("Tau_EtaAtEcalEntrance", &Tau_EtaAtEcalEntrance_);
324  readerwGwGSFwPFMVA_EC->AddVariable("Tau_Pt", &Tau_Pt_);
325  readerwGwGSFwPFMVA_EC->AddVariable("Tau_EmFraction", &Tau_EmFraction_);
326  readerwGwGSFwPFMVA_EC->AddVariable("Tau_NumGammaCands", &Tau_NumGammaCands_);
327  readerwGwGSFwPFMVA_EC->AddVariable("Tau_HadrHoP", &Tau_HadrHoP_);
328  readerwGwGSFwPFMVA_EC->AddVariable("Tau_HadrEoP", &Tau_HadrEoP_);
329  readerwGwGSFwPFMVA_EC->AddVariable("Tau_VisMass", &Tau_VisMass_);
330  readerwGwGSFwPFMVA_EC->AddVariable("Tau_GammaEtaMom", &Tau_GammaEtaMom_);
331  readerwGwGSFwPFMVA_EC->AddVariable("Tau_GammaPhiMom", &Tau_GammaPhiMom_);
332  readerwGwGSFwPFMVA_EC->AddVariable("Tau_GammaEnFrac", &Tau_GammaEnFrac_);
333  readerwGwGSFwPFMVA_EC->SetVerbose(verbosity_);
334 
335  fTMVAReader_[k_NoEleMatch_BL] = readerNoEleMatch_BL;
336  fTMVAReader_[k_woG_BL] = readerwoG_BL;
337  fTMVAReader_[k_wGwoGSF_BL] = readerwGwoGSF_BL;
338  fTMVAReader_[k_wGwGSFwoPFMVA_BL] = readerwGwGSFwoPFMVA_BL;
339  fTMVAReader_[k_wGwGSFwPFMVA_BL] = readerwGwGSFwPFMVA_BL;
340  fTMVAReader_[k_NoEleMatch_EC] = readerNoEleMatch_EC;
341  fTMVAReader_[k_woG_EC] = readerwoG_EC;
342  fTMVAReader_[k_wGwoGSF_EC] = readerwGwoGSF_EC;
343  fTMVAReader_[k_wGwGSFwoPFMVA_EC] = readerwGwGSFwoPFMVA_EC;
344  fTMVAReader_[k_wGwGSFwPFMVA_EC] = readerwGwGSFwPFMVA_EC;
345 }
TMVA::Reader * fTMVAReader_[10]
void AntiElectronIDMVA2::Initialize_from_file ( const std::string &  methodName,
const std::string &  oneProngNoEleMatch_BL,
const std::string &  oneProng0Pi0_BL,
const std::string &  oneProng1pi0woGSF_BL,
const std::string &  oneProng1pi0wGSFwoPfEleMva_BL,
const std::string &  oneProng1pi0wGSFwPfEleMva_BL,
const std::string &  oneProngNoEleMatch_EC,
const std::string &  oneProng0Pi0_EC,
const std::string &  oneProng1pi0woGSF_EC,
const std::string &  oneProng1pi0wGSFwoPfEleMva_EC,
const std::string &  oneProng1pi0wGSFwPfEleMva_EC 
)

Definition at line 37 of file AntiElectronIDMVA2.cc.

References bookMVAs(), fTMVAReader_, i, isInitialized_, k_NoEleMatch_BL, k_NoEleMatch_EC, k_wGwGSFwoPFMVA_BL, k_wGwGSFwoPFMVA_EC, k_wGwGSFwPFMVA_BL, k_wGwGSFwPFMVA_EC, k_wGwoGSF_BL, k_wGwoGSF_EC, k_woG_BL, k_woG_EC, reco::details::loadTMVAWeights(), and methodName_.

48 {
49  for ( unsigned i = 0; i < 10; ++i ) {
50  if ( fTMVAReader_[i] ) delete fTMVAReader_[i];
51  }
52 
53  isInitialized_ = kTRUE;
54  methodName_ = methodName;
55 
56  bookMVAs();
57 
68 }
int i
Definition: DBlmapReader.cc:9
TMVA::Reader * fTMVAReader_[10]
void loadTMVAWeights(TMVA::Reader *reader, const std::string &method, const std::string &weightFile, bool verbose=false)
void AntiElectronIDMVA2::Initialize_from_string ( const std::string &  methodName,
const std::string &  oneProngNoEleMatch_BL,
const std::string &  oneProng0Pi0_BL,
const std::string &  oneProng1pi0woGSF_BL,
const std::string &  oneProng1pi0wGSFwoPfEleMva_BL,
const std::string &  oneProng1pi0wGSFwPfEleMva_BL,
const std::string &  oneProngNoEleMatch_EC,
const std::string &  oneProng0Pi0_EC,
const std::string &  oneProng1pi0woGSF_EC,
const std::string &  oneProng1pi0wGSFwoPfEleMva_EC,
const std::string &  oneProng1pi0wGSFwPfEleMva_EC 
)

Definition at line 70 of file AntiElectronIDMVA2.cc.

References bookMVAs(), edm::hlt::Exception, fTMVAReader_, i, isInitialized_, k_NoEleMatch_BL, k_NoEleMatch_EC, k_wGwGSFwoPFMVA_BL, k_wGwGSFwoPFMVA_EC, k_wGwGSFwPFMVA_BL, k_wGwGSFwPFMVA_EC, k_wGwoGSF_BL, k_wGwoGSF_EC, k_woG_BL, k_woG_EC, and methodName_.

81 {
82  for ( unsigned i = 0; i < 10; ++i ) {
83  if ( fTMVAReader_[i] ) delete fTMVAReader_[i];
84  }
85 
86  isInitialized_ = kTRUE;
87  methodName_ = methodName;
88 
89  bookMVAs();
90 
91  int methodName_int = -1;
92  if ( methodName_ == "BDT" ) methodName_int = TMVA::Types::kBDT;
93  else throw cms::Exception("InvalidParameter")
94  << "Invalid TMVA method name = " << methodName_ << " !!\n";
95 
96  fTMVAReader_[k_NoEleMatch_BL]->BookMVA(methodName_int, oneProngNoEleMatch_BL.data());
97  fTMVAReader_[k_woG_BL]->BookMVA(methodName_int, oneProng0Pi0_BL.data());
98  fTMVAReader_[k_wGwoGSF_BL]->BookMVA(methodName_int, oneProng1pi0woGSF_BL.data());
99  fTMVAReader_[k_wGwGSFwoPFMVA_BL]->BookMVA(methodName_int, oneProng1pi0wGSFwoPfEleMva_BL.data());
100  fTMVAReader_[k_wGwGSFwPFMVA_BL]->BookMVA(methodName_int, oneProng1pi0wGSFwPfEleMva_BL.data());
101  fTMVAReader_[k_NoEleMatch_EC]->BookMVA(methodName_int, oneProngNoEleMatch_EC.data());
102  fTMVAReader_[k_woG_EC]->BookMVA(methodName_int, oneProng0Pi0_EC.data());
103  fTMVAReader_[k_wGwoGSF_EC]->BookMVA(methodName_int, oneProng1pi0woGSF_EC.data());
104  fTMVAReader_[k_wGwGSFwoPFMVA_EC]->BookMVA(methodName_int, oneProng1pi0wGSFwoPfEleMva_EC.data());
105  fTMVAReader_[k_wGwGSFwPFMVA_EC]->BookMVA(methodName_int, oneProng1pi0wGSFwPfEleMva_EC.data());
106 }
int i
Definition: DBlmapReader.cc:9
TMVA::Reader * fTMVAReader_[10]
double AntiElectronIDMVA2::MVAValue ( Float_t  TauEtaAtEcalEntrance,
Float_t  TauPhi,
Float_t  TauPt,
Float_t  TauSignalPFChargedCands,
Float_t  TauSignalPFGammaCands,
Float_t  TauLeadPFChargedHadrHoP,
Float_t  TauLeadPFChargedHadrEoP,
Float_t  TauHasGsf,
Float_t  TauVisMass,
Float_t  TauEmFraction,
const std::vector< Float_t > &  GammasdEta,
const std::vector< Float_t > &  GammasdPhi,
const std::vector< Float_t > &  GammasPt,
Float_t  ElecEta,
Float_t  ElecPhi,
Float_t  ElecPt,
Float_t  ElecPFMvaOutput,
Float_t  ElecEe,
Float_t  ElecEgamma,
Float_t  ElecPin,
Float_t  ElecPout,
Float_t  ElecEarlyBrem,
Float_t  ElecLateBrem,
Float_t  ElecFbrem,
Float_t  ElecChi2KF,
Float_t  ElecChi2GSF,
Float_t  ElecNumHits,
Float_t  ElecGSFTrackResol,
Float_t  ElecGSFTracklnPt,
Float_t  ElecGSFTrackEta 
)

Definition at line 347 of file AntiElectronIDMVA2.cc.

References dPhi(), i, and Pi.

Referenced by MVAValue().

377 {
378  double sumPt = 0.;
379  double dEta = 0.;
380  double dEta2 = 0.;
381  double dPhi = 0.;
382  double dPhi2 = 0.;
383  double sumPt2 = 0.;
384  for ( unsigned int i = 0 ; i < GammasPt.size() ; ++i ) {
385  double pt_i = GammasPt[i];
386  double phi_i = GammasdPhi[i];
387  if ( GammasdPhi[i] > TMath::Pi() ) phi_i = GammasdPhi[i] - 2*TMath::Pi();
388  else if ( GammasdPhi[i] < -TMath::Pi() ) phi_i = GammasdPhi[i] + 2*TMath::Pi();
389  double eta_i = GammasdEta[i];
390  sumPt += pt_i;
391  sumPt2 += (pt_i*pt_i);
392  dEta += (pt_i*eta_i);
393  dEta2 += (pt_i*eta_i*eta_i);
394  dPhi += (pt_i*phi_i);
395  dPhi2 += (pt_i*phi_i*phi_i);
396  }
397 
398  Float_t GammaEnFrac = sumPt/TauPt;
399 
400  if ( sumPt > 0. ) {
401  dEta /= sumPt;
402  dPhi /= sumPt;
403  dEta2 /= sumPt;
404  dPhi2 /= sumPt;
405  }
406 
407  Float_t GammaEtaMom = TMath::Sqrt(dEta2)*TMath::Sqrt(GammaEnFrac)*TauPt;
408  Float_t GammaPhiMom = TMath::Sqrt(dPhi2)*TMath::Sqrt(GammaEnFrac)*TauPt;
409 
410  return MVAValue(TauEtaAtEcalEntrance,
411  TauPhi,
412  TauPt,
413  TauSignalPFChargedCands,
414  TauSignalPFGammaCands,
415  TauLeadPFChargedHadrHoP,
416  TauLeadPFChargedHadrEoP,
417  TauHasGsf,
418  TauVisMass,
419  TauEmFraction,
420  GammaEtaMom,
421  GammaPhiMom,
422  GammaEnFrac,
423  ElecEta,
424  ElecPhi,
425  ElecPt,
426  ElecPFMvaOutput,
427  ElecEe,
428  ElecEgamma,
429  ElecPin,
430  ElecPout,
431  ElecEarlyBrem,
432  ElecLateBrem,
433  ElecFbrem,
434  ElecChi2KF,
435  ElecChi2GSF,
436  ElecNumHits,
437  ElecGSFTrackResol,
438  ElecGSFTracklnPt,
439  ElecGSFTrackEta);
440 }
const double Pi
int i
Definition: DBlmapReader.cc:9
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
double MVAValue(Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauPt, Float_t TauSignalPFChargedCands, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauHasGsf, Float_t TauVisMass, Float_t TauEmFraction, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecPFMvaOutput, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecEarlyBrem, Float_t ElecLateBrem, Float_t ElecFbrem, Float_t ElecChi2KF, Float_t ElecChi2GSF, Float_t ElecNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
double AntiElectronIDMVA2::MVAValue ( Float_t  TauEtaAtEcalEntrance,
Float_t  TauPhi,
Float_t  TauPt,
Float_t  TauSignalPFChargedCands,
Float_t  TauSignalPFGammaCands,
Float_t  TauLeadPFChargedHadrHoP,
Float_t  TauLeadPFChargedHadrEoP,
Float_t  TauHasGsf,
Float_t  TauVisMass,
Float_t  TauEmFraction,
Float_t  GammaEtaMom,
Float_t  GammaPhiMom,
Float_t  GammaEnFrac,
Float_t  ElecEta,
Float_t  ElecPhi,
Float_t  ElecPt,
Float_t  ElecPFMvaOutput,
Float_t  ElecEe,
Float_t  ElecEgamma,
Float_t  ElecPin,
Float_t  ElecPout,
Float_t  ElecEarlyBrem,
Float_t  ElecLateBrem,
Float_t  ElecFbrem,
Float_t  ElecChi2KF,
Float_t  ElecChi2GSF,
Float_t  ElecNumHits,
Float_t  ElecGSFTrackResol,
Float_t  ElecGSFTracklnPt,
Float_t  ElecGSFTrackEta 
)

Definition at line 442 of file AntiElectronIDMVA2.cc.

References gather_cfg::cout, deltaR(), Elec_Chi2GSF_, Elec_Chi2KF_, Elec_EarlyBrem_, Elec_EgammaOverPdif_, Elec_Eta_, Elec_EtotOverPin_, Elec_Fbrem_, Elec_GSFTrackEta_, Elec_GSFTracklnPt_, Elec_GSFTrackResol_, Elec_LateBrem_, Elec_NumHits_, Elec_Pt_, fTMVAReader_, isInitialized_, k_NoEleMatch_BL, k_NoEleMatch_EC, k_wGwGSFwoPFMVA_BL, k_wGwGSFwoPFMVA_EC, k_wGwGSFwPFMVA_BL, k_wGwGSFwPFMVA_EC, k_wGwoGSF_BL, k_wGwoGSF_EC, k_woG_BL, k_woG_EC, siStripFEDMonitor_P5_cff::Max, methodName_, Tau_EmFraction_, Tau_EtaAtEcalEntrance_, Tau_GammaEnFrac_, Tau_GammaEtaMom_, Tau_GammaPhiMom_, Tau_HadrEoP_, Tau_HadrHoP_, Tau_HasGsf_, Tau_NumChargedCands_, Tau_NumGammaCands_, Tau_Pt_, and Tau_VisMass_.

472 {
473 
474  if ( !isInitialized_ ) {
475  std::cout << "Error: AntiElectronMVA not properly initialized.\n";
476  return -99.;
477  }
478 
479  Tau_EtaAtEcalEntrance_ = TauEtaAtEcalEntrance;
480  Tau_Pt_ = TauPt;
481  Tau_HasGsf_ = TauHasGsf;
482  Tau_EmFraction_ = TMath::Max(TauEmFraction,float(0.0));
483  Tau_NumChargedCands_ = TauSignalPFChargedCands;
484  Tau_NumGammaCands_ = TauSignalPFGammaCands;
485  Tau_HadrHoP_ = TauLeadPFChargedHadrHoP;
486  Tau_HadrEoP_ = TauLeadPFChargedHadrEoP;
487  Tau_VisMass_ = TauVisMass;
488  Tau_GammaEtaMom_ = GammaEtaMom;
489  Tau_GammaPhiMom_ = GammaPhiMom;
490  Tau_GammaEnFrac_ = GammaEnFrac;
491 
492  Elec_Eta_ = ElecEta;
493  Elec_Pt_ = ElecPt;
494  Elec_EtotOverPin_ = (ElecEe + ElecEgamma)/ElecPin;
495  Elec_EgammaOverPdif_ = ElecEgamma/(ElecPin - ElecPout);
496  Elec_EarlyBrem_ = ElecEarlyBrem;
497  Elec_LateBrem_ = ElecLateBrem;
498  Elec_Fbrem_ = ElecFbrem;
499  Elec_Chi2KF_ = ElecChi2KF;
500  Elec_Chi2GSF_ = ElecChi2GSF;
501  Elec_NumHits_ = ElecNumHits;
502  Elec_GSFTrackResol_ = ElecGSFTrackResol;
503  Elec_GSFTracklnPt_ = ElecGSFTracklnPt;
504  Elec_GSFTrackEta_ = ElecGSFTrackEta;
505 
506  double mva = -99.;
507  if ( Tau_NumChargedCands_ == 3 ) mva = 1.0;
508  else if ( deltaR(TauEtaAtEcalEntrance, TauPhi, ElecEta, ElecPhi) > 0.3 ) {
509  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.5 ) mva = fTMVAReader_[k_NoEleMatch_BL]->EvaluateMVA(methodName_);
510  else mva = fTMVAReader_[k_NoEleMatch_EC]->EvaluateMVA(methodName_);
511  } else if ( TauSignalPFGammaCands == 0 ) {
512  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.5 ) mva = fTMVAReader_[k_woG_BL]->EvaluateMVA(methodName_);
513  else mva = fTMVAReader_[k_woG_EC]->EvaluateMVA(methodName_);
514  } else if ( TauSignalPFGammaCands > 0 && TauHasGsf < 0.5 ) {
515  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.5 ) mva = fTMVAReader_[k_wGwoGSF_BL]->EvaluateMVA(methodName_);
516  else mva = fTMVAReader_[k_wGwoGSF_EC]->EvaluateMVA(methodName_);
517  } else if ( TauSignalPFGammaCands > 0 && TauHasGsf > 0.5 && ElecPFMvaOutput < -0.1 ) {
518  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.5 ) mva = fTMVAReader_[k_wGwGSFwoPFMVA_BL]->EvaluateMVA(methodName_);
519  else mva = fTMVAReader_[k_wGwGSFwoPFMVA_EC]->EvaluateMVA(methodName_);
520  } else if ( TauSignalPFGammaCands > 0 && TauHasGsf > 0.5 && ElecPFMvaOutput > -0.1 ) {
521  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.5 ) mva = fTMVAReader_[k_wGwGSFwPFMVA_BL]->EvaluateMVA(methodName_);
522  else mva = fTMVAReader_[k_wGwGSFwPFMVA_EC]->EvaluateMVA(methodName_);
523  }
524 
525  return mva;
526 }
TMVA::Reader * fTMVAReader_[10]
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
tuple cout
Definition: gather_cfg.py:121
double AntiElectronIDMVA2::MVAValue ( const reco::PFTau thePFTau,
const reco::GsfElectron theGsfEle 
)

Definition at line 529 of file AntiElectronIDMVA2.cc.

References edm::RefVector< C, T, F >::at(), asciidump::at, reco::GsfElectron::closestCtfTrackRef(), reco::GsfElectron::MvaInput::earlyBrem, Elec_Ee_, Elec_Egamma_, reco::PFTau::emFraction(), reco::LeafCandidate::eta(), reco::GsfElectron::fbrem(), reco::GsfElectron::gsfTrack(), i, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), j, reco::GsfElectron::MvaInput::lateBrem, reco::PFTau::leadPFChargedHadrCand(), create_public_lumi_plots::log, reco::LeafCandidate::mass(), siStripFEDMonitor_P5_cff::Max, reco::GsfElectron::MvaOutput::mva, reco::GsfElectron::mvaInput(), reco::GsfElectron::mvaOutput(), MVAValue(), reco::GsfElectron::pflowSuperCluster(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::PFTau::signalPFCands(), reco::PFTau::signalPFChargedHadrCands(), reco::PFTau::signalPFGammaCands(), edm::RefVector< C, T, F >::size(), findQualityFiles::size, reco::GsfElectron::trackMomentumAtVtx(), and reco::GsfElectron::trackMomentumOut().

532 {
533  float sumEtaTimesEnergy = 0;
534  float sumEnergy = 0;
535  Float_t TauEtaAtEcalEntrance = 0;
536  for(unsigned int j = 0 ; j < (thePFTau.signalPFCands()).size() ; j++){
537  reco::PFCandidateRef pfcandidate = (thePFTau.signalPFCands()).at(j);
538  sumEtaTimesEnergy += pfcandidate->positionAtECALEntrance().eta()*pfcandidate->energy();
539  sumEnergy += pfcandidate->energy();
540  }
541  if(sumEnergy>0)TauEtaAtEcalEntrance = sumEtaTimesEnergy/sumEnergy;
542 
543  Float_t TauPhi = thePFTau.phi();
544  Float_t TauPt = thePFTau.pt();
545  Float_t TauSignalPFChargedCands = thePFTau.signalPFChargedHadrCands().size();
546  Float_t TauSignalPFGammaCands = thePFTau.signalPFGammaCands().size();
547  Float_t TauLeadPFChargedHadrHoP = 0.;
548  Float_t TauLeadPFChargedHadrEoP = 0.;
549  if ( thePFTau.leadPFChargedHadrCand()->p() > 0. ) {
550  TauLeadPFChargedHadrHoP = thePFTau.leadPFChargedHadrCand()->hcalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
551  TauLeadPFChargedHadrEoP = thePFTau.leadPFChargedHadrCand()->ecalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
552  }
553  Float_t TauHasGsf = thePFTau.leadPFChargedHadrCand()->gsfTrackRef().isNonnull();
554  Float_t TauVisMass = thePFTau.mass();
555  Float_t TauEmFraction = TMath::Max(thePFTau.emFraction(), (Float_t)0.);
556  std::vector<Float_t> GammasdEta;
557  std::vector<Float_t> GammasdPhi;
558  std::vector<Float_t> GammasPt;
559  for ( unsigned i = 0 ; i < thePFTau.signalPFGammaCands().size(); ++i ) {
560  reco::PFCandidateRef gamma = thePFTau.signalPFGammaCands().at(i);
561  if ( thePFTau.leadPFChargedHadrCand().isNonnull() ) {
562  GammasdEta.push_back(gamma->eta() - thePFTau.leadPFChargedHadrCand()->eta());
563  GammasdPhi.push_back(gamma->phi() - thePFTau.leadPFChargedHadrCand()->phi());
564  } else {
565  GammasdEta.push_back(gamma->eta() - thePFTau.eta());
566  GammasdPhi.push_back(gamma->phi() - thePFTau.phi());
567  }
568  GammasPt.push_back(gamma->pt());
569  }
570 
571  Float_t ElecEta = theGsfEle.eta();
572  Float_t ElecPhi = theGsfEle.phi();
573  Float_t ElecPt = theGsfEle.pt();
574  Float_t ElecPFMvaOutput = theGsfEle.mvaOutput().mva;
575  //Variables related to the electron Cluster
576  Float_t ElecEe = 0.;
577  Float_t ElecEgamma = 0.;
578  reco::SuperClusterRef pfSuperCluster = theGsfEle.pflowSuperCluster();
579  if ( pfSuperCluster.isNonnull() && pfSuperCluster.isAvailable() ) {
580  for ( reco::CaloCluster_iterator pfCluster = pfSuperCluster->clustersBegin();
581  pfCluster != pfSuperCluster->clustersEnd(); ++pfCluster ) {
582  double pfClusterEn = (*pfCluster)->energy();
583  if ( pfCluster == pfSuperCluster->clustersBegin() ) Elec_Ee_ += pfClusterEn;
584  else Elec_Egamma_ += pfClusterEn;
585  }
586  }
587  Float_t ElecPin = TMath::Sqrt(theGsfEle.trackMomentumAtVtx().Mag2());
588  Float_t ElecPout = TMath::Sqrt(theGsfEle.trackMomentumOut().Mag2());
589  Float_t ElecEarlyBrem = theGsfEle.mvaInput().earlyBrem;
590  Float_t ElecLateBrem = theGsfEle.mvaInput().lateBrem;
591  Float_t ElecFbrem = theGsfEle.fbrem();
592  //Variables related to the CtfTrack
593  Float_t ElecChi2KF = -99.;
594  Float_t ElecNumHits = -99.;
595  if ( theGsfEle.closestCtfTrackRef().isNonnull() ) {
596  ElecChi2KF = theGsfEle.closestCtfTrackRef()->normalizedChi2();
597  ElecNumHits = theGsfEle.closestCtfTrackRef()->numberOfValidHits();
598  }
599  //Variables related to the GsfTrack
600  Float_t ElecChi2GSF = -99.;
601  Float_t ElecGSFTrackResol = -99.;
602  Float_t ElecGSFTracklnPt = -99.;
603  Float_t ElecGSFTrackEta = -99.;
604  if ( theGsfEle.gsfTrack().isNonnull() ) {
605  ElecChi2GSF = (theGsfEle).gsfTrack()->normalizedChi2();
606  if ( theGsfEle.gsfTrack()->pt() > 0. ) {
607  ElecGSFTrackResol = theGsfEle.gsfTrack()->ptError()/theGsfEle.gsfTrack()->pt();
608  ElecGSFTracklnPt = log(theGsfEle.gsfTrack()->pt())*TMath::Ln10();
609  }
610  ElecGSFTrackEta = theGsfEle.gsfTrack()->eta();
611  }
612 
613  return MVAValue(TauEtaAtEcalEntrance,
614  TauPhi,
615  TauPt,
616  TauSignalPFChargedCands,
617  TauSignalPFGammaCands,
618  TauLeadPFChargedHadrHoP,
619  TauLeadPFChargedHadrEoP,
620  TauHasGsf,
621  TauVisMass,
622  TauEmFraction,
623  GammasdEta,
624  GammasdPhi,
625  GammasPt,
626  ElecEta,
627  ElecPhi,
628  ElecPt,
629  ElecPFMvaOutput,
630  ElecEe,
631  ElecEgamma,
632  ElecPin,
633  ElecPout,
634  ElecEarlyBrem,
635  ElecLateBrem,
636  ElecFbrem,
637  ElecChi2KF,
638  ElecChi2GSF,
639  ElecNumHits,
640  ElecGSFTrackResol,
641  ElecGSFTracklnPt,
642  ElecGSFTrackEta);
643 }
int i
Definition: DBlmapReader.cc:9
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:272
float emFraction() const
Definition: PFTau.cc:158
const PFCandidateRefVector & signalPFChargedHadrCands() const
Charged hadrons in signal region.
Definition: PFTau.cc:75
float fbrem() const
Definition: GsfElectron.h:639
bool isAvailable() const
Definition: Ref.h:276
virtual double eta() const
momentum pseudorapidity
const PFCandidateRefVector & signalPFCands() const
PFCandidates in signal region.
Definition: PFTau.cc:73
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:185
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual double mass() const
mass
const MvaInput & mvaInput() const
Definition: GsfElectron.h:557
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:274
int j
Definition: DBlmapReader.cc:9
const PFCandidateRef & leadPFChargedHadrCand() const
Definition: PFTau.cc:62
const PFCandidateRefVector & signalPFGammaCands() const
Gamma candidates in signal region.
Definition: PFTau.cc:79
virtual double pt() const
transverse momentum
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:558
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:76
double MVAValue(Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauPt, Float_t TauSignalPFChargedCands, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauHasGsf, Float_t TauVisMass, Float_t TauEmFraction, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecPFMvaOutput, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecEarlyBrem, Float_t ElecLateBrem, Float_t ElecFbrem, Float_t ElecChi2KF, Float_t ElecChi2GSF, Float_t ElecNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
virtual double phi() const
momentum azimuthal angle
SuperClusterRef pflowSuperCluster() const
Definition: GsfElectron.h:174
tuple size
Write out results.
list at
Definition: asciidump.py:428
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:169
double AntiElectronIDMVA2::MVAValue ( const reco::PFTau thePFTau)

Definition at line 645 of file AntiElectronIDMVA2.cc.

References edm::RefVector< C, T, F >::at(), asciidump::at, reco::PFTau::emFraction(), reco::LeafCandidate::eta(), i, edm::Ref< C, T, F >::isNonnull(), j, reco::PFTau::leadPFChargedHadrCand(), reco::LeafCandidate::mass(), siStripFEDMonitor_P5_cff::Max, MVAValue(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::PFTau::signalPFCands(), reco::PFTau::signalPFChargedHadrCands(), reco::PFTau::signalPFGammaCands(), edm::RefVector< C, T, F >::size(), and findQualityFiles::size.

646 {
647  float sumEtaTimesEnergy = 0;
648  float sumEnergy = 0;
649  Float_t TauEtaAtEcalEntrance =0;
650  for(unsigned int j = 0 ; j < (thePFTau.signalPFCands()).size() ; j++){
651  reco::PFCandidateRef pfcandidate = (thePFTau.signalPFCands()).at(j);
652  sumEtaTimesEnergy += pfcandidate->positionAtECALEntrance().eta()*pfcandidate->energy();
653  sumEnergy += pfcandidate->energy();
654  }
655  if(sumEnergy>0)TauEtaAtEcalEntrance = sumEtaTimesEnergy/sumEnergy;
656 
657  Float_t TauPhi = thePFTau.phi();
658  Float_t TauPt = thePFTau.pt();
659  Float_t TauSignalPFChargedCands = thePFTau.signalPFChargedHadrCands().size();
660  Float_t TauSignalPFGammaCands = thePFTau.signalPFGammaCands().size();
661  Float_t TauLeadPFChargedHadrHoP = 0.;
662  Float_t TauLeadPFChargedHadrEoP = 0.;
663  if ( thePFTau.leadPFChargedHadrCand()->p() > 0. ) {
664  TauLeadPFChargedHadrHoP = thePFTau.leadPFChargedHadrCand()->hcalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
665  TauLeadPFChargedHadrEoP = thePFTau.leadPFChargedHadrCand()->ecalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
666  }
667  Float_t TauHasGsf = thePFTau.leadPFChargedHadrCand()->gsfTrackRef().isNonnull();
668  Float_t TauVisMass = thePFTau.mass();
669  Float_t TauEmFraction = TMath::Max(thePFTau.emFraction(), (Float_t)0.);
670  std::vector<Float_t> GammasdEta;
671  std::vector<Float_t> GammasdPhi;
672  std::vector<Float_t> GammasPt;
673  for ( unsigned i = 0 ; i < thePFTau.signalPFGammaCands().size(); ++i ) {
674  reco::PFCandidateRef gamma = thePFTau.signalPFGammaCands().at(i);
675  if ( thePFTau.leadPFChargedHadrCand().isNonnull() ) {
676  GammasdEta.push_back(gamma->eta() - thePFTau.leadPFChargedHadrCand()->eta());
677  GammasdPhi.push_back(gamma->phi() - thePFTau.leadPFChargedHadrCand()->phi());
678  } else {
679  GammasdEta.push_back(gamma->eta() - thePFTau.eta());
680  GammasdPhi.push_back(gamma->phi() - thePFTau.phi());
681  }
682  GammasPt.push_back(gamma->pt());
683  }
684 
685  Float_t dummyElecEta = 9.9;
686 
687  return MVAValue(TauEtaAtEcalEntrance,
688  TauPhi,
689  TauPt,
690  TauSignalPFChargedCands,
691  TauSignalPFGammaCands,
692  TauLeadPFChargedHadrHoP,
693  TauLeadPFChargedHadrEoP,
694  TauHasGsf,
695  TauVisMass,
696  TauEmFraction,
697  GammasdEta,
698  GammasdPhi,
699  GammasPt,
700  dummyElecEta,
701  0.,
702  0.,
703  0.,
704  0.,
705  0.,
706  0.,
707  0.,
708  0.,
709  0.,
710  0.,
711  0.,
712  0.,
713  0.,
714  0.,
715  0.,
716  0.);
717 }
int i
Definition: DBlmapReader.cc:9
float emFraction() const
Definition: PFTau.cc:158
const PFCandidateRefVector & signalPFChargedHadrCands() const
Charged hadrons in signal region.
Definition: PFTau.cc:75
virtual double eta() const
momentum pseudorapidity
const PFCandidateRefVector & signalPFCands() const
PFCandidates in signal region.
Definition: PFTau.cc:73
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual double mass() const
mass
int j
Definition: DBlmapReader.cc:9
const PFCandidateRef & leadPFChargedHadrCand() const
Definition: PFTau.cc:62
const PFCandidateRefVector & signalPFGammaCands() const
Gamma candidates in signal region.
Definition: PFTau.cc:79
virtual double pt() const
transverse momentum
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:76
double MVAValue(Float_t TauEtaAtEcalEntrance, Float_t TauPhi, Float_t TauPt, Float_t TauSignalPFChargedCands, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauHasGsf, Float_t TauVisMass, Float_t TauEmFraction, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecPFMvaOutput, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecEarlyBrem, Float_t ElecLateBrem, Float_t ElecFbrem, Float_t ElecChi2KF, Float_t ElecChi2GSF, Float_t ElecNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
virtual double phi() const
momentum azimuthal angle
tuple size
Write out results.
list at
Definition: asciidump.py:428

Member Data Documentation

Float_t AntiElectronIDMVA2::Elec_Chi2GSF_
private

Definition at line 167 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_Chi2KF_
private

Definition at line 166 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_EarlyBrem_
private

Definition at line 163 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_Ee_
private

Definition at line 156 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_EeOverPout_
private

Definition at line 161 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::Elec_Egamma_
private

Definition at line 157 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_EgammaOverPdif_
private

Definition at line 162 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_Eta_
private

Definition at line 153 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_EtotOverPin_
private

Definition at line 160 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_Fbrem_
private

Definition at line 165 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_GSFTrackEta_
private

Definition at line 171 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_GSFTracklnPt_
private

Definition at line 170 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_GSFTrackResol_
private

Definition at line 169 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_LateBrem_
private

Definition at line 164 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_NumHits_
private

Definition at line 168 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Elec_PFMvaOutput_
private

Definition at line 155 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::Elec_Pin_
private

Definition at line 158 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::Elec_Pout_
private

Definition at line 159 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::Elec_Pt_
private

Definition at line 154 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

TMVA::Reader* AntiElectronIDMVA2::fTMVAReader_[10]
private
Float_t AntiElectronIDMVA2::GammadEta_
private

Definition at line 135 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::GammadPhi_
private

Definition at line 136 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::GammadPt_
private

Definition at line 137 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Bool_t AntiElectronIDMVA2::isInitialized_
private

Definition at line 131 of file AntiElectronIDMVA2.h.

Referenced by Initialize_from_file(), Initialize_from_string(), and MVAValue().

std::string AntiElectronIDMVA2::methodName_
private

Definition at line 132 of file AntiElectronIDMVA2.h.

Referenced by Initialize_from_file(), Initialize_from_string(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_EmFraction_
private

Definition at line 142 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_EtaAtEcalEntrance_
private

Definition at line 139 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_GammaEnFrac_
private

Definition at line 150 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_GammaEtaMom_
private

Definition at line 148 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_GammaPhiMom_
private

Definition at line 149 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_HadrEoP_
private

Definition at line 146 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_HadrHoP_
private

Definition at line 145 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_HadrMva_
private

Definition at line 151 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs().

Float_t AntiElectronIDMVA2::Tau_HasGsf_
private

Definition at line 141 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_NumChargedCands_
private

Definition at line 143 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_NumGammaCands_
private

Definition at line 144 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_Pt_
private

Definition at line 140 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

Float_t AntiElectronIDMVA2::Tau_VisMass_
private

Definition at line 147 of file AntiElectronIDMVA2.h.

Referenced by bookMVAs(), and MVAValue().

int AntiElectronIDMVA2::verbosity_
private

Definition at line 173 of file AntiElectronIDMVA2.h.

Referenced by AntiElectronIDMVA2(), and bookMVAs().