test
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
AntiElectronIDMVA5GBR Class Reference

#include <AntiElectronIDMVA5GBR.h>

Public Member Functions

 AntiElectronIDMVA5GBR ()
 
void Initialize_from_file (const std::string &methodName, const std::string &gbrFile)
 
double MVAValue (Float_t TauEtaAtEcalEntrance, Float_t TauPt, Float_t TauLeadChargedPFCandEtaAtEcalEntrance, Float_t TauLeadChargedPFCandPt, Float_t TaudCrackEta, Float_t TaudCrackPhi, Float_t TauEmFraction, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauVisMass, Float_t TauHadrMva, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t TauKFNumHits, Float_t TauGSFNumHits, Float_t TauGSFChi2, Float_t TauGSFTrackResol, Float_t TauGSFTracklnPt, Float_t TauGSFTrackEta, Float_t TauPhi, Float_t TauSignalPFChargedCands, Float_t TauHasGsf, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecFbrem, Float_t ElecChi2GSF, Float_t ElecGSFNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
 
double MVAValue (Float_t TauEtaAtEcalEntrance, Float_t TauPt, Float_t TauLeadChargedPFCandEtaAtEcalEntrance, Float_t TauLeadChargedPFCandPt, Float_t TaudCrackEta, Float_t TaudCrackPhi, Float_t TauEmFraction, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauVisMass, Float_t TauHadrMva, Float_t TauGammaEtaMom, Float_t TauGammaPhiMom, Float_t TauGammaEnFrac, Float_t TauKFNumHits, Float_t TauGSFNumHits, Float_t TauGSFChi2, Float_t TauGSFTrackResol, Float_t TauGSFTracklnPt, Float_t TauGSFTrackEta, Float_t TauPhi, Float_t TauSignalPFChargedCands, Float_t TauHasGsf, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecFbrem, Float_t ElecChi2GSF, Float_t ElecGSFNumHits, 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)
 
 ~AntiElectronIDMVA5GBR ()
 

Private Member Functions

double dCrackEta (double eta)
 
double dCrackPhi (double phi, double eta)
 
double minimum (double a, double b)
 

Private Attributes

TFile * fin_
 
GBRForestgbr_NoEleMatch_wGwGSF_BL_
 
GBRForestgbr_NoEleMatch_wGwGSF_EC_
 
GBRForestgbr_NoEleMatch_wGwoGSF_BL_
 
GBRForestgbr_NoEleMatch_wGwoGSF_EC_
 
GBRForestgbr_NoEleMatch_woGwGSF_BL_
 
GBRForestgbr_NoEleMatch_woGwGSF_EC_
 
GBRForestgbr_NoEleMatch_woGwoGSF_BL_
 
GBRForestgbr_NoEleMatch_woGwoGSF_EC_
 
GBRForestgbr_wGwGSF_BL_
 
GBRForestgbr_wGwGSF_EC_
 
GBRForestgbr_wGwoGSF_BL_
 
GBRForestgbr_wGwoGSF_EC_
 
GBRForestgbr_woGwGSF_BL_
 
GBRForestgbr_woGwGSF_EC_
 
GBRForestgbr_woGwoGSF_BL_
 
GBRForestgbr_woGwoGSF_EC_
 
Bool_t isInitialized_
 
std::string methodName_
 
Float_t * Var_NoEleMatch_wGwGSF_Barrel_
 
Float_t * Var_NoEleMatch_wGwGSF_Endcap_
 
Float_t * Var_NoEleMatch_wGwoGSF_Barrel_
 
Float_t * Var_NoEleMatch_wGwoGSF_Endcap_
 
Float_t * Var_NoEleMatch_woGwGSF_Barrel_
 
Float_t * Var_NoEleMatch_woGwGSF_Endcap_
 
Float_t * Var_NoEleMatch_woGwoGSF_Barrel_
 
Float_t * Var_NoEleMatch_woGwoGSF_Endcap_
 
Float_t * Var_wGwGSF_Barrel_
 
Float_t * Var_wGwGSF_Endcap_
 
Float_t * Var_wGwoGSF_Barrel_
 
Float_t * Var_wGwoGSF_Endcap_
 
Float_t * Var_woGwGSF_Barrel_
 
Float_t * Var_woGwGSF_Endcap_
 
Float_t * Var_woGwoGSF_Barrel_
 
Float_t * Var_woGwoGSF_Endcap_
 
int verbosity_
 

Detailed Description

Definition at line 26 of file AntiElectronIDMVA5GBR.h.

Constructor & Destructor Documentation

AntiElectronIDMVA5GBR::AntiElectronIDMVA5GBR ( )

Definition at line 14 of file AntiElectronIDMVA5GBR.cc.

References gbr_NoEleMatch_wGwGSF_BL_, gbr_NoEleMatch_wGwGSF_EC_, gbr_NoEleMatch_wGwoGSF_BL_, gbr_NoEleMatch_wGwoGSF_EC_, gbr_NoEleMatch_woGwGSF_BL_, gbr_NoEleMatch_woGwGSF_EC_, gbr_NoEleMatch_woGwoGSF_BL_, gbr_NoEleMatch_woGwoGSF_EC_, gbr_wGwGSF_BL_, gbr_wGwGSF_EC_, gbr_wGwoGSF_BL_, gbr_wGwoGSF_EC_, gbr_woGwGSF_BL_, gbr_woGwGSF_EC_, gbr_woGwoGSF_BL_, gbr_woGwoGSF_EC_, Var_NoEleMatch_wGwGSF_Barrel_, Var_NoEleMatch_wGwGSF_Endcap_, Var_NoEleMatch_wGwoGSF_Barrel_, Var_NoEleMatch_wGwoGSF_Endcap_, Var_NoEleMatch_woGwGSF_Barrel_, Var_NoEleMatch_woGwGSF_Endcap_, Var_NoEleMatch_woGwoGSF_Barrel_, Var_NoEleMatch_woGwoGSF_Endcap_, Var_wGwGSF_Barrel_, Var_wGwGSF_Endcap_, Var_wGwoGSF_Barrel_, Var_wGwoGSF_Endcap_, Var_woGwGSF_Barrel_, Var_woGwGSF_Endcap_, Var_woGwoGSF_Barrel_, Var_woGwoGSF_Endcap_, and verbosity_.

15  : isInitialized_(kFALSE),
16  methodName_("BDTG")
17 {
18  Var_NoEleMatch_woGwoGSF_Barrel_ = new Float_t[10];
19  Var_NoEleMatch_woGwGSF_Barrel_ = new Float_t[16];
20  Var_NoEleMatch_wGwoGSF_Barrel_ = new Float_t[14];
21  Var_NoEleMatch_wGwGSF_Barrel_ = new Float_t[20];
22  Var_woGwoGSF_Barrel_ = new Float_t[18];
23  Var_woGwGSF_Barrel_ = new Float_t[24];
24  Var_wGwoGSF_Barrel_ = new Float_t[22];
25  Var_wGwGSF_Barrel_ = new Float_t[28];
26  Var_NoEleMatch_woGwoGSF_Endcap_ = new Float_t[9];
27  Var_NoEleMatch_woGwGSF_Endcap_ = new Float_t[15];
28  Var_NoEleMatch_wGwoGSF_Endcap_ = new Float_t[13];
29  Var_NoEleMatch_wGwGSF_Endcap_ = new Float_t[19];
30  Var_woGwoGSF_Endcap_ = new Float_t[17];
31  Var_woGwGSF_Endcap_ = new Float_t[23];
32  Var_wGwoGSF_Endcap_ = new Float_t[21];
33  Var_wGwGSF_Endcap_ = new Float_t[27];
34 
40  gbr_woGwGSF_BL_ = 0;
41  gbr_wGwoGSF_BL_ = 0;
42  gbr_wGwGSF_BL_ = 0;
47  gbr_woGwoGSF_EC_ = 0;
48  gbr_woGwGSF_EC_ = 0;
49  gbr_wGwoGSF_EC_ = 0;
50  gbr_wGwGSF_EC_ = 0;
51 
52  verbosity_ = 0;
53 }
AntiElectronIDMVA5GBR::~AntiElectronIDMVA5GBR ( )

Definition at line 55 of file AntiElectronIDMVA5GBR.cc.

References fin_, Var_NoEleMatch_wGwGSF_Barrel_, Var_NoEleMatch_wGwGSF_Endcap_, Var_NoEleMatch_wGwoGSF_Barrel_, Var_NoEleMatch_wGwoGSF_Endcap_, Var_NoEleMatch_woGwGSF_Barrel_, Var_NoEleMatch_woGwGSF_Endcap_, Var_NoEleMatch_woGwoGSF_Barrel_, Var_NoEleMatch_woGwoGSF_Endcap_, Var_wGwGSF_Barrel_, Var_wGwGSF_Endcap_, Var_wGwoGSF_Barrel_, Var_wGwoGSF_Endcap_, Var_woGwGSF_Barrel_, Var_woGwGSF_Endcap_, Var_woGwoGSF_Barrel_, and Var_woGwoGSF_Endcap_.

56 {
61  delete [] Var_woGwoGSF_Barrel_;
62  delete [] Var_woGwGSF_Barrel_;
63  delete [] Var_wGwoGSF_Barrel_;
64  delete [] Var_wGwGSF_Barrel_;
69  delete [] Var_woGwoGSF_Endcap_;
70  delete [] Var_woGwGSF_Endcap_;
71  delete [] Var_wGwoGSF_Endcap_;
72  delete [] Var_wGwGSF_Endcap_;
73  delete fin_;
74 }

Member Function Documentation

double AntiElectronIDMVA5GBR::dCrackEta ( double  eta)
private

Definition at line 978 of file AntiElectronIDMVA5GBR.cc.

References Abs(), and minimum().

Referenced by MVAValue().

979 {
980 //--- compute the (unsigned) distance to the closest eta-crack in the ECAL barrel
981 
982  // IN: define locations of the eta-cracks
983  double cracks[5] = { 0., 4.44747e-01, 7.92824e-01, 1.14090e+00, 1.47464e+00 };
984 
985  double retVal = 99.;
986 
987  for ( int iCrack = 0; iCrack < 5 ; ++iCrack ) {
988  double d = minimum(eta - cracks[iCrack], eta + cracks[iCrack]);
989  if ( TMath::Abs(d) < TMath::Abs(retVal) ) {
990  retVal = d;
991  }
992  }
993 
994  return TMath::Abs(retVal);
995 }
T eta() const
double minimum(double a, double b)
T Abs(T a)
Definition: MathUtil.h:49
double AntiElectronIDMVA5GBR::dCrackPhi ( double  phi,
double  eta 
)
private

Definition at line 919 of file AntiElectronIDMVA5GBR.cc.

References Abs(), minimum(), Pi, and pi.

Referenced by MVAValue().

920 {
921 //--- compute the (unsigned) distance to the closest phi-crack in the ECAL barrel
922 
923  double pi = TMath::Pi(); // 3.14159265358979323846;
924 
925  // IN: define locations of the 18 phi-cracks
926  static std::vector<double> cPhi;
927  if ( cPhi.size() == 0 ) {
928  cPhi.resize(18, 0);
929  cPhi[0] = 2.97025;
930  for ( unsigned iCrack = 1; iCrack <= 17; ++iCrack ) {
931  cPhi[iCrack] = cPhi[0] - 2.*iCrack*pi/18;
932  }
933  }
934 
935  // IN: shift of this location if eta < 0
936  double delta_cPhi = 0.00638;
937 
938  double retVal = 99.;
939 
940  if ( eta >= -1.47464 && eta <= 1.47464 ) {
941 
942  // the location is shifted
943  if ( eta < 0. ) phi += delta_cPhi;
944 
945  // CV: need to bring-back phi into interval [-pi,+pi]
946  if ( phi > pi ) phi -= 2.*pi;
947  if ( phi < -pi ) phi += 2.*pi;
948 
949  if ( phi >= -pi && phi <= pi ) {
950 
951  // the problem of the extrema:
952  if ( phi < cPhi[17] || phi >= cPhi[0] ) {
953  if ( phi < 0. ) phi += 2.*pi;
954  retVal = minimum(phi - cPhi[0], phi - cPhi[17] - 2.*pi);
955  } else {
956  // between these extrema...
957  bool OK = false;
958  unsigned iCrack = 16;
959  while( !OK ) {
960  if ( phi < cPhi[iCrack] ) {
961  retVal = minimum(phi - cPhi[iCrack + 1], phi - cPhi[iCrack]);
962  OK = true;
963  } else {
964  iCrack -= 1;
965  }
966  }
967  }
968  } else {
969  retVal = 0.; // IN: if there is a problem, we assume that we are in a crack
970  }
971  } else {
972  return -99.;
973  }
974 
975  return TMath::Abs(retVal);
976 }
const double Pi
pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:72
T eta() const
double minimum(double a, double b)
const Double_t pi
T Abs(T a)
Definition: MathUtil.h:49
Definition: DDAxes.h:10
void AntiElectronIDMVA5GBR::Initialize_from_file ( const std::string &  methodName,
const std::string &  gbrFile 
)

Definition at line 76 of file AntiElectronIDMVA5GBR.cc.

References fin_, gbr_NoEleMatch_wGwGSF_BL_, gbr_NoEleMatch_wGwGSF_EC_, gbr_NoEleMatch_wGwoGSF_BL_, gbr_NoEleMatch_wGwoGSF_EC_, gbr_NoEleMatch_woGwGSF_BL_, gbr_NoEleMatch_woGwGSF_EC_, gbr_NoEleMatch_woGwoGSF_BL_, gbr_NoEleMatch_woGwoGSF_EC_, gbr_wGwGSF_BL_, gbr_wGwGSF_EC_, gbr_wGwoGSF_BL_, gbr_wGwoGSF_EC_, gbr_woGwGSF_BL_, gbr_woGwGSF_EC_, gbr_woGwoGSF_BL_, gbr_woGwoGSF_EC_, isInitialized_, and methodName_.

77 {
78  isInitialized_ = kTRUE;
79  methodName_ = methodName;
80 
81  //open input root file
82  fin_ = new TFile(gbrFile.data(), "READ");
83  if ( fin_->IsZombie() )
84  throw cms::Exception("AntiElectronIDMVA5GBR")
85  << " Failed to open File = " << gbrFile << " !!\n";
86 
87  //read GBRForest from file
88  gbr_NoEleMatch_woGwoGSF_BL_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_woGwoGSF_BL"));
89  gbr_NoEleMatch_woGwGSF_BL_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_woGwGSF_BL"));
90  gbr_NoEleMatch_wGwoGSF_BL_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_wGwoGSF_BL"));
91  gbr_NoEleMatch_wGwGSF_BL_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_wGwGSF_BL"));
92  gbr_woGwoGSF_BL_ = (GBRForest *)(fin_->Get("gbr_woGwoGSF_BL"));
93  gbr_woGwGSF_BL_ = (GBRForest *)(fin_->Get("gbr_woGwGSF_BL"));
94  gbr_wGwoGSF_BL_ = (GBRForest *)(fin_->Get("gbr_wGwoGSF_BL"));
95  gbr_wGwGSF_BL_ = (GBRForest *)(fin_->Get("gbr_wGwGSF_BL"));
96  gbr_NoEleMatch_woGwoGSF_EC_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_woGwoGSF_EC"));
97  gbr_NoEleMatch_woGwGSF_EC_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_woGwGSF_EC"));
98  gbr_NoEleMatch_wGwoGSF_EC_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_wGwoGSF_EC"));
99  gbr_NoEleMatch_wGwGSF_EC_ = (GBRForest *)(fin_->Get("gbr_NoEleMatch_wGwGSF_EC"));
100  gbr_woGwoGSF_EC_ = (GBRForest *)(fin_->Get("gbr_woGwoGSF_EC"));
101  gbr_woGwGSF_EC_ = (GBRForest *)(fin_->Get("gbr_woGwGSF_EC"));
102  gbr_wGwoGSF_EC_ = (GBRForest *)(fin_->Get("gbr_wGwoGSF_EC"));
103  gbr_wGwGSF_EC_ = (GBRForest *)(fin_->Get("gbr_wGwGSF_EC"));
104 }
double AntiElectronIDMVA5GBR::minimum ( double  a,
double  b 
)
private

Definition at line 913 of file AntiElectronIDMVA5GBR.cc.

References a, Abs(), and b.

Referenced by dCrackEta(), and dCrackPhi().

914 {
915  if ( TMath::Abs(b) < TMath::Abs(a) ) return b;
916  else return a;
917 }
T Abs(T a)
Definition: MathUtil.h:49
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
double AntiElectronIDMVA5GBR::MVAValue ( Float_t  TauEtaAtEcalEntrance,
Float_t  TauPt,
Float_t  TauLeadChargedPFCandEtaAtEcalEntrance,
Float_t  TauLeadChargedPFCandPt,
Float_t  TaudCrackEta,
Float_t  TaudCrackPhi,
Float_t  TauEmFraction,
Float_t  TauSignalPFGammaCands,
Float_t  TauLeadPFChargedHadrHoP,
Float_t  TauLeadPFChargedHadrEoP,
Float_t  TauVisMass,
Float_t  TauHadrMva,
const std::vector< Float_t > &  GammasdEta,
const std::vector< Float_t > &  GammasdPhi,
const std::vector< Float_t > &  GammasPt,
Float_t  TauKFNumHits,
Float_t  TauGSFNumHits,
Float_t  TauGSFChi2,
Float_t  TauGSFTrackResol,
Float_t  TauGSFTracklnPt,
Float_t  TauGSFTrackEta,
Float_t  TauPhi,
Float_t  TauSignalPFChargedCands,
Float_t  TauHasGsf,
Float_t  ElecEta,
Float_t  ElecPhi,
Float_t  ElecPt,
Float_t  ElecEe,
Float_t  ElecEgamma,
Float_t  ElecPin,
Float_t  ElecPout,
Float_t  ElecFbrem,
Float_t  ElecChi2GSF,
Float_t  ElecGSFNumHits,
Float_t  ElecGSFTrackResol,
Float_t  ElecGSFTracklnPt,
Float_t  ElecGSFTrackEta 
)

Definition at line 106 of file AntiElectronIDMVA5GBR.cc.

References dPhi(), i, and Pi.

Referenced by MVAValue().

143 {
144  double sumPt = 0.;
145  double dEta = 0.;
146  double dEta2 = 0.;
147  double dPhi = 0.;
148  double dPhi2 = 0.;
149  double sumPt2 = 0.;
150  for ( unsigned int i = 0 ; i < GammasPt.size() ; ++i ) {
151  double pt_i = GammasPt[i];
152  double phi_i = GammasdPhi[i];
153  if ( GammasdPhi[i] > TMath::Pi() ) phi_i = GammasdPhi[i] - 2*TMath::Pi();
154  else if ( GammasdPhi[i] < -TMath::Pi() ) phi_i = GammasdPhi[i] + 2*TMath::Pi();
155  double eta_i = GammasdEta[i];
156  sumPt += pt_i;
157  sumPt2 += (pt_i*pt_i);
158  dEta += (pt_i*eta_i);
159  dEta2 += (pt_i*eta_i*eta_i);
160  dPhi += (pt_i*phi_i);
161  dPhi2 += (pt_i*phi_i*phi_i);
162  }
163 
164  Float_t TauGammaEnFrac = sumPt/TauPt;
165 
166  if ( sumPt > 0. ) {
167  dEta /= sumPt;
168  dPhi /= sumPt;
169  dEta2 /= sumPt;
170  dPhi2 /= sumPt;
171  }
172 
173  Float_t TauGammaEtaMom = TMath::Sqrt(dEta2)*TMath::Sqrt(TauGammaEnFrac)*TauPt;
174  Float_t TauGammaPhiMom = TMath::Sqrt(dPhi2)*TMath::Sqrt(TauGammaEnFrac)*TauPt;
175 
176  return MVAValue(TauEtaAtEcalEntrance,
177  TauPt,
178  TauLeadChargedPFCandEtaAtEcalEntrance,
179  TauLeadChargedPFCandPt,
180  TaudCrackEta,
181  TaudCrackPhi,
182  TauEmFraction,
183  TauSignalPFGammaCands,
184  TauLeadPFChargedHadrHoP,
185  TauLeadPFChargedHadrEoP,
186  TauVisMass,
187  TauHadrMva,
188  TauGammaEtaMom,
189  TauGammaPhiMom,
190  TauGammaEnFrac,
191  TauKFNumHits,
192  TauGSFNumHits,
193  TauGSFChi2,
194  TauGSFTrackResol,
195  TauGSFTracklnPt,
196  TauGSFTrackEta,
197  TauPhi,
198  TauSignalPFChargedCands,
199  TauHasGsf,
200  ElecEta,
201  ElecPhi,
202  ElecPt,
203  ElecEe,
204  ElecEgamma,
205  ElecPin,
206  ElecPout,
207  ElecFbrem,
208  ElecChi2GSF,
209  ElecGSFNumHits,
210  ElecGSFTrackResol,
211  ElecGSFTracklnPt,
212  ElecGSFTrackEta);
213 }
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 TauPt, Float_t TauLeadChargedPFCandEtaAtEcalEntrance, Float_t TauLeadChargedPFCandPt, Float_t TaudCrackEta, Float_t TaudCrackPhi, Float_t TauEmFraction, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauVisMass, Float_t TauHadrMva, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t TauKFNumHits, Float_t TauGSFNumHits, Float_t TauGSFChi2, Float_t TauGSFTrackResol, Float_t TauGSFTracklnPt, Float_t TauGSFTrackEta, Float_t TauPhi, Float_t TauSignalPFChargedCands, Float_t TauHasGsf, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecFbrem, Float_t ElecChi2GSF, Float_t ElecGSFNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
double AntiElectronIDMVA5GBR::MVAValue ( Float_t  TauEtaAtEcalEntrance,
Float_t  TauPt,
Float_t  TauLeadChargedPFCandEtaAtEcalEntrance,
Float_t  TauLeadChargedPFCandPt,
Float_t  TaudCrackEta,
Float_t  TaudCrackPhi,
Float_t  TauEmFraction,
Float_t  TauSignalPFGammaCands,
Float_t  TauLeadPFChargedHadrHoP,
Float_t  TauLeadPFChargedHadrEoP,
Float_t  TauVisMass,
Float_t  TauHadrMva,
Float_t  TauGammaEtaMom,
Float_t  TauGammaPhiMom,
Float_t  TauGammaEnFrac,
Float_t  TauKFNumHits,
Float_t  TauGSFNumHits,
Float_t  TauGSFChi2,
Float_t  TauGSFTrackResol,
Float_t  TauGSFTracklnPt,
Float_t  TauGSFTrackEta,
Float_t  TauPhi,
Float_t  TauSignalPFChargedCands,
Float_t  TauHasGsf,
Float_t  ElecEta,
Float_t  ElecPhi,
Float_t  ElecPt,
Float_t  ElecEe,
Float_t  ElecEgamma,
Float_t  ElecPin,
Float_t  ElecPout,
Float_t  ElecFbrem,
Float_t  ElecChi2GSF,
Float_t  ElecGSFNumHits,
Float_t  ElecGSFTrackResol,
Float_t  ElecGSFTracklnPt,
Float_t  ElecGSFTrackEta 
)

Definition at line 215 of file AntiElectronIDMVA5GBR.cc.

References Abs(), deltaR(), edm::hlt::Exception, gbr_NoEleMatch_wGwGSF_BL_, gbr_NoEleMatch_wGwGSF_EC_, gbr_NoEleMatch_wGwoGSF_BL_, gbr_NoEleMatch_wGwoGSF_EC_, gbr_NoEleMatch_woGwGSF_BL_, gbr_NoEleMatch_woGwGSF_EC_, gbr_NoEleMatch_woGwoGSF_BL_, gbr_NoEleMatch_woGwoGSF_EC_, gbr_wGwGSF_BL_, gbr_wGwGSF_EC_, gbr_wGwoGSF_BL_, gbr_wGwoGSF_EC_, gbr_woGwGSF_BL_, gbr_woGwGSF_EC_, gbr_woGwoGSF_BL_, gbr_woGwoGSF_EC_, GBRForest::GetClassifier(), isInitialized_, Max(), Min(), Var_NoEleMatch_wGwGSF_Barrel_, Var_NoEleMatch_wGwGSF_Endcap_, Var_NoEleMatch_wGwoGSF_Barrel_, Var_NoEleMatch_wGwoGSF_Endcap_, Var_NoEleMatch_woGwGSF_Barrel_, Var_NoEleMatch_woGwGSF_Endcap_, Var_NoEleMatch_woGwoGSF_Barrel_, Var_NoEleMatch_woGwoGSF_Endcap_, Var_wGwGSF_Barrel_, Var_wGwGSF_Endcap_, Var_wGwoGSF_Barrel_, Var_wGwoGSF_Endcap_, Var_woGwGSF_Barrel_, Var_woGwGSF_Endcap_, Var_woGwoGSF_Barrel_, and Var_woGwoGSF_Endcap_.

252 {
253 
254  if ( !isInitialized_ ) {
255  throw cms::Exception("ClassNotInitialized") << "Error: AntiElectronMVA not properly initialized.\n";
256  }
257 
258  Float_t TauEmFraction = TMath::Max(TauEmFract, float(0.));
259  Float_t TauNumHitsVariable = (TauGSFNumHits - TauKFNumHits)/(TauGSFNumHits + TauKFNumHits);
260  Float_t ElecEtotOverPin = (ElecEe + ElecEgamma)/ElecPin;
261  Float_t ElecEgammaOverPdif = ElecEgamma/(ElecPin - ElecPout);
262 
263  double mva = -99.;
264  if ( deltaR(TauEtaAtEcalEntrance, TauPhi, ElecEta, ElecPhi) > 0.3 && TauSignalPFGammaCands == 0 && TauHasGsf < 0.5) {
265  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ){
266  Var_NoEleMatch_woGwoGSF_Barrel_[0] = TauEtaAtEcalEntrance;
267  Var_NoEleMatch_woGwoGSF_Barrel_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
268  Var_NoEleMatch_woGwoGSF_Barrel_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
269  Var_NoEleMatch_woGwoGSF_Barrel_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
270  Var_NoEleMatch_woGwoGSF_Barrel_[4] = TauEmFraction;
271  Var_NoEleMatch_woGwoGSF_Barrel_[5] = TauLeadPFChargedHadrHoP;
272  Var_NoEleMatch_woGwoGSF_Barrel_[6] = TauLeadPFChargedHadrEoP;
273  Var_NoEleMatch_woGwoGSF_Barrel_[7] = TauVisMass;
274  Var_NoEleMatch_woGwoGSF_Barrel_[8] = TaudCrackEta;
275  Var_NoEleMatch_woGwoGSF_Barrel_[9] = TaudCrackPhi;
277  } else {
278  Var_NoEleMatch_woGwoGSF_Endcap_[0] = TauEtaAtEcalEntrance;
279  Var_NoEleMatch_woGwoGSF_Endcap_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
280  Var_NoEleMatch_woGwoGSF_Endcap_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
281  Var_NoEleMatch_woGwoGSF_Endcap_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
282  Var_NoEleMatch_woGwoGSF_Endcap_[4] = TauEmFraction;
283  Var_NoEleMatch_woGwoGSF_Endcap_[5] = TauLeadPFChargedHadrHoP;
284  Var_NoEleMatch_woGwoGSF_Endcap_[6] = TauLeadPFChargedHadrEoP;
285  Var_NoEleMatch_woGwoGSF_Endcap_[7] = TauVisMass;
286  Var_NoEleMatch_woGwoGSF_Endcap_[8] = TaudCrackEta;
288  }
289  } else if ( deltaR(TauEtaAtEcalEntrance, TauPhi, ElecEta, ElecPhi) > 0.3 && TauSignalPFGammaCands == 0 && TauHasGsf > 0.5) {
290  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ){
291  Var_NoEleMatch_woGwGSF_Barrel_[0] = TauEtaAtEcalEntrance;
292  Var_NoEleMatch_woGwGSF_Barrel_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
293  Var_NoEleMatch_woGwGSF_Barrel_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
294  Var_NoEleMatch_woGwGSF_Barrel_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
295  Var_NoEleMatch_woGwGSF_Barrel_[4] = TauEmFraction;
296  Var_NoEleMatch_woGwGSF_Barrel_[5] = TauLeadPFChargedHadrHoP;
297  Var_NoEleMatch_woGwGSF_Barrel_[6] = TauLeadPFChargedHadrEoP;
298  Var_NoEleMatch_woGwGSF_Barrel_[7] = TauVisMass;
299  Var_NoEleMatch_woGwGSF_Barrel_[8] = TauHadrMva;
300  Var_NoEleMatch_woGwGSF_Barrel_[9] = TauGSFChi2;
301  Var_NoEleMatch_woGwGSF_Barrel_[10] = TauNumHitsVariable;
302  Var_NoEleMatch_woGwGSF_Barrel_[11] = TauGSFTrackResol;
303  Var_NoEleMatch_woGwGSF_Barrel_[12] = TauGSFTracklnPt;
304  Var_NoEleMatch_woGwGSF_Barrel_[13] = TauGSFTrackEta;
305  Var_NoEleMatch_woGwGSF_Barrel_[14] = TaudCrackEta;
306  Var_NoEleMatch_woGwGSF_Barrel_[15] = TaudCrackPhi;
308  } else {
309  Var_NoEleMatch_woGwGSF_Endcap_[0] = TauEtaAtEcalEntrance;
310  Var_NoEleMatch_woGwGSF_Endcap_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
311  Var_NoEleMatch_woGwGSF_Endcap_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
312  Var_NoEleMatch_woGwGSF_Endcap_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
313  Var_NoEleMatch_woGwGSF_Endcap_[4] = TauEmFraction;
314  Var_NoEleMatch_woGwGSF_Endcap_[5] = TauLeadPFChargedHadrHoP;
315  Var_NoEleMatch_woGwGSF_Endcap_[6] = TauLeadPFChargedHadrEoP;
316  Var_NoEleMatch_woGwGSF_Endcap_[7] = TauVisMass;
317  Var_NoEleMatch_woGwGSF_Endcap_[8] = TauHadrMva;
318  Var_NoEleMatch_woGwGSF_Endcap_[9] = TauGSFChi2;
319  Var_NoEleMatch_woGwGSF_Endcap_[10] = TauNumHitsVariable;
320  Var_NoEleMatch_woGwGSF_Endcap_[11] = TauGSFTrackResol;
321  Var_NoEleMatch_woGwGSF_Endcap_[12] = TauGSFTracklnPt;
322  Var_NoEleMatch_woGwGSF_Endcap_[13] = TauGSFTrackEta;
323  Var_NoEleMatch_woGwGSF_Endcap_[14] = TaudCrackEta;
325  }
326  } else if ( deltaR(TauEtaAtEcalEntrance, TauPhi, ElecEta, ElecPhi) > 0.3 && TauSignalPFGammaCands > 0 && TauHasGsf < 0.5 ) {
327  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ){
328  Var_NoEleMatch_wGwoGSF_Barrel_[0] = TauEtaAtEcalEntrance;
329  Var_NoEleMatch_wGwoGSF_Barrel_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
330  Var_NoEleMatch_wGwoGSF_Barrel_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
331  Var_NoEleMatch_wGwoGSF_Barrel_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
332  Var_NoEleMatch_wGwoGSF_Barrel_[4] = TauEmFraction;
333  Var_NoEleMatch_wGwoGSF_Barrel_[5] = TauSignalPFGammaCands;
334  Var_NoEleMatch_wGwoGSF_Barrel_[6] = TauLeadPFChargedHadrHoP;
335  Var_NoEleMatch_wGwoGSF_Barrel_[7] = TauLeadPFChargedHadrEoP;
336  Var_NoEleMatch_wGwoGSF_Barrel_[8] = TauVisMass;
337  Var_NoEleMatch_wGwoGSF_Barrel_[9] = TauGammaEtaMom;
338  Var_NoEleMatch_wGwoGSF_Barrel_[10] = TauGammaPhiMom;
339  Var_NoEleMatch_wGwoGSF_Barrel_[11] = TauGammaEnFrac;
340  Var_NoEleMatch_wGwoGSF_Barrel_[12] = TaudCrackEta;
341  Var_NoEleMatch_wGwoGSF_Barrel_[13] = TaudCrackPhi;
343  } else {
344  Var_NoEleMatch_wGwoGSF_Endcap_[0] = TauEtaAtEcalEntrance;
345  Var_NoEleMatch_wGwoGSF_Endcap_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
346  Var_NoEleMatch_wGwoGSF_Endcap_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
347  Var_NoEleMatch_wGwoGSF_Endcap_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
348  Var_NoEleMatch_wGwoGSF_Endcap_[4] = TauEmFraction;
349  Var_NoEleMatch_wGwoGSF_Endcap_[5] = TauSignalPFGammaCands;
350  Var_NoEleMatch_wGwoGSF_Endcap_[6] = TauLeadPFChargedHadrHoP;
351  Var_NoEleMatch_wGwoGSF_Endcap_[7] = TauLeadPFChargedHadrEoP;
352  Var_NoEleMatch_wGwoGSF_Endcap_[8] = TauVisMass;
353  Var_NoEleMatch_wGwoGSF_Endcap_[9] = TauGammaEtaMom;
354  Var_NoEleMatch_wGwoGSF_Endcap_[10] = TauGammaPhiMom;
355  Var_NoEleMatch_wGwoGSF_Endcap_[11] = TauGammaEnFrac;
356  Var_NoEleMatch_wGwoGSF_Endcap_[12] = TaudCrackEta;
358  }
359  }
360  else if ( deltaR(TauEtaAtEcalEntrance, TauPhi, ElecEta, ElecPhi) > 0.3 && TauSignalPFGammaCands > 0 && TauHasGsf > 0.5 ) {
361  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ) {
362  Var_NoEleMatch_wGwGSF_Barrel_[0] = TauEtaAtEcalEntrance;
363  Var_NoEleMatch_wGwGSF_Barrel_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
364  Var_NoEleMatch_wGwGSF_Barrel_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
365  Var_NoEleMatch_wGwGSF_Barrel_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
366  Var_NoEleMatch_wGwGSF_Barrel_[4] = TauEmFraction;
367  Var_NoEleMatch_wGwGSF_Barrel_[5] = TauSignalPFGammaCands;
368  Var_NoEleMatch_wGwGSF_Barrel_[6] = TauLeadPFChargedHadrHoP;
369  Var_NoEleMatch_wGwGSF_Barrel_[7] = TauLeadPFChargedHadrEoP;
370  Var_NoEleMatch_wGwGSF_Barrel_[8] = TauVisMass;
371  Var_NoEleMatch_wGwGSF_Barrel_[9] = TauHadrMva;
372  Var_NoEleMatch_wGwGSF_Barrel_[10] = TauGammaEtaMom;
373  Var_NoEleMatch_wGwGSF_Barrel_[11] = TauGammaPhiMom;
374  Var_NoEleMatch_wGwGSF_Barrel_[12] = TauGammaEnFrac;
375  Var_NoEleMatch_wGwGSF_Barrel_[13] = TauGSFChi2;
376  Var_NoEleMatch_wGwGSF_Barrel_[14] = TauNumHitsVariable;
377  Var_NoEleMatch_wGwGSF_Barrel_[15] = TauGSFTrackResol;
378  Var_NoEleMatch_wGwGSF_Barrel_[16] = TauGSFTracklnPt;
379  Var_NoEleMatch_wGwGSF_Barrel_[17] = TauGSFTrackEta;
380  Var_NoEleMatch_wGwGSF_Barrel_[18] = TaudCrackEta;
381  Var_NoEleMatch_wGwGSF_Barrel_[19] = TaudCrackPhi;
383  } else {
384  Var_NoEleMatch_wGwGSF_Endcap_[0] = TauEtaAtEcalEntrance;
385  Var_NoEleMatch_wGwGSF_Endcap_[1] = TauLeadChargedPFCandEtaAtEcalEntrance;
386  Var_NoEleMatch_wGwGSF_Endcap_[2] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
387  Var_NoEleMatch_wGwGSF_Endcap_[3] = TMath::Log(TMath::Max(float(1.), TauPt));
388  Var_NoEleMatch_wGwGSF_Endcap_[4] = TauEmFraction;
389  Var_NoEleMatch_wGwGSF_Endcap_[5] = TauSignalPFGammaCands;
390  Var_NoEleMatch_wGwGSF_Endcap_[6] = TauLeadPFChargedHadrHoP;
391  Var_NoEleMatch_wGwGSF_Endcap_[7] = TauLeadPFChargedHadrEoP;
392  Var_NoEleMatch_wGwGSF_Endcap_[8] = TauVisMass;
393  Var_NoEleMatch_wGwGSF_Endcap_[9] = TauHadrMva;
394  Var_NoEleMatch_wGwGSF_Endcap_[10] = TauGammaEtaMom;
395  Var_NoEleMatch_wGwGSF_Endcap_[11] = TauGammaPhiMom;
396  Var_NoEleMatch_wGwGSF_Endcap_[12] = TauGammaEnFrac;
397  Var_NoEleMatch_wGwGSF_Endcap_[13] = TauGSFChi2;
398  Var_NoEleMatch_wGwGSF_Endcap_[14] = TauNumHitsVariable;
399  Var_NoEleMatch_wGwGSF_Endcap_[15] = TauGSFTrackResol;
400  Var_NoEleMatch_wGwGSF_Endcap_[16] = TauGSFTracklnPt;
401  Var_NoEleMatch_wGwGSF_Endcap_[17] = TauGSFTrackEta;
402  Var_NoEleMatch_wGwGSF_Endcap_[18] = TaudCrackEta;
404  }
405  } else if ( TauSignalPFGammaCands == 0 && TauHasGsf < 0.5 ) {
406  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ) {
407  Var_woGwoGSF_Barrel_[0] = ElecEtotOverPin;
408  Var_woGwoGSF_Barrel_[1] = ElecEgammaOverPdif;
409  Var_woGwoGSF_Barrel_[2] = ElecFbrem;
410  Var_woGwoGSF_Barrel_[3] = ElecChi2GSF;
411  Var_woGwoGSF_Barrel_[4] = ElecGSFNumHits;
412  Var_woGwoGSF_Barrel_[5] = ElecGSFTrackResol;
413  Var_woGwoGSF_Barrel_[6] = ElecGSFTracklnPt;
414  Var_woGwoGSF_Barrel_[7] = ElecGSFTrackEta;
415  Var_woGwoGSF_Barrel_[8] = TauEtaAtEcalEntrance;
416  Var_woGwoGSF_Barrel_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
417  Var_woGwoGSF_Barrel_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
418  Var_woGwoGSF_Barrel_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
419  Var_woGwoGSF_Barrel_[12] = TauEmFraction;
420  Var_woGwoGSF_Barrel_[13] = TauLeadPFChargedHadrHoP;
421  Var_woGwoGSF_Barrel_[14] = TauLeadPFChargedHadrEoP;
422  Var_woGwoGSF_Barrel_[15] = TauVisMass;
423  Var_woGwoGSF_Barrel_[16] = TaudCrackEta;
424  Var_woGwoGSF_Barrel_[17] = TaudCrackPhi;
426  } else {
427  Var_woGwoGSF_Endcap_[0] = ElecEtotOverPin;
428  Var_woGwoGSF_Endcap_[1] = ElecEgammaOverPdif;
429  Var_woGwoGSF_Endcap_[2] = ElecFbrem;
430  Var_woGwoGSF_Endcap_[3] = ElecChi2GSF;
431  Var_woGwoGSF_Endcap_[4] = ElecGSFNumHits;
432  Var_woGwoGSF_Endcap_[5] = ElecGSFTrackResol;
433  Var_woGwoGSF_Endcap_[6] = ElecGSFTracklnPt;
434  Var_woGwoGSF_Endcap_[7] = ElecGSFTrackEta;
435  Var_woGwoGSF_Endcap_[8] = TauEtaAtEcalEntrance;
436  Var_woGwoGSF_Endcap_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
437  Var_woGwoGSF_Endcap_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
438  Var_woGwoGSF_Endcap_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
439  Var_woGwoGSF_Endcap_[12] = TauEmFraction;
440  Var_woGwoGSF_Endcap_[13] = TauLeadPFChargedHadrHoP;
441  Var_woGwoGSF_Endcap_[14] = TauLeadPFChargedHadrEoP;
442  Var_woGwoGSF_Endcap_[15] = TauVisMass;
443  Var_woGwoGSF_Endcap_[16] = TaudCrackEta;
445  }
446  } else if ( TauSignalPFGammaCands == 0 && TauHasGsf > 0.5 ) {
447  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ) {
448  Var_woGwGSF_Barrel_[0] = ElecEtotOverPin;
449  Var_woGwGSF_Barrel_[1] = ElecEgammaOverPdif;
450  Var_woGwGSF_Barrel_[2] = ElecFbrem;
451  Var_woGwGSF_Barrel_[3] = ElecChi2GSF;
452  Var_woGwGSF_Barrel_[4] = ElecGSFNumHits;
453  Var_woGwGSF_Barrel_[5] = ElecGSFTrackResol;
454  Var_woGwGSF_Barrel_[6] = ElecGSFTracklnPt;
455  Var_woGwGSF_Barrel_[7] = ElecGSFTrackEta;
456  Var_woGwGSF_Barrel_[8] = TauEtaAtEcalEntrance;
457  Var_woGwGSF_Barrel_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
458  Var_woGwGSF_Barrel_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
459  Var_woGwGSF_Barrel_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
460  Var_woGwGSF_Barrel_[12] = TauEmFraction;
461  Var_woGwGSF_Barrel_[13] = TauLeadPFChargedHadrHoP;
462  Var_woGwGSF_Barrel_[14] = TauLeadPFChargedHadrEoP;
463  Var_woGwGSF_Barrel_[15] = TauVisMass;
464  Var_woGwGSF_Barrel_[16] = TauHadrMva;
465  Var_woGwGSF_Barrel_[17] = TauGSFChi2;
466  Var_woGwGSF_Barrel_[18] = TauNumHitsVariable;
467  Var_woGwGSF_Barrel_[19] = TauGSFTrackResol;
468  Var_woGwGSF_Barrel_[20] = TauGSFTracklnPt;
469  Var_woGwGSF_Barrel_[21] = TauGSFTrackEta;
470  Var_woGwGSF_Barrel_[22] = TaudCrackEta;
471  Var_woGwGSF_Barrel_[23] = TaudCrackPhi;
473  } else {
474  Var_woGwGSF_Endcap_[0] = ElecEtotOverPin;
475  Var_woGwGSF_Endcap_[1] = ElecEgammaOverPdif;
476  Var_woGwGSF_Endcap_[2] = ElecFbrem;
477  Var_woGwGSF_Endcap_[3] = ElecChi2GSF;
478  Var_woGwGSF_Endcap_[4] = ElecGSFNumHits;
479  Var_woGwGSF_Endcap_[5] = ElecGSFTrackResol;
480  Var_woGwGSF_Endcap_[6] = ElecGSFTracklnPt;
481  Var_woGwGSF_Endcap_[7] = ElecGSFTrackEta;
482  Var_woGwGSF_Endcap_[8] = TauEtaAtEcalEntrance;
483  Var_woGwGSF_Endcap_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
484  Var_woGwGSF_Endcap_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
485  Var_woGwGSF_Endcap_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
486  Var_woGwGSF_Endcap_[12] = TauEmFraction;
487  Var_woGwGSF_Endcap_[13] = TauLeadPFChargedHadrHoP;
488  Var_woGwGSF_Endcap_[14] = TauLeadPFChargedHadrEoP;
489  Var_woGwGSF_Endcap_[15] = TauVisMass;
490  Var_woGwGSF_Endcap_[16] = TauHadrMva;
491  Var_woGwGSF_Endcap_[17] = TauGSFChi2;
492  Var_woGwGSF_Endcap_[18] = TauNumHitsVariable;
493  Var_woGwGSF_Endcap_[19] = TauGSFTrackResol;
494  Var_woGwGSF_Endcap_[20] = TauGSFTracklnPt;
495  Var_woGwGSF_Endcap_[21] = TauGSFTrackEta;
496  Var_woGwGSF_Endcap_[22] = TaudCrackEta;
498  }
499  } else if ( TauSignalPFGammaCands > 0 && TauHasGsf < 0.5 ) {
500  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ) {
501  Var_wGwoGSF_Barrel_[0] = ElecEtotOverPin;
502  Var_wGwoGSF_Barrel_[1] = ElecEgammaOverPdif;
503  Var_wGwoGSF_Barrel_[2] = ElecFbrem;
504  Var_wGwoGSF_Barrel_[3] = ElecChi2GSF;
505  Var_wGwoGSF_Barrel_[4] = ElecGSFNumHits;
506  Var_wGwoGSF_Barrel_[5] = ElecGSFTrackResol;
507  Var_wGwoGSF_Barrel_[6] = ElecGSFTracklnPt;
508  Var_wGwoGSF_Barrel_[7] = ElecGSFTrackEta;
509  Var_wGwoGSF_Barrel_[8] = TauEtaAtEcalEntrance;
510  Var_wGwoGSF_Barrel_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
511  Var_wGwoGSF_Barrel_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
512  Var_wGwoGSF_Barrel_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
513  Var_wGwoGSF_Barrel_[12] = TauEmFraction;
514  Var_wGwoGSF_Barrel_[13] = TauSignalPFGammaCands;
515  Var_wGwoGSF_Barrel_[14] = TauLeadPFChargedHadrHoP;
516  Var_wGwoGSF_Barrel_[15] = TauLeadPFChargedHadrEoP;
517  Var_wGwoGSF_Barrel_[16] = TauVisMass;
518  Var_wGwoGSF_Barrel_[17] = TauGammaEtaMom;
519  Var_wGwoGSF_Barrel_[18] = TauGammaPhiMom;
520  Var_wGwoGSF_Barrel_[19] = TauGammaEnFrac;
521  Var_wGwoGSF_Barrel_[20] = TaudCrackEta;
522  Var_wGwoGSF_Barrel_[21] = TaudCrackPhi;
524  } else {
525  Var_wGwoGSF_Endcap_[0] = ElecEtotOverPin;
526  Var_wGwoGSF_Endcap_[1] = ElecEgammaOverPdif;
527  Var_wGwoGSF_Endcap_[2] = ElecFbrem;
528  Var_wGwoGSF_Endcap_[3] = ElecChi2GSF;
529  Var_wGwoGSF_Endcap_[4] = ElecGSFNumHits;
530  Var_wGwoGSF_Endcap_[5] = ElecGSFTrackResol;
531  Var_wGwoGSF_Endcap_[6] = ElecGSFTracklnPt;
532  Var_wGwoGSF_Endcap_[7] = ElecGSFTrackEta;
533  Var_wGwoGSF_Endcap_[8] = TauEtaAtEcalEntrance;
534  Var_wGwoGSF_Endcap_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
535  Var_wGwoGSF_Endcap_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
536  Var_wGwoGSF_Endcap_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
537  Var_wGwoGSF_Endcap_[12] = TauEmFraction;
538  Var_wGwoGSF_Endcap_[13] = TauSignalPFGammaCands;
539  Var_wGwoGSF_Endcap_[14] = TauLeadPFChargedHadrHoP;
540  Var_wGwoGSF_Endcap_[15] = TauLeadPFChargedHadrEoP;
541  Var_wGwoGSF_Endcap_[16] = TauVisMass;
542  Var_wGwoGSF_Endcap_[17] = TauGammaEtaMom;
543  Var_wGwoGSF_Endcap_[18] = TauGammaPhiMom;
544  Var_wGwoGSF_Endcap_[19] = TauGammaEnFrac;
545  Var_wGwoGSF_Endcap_[20] = TaudCrackEta;
547  }
548  } else if ( TauSignalPFGammaCands > 0 && TauHasGsf > 0.5 ) {
549  if ( TMath::Abs(TauEtaAtEcalEntrance) < 1.479 ) {
550  Var_wGwGSF_Barrel_[0] = ElecEtotOverPin;
551  Var_wGwGSF_Barrel_[1] = ElecEgammaOverPdif;
552  Var_wGwGSF_Barrel_[2] = ElecFbrem;
553  Var_wGwGSF_Barrel_[3] = ElecChi2GSF;
554  Var_wGwGSF_Barrel_[4] = ElecGSFNumHits;
555  Var_wGwGSF_Barrel_[5] = ElecGSFTrackResol;
556  Var_wGwGSF_Barrel_[6] = ElecGSFTracklnPt;
557  Var_wGwGSF_Barrel_[7] = ElecGSFTrackEta;
558  Var_wGwGSF_Barrel_[8] = TauEtaAtEcalEntrance;
559  Var_wGwGSF_Barrel_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
560  Var_wGwGSF_Barrel_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
561  Var_wGwGSF_Barrel_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
562  Var_wGwGSF_Barrel_[12] = TauEmFraction;
563  Var_wGwGSF_Barrel_[13] = TauSignalPFGammaCands;
564  Var_wGwGSF_Barrel_[14] = TauLeadPFChargedHadrHoP;
565  Var_wGwGSF_Barrel_[15] = TauLeadPFChargedHadrEoP;
566  Var_wGwGSF_Barrel_[16] = TauVisMass;
567  Var_wGwGSF_Barrel_[17] = TauHadrMva;
568  Var_wGwGSF_Barrel_[18] = TauGammaEtaMom;
569  Var_wGwGSF_Barrel_[19] = TauGammaPhiMom;
570  Var_wGwGSF_Barrel_[20] = TauGammaEnFrac;
571  Var_wGwGSF_Barrel_[21] = TauGSFChi2;
572  Var_wGwGSF_Barrel_[22] = TauNumHitsVariable;
573  Var_wGwGSF_Barrel_[23] = TauGSFTrackResol;
574  Var_wGwGSF_Barrel_[24] = TauGSFTracklnPt;
575  Var_wGwGSF_Barrel_[25] = TauGSFTrackEta;
576  Var_wGwGSF_Barrel_[26] = TaudCrackEta;
577  Var_wGwGSF_Barrel_[27] = TaudCrackPhi;
579  } else {
580  Var_wGwGSF_Endcap_[0] = ElecEtotOverPin;
581  Var_wGwGSF_Endcap_[1] = ElecEgammaOverPdif;
582  Var_wGwGSF_Endcap_[2] = ElecFbrem;
583  Var_wGwGSF_Endcap_[3] = ElecChi2GSF;
584  Var_wGwGSF_Endcap_[4] = ElecGSFNumHits;
585  Var_wGwGSF_Endcap_[5] = ElecGSFTrackResol;
586  Var_wGwGSF_Endcap_[6] = ElecGSFTracklnPt;
587  Var_wGwGSF_Endcap_[7] = ElecGSFTrackEta;
588  Var_wGwGSF_Endcap_[8] = TauEtaAtEcalEntrance;
589  Var_wGwGSF_Endcap_[9] = TauLeadChargedPFCandEtaAtEcalEntrance;
590  Var_wGwGSF_Endcap_[10] = TMath::Min(float(2.), TauLeadChargedPFCandPt/TMath::Max(float(1.), TauPt));
591  Var_wGwGSF_Endcap_[11] = TMath::Log(TMath::Max(float(1.), TauPt));
592  Var_wGwGSF_Endcap_[12] = TauEmFraction;
593  Var_wGwGSF_Endcap_[13] = TauSignalPFGammaCands;
594  Var_wGwGSF_Endcap_[14] = TauLeadPFChargedHadrHoP;
595  Var_wGwGSF_Endcap_[15] = TauLeadPFChargedHadrEoP;
596  Var_wGwGSF_Endcap_[16] = TauVisMass;
597  Var_wGwGSF_Endcap_[17] = TauHadrMva;
598  Var_wGwGSF_Endcap_[18] = TauGammaEtaMom;
599  Var_wGwGSF_Endcap_[19] = TauGammaPhiMom;
600  Var_wGwGSF_Endcap_[20] = TauGammaEnFrac;
601  Var_wGwGSF_Endcap_[21] = TauGSFChi2;
602  Var_wGwGSF_Endcap_[22] = TauNumHitsVariable;
603  Var_wGwGSF_Endcap_[23] = TauGSFTrackResol;
604  Var_wGwGSF_Endcap_[24] = TauGSFTracklnPt;
605  Var_wGwGSF_Endcap_[25] = TauGSFTrackEta;
606  Var_wGwGSF_Endcap_[26] = TaudCrackEta;
608  }
609  }
610  return mva;
611 }
T Min(T a, T b)
Definition: MathUtil.h:39
T Abs(T a)
Definition: MathUtil.h:49
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
T Max(T a, T b)
Definition: MathUtil.h:44
double GetClassifier(const float *vector) const
Definition: GBRForest.h:64
double AntiElectronIDMVA5GBR::MVAValue ( const reco::PFTau thePFTau,
const reco::GsfElectron theGsfEle 
)

Definition at line 613 of file AntiElectronIDMVA5GBR.cc.

References dCrackEta(), dCrackPhi(), reco::PFTau::electronPreIDOutput(), reco::PFTau::emFraction(), reco::TrackBase::eta(), reco::LeafCandidate::eta(), reco::GsfElectron::fbrem(), reco::GsfElectron::gsfTrack(), i, edm::Ref< C, T, F >::isAvailable(), edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), reco::PFTau::leadPFChargedHadrCand(), fff_deleter::log, reco::LeafCandidate::mass(), Max(), MVAValue(), reco::GsfElectron::parentSuperCluster(), reco::LeafCandidate::phi(), reco::TrackBase::pt(), reco::LeafCandidate::pt(), reco::PFTau::signalPFCands(), reco::PFTau::signalPFChargedHadrCands(), reco::PFTau::signalPFGammaCands(), reco::GsfElectron::trackMomentumAtVtx(), and reco::GsfElectron::trackMomentumOut().

616 {
617  Float_t TauEtaAtEcalEntrance = -99.;
618  float sumEtaTimesEnergy = 0.;
619  float sumEnergy = 0.;
620  const std::vector<reco::PFCandidatePtr>& signalPFCands = thePFTau.signalPFCands();
621  for ( std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
622  pfCandidate != signalPFCands.end(); ++pfCandidate ) {
623  sumEtaTimesEnergy += (*pfCandidate)->positionAtECALEntrance().eta()*(*pfCandidate)->energy();
624  sumEnergy += (*pfCandidate)->energy();
625  }
626  if ( sumEnergy > 0. ) {
627  TauEtaAtEcalEntrance = sumEtaTimesEnergy/sumEnergy;
628  }
629 
630  float TauLeadChargedPFCandEtaAtEcalEntrance = -99.;
631  float TauLeadChargedPFCandPt = -99.;
632  for ( std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
633  pfCandidate != signalPFCands.end(); ++pfCandidate ) {
634  const reco::Track* track = 0;
635  if ( (*pfCandidate)->trackRef().isNonnull() ) track = (*pfCandidate)->trackRef().get();
636  else if ( (*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->innerTrack().isNonnull() ) track = (*pfCandidate)->muonRef()->innerTrack().get();
637  else if ( (*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->globalTrack().isNonnull() ) track = (*pfCandidate)->muonRef()->globalTrack().get();
638  else if ( (*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->outerTrack().isNonnull() ) track = (*pfCandidate)->muonRef()->outerTrack().get();
639  else if ( (*pfCandidate)->gsfTrackRef().isNonnull() ) track = (*pfCandidate)->gsfTrackRef().get();
640  if ( track ) {
641  if ( track->pt() > TauLeadChargedPFCandPt ) {
642  TauLeadChargedPFCandEtaAtEcalEntrance = (*pfCandidate)->positionAtECALEntrance().eta();
643  TauLeadChargedPFCandPt = track->pt();
644  }
645  }
646  }
647 
648  Float_t TauPt = thePFTau.pt();
649  Float_t TauEmFraction = TMath::Max(thePFTau.emFraction(), (Float_t)0.);
650  Float_t TauSignalPFGammaCands = thePFTau.signalPFGammaCands().size();
651  Float_t TauLeadPFChargedHadrHoP = 0.;
652  Float_t TauLeadPFChargedHadrEoP = 0.;
653  if ( thePFTau.leadPFChargedHadrCand()->p() > 0. ) {
654  TauLeadPFChargedHadrHoP = thePFTau.leadPFChargedHadrCand()->hcalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
655  TauLeadPFChargedHadrEoP = thePFTau.leadPFChargedHadrCand()->ecalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
656  }
657  Float_t TauVisMass = thePFTau.mass();
658  Float_t TauHadrMva = TMath::Max(thePFTau.electronPreIDOutput(), float(-1.0));
659  std::vector<Float_t> GammasdEta;
660  std::vector<Float_t> GammasdPhi;
661  std::vector<Float_t> GammasPt;
662  for ( unsigned i = 0 ; i < thePFTau.signalPFGammaCands().size(); ++i ) {
663  reco::PFCandidatePtr gamma = thePFTau.signalPFGammaCands().at(i);
664  if ( thePFTau.leadPFChargedHadrCand().isNonnull() ) {
665  GammasdEta.push_back(gamma->eta() - thePFTau.leadPFChargedHadrCand()->eta());
666  GammasdPhi.push_back(gamma->phi() - thePFTau.leadPFChargedHadrCand()->phi());
667  } else {
668  GammasdEta.push_back(gamma->eta() - thePFTau.eta());
669  GammasdPhi.push_back(gamma->phi() - thePFTau.phi());
670  }
671  GammasPt.push_back(gamma->pt());
672  }
673  Float_t TauKFNumHits = -99.;
674  if ( (thePFTau.leadPFChargedHadrCand()->trackRef()).isNonnull() ) {
675  TauKFNumHits = thePFTau.leadPFChargedHadrCand()->trackRef()->numberOfValidHits();
676  }
677  Float_t TauGSFNumHits = -99.;
678  Float_t TauGSFChi2 = -99.;
679  Float_t TauGSFTrackResol = -99.;
680  Float_t TauGSFTracklnPt = -99.;
681  Float_t TauGSFTrackEta = -99.;
682  if ( (thePFTau.leadPFChargedHadrCand()->gsfTrackRef()).isNonnull() ) {
683  TauGSFChi2 = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->normalizedChi2();
684  TauGSFNumHits = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->numberOfValidHits();
685  if ( thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->pt() > 0. ) {
686  TauGSFTrackResol = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->ptError()/thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->pt();
687  TauGSFTracklnPt = log(thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->pt())*TMath::Ln10();
688  }
689  TauGSFTrackEta = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->eta();
690  }
691  Float_t TauPhi = thePFTau.phi();
692  float sumPhiTimesEnergy = 0.;
693  float sumEnergyPhi = 0.;
694  for ( std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
695  pfCandidate != signalPFCands.end(); ++pfCandidate ) {
696  sumPhiTimesEnergy += (*pfCandidate)->positionAtECALEntrance().phi()*(*pfCandidate)->energy();
697  sumEnergyPhi += (*pfCandidate)->energy();
698  }
699  if ( sumEnergyPhi > 0. ) {
700  TauPhi = sumPhiTimesEnergy/sumEnergyPhi;
701  }
702  Float_t TaudCrackPhi = dCrackPhi(TauPhi, TauEtaAtEcalEntrance);
703  Float_t TaudCrackEta = dCrackEta(TauEtaAtEcalEntrance);
704  Float_t TauSignalPFChargedCands = thePFTau.signalPFChargedHadrCands().size();
705  Float_t TauHasGsf = thePFTau.leadPFChargedHadrCand()->gsfTrackRef().isNonnull();
706 
707  Float_t ElecEta = theGsfEle.eta();
708  Float_t ElecPhi = theGsfEle.phi();
709  Float_t ElecPt = theGsfEle.pt();
710  //Variables related to the electron Cluster
711  Float_t ElecEe = 0.;
712  Float_t ElecEgamma = 0.;
713  reco::SuperClusterRef pfSuperCluster = theGsfEle.parentSuperCluster();
714  if ( pfSuperCluster.isNonnull() && pfSuperCluster.isAvailable() ) {
715  for ( reco::CaloCluster_iterator pfCluster = pfSuperCluster->clustersBegin();
716  pfCluster != pfSuperCluster->clustersEnd(); ++pfCluster ) {
717  double pfClusterEn = (*pfCluster)->energy();
718  if ( pfCluster == pfSuperCluster->clustersBegin() ) ElecEe += pfClusterEn;
719  else ElecEgamma += pfClusterEn;
720  }
721  }
722  Float_t ElecPin = TMath::Sqrt(theGsfEle.trackMomentumAtVtx().Mag2());
723  Float_t ElecPout = TMath::Sqrt(theGsfEle.trackMomentumOut().Mag2());
724  Float_t ElecFbrem = theGsfEle.fbrem();
725  //Variables related to the GsfTrack
726  Float_t ElecChi2GSF = -99.;
727  Float_t ElecGSFNumHits = -99.;
728  Float_t ElecGSFTrackResol = -99.;
729  Float_t ElecGSFTracklnPt = -99.;
730  Float_t ElecGSFTrackEta = -99.;
731  if ( theGsfEle.gsfTrack().isNonnull() ) {
732  ElecChi2GSF = (theGsfEle).gsfTrack()->normalizedChi2();
733  ElecGSFNumHits = (theGsfEle).gsfTrack()->numberOfValidHits();
734  if ( theGsfEle.gsfTrack()->pt() > 0. ) {
735  ElecGSFTrackResol = theGsfEle.gsfTrack()->ptError()/theGsfEle.gsfTrack()->pt();
736  ElecGSFTracklnPt = log(theGsfEle.gsfTrack()->pt())*TMath::Ln10();
737  }
738  ElecGSFTrackEta = theGsfEle.gsfTrack()->eta();
739  }
740 
741  return MVAValue(TauEtaAtEcalEntrance,
742  TauPt,
743  TauLeadChargedPFCandEtaAtEcalEntrance,
744  TauLeadChargedPFCandPt,
745  TaudCrackEta,
746  TaudCrackPhi,
747  TauEmFraction,
748  TauSignalPFGammaCands,
749  TauLeadPFChargedHadrHoP,
750  TauLeadPFChargedHadrEoP,
751  TauVisMass,
752  TauHadrMva,
753  GammasdEta,
754  GammasdPhi,
755  GammasPt,
756  TauKFNumHits,
757  TauGSFNumHits,
758  TauGSFChi2,
759  TauGSFTrackResol,
760  TauGSFTracklnPt,
761  TauGSFTrackEta,
762  TauPhi,
763  TauSignalPFChargedCands,
764  TauHasGsf,
765  ElecEta,
766  ElecPhi,
767  ElecPt,
768  ElecEe,
769  ElecEgamma,
770  ElecPin,
771  ElecPout,
772  ElecFbrem,
773  ElecChi2GSF,
774  ElecGSFNumHits,
775  ElecGSFTrackResol,
776  ElecGSFTracklnPt,
777  ElecGSFTrackEta);
778 }
int i
Definition: DBlmapReader.cc:9
SuperClusterRef parentSuperCluster() const
Definition: GsfElectron.h:188
const PFCandidatePtr & leadPFChargedHadrCand() const
Definition: PFTau.cc:61
virtual float pt() const
transverse momentum
virtual float phi() const
momentum azimuthal angle
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:286
const std::vector< reco::PFCandidatePtr > & signalPFGammaCands() const
Gamma candidates in signal region.
Definition: PFTau.cc:78
float emFraction() const
Definition: PFTau.cc:203
float fbrem() const
Definition: GsfElectron.h:684
bool isAvailable() const
Definition: Ref.h:276
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
PFCandidates in signal region.
Definition: PFTau.cc:72
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
virtual float eta() const
momentum pseudorapidity
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:288
double pt() const
track transverse momentum
Definition: TrackBase.h:129
T Max(T a, T b)
Definition: MathUtil.h:44
double dCrackPhi(double phi, double eta)
virtual float mass() const
mass
double MVAValue(Float_t TauEtaAtEcalEntrance, Float_t TauPt, Float_t TauLeadChargedPFCandEtaAtEcalEntrance, Float_t TauLeadChargedPFCandPt, Float_t TaudCrackEta, Float_t TaudCrackPhi, Float_t TauEmFraction, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauVisMass, Float_t TauHadrMva, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t TauKFNumHits, Float_t TauGSFNumHits, Float_t TauGSFChi2, Float_t TauGSFTrackResol, Float_t TauGSFTracklnPt, Float_t TauGSFTrackEta, Float_t TauPhi, Float_t TauSignalPFChargedCands, Float_t TauHasGsf, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecFbrem, Float_t ElecChi2GSF, Float_t ElecGSFNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
float electronPreIDOutput() const
Definition: PFTau.cc:210
double dCrackEta(double eta)
const std::vector< reco::PFCandidatePtr > & signalPFChargedHadrCands() const
Charged hadrons in signal region.
Definition: PFTau.cc:74
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
double AntiElectronIDMVA5GBR::MVAValue ( const reco::PFTau thePFTau)

Definition at line 780 of file AntiElectronIDMVA5GBR.cc.

References dCrackEta(), dCrackPhi(), reco::PFTau::electronPreIDOutput(), reco::PFTau::emFraction(), reco::TrackBase::eta(), reco::LeafCandidate::eta(), i, edm::Ptr< T >::isNonnull(), reco::PFTau::leadPFChargedHadrCand(), fff_deleter::log, reco::LeafCandidate::mass(), Max(), MVAValue(), reco::LeafCandidate::phi(), reco::TrackBase::pt(), reco::LeafCandidate::pt(), reco::PFTau::signalPFCands(), reco::PFTau::signalPFChargedHadrCands(), and reco::PFTau::signalPFGammaCands().

781 {
782  Float_t TauEtaAtEcalEntrance = -99.;
783  float sumEtaTimesEnergy = 0.;
784  float sumEnergy = 0.;
785  const std::vector<reco::PFCandidatePtr>& signalPFCands = thePFTau.signalPFCands();
786  for ( std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
787  pfCandidate != signalPFCands.end(); ++pfCandidate ) {
788  sumEtaTimesEnergy += (*pfCandidate)->positionAtECALEntrance().eta()*(*pfCandidate)->energy();
789  sumEnergy += (*pfCandidate)->energy();
790  }
791  if ( sumEnergy > 0. ) {
792  TauEtaAtEcalEntrance = sumEtaTimesEnergy/sumEnergy;
793  }
794 
795  float TauLeadChargedPFCandEtaAtEcalEntrance = -99.;
796  float TauLeadChargedPFCandPt = -99.;
797  for ( std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
798  pfCandidate != signalPFCands.end(); ++pfCandidate ) {
799  const reco::Track* track = 0;
800  if ( (*pfCandidate)->trackRef().isNonnull() ) track = (*pfCandidate)->trackRef().get();
801  else if ( (*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->innerTrack().isNonnull() ) track = (*pfCandidate)->muonRef()->innerTrack().get();
802  else if ( (*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->globalTrack().isNonnull() ) track = (*pfCandidate)->muonRef()->globalTrack().get();
803  else if ( (*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->outerTrack().isNonnull() ) track = (*pfCandidate)->muonRef()->outerTrack().get();
804  else if ( (*pfCandidate)->gsfTrackRef().isNonnull() ) track = (*pfCandidate)->gsfTrackRef().get();
805  if ( track ) {
806  if ( track->pt() > TauLeadChargedPFCandPt ) {
807  TauLeadChargedPFCandEtaAtEcalEntrance = (*pfCandidate)->positionAtECALEntrance().eta();
808  TauLeadChargedPFCandPt = track->pt();
809  }
810  }
811  }
812 
813  Float_t TauPt = thePFTau.pt();
814  Float_t TauEmFraction = TMath::Max(thePFTau.emFraction(), (Float_t)0.);
815  Float_t TauSignalPFGammaCands = thePFTau.signalPFGammaCands().size();
816  Float_t TauLeadPFChargedHadrHoP = 0.;
817  Float_t TauLeadPFChargedHadrEoP = 0.;
818  if ( thePFTau.leadPFChargedHadrCand()->p() > 0. ) {
819  TauLeadPFChargedHadrHoP = thePFTau.leadPFChargedHadrCand()->hcalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
820  TauLeadPFChargedHadrEoP = thePFTau.leadPFChargedHadrCand()->ecalEnergy()/thePFTau.leadPFChargedHadrCand()->p();
821  }
822  Float_t TauVisMass = thePFTau.mass();
823  Float_t TauHadrMva = TMath::Max(thePFTau.electronPreIDOutput(),float(-1.0));
824  std::vector<Float_t> GammasdEta;
825  std::vector<Float_t> GammasdPhi;
826  std::vector<Float_t> GammasPt;
827  for ( unsigned i = 0 ; i < thePFTau.signalPFGammaCands().size(); ++i ) {
828  reco::PFCandidatePtr gamma = thePFTau.signalPFGammaCands().at(i);
829  if ( thePFTau.leadPFChargedHadrCand().isNonnull() ) {
830  GammasdEta.push_back(gamma->eta() - thePFTau.leadPFChargedHadrCand()->eta());
831  GammasdPhi.push_back(gamma->phi() - thePFTau.leadPFChargedHadrCand()->phi());
832  } else {
833  GammasdEta.push_back(gamma->eta() - thePFTau.eta());
834  GammasdPhi.push_back(gamma->phi() - thePFTau.phi());
835  }
836  GammasPt.push_back(gamma->pt());
837  }
838  Float_t TauKFNumHits = -99.;
839  if ( (thePFTau.leadPFChargedHadrCand()->trackRef()).isNonnull() ) {
840  TauKFNumHits = thePFTau.leadPFChargedHadrCand()->trackRef()->numberOfValidHits();
841  }
842  Float_t TauGSFNumHits = -99.;
843  Float_t TauGSFChi2 = -99.;
844  Float_t TauGSFTrackResol = -99.;
845  Float_t TauGSFTracklnPt = -99.;
846  Float_t TauGSFTrackEta = -99.;
847  if ( (thePFTau.leadPFChargedHadrCand()->gsfTrackRef()).isNonnull() ) {
848  TauGSFChi2 = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->normalizedChi2();
849  TauGSFNumHits = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->numberOfValidHits();
850  if ( thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->pt() > 0. ) {
851  TauGSFTrackResol = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->ptError()/thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->pt();
852  TauGSFTracklnPt = log(thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->pt())*TMath::Ln10();
853  }
854  TauGSFTrackEta = thePFTau.leadPFChargedHadrCand()->gsfTrackRef()->eta();
855  }
856  Float_t TauPhi = thePFTau.phi();
857  float sumPhiTimesEnergy = 0.;
858  float sumEnergyPhi = 0.;
859  for ( std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
860  pfCandidate != signalPFCands.end(); ++pfCandidate ) {
861  sumPhiTimesEnergy += (*pfCandidate)->positionAtECALEntrance().phi()*(*pfCandidate)->energy();
862  sumEnergyPhi += (*pfCandidate)->energy();
863  }
864  if ( sumEnergyPhi > 0. ) {
865  TauPhi = sumPhiTimesEnergy/sumEnergyPhi;
866  }
867  Float_t TaudCrackPhi = dCrackPhi(TauPhi,TauEtaAtEcalEntrance) ;
868  Float_t TaudCrackEta = dCrackEta(TauEtaAtEcalEntrance) ;
869  Float_t TauSignalPFChargedCands = thePFTau.signalPFChargedHadrCands().size();
870  Float_t TauHasGsf = thePFTau.leadPFChargedHadrCand()->gsfTrackRef().isNonnull();
871 
872  Float_t dummyElecEta = 9.9;
873 
874  return MVAValue(TauEtaAtEcalEntrance,
875  TauPt,
876  TauLeadChargedPFCandEtaAtEcalEntrance,
877  TauLeadChargedPFCandPt,
878  TaudCrackEta,
879  TaudCrackPhi,
880  TauEmFraction,
881  TauSignalPFGammaCands,
882  TauLeadPFChargedHadrHoP,
883  TauLeadPFChargedHadrEoP,
884  TauVisMass,
885  TauHadrMva,
886  GammasdEta,
887  GammasdPhi,
888  GammasPt,
889  TauKFNumHits,
890  TauGSFNumHits,
891  TauGSFChi2,
892  TauGSFTrackResol,
893  TauGSFTracklnPt,
894  TauGSFTrackEta,
895  TauPhi,
896  TauSignalPFChargedCands,
897  TauHasGsf,
898  dummyElecEta,
899  0.,
900  0.,
901  0.,
902  0.,
903  0.,
904  0.,
905  0.,
906  0.,
907  0.,
908  0.,
909  0.,
910  0.);
911 }
int i
Definition: DBlmapReader.cc:9
const PFCandidatePtr & leadPFChargedHadrCand() const
Definition: PFTau.cc:61
virtual float pt() const
transverse momentum
virtual float phi() const
momentum azimuthal angle
const std::vector< reco::PFCandidatePtr > & signalPFGammaCands() const
Gamma candidates in signal region.
Definition: PFTau.cc:78
float emFraction() const
Definition: PFTau.cc:203
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
PFCandidates in signal region.
Definition: PFTau.cc:72
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
virtual float eta() const
momentum pseudorapidity
double pt() const
track transverse momentum
Definition: TrackBase.h:129
T Max(T a, T b)
Definition: MathUtil.h:44
double dCrackPhi(double phi, double eta)
virtual float mass() const
mass
double MVAValue(Float_t TauEtaAtEcalEntrance, Float_t TauPt, Float_t TauLeadChargedPFCandEtaAtEcalEntrance, Float_t TauLeadChargedPFCandPt, Float_t TaudCrackEta, Float_t TaudCrackPhi, Float_t TauEmFraction, Float_t TauSignalPFGammaCands, Float_t TauLeadPFChargedHadrHoP, Float_t TauLeadPFChargedHadrEoP, Float_t TauVisMass, Float_t TauHadrMva, const std::vector< Float_t > &GammasdEta, const std::vector< Float_t > &GammasdPhi, const std::vector< Float_t > &GammasPt, Float_t TauKFNumHits, Float_t TauGSFNumHits, Float_t TauGSFChi2, Float_t TauGSFTrackResol, Float_t TauGSFTracklnPt, Float_t TauGSFTrackEta, Float_t TauPhi, Float_t TauSignalPFChargedCands, Float_t TauHasGsf, Float_t ElecEta, Float_t ElecPhi, Float_t ElecPt, Float_t ElecEe, Float_t ElecEgamma, Float_t ElecPin, Float_t ElecPout, Float_t ElecFbrem, Float_t ElecChi2GSF, Float_t ElecGSFNumHits, Float_t ElecGSFTrackResol, Float_t ElecGSFTracklnPt, Float_t ElecGSFTrackEta)
float electronPreIDOutput() const
Definition: PFTau.cc:210
double dCrackEta(double eta)
const std::vector< reco::PFCandidatePtr > & signalPFChargedHadrCands() const
Charged hadrons in signal region.
Definition: PFTau.cc:74

Member Data Documentation

TFile* AntiElectronIDMVA5GBR::fin_
private

Definition at line 124 of file AntiElectronIDMVA5GBR.h.

Referenced by Initialize_from_file(), and ~AntiElectronIDMVA5GBR().

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_wGwGSF_BL_
private

Definition at line 145 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_wGwGSF_EC_
private

Definition at line 153 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_wGwoGSF_BL_
private

Definition at line 144 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_wGwoGSF_EC_
private

Definition at line 152 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_woGwGSF_BL_
private

Definition at line 143 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_woGwGSF_EC_
private

Definition at line 151 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_woGwoGSF_BL_
private

Definition at line 142 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_NoEleMatch_woGwoGSF_EC_
private

Definition at line 150 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_wGwGSF_BL_
private

Definition at line 149 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_wGwGSF_EC_
private

Definition at line 157 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_wGwoGSF_BL_
private

Definition at line 148 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_wGwoGSF_EC_
private

Definition at line 156 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_woGwGSF_BL_
private

Definition at line 147 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_woGwGSF_EC_
private

Definition at line 155 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_woGwoGSF_BL_
private

Definition at line 146 of file AntiElectronIDMVA5GBR.h.

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

GBRForest* AntiElectronIDMVA5GBR::gbr_woGwoGSF_EC_
private

Definition at line 154 of file AntiElectronIDMVA5GBR.h.

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

Bool_t AntiElectronIDMVA5GBR::isInitialized_
private

Definition at line 122 of file AntiElectronIDMVA5GBR.h.

Referenced by Initialize_from_file(), and MVAValue().

std::string AntiElectronIDMVA5GBR::methodName_
private

Definition at line 123 of file AntiElectronIDMVA5GBR.h.

Referenced by Initialize_from_file().

Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_wGwGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_wGwGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_wGwoGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_wGwoGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_woGwGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_woGwGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_woGwoGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_NoEleMatch_woGwoGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_wGwGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_wGwGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_wGwoGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_wGwoGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_woGwGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_woGwGSF_Endcap_
private
Float_t* AntiElectronIDMVA5GBR::Var_woGwoGSF_Barrel_
private
Float_t* AntiElectronIDMVA5GBR::Var_woGwoGSF_Endcap_
private
int AntiElectronIDMVA5GBR::verbosity_
private

Definition at line 159 of file AntiElectronIDMVA5GBR.h.

Referenced by AntiElectronIDMVA5GBR().