CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
AntiElectronIDMVA6< TauType, ElectronType > Class Template Reference

#include <AntiElectronIDMVA6.h>

Public Types

typedef std::vector< ElectronType > ElectronCollection
 
typedef edm::Ref< ElectronCollectionElectronRef
 

Public Member Functions

 AntiElectronIDMVA6 (const edm::ParameterSet &, edm::ConsumesCollector &&)
 
void beginEvent (const edm::Event &, const edm::EventSetup &)
 
antiElecIDMVA6_blocks::ElecVars getElecVars (const ElectronRef &theEleRef)
 
void getElecVarsHGCalTypeSpecific (const reco::GsfElectronRef &theEleRef, antiElecIDMVA6_blocks::ElecVars &elecVars)
 
void getElecVarsHGCalTypeSpecific (const pat::ElectronRef &theEleRef, antiElecIDMVA6_blocks::ElecVars &elecVars)
 
antiElecIDMVA6_blocks::TauGammaVecs getTauGammaVecs (const TauType &theTau)
 
antiElecIDMVA6_blocks::TauVars getTauVars (const TauType &theTau)
 
antiElecIDMVA6_blocks::TauVars getTauVarsTypeSpecific (const reco::PFTau &theTau)
 
antiElecIDMVA6_blocks::TauVars getTauVarsTypeSpecific (const pat::Tau &theTau)
 
double mvaValue (const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaVecs &tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars &elecVars)
 
double mvaValue (const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaMoms &tauGammaMoms, const antiElecIDMVA6_blocks::ElecVars &elecVars)
 
double mvaValue (const TauType &theTau, const ElectronRef &theEleRef)
 
double mvaValue (const TauType &theTau)
 
double mvaValuePhase2 (const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaMoms &tauGammaMoms, const antiElecIDMVA6_blocks::ElecVars &elecVars)
 
 ~AntiElectronIDMVA6 ()
 

Private Member Functions

double dCrackEta (double eta)
 
double dCrackPhi (double phi, double eta)
 
bool energyWeightedEtaAndPhiAtECal (const pat::Tau &theTau, float &eta, float &phi)
 
double minimum (double a, double b)
 

Private Attributes

std::map< std::string, edm::Handle< edm::ValueMap< float > > > electronIds_
 
std::map< std::string, edm::EDGetTokenT< edm::ValueMap< float > > > electronIds_tokens_
 
edm::FileInPath inputFileName_
 
std::vector< TFile * > inputFilesToDelete_
 
bool isInitialized_
 
const bool isPhase2_
 
bool loadMVAfromDB_
 
const GBRForestmva_NoEleMatch_wGwoGSF_BL_
 
const GBRForestmva_NoEleMatch_wGwoGSF_EC_
 
const GBRForestmva_NoEleMatch_wGwoGSF_VFEC_
 
const GBRForestmva_NoEleMatch_woGwoGSF_BL_
 
const GBRForestmva_NoEleMatch_woGwoGSF_EC_
 
const GBRForestmva_NoEleMatch_woGwoGSF_VFEC_
 
const GBRForestmva_wGwGSF_BL_
 
const GBRForestmva_wGwGSF_EC_
 
const GBRForestmva_wGwGSF_VFEC_
 
const GBRForestmva_woGwGSF_BL_
 
const GBRForestmva_woGwGSF_EC_
 
const GBRForestmva_woGwGSF_VFEC_
 
std::string mvaName_NoEleMatch_wGwoGSF_BL_
 
std::string mvaName_NoEleMatch_wGwoGSF_EC_
 
std::string mvaName_NoEleMatch_wGwoGSF_VFEC_
 
std::string mvaName_NoEleMatch_woGwoGSF_BL_
 
std::string mvaName_NoEleMatch_woGwoGSF_EC_
 
std::string mvaName_NoEleMatch_woGwoGSF_VFEC_
 
std::string mvaName_wGwGSF_BL_
 
std::string mvaName_wGwGSF_EC_
 
std::string mvaName_wGwGSF_VFEC_
 
std::string mvaName_woGwGSF_BL_
 
std::string mvaName_woGwGSF_EC_
 
std::string mvaName_woGwGSF_VFEC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_NoEleMatch_wGwoGSF_BL_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_NoEleMatch_wGwoGSF_EC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_NoEleMatch_wGwoGSF_VFEC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_NoEleMatch_woGwoGSF_BL_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_NoEleMatch_woGwoGSF_EC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_NoEleMatch_woGwoGSF_VFEC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_wGwGSF_BL_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_wGwGSF_EC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_wGwGSF_VFEC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_woGwGSF_BL_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_woGwGSF_EC_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaToken_woGwGSF_VFEC_
 
PositionAtECalEntranceComputer positionAtECalEntrance_
 
bool usePhiAtEcalEntranceExtrapolation_
 
std::vector< float > var_NoEleMatch_wGwoGSF_Barrel_
 
std::vector< float > var_NoEleMatch_wGwoGSF_Endcap_
 
std::vector< float > var_NoEleMatch_wGwoGSF_VFEndcap_
 
std::vector< float > var_NoEleMatch_woGwoGSF_Barrel_
 
std::vector< float > var_NoEleMatch_woGwoGSF_Endcap_
 
std::vector< float > var_NoEleMatch_woGwoGSF_VFEndcap_
 
std::vector< float > var_wGwGSF_Barrel_
 
std::vector< float > var_wGwGSF_Endcap_
 
std::vector< float > var_wGwGSF_VFEndcap_
 
std::vector< float > var_woGwGSF_Barrel_
 
std::vector< float > var_woGwGSF_Endcap_
 
std::vector< float > var_woGwGSF_VFEndcap_
 
const int verbosity_
 

Static Private Attributes

static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479
 
static constexpr float ecalEndcapVFEndcapEtaBorder_ = 2.4
 

Detailed Description

template<class TauType, class ElectronType>
class AntiElectronIDMVA6< TauType, ElectronType >

Definition at line 116 of file AntiElectronIDMVA6.h.

Member Typedef Documentation

◆ ElectronCollection

template<class TauType , class ElectronType >
typedef std::vector<ElectronType> AntiElectronIDMVA6< TauType, ElectronType >::ElectronCollection

Definition at line 118 of file AntiElectronIDMVA6.h.

◆ ElectronRef

template<class TauType , class ElectronType >
typedef edm::Ref<ElectronCollection> AntiElectronIDMVA6< TauType, ElectronType >::ElectronRef

Definition at line 119 of file AntiElectronIDMVA6.h.

Constructor & Destructor Documentation

◆ AntiElectronIDMVA6()

template<class TauType , class ElectronType >
AntiElectronIDMVA6< TauType, ElectronType >::AntiElectronIDMVA6 ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  cc 
)

Definition at line 36 of file AntiElectronIDMVA6.cc.

References gpuPixelDoublets::cc, looper::cfg, AntiElectronIDMVA6< TauType, ElectronType >::electronIds_, AntiElectronIDMVA6< TauType, ElectronType >::electronIds_tokens_, Exception, AntiElectronIDMVA6< TauType, ElectronType >::inputFileName_, SimL1EmulatorRepack_Full_cff::inputTag, AntiElectronIDMVA6< TauType, ElectronType >::isPhase2_, AntiElectronIDMVA6< TauType, ElectronType >::loadMVAfromDB_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_wGwoGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_wGwoGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_wGwoGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_woGwoGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_woGwoGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_woGwoGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_wGwGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_wGwGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_wGwGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_woGwGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_woGwGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaName_woGwGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_wGwoGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_wGwoGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_wGwoGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_woGwoGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_woGwoGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_woGwoGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_wGwGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_wGwGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_wGwGSF_VFEC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_woGwGSF_BL_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_woGwGSF_EC_, AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_woGwGSF_VFEC_, AlCaHLTBitMon_QueryRunRegistry::string, AntiElectronIDMVA6< TauType, ElectronType >::usePhiAtEcalEntranceExtrapolation_, relativeConstraints::value, AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_wGwoGSF_Barrel_, AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_wGwoGSF_Endcap_, AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_wGwoGSF_VFEndcap_, AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_woGwoGSF_Barrel_, AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_woGwoGSF_Endcap_, AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_woGwoGSF_VFEndcap_, AntiElectronIDMVA6< TauType, ElectronType >::var_wGwGSF_Barrel_, AntiElectronIDMVA6< TauType, ElectronType >::var_wGwGSF_Endcap_, AntiElectronIDMVA6< TauType, ElectronType >::var_wGwGSF_VFEndcap_, AntiElectronIDMVA6< TauType, ElectronType >::var_woGwGSF_Barrel_, AntiElectronIDMVA6< TauType, ElectronType >::var_woGwGSF_Endcap_, and AntiElectronIDMVA6< TauType, ElectronType >::var_woGwGSF_VFEndcap_.

37  : isInitialized_(false),
40  mva_woGwGSF_BL_(nullptr),
41  mva_wGwGSF_BL_(nullptr),
44  mva_woGwGSF_EC_(nullptr),
45  mva_wGwGSF_EC_(nullptr),
48  mva_woGwGSF_VFEC_(nullptr),
49  mva_wGwGSF_VFEC_(nullptr),
50  isPhase2_(cfg.getParameter<bool>("isPhase2")),
52  verbosity_(cfg.getParameter<int>("verbosity")) {
53  loadMVAfromDB_ = cfg.exists("loadMVAfromDB") ? cfg.getParameter<bool>("loadMVAfromDB") : false;
54  if (!loadMVAfromDB_) {
55  if (cfg.exists("inputFileName")) {
56  inputFileName_ = cfg.getParameter<edm::FileInPath>("inputFileName");
57  } else
58  throw cms::Exception("MVA input not defined")
59  << "Requested to load tau MVA input from ROOT file but no file provided in cfg file";
60  }
61 
62  mvaName_NoEleMatch_woGwoGSF_BL_ = cfg.getParameter<std::string>("mvaName_NoEleMatch_woGwoGSF_BL");
63  mvaName_NoEleMatch_wGwoGSF_BL_ = cfg.getParameter<std::string>("mvaName_NoEleMatch_wGwoGSF_BL");
64  mvaName_woGwGSF_BL_ = cfg.getParameter<std::string>("mvaName_woGwGSF_BL");
65  mvaName_wGwGSF_BL_ = cfg.getParameter<std::string>("mvaName_wGwGSF_BL");
66  mvaName_NoEleMatch_woGwoGSF_EC_ = cfg.getParameter<std::string>("mvaName_NoEleMatch_woGwoGSF_EC");
67  mvaName_NoEleMatch_wGwoGSF_EC_ = cfg.getParameter<std::string>("mvaName_NoEleMatch_wGwoGSF_EC");
68  mvaName_woGwGSF_EC_ = cfg.getParameter<std::string>("mvaName_woGwGSF_EC");
69  mvaName_wGwGSF_EC_ = cfg.getParameter<std::string>("mvaName_wGwGSF_EC");
70  if (isPhase2_) {
71  mvaName_NoEleMatch_woGwoGSF_VFEC_ = cfg.getParameter<std::string>("mvaName_NoEleMatch_woGwoGSF_VFEC");
72  mvaName_NoEleMatch_wGwoGSF_VFEC_ = cfg.getParameter<std::string>("mvaName_NoEleMatch_wGwoGSF_VFEC");
73  mvaName_woGwGSF_VFEC_ = cfg.getParameter<std::string>("mvaName_woGwGSF_VFEC");
74  mvaName_wGwGSF_VFEC_ = cfg.getParameter<std::string>("mvaName_wGwGSF_VFEC");
75  }
76  if (loadMVAfromDB_) {
85  if (isPhase2_) {
90  }
91  }
92  usePhiAtEcalEntranceExtrapolation_ = cfg.getParameter<bool>("usePhiAtEcalEntranceExtrapolation");
93 
94  if (!isPhase2_) {
95  var_NoEleMatch_woGwoGSF_Barrel_ = std::vector<float>(10);
96  var_NoEleMatch_wGwoGSF_Barrel_ = std::vector<float>(18);
97  var_woGwGSF_Barrel_ = std::vector<float>(24);
98  var_wGwGSF_Barrel_ = std::vector<float>(32);
99  var_NoEleMatch_woGwoGSF_Endcap_ = std::vector<float>(9);
100  var_NoEleMatch_wGwoGSF_Endcap_ = std::vector<float>(17);
101  var_woGwGSF_Endcap_ = std::vector<float>(23);
102  var_wGwGSF_Endcap_ = std::vector<float>(31);
103  } else {
104  var_NoEleMatch_woGwoGSF_Barrel_ = std::vector<float>(9);
105  var_NoEleMatch_wGwoGSF_Barrel_ = std::vector<float>(17);
106  var_woGwGSF_Barrel_ = std::vector<float>(27);
107  var_wGwGSF_Barrel_ = std::vector<float>(36);
108  var_NoEleMatch_woGwoGSF_Endcap_ = std::vector<float>(6);
109  var_NoEleMatch_wGwoGSF_Endcap_ = std::vector<float>(14);
110  var_woGwGSF_Endcap_ = std::vector<float>(31);
111  var_wGwGSF_Endcap_ = std::vector<float>(38);
112  var_NoEleMatch_woGwoGSF_VFEndcap_ = std::vector<float>(6);
113  var_NoEleMatch_wGwoGSF_VFEndcap_ = std::vector<float>(14);
114  var_woGwGSF_VFEndcap_ = std::vector<float>(32);
115  var_wGwGSF_VFEndcap_ = std::vector<float>(40);
116 
117  //MB: Tokens for additional inputs (HGCal EleID variables) only for Phase2 and reco::GsfElectrons
119  for (const auto& inputTag : cfg.getParameter<std::vector<edm::InputTag>>("hgcalElectronIDs")) {
120  std::string elecIdLabel = "hgcElectronID:" + inputTag.instance();
121  electronIds_tokens_[elecIdLabel] = cc.consumes<edm::ValueMap<float>>(
122  inputTag); //MB: It assumes that instances are not empty and meaningful (as for userData in patElectrons)
124  }
125  }
126  }
127 }
std::vector< float > var_NoEleMatch_wGwoGSF_Barrel_
std::string mvaName_wGwGSF_BL_
std::vector< float > var_wGwGSF_Endcap_
std::vector< float > var_wGwGSF_VFEndcap_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_woGwGSF_EC_
std::string mvaName_NoEleMatch_woGwoGSF_VFEC_
const GBRForest * mva_NoEleMatch_wGwoGSF_VFEC_
const GBRForest * mva_wGwGSF_EC_
std::vector< float > var_NoEleMatch_woGwoGSF_Endcap_
const GBRForest * mva_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_wGwGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_wGwoGSF_VFEC_
PositionAtECalEntranceComputer positionAtECalEntrance_
std::string mvaName_NoEleMatch_wGwoGSF_BL_
std::string mvaName_NoEleMatch_wGwoGSF_EC_
std::vector< float > var_wGwGSF_Barrel_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_wGwGSF_BL_
std::string mvaName_wGwGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_woGwoGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_woGwGSF_BL_
std::string mvaName_NoEleMatch_wGwoGSF_VFEC_
std::vector< float > var_woGwGSF_Endcap_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_wGwGSF_EC_
const GBRForest * mva_woGwGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_woGwGSF_VFEC_
std::vector< float > var_NoEleMatch_woGwoGSF_Barrel_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_NoEleMatch_woGwoGSF_VFEC_
const GBRForest * mva_woGwGSF_VFEC_
std::map< std::string, edm::EDGetTokenT< edm::ValueMap< float > > > electronIds_tokens_
const GBRForest * mva_NoEleMatch_woGwoGSF_EC_
const GBRForest * mva_NoEleMatch_woGwoGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_woGwGSF_EC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_woGwoGSF_EC_
std::string mvaName_woGwGSF_VFEC_
std::vector< float > var_NoEleMatch_wGwoGSF_VFEndcap_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_wGwGSF_VFEC_
std::vector< float > var_NoEleMatch_wGwoGSF_Endcap_
edm::FileInPath inputFileName_
std::string mvaName_wGwGSF_EC_
std::map< std::string, edm::Handle< edm::ValueMap< float > > > electronIds_
const GBRForest * mva_wGwGSF_BL_
std::string mvaName_NoEleMatch_woGwoGSF_EC_
std::vector< float > var_woGwGSF_Barrel_
std::string mvaName_woGwGSF_EC_
std::string mvaName_woGwGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_woGwoGSF_VFEC_
std::vector< float > var_NoEleMatch_woGwoGSF_VFEndcap_
std::vector< float > var_woGwGSF_VFEndcap_
std::string mvaName_NoEleMatch_woGwoGSF_BL_

◆ ~AntiElectronIDMVA6()

template<class TauType , class ElectronType >
AntiElectronIDMVA6< TauType, ElectronType >::~AntiElectronIDMVA6 ( )

Definition at line 130 of file AntiElectronIDMVA6.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

130  {
131  if (!loadMVAfromDB_) {
134  delete mva_woGwGSF_BL_;
135  delete mva_wGwGSF_BL_;
138  delete mva_woGwGSF_EC_;
139  delete mva_wGwGSF_EC_;
140  if (isPhase2_) {
143  delete mva_woGwGSF_VFEC_;
144  delete mva_wGwGSF_VFEC_;
145  }
146  }
147 
148  for (std::vector<TFile*>::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) {
149  delete (*it);
150  }
151 }
const GBRForest * mva_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_woGwGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_VFEC_
const GBRForest * mva_wGwGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_wGwGSF_VFEC_
const GBRForest * mva_woGwGSF_BL_
const GBRForest * mva_NoEleMatch_woGwoGSF_VFEC_
const GBRForest * mva_woGwGSF_VFEC_
const GBRForest * mva_NoEleMatch_woGwoGSF_EC_
const GBRForest * mva_NoEleMatch_woGwoGSF_BL_
std::vector< TFile * > inputFilesToDelete_
const GBRForest * mva_wGwGSF_BL_

Member Function Documentation

◆ beginEvent()

template<class TauType , class ElectronType >
void AntiElectronIDMVA6< TauType, ElectronType >::beginEvent ( const edm::Event evt,
const edm::EventSetup es 
)

Definition at line 166 of file AntiElectronIDMVA6.cc.

References edm::EventSetup::getData(), edm::Event::getHandle(), makeListRunsInFiles::inputFile, edm::FileInPath::Unknown, and relativeConstraints::value.

166  {
167  if (!isInitialized_) {
168  if (loadMVAfromDB_) {
177  if (isPhase2_) {
182  }
183  } else {
185  throw cms::Exception("PFRecoTauDiscriminationAgainstElectronMVA6::loadMVA")
186  << " Failed to find File = " << inputFileName_ << " !!\n";
187  TFile* inputFile = new TFile(inputFileName_.fullPath().data());
188 
191  mva_woGwGSF_BL_ = loadMVAfromFile(inputFile, mvaName_woGwGSF_BL_);
192  mva_wGwGSF_BL_ = loadMVAfromFile(inputFile, mvaName_wGwGSF_BL_);
195  mva_woGwGSF_EC_ = loadMVAfromFile(inputFile, mvaName_woGwGSF_EC_);
196  mva_wGwGSF_EC_ = loadMVAfromFile(inputFile, mvaName_wGwGSF_EC_);
197  if (isPhase2_) {
201  mva_wGwGSF_VFEC_ = loadMVAfromFile(inputFile, mvaName_wGwGSF_VFEC_);
202  }
203  inputFilesToDelete_.push_back(inputFile);
204  }
205  isInitialized_ = true;
206  }
208  //MB: Handle additional inputs (HGCal EleID variables) only for Phase2 and reco::GsfElectrons
210  for (const auto& eId_token : electronIds_tokens_) {
211  electronIds_[eId_token.first] = evt.getHandle(eId_token.second);
212  }
213  }
214 }
std::string mvaName_wGwGSF_BL_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void beginEvent(const edm::EventSetup &)
std::string fullPath() const
Definition: FileInPath.cc:161
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_woGwGSF_EC_
std::string mvaName_NoEleMatch_woGwoGSF_VFEC_
const GBRForest * mva_NoEleMatch_wGwoGSF_VFEC_
const GBRForest * mva_wGwGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_wGwGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_wGwoGSF_VFEC_
PositionAtECalEntranceComputer positionAtECalEntrance_
std::string mvaName_NoEleMatch_wGwoGSF_BL_
std::string mvaName_NoEleMatch_wGwoGSF_EC_
LocationCode location() const
Where was the file found?
Definition: FileInPath.cc:159
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_wGwGSF_BL_
std::string mvaName_wGwGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_woGwoGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_woGwGSF_BL_
std::string mvaName_NoEleMatch_wGwoGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_wGwGSF_EC_
const GBRForest * mva_woGwGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_woGwGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_NoEleMatch_woGwoGSF_VFEC_
const GBRForest * mva_woGwGSF_VFEC_
std::map< std::string, edm::EDGetTokenT< edm::ValueMap< float > > > electronIds_tokens_
const GBRForest * mva_NoEleMatch_woGwoGSF_EC_
const GBRForest * mva_NoEleMatch_woGwoGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_woGwGSF_EC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_woGwoGSF_EC_
std::string mvaName_woGwGSF_VFEC_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_wGwGSF_VFEC_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:552
edm::FileInPath inputFileName_
std::vector< TFile * > inputFilesToDelete_
std::string mvaName_wGwGSF_EC_
std::map< std::string, edm::Handle< edm::ValueMap< float > > > electronIds_
const GBRForest * mva_wGwGSF_BL_
std::string mvaName_NoEleMatch_woGwoGSF_EC_
std::string mvaName_woGwGSF_EC_
std::string mvaName_woGwGSF_BL_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_NoEleMatch_woGwoGSF_VFEC_
std::string mvaName_NoEleMatch_woGwoGSF_BL_

◆ dCrackEta()

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::dCrackEta ( double  eta)
private

Definition at line 1082 of file AntiElectronIDMVA6.cc.

References funct::abs(), ztail::d, and PVValHelper::eta.

1082  {
1083  //--- compute the (unsigned) distance to the closest eta-crack in the ECAL barrel
1084 
1085  // IN: define locations of the eta-cracks
1086  double cracks[5] = {0., 4.44747e-01, 7.92824e-01, 1.14090e+00, 1.47464e+00};
1087 
1088  double retVal = 99.;
1089 
1090  for (int iCrack = 0; iCrack < 5; ++iCrack) {
1091  double d = minimum(eta - cracks[iCrack], eta + cracks[iCrack]);
1092  if (std::abs(d) < std::abs(retVal)) {
1093  retVal = d;
1094  }
1095  }
1096 
1097  return std::abs(retVal);
1098 }
double minimum(double a, double b)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
d
Definition: ztail.py:151

◆ dCrackPhi()

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::dCrackPhi ( double  phi,
double  eta 
)
private

Definition at line 1031 of file AntiElectronIDMVA6.cc.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), PVValHelper::eta, M_PI, PVValHelper::phi, and pi.

1031  {
1032  //--- compute the (unsigned) distance to the closest phi-crack in the ECAL barrel
1033 
1034  constexpr double pi = M_PI; // 3.14159265358979323846;
1035 
1036  // IN: shift of this location if eta < 0
1037  constexpr double delta_cPhi = 0.00638;
1038 
1039  double retVal = 99.;
1040 
1041  if (eta >= -1.47464 && eta <= 1.47464) {
1042  // the location is shifted
1043  if (eta < 0.)
1044  phi += delta_cPhi;
1045 
1046  // CV: need to bring-back phi into interval [-pi,+pi]
1047  if (phi > pi)
1048  phi -= 2. * pi;
1049  if (phi < -pi)
1050  phi += 2. * pi;
1051 
1052  if (phi >= -pi && phi <= pi) {
1053  // the problem of the extrema:
1054  if (phi < cPhi[17] || phi >= cPhi[0]) {
1055  if (phi < 0.)
1056  phi += 2. * pi;
1057  retVal = minimum(phi - cPhi[0], phi - cPhi[17] - 2. * pi);
1058  } else {
1059  // between these extrema...
1060  bool OK = false;
1061  unsigned iCrack = 16;
1062  while (!OK) {
1063  if (phi < cPhi[iCrack]) {
1064  retVal = minimum(phi - cPhi[iCrack + 1], phi - cPhi[iCrack]);
1065  OK = true;
1066  } else {
1067  iCrack -= 1;
1068  }
1069  }
1070  }
1071  } else {
1072  retVal = 0.; // IN: if there is a problem, we assume that we are in a crack
1073  }
1074  } else {
1075  return -99.;
1076  }
1077 
1078  return std::abs(retVal);
1079 }
double minimum(double a, double b)
const Double_t pi
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126

◆ energyWeightedEtaAndPhiAtECal()

template<class TauType , class ElectronType >
bool AntiElectronIDMVA6< TauType, ElectronType >::energyWeightedEtaAndPhiAtECal ( const pat::Tau theTau,
float &  eta,
float &  phi 
)
private

Definition at line 1329 of file AntiElectronIDMVA6.cc.

References PVValHelper::eta, PVValHelper::phi, pat::Tau::signalCands(), and summarizeEdmComparisonLogfiles::success.

1331  {
1332  eta = 0.;
1333  phi = 0.;
1334  float sumEnergy = 0.;
1335  for (const auto& candidate : theTau.signalCands()) {
1336  float etaAtECalEntrance = candidate->eta();
1337  float phiAtECalEntrance = candidate->phi();
1338  bool success = false;
1339  reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success);
1340  if (success) {
1341  etaAtECalEntrance = posAtECal.eta();
1342  phiAtECalEntrance = posAtECal.phi();
1343  }
1344  eta += etaAtECalEntrance * candidate->energy();
1345  phi += phiAtECalEntrance * candidate->energy();
1346  sumEnergy += candidate->energy();
1347  }
1348  if (sumEnergy > 0.) {
1349  eta = eta / sumEnergy;
1350  phi = phi / sumEnergy;
1351  } else {
1352  eta = -99.;
1353  phi = -99.;
1354  }
1355  return (sumEnergy > 0.);
1356 }
PositionAtECalEntranceComputer positionAtECalEntrance_
reco::CandidatePtrVector signalCands() const
math::XYZPoint Point
point in the space
Definition: Candidate.h:40

◆ getElecVars()

template<class TauType , class ElectronType >
ElecVars AntiElectronIDMVA6< TauType, ElectronType >::getElecVars ( const ElectronRef theEleRef)

Definition at line 924 of file AntiElectronIDMVA6.cc.

References antiElecIDMVA6_blocks::ElecVars::chi2NormGSF, antiElecIDMVA6_blocks::ElecVars::chi2NormKF, antiElecIDMVA6_blocks::ElecVars::deltaEta, antiElecIDMVA6_blocks::ElecVars::deltaPhi, antiElecIDMVA6_blocks::ElecVars::eEcal, antiElecIDMVA6_blocks::ElecVars::eSeedClusterOverPout, antiElecIDMVA6_blocks::ElecVars::eta, antiElecIDMVA6_blocks::ElecVars::eTotOverPin, Exception, antiElecIDMVA6_blocks::ElecVars::gsfNumHits, antiElecIDMVA6_blocks::ElecVars::gsfTracklnPt, antiElecIDMVA6_blocks::ElecVars::gsfTrackResol, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), antiElecIDMVA6_blocks::ElecVars::kfNumHits, dqm-mbProfile::log, antiElecIDMVA6_blocks::ElecVars::mvaInDeltaEta, antiElecIDMVA6_blocks::ElecVars::mvaInHadEnergy, antiElecIDMVA6_blocks::ElecVars::mvaInSigmaEtaEta, antiElecIDMVA6_blocks::ElecVars::phi, antiElecIDMVA6_blocks::ElecVars::pIn, antiElecIDMVA6_blocks::ElecVars::pOut, antiElecIDMVA6_blocks::ElecVars::r9, antiElecIDMVA6_blocks::ElecVars::showerCircularity, antiElecIDMVA6_blocks::ElecVars::sigmaIEtaIEta5x5, antiElecIDMVA6_blocks::ElecVars::sigmaIPhiIPhi5x5, mathSSE::sqrt(), antiElecIDMVA6_blocks::ElecVars::superClusterEtaWidth, antiElecIDMVA6_blocks::ElecVars::superClusterPhiWidth, and relativeConstraints::value.

Referenced by AntiElectronIDMVA6< TauType, ElectronType >::mvaValue().

924  {
925  ElecVars elecVars;
926 
927  elecVars.eta = theEleRef->eta();
928  elecVars.phi = theEleRef->phi();
929 
930  // Variables related to the electron Cluster
931  float elecEe = 0.;
932  float elecEgamma = 0.;
933  reco::SuperClusterRef pfSuperCluster = theEleRef->superCluster();
934  if (pfSuperCluster.isNonnull() && pfSuperCluster.isAvailable()) {
935  if (!isPhase2_) {
936  for (reco::CaloCluster_iterator pfCluster = pfSuperCluster->clustersBegin();
937  pfCluster != pfSuperCluster->clustersEnd();
938  ++pfCluster) {
939  double pfClusterEn = (*pfCluster)->energy();
940  if (pfCluster == pfSuperCluster->clustersBegin())
941  elecEe += pfClusterEn;
942  else
943  elecEgamma += pfClusterEn;
944  }
945  }
946  elecVars.superClusterEtaWidth = pfSuperCluster->etaWidth();
947  elecVars.superClusterPhiWidth = pfSuperCluster->phiWidth();
948  }
949  elecVars.eSeedClusterOverPout = theEleRef->eSeedClusterOverPout();
950  elecVars.showerCircularity = 1. - theEleRef->e1x5() / theEleRef->e5x5();
951  elecVars.r9 = theEleRef->r9();
952  elecVars.sigmaIEtaIEta5x5 = theEleRef->full5x5_sigmaIetaIeta();
953  elecVars.sigmaIPhiIPhi5x5 = theEleRef->full5x5_sigmaIphiIphi();
954 
955  elecVars.pIn = std::sqrt(theEleRef->trackMomentumAtVtx().Mag2());
956  elecVars.pOut = std::sqrt(theEleRef->trackMomentumOut().Mag2());
957  elecVars.eTotOverPin = (elecVars.pIn > 0.0) ? ((elecEe + elecEgamma) / elecVars.pIn) : -0.1;
958  elecVars.eEcal = theEleRef->ecalEnergy();
959  if (!isPhase2_) {
960  elecVars.deltaEta = theEleRef->deltaEtaSeedClusterTrackAtCalo();
961  elecVars.deltaPhi = theEleRef->deltaPhiSeedClusterTrackAtCalo();
962  } else {
963  elecVars.deltaEta = theEleRef->deltaEtaEleClusterTrackAtCalo();
964  elecVars.deltaPhi = theEleRef->deltaPhiEleClusterTrackAtCalo();
965  }
966  elecVars.mvaInSigmaEtaEta = theEleRef->mvaInput().sigmaEtaEta;
967  elecVars.mvaInHadEnergy = theEleRef->mvaInput().hadEnergy;
968  elecVars.mvaInDeltaEta = theEleRef->mvaInput().deltaEta;
969 
970  // Variables related to the GsfTrack
971  elecVars.chi2NormGSF = -99.;
972  elecVars.gsfNumHits = -99.;
973  elecVars.gsfTrackResol = -99.;
974  elecVars.gsfTracklnPt = -99.;
975  if (theEleRef->gsfTrack().isNonnull()) {
976  elecVars.chi2NormGSF = theEleRef->gsfTrack()->normalizedChi2();
977  elecVars.gsfNumHits = theEleRef->gsfTrack()->numberOfValidHits();
978  if (theEleRef->gsfTrack()->pt() > 0.) {
979  elecVars.gsfTrackResol = theEleRef->gsfTrack()->ptError() / theEleRef->gsfTrack()->pt();
980  elecVars.gsfTracklnPt = log(theEleRef->gsfTrack()->pt()) * M_LN10;
981  }
982  }
983 
984  // Variables related to the CtfTrack
985  elecVars.chi2NormKF = -99.;
986  elecVars.kfNumHits = -99.;
987  if (theEleRef->closestCtfTrackRef().isNonnull()) {
988  elecVars.chi2NormKF = theEleRef->closestCtfTrackRef()->normalizedChi2();
989  elecVars.kfNumHits = theEleRef->closestCtfTrackRef()->numberOfValidHits();
990  }
991 
992  // Variables related to HGCal
993  if (isPhase2_ && !theEleRef->isEB()) {
995  getElecVarsHGCalTypeSpecific(theEleRef, elecVars);
996  else
997  throw cms::Exception("AntiElectronIDMVA6")
998  << "Unsupported ElectronType used. You must use either reco::GsfElectron or pat::Electron.";
999  }
1000 
1001  return elecVars;
1002 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
void getElecVarsHGCalTypeSpecific(const reco::GsfElectronRef &theEleRef, antiElecIDMVA6_blocks::ElecVars &elecVars)
T sqrt(T t)
Definition: SSEVec.h:19
bool isAvailable() const
Definition: Ref.h:541

◆ getElecVarsHGCalTypeSpecific() [1/2]

template<class TauType , class ElectronType >
void AntiElectronIDMVA6< TauType, ElectronType >::getElecVarsHGCalTypeSpecific ( const reco::GsfElectronRef theEleRef,
antiElecIDMVA6_blocks::ElecVars elecVars 
)

Definition at line 1279 of file AntiElectronIDMVA6.cc.

References antiElecIDMVA6_blocks::ElecVars::hgcalDepthCompatibility, antiElecIDMVA6_blocks::ElecVars::hgcalEcEnergyEE, antiElecIDMVA6_blocks::ElecVars::hgcalEcEnergyFH, antiElecIDMVA6_blocks::ElecVars::hgcalExpectedDepth, antiElecIDMVA6_blocks::ElecVars::hgcalExpectedSigma, antiElecIDMVA6_blocks::ElecVars::hgcalFirstLayer, antiElecIDMVA6_blocks::ElecVars::hgcalLastLayer, antiElecIDMVA6_blocks::ElecVars::hgcalLayerEfrac10, antiElecIDMVA6_blocks::ElecVars::hgcalLayerEfrac90, antiElecIDMVA6_blocks::ElecVars::hgcalMeasuredDepth, antiElecIDMVA6_blocks::ElecVars::hgcalNLayers, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaEE, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaPP, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaUU, and antiElecIDMVA6_blocks::ElecVars::hgcalSigmaVV.

1280  {
1281  //MB: Assumed that presence of one of the HGCal EleID variables guarantee presence of all
1282  if (!(electronIds_.find("hgcElectronID:sigmaUU") != electronIds_.end() &&
1283  electronIds_.at("hgcElectronID:sigmaUU").isValid()))
1284  return;
1285 
1286  elecVars.hgcalSigmaUU = (*electronIds_.at("hgcElectronID:sigmaUU"))[theEleRef];
1287  elecVars.hgcalSigmaVV = (*electronIds_.at("hgcElectronID:sigmaVV"))[theEleRef];
1288  elecVars.hgcalSigmaEE = (*electronIds_.at("hgcElectronID:sigmaEE"))[theEleRef];
1289  elecVars.hgcalSigmaPP = (*electronIds_.at("hgcElectronID:sigmaPP"))[theEleRef];
1290  elecVars.hgcalNLayers = (*electronIds_.at("hgcElectronID:nLayers"))[theEleRef];
1291  elecVars.hgcalFirstLayer = (*electronIds_.at("hgcElectronID:firstLayer"))[theEleRef];
1292  elecVars.hgcalLastLayer = (*electronIds_.at("hgcElectronID:lastLayer"))[theEleRef];
1293  elecVars.hgcalLayerEfrac10 = (*electronIds_.at("hgcElectronID:layerEfrac10"))[theEleRef];
1294  elecVars.hgcalLayerEfrac90 = (*electronIds_.at("hgcElectronID:layerEfrac90"))[theEleRef];
1295  elecVars.hgcalEcEnergyEE = (*electronIds_.at("hgcElectronID:ecEnergyEE"))[theEleRef];
1296  elecVars.hgcalEcEnergyFH = (*electronIds_.at("hgcElectronID:ecEnergyFH"))[theEleRef];
1297  elecVars.hgcalMeasuredDepth = (*electronIds_.at("hgcElectronID:measuredDepth"))[theEleRef];
1298  elecVars.hgcalExpectedDepth = (*electronIds_.at("hgcElectronID:expectedDepth"))[theEleRef];
1299  elecVars.hgcalExpectedSigma = (*electronIds_.at("hgcElectronID:expectedSigma"))[theEleRef];
1300  elecVars.hgcalDepthCompatibility = (*electronIds_.at("hgcElectronID:depthCompatibility"))[theEleRef];
1301 }
std::map< std::string, edm::Handle< edm::ValueMap< float > > > electronIds_

◆ getElecVarsHGCalTypeSpecific() [2/2]

template<class TauType , class ElectronType >
void AntiElectronIDMVA6< TauType, ElectronType >::getElecVarsHGCalTypeSpecific ( const pat::ElectronRef theEleRef,
antiElecIDMVA6_blocks::ElecVars elecVars 
)

Definition at line 1305 of file AntiElectronIDMVA6.cc.

References antiElecIDMVA6_blocks::ElecVars::hgcalDepthCompatibility, antiElecIDMVA6_blocks::ElecVars::hgcalEcEnergyEE, antiElecIDMVA6_blocks::ElecVars::hgcalEcEnergyFH, antiElecIDMVA6_blocks::ElecVars::hgcalExpectedDepth, antiElecIDMVA6_blocks::ElecVars::hgcalExpectedSigma, antiElecIDMVA6_blocks::ElecVars::hgcalFirstLayer, antiElecIDMVA6_blocks::ElecVars::hgcalLastLayer, antiElecIDMVA6_blocks::ElecVars::hgcalLayerEfrac10, antiElecIDMVA6_blocks::ElecVars::hgcalLayerEfrac90, antiElecIDMVA6_blocks::ElecVars::hgcalMeasuredDepth, antiElecIDMVA6_blocks::ElecVars::hgcalNLayers, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaEE, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaPP, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaUU, and antiElecIDMVA6_blocks::ElecVars::hgcalSigmaVV.

1306  {
1307  //MB: Assumed that presence of one of the HGCal EleID variables guarantee presence of all
1308  if (!theEleRef->hasUserFloat("hgcElectronID:sigmaUU"))
1309  return;
1310 
1311  elecVars.hgcalSigmaUU = theEleRef->userFloat("hgcElectronID:sigmaUU");
1312  elecVars.hgcalSigmaVV = theEleRef->userFloat("hgcElectronID:sigmaVV");
1313  elecVars.hgcalSigmaEE = theEleRef->userFloat("hgcElectronID:sigmaEE");
1314  elecVars.hgcalSigmaPP = theEleRef->userFloat("hgcElectronID:sigmaPP");
1315  elecVars.hgcalNLayers = theEleRef->userFloat("hgcElectronID:nLayers");
1316  elecVars.hgcalFirstLayer = theEleRef->userFloat("hgcElectronID:firstLayer");
1317  elecVars.hgcalLastLayer = theEleRef->userFloat("hgcElectronID:lastLayer");
1318  elecVars.hgcalLayerEfrac10 = theEleRef->userFloat("hgcElectronID:layerEfrac10");
1319  elecVars.hgcalLayerEfrac90 = theEleRef->userFloat("hgcElectronID:layerEfrac90");
1320  elecVars.hgcalEcEnergyEE = theEleRef->userFloat("hgcElectronID:ecEnergyEE");
1321  elecVars.hgcalEcEnergyFH = theEleRef->userFloat("hgcElectronID:ecEnergyFH");
1322  elecVars.hgcalMeasuredDepth = theEleRef->userFloat("hgcElectronID:measuredDepth");
1323  elecVars.hgcalExpectedDepth = theEleRef->userFloat("hgcElectronID:expectedDepth");
1324  elecVars.hgcalExpectedSigma = theEleRef->userFloat("hgcElectronID:expectedSigma");
1325  elecVars.hgcalDepthCompatibility = theEleRef->userFloat("hgcElectronID:depthCompatibility");
1326 }

◆ getTauGammaVecs()

template<class TauType , class ElectronType >
TauGammaVecs AntiElectronIDMVA6< TauType, ElectronType >::getTauGammaVecs ( const TauType &  theTau)

Definition at line 901 of file AntiElectronIDMVA6.cc.

References PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, CustomPhysics_cfi::gamma, antiElecIDMVA6_blocks::TauGammaVecs::gammasdEtaInSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasdEtaOutSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasdPhiInSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasdPhiOutSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasPtInSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasPtOutSigCone, and SiStripPI::max.

Referenced by AntiElectronIDMVA6< TauType, ElectronType >::mvaValue().

901  {
902  TauGammaVecs tauGammaVecs;
903 
904  float signalrad = std::clamp(3.0 / std::max(1.0, theTau.pt()), 0.05, 0.10);
905  for (const auto& gamma : theTau.signalGammaCands()) {
906  float dR = deltaR(gamma->p4(), theTau.leadChargedHadrCand()->p4());
907  // pfGammas inside the tau signal cone
908  if (dR < signalrad) {
909  tauGammaVecs.gammasdEtaInSigCone.push_back(gamma->eta() - theTau.leadChargedHadrCand()->eta());
910  tauGammaVecs.gammasdPhiInSigCone.push_back(gamma->phi() - theTau.leadChargedHadrCand()->phi());
911  tauGammaVecs.gammasPtInSigCone.push_back(gamma->pt());
912  }
913  // pfGammas outside the tau signal cone
914  else {
915  tauGammaVecs.gammasdEtaOutSigCone.push_back(gamma->eta() - theTau.leadChargedHadrCand()->eta());
916  tauGammaVecs.gammasdPhiOutSigCone.push_back(gamma->phi() - theTau.leadChargedHadrCand()->phi());
917  tauGammaVecs.gammasPtOutSigCone.push_back(gamma->pt());
918  }
919  }
920  return tauGammaVecs;
921 }

◆ getTauVars()

template<class TauType , class ElectronType >
TauVars AntiElectronIDMVA6< TauType, ElectronType >::getTauVars ( const TauType &  theTau)

Definition at line 851 of file AntiElectronIDMVA6.cc.

References funct::abs(), PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, Exception, CustomPhysics_cfi::gamma, reco::PFCandidate::gsfTrackRef(), edm::Ref< C, T, F >::isNonnull(), EgHLTOffHistBins_cfi::mass, SiStripPI::max, pat::PackedCandidate::pdgId(), leptonTimeLifeInfo_common_cff::tauVars, and relativeConstraints::value.

Referenced by AntiElectronIDMVA6< TauType, ElectronType >::mvaValue().

851  {
855  else
856  throw cms::Exception("AntiElectronIDMVA6")
857  << "Unsupported TauType used. You must use either reco::PFTau or pat::Tau.";
858 
859  tauVars.pt = theTau.pt();
860 
861  reco::Candidate::LorentzVector pfGammaSum(0, 0, 0, 0);
862  reco::Candidate::LorentzVector pfChargedSum(0, 0, 0, 0);
863  float signalrad = std::clamp(3.0 / std::max(1.0, theTau.pt()), 0.05, 0.10);
864  for (const auto& gamma : theTau.signalGammaCands()) {
865  float dR = deltaR(gamma->p4(), theTau.leadChargedHadrCand()->p4());
866  // pfGammas inside the tau signal cone
867  if (dR < signalrad) {
868  pfGammaSum += gamma->p4();
869  }
870  }
871  for (const auto& charged : theTau.signalChargedHadrCands()) {
872  float dR = deltaR(charged->p4(), theTau.leadChargedHadrCand()->p4());
873  // charged particles inside the tau signal cone
874  if (dR < signalrad) {
875  pfChargedSum += charged->p4();
876  }
877  }
878  tauVars.visMassIn = (pfGammaSum + pfChargedSum).mass();
879 
880  tauVars.hasGsf = 0;
881  if (theTau.leadChargedHadrCand().isNonnull()) {
882  const pat::PackedCandidate* packedLeadChCand =
883  dynamic_cast<const pat::PackedCandidate*>(theTau.leadChargedHadrCand().get());
884  if (packedLeadChCand != nullptr) {
885  if (std::abs(packedLeadChCand->pdgId()) == 11)
886  tauVars.hasGsf = 1;
887  } else {
888  const reco::PFCandidate* pfLeadChCand =
889  dynamic_cast<const reco::PFCandidate*>(theTau.leadChargedHadrCand().get());
890  if (pfLeadChCand != nullptr && pfLeadChCand->gsfTrackRef().isNonnull())
891  tauVars.hasGsf = 1;
892  }
893  }
894  tauVars.dCrackPhi = dCrackPhi(tauVars.phi, tauVars.etaAtEcalEntrance);
895  tauVars.dCrackEta = dCrackEta(tauVars.etaAtEcalEntrance);
896 
897  return tauVars;
898 }
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:469
antiElecIDMVA6_blocks::TauVars getTauVarsTypeSpecific(const reco::PFTau &theTau)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
int pdgId() const override
PDG identifier.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double dCrackEta(double eta)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
double dCrackPhi(double phi, double eta)

◆ getTauVarsTypeSpecific() [1/2]

template<class TauType , class ElectronType >
TauVars AntiElectronIDMVA6< TauType, ElectronType >::getTauVarsTypeSpecific ( const reco::PFTau theTau)

Definition at line 1152 of file AntiElectronIDMVA6.cc.

References funct::abs(), pat::PackedCandidate::caloFraction(), reco::PFCandidate::ecalEnergy(), reco::PFTau::emFraction(), pat::PackedCandidate::energy(), reco::LeafCandidate::eta(), edm::Ptr< T >::get(), reco::PFCandidate::hcalEnergy(), pat::PackedCandidate::hcalFraction(), edm::Ptr< T >::isNonnull(), reco::PFTau::leadCand(), reco::PFTau::leadChargedHadrCand(), SiStripPI::max, reco::LeafCandidate::p(), pat::PackedCandidate::p(), reco::LeafCandidate::phi(), reco::PFCandidate::positionAtECALEntrance(), reco::PFTau::signalCands(), summarizeEdmComparisonLogfiles::success, leptonTimeLifeInfo_common_cff::tauVars, and HLT_2024v10_cff::track.

1152  {
1153  TauVars tauVars;
1154  tauVars.etaAtEcalEntrance = -99.;
1155  tauVars.leadChargedPFCandEtaAtEcalEntrance = -99.;
1156  tauVars.leadChargedPFCandPt = -99.;
1157  float sumEtaTimesEnergy = 0.;
1158  float sumPhiTimesEnergy = 0.;
1159  float sumEnergy = 0.;
1160  tauVars.phi = theTau.phi();
1161  // Check type of candidates building tau to avoid dynamic casts further
1162  bool isFromPFCands =
1163  (theTau.leadCand().isNonnull() && dynamic_cast<const reco::PFCandidate*>(theTau.leadCand().get()) != nullptr);
1164  if (!isPhase2_) {
1165  for (const auto& candidate : theTau.signalCands()) {
1166  float etaAtECalEntrance = candidate->eta();
1167  float phiAtECalEntrance = candidate->phi();
1168  const reco::Track* track = nullptr;
1169  if (isFromPFCands) {
1170  const reco::PFCandidate* pfCandidate = static_cast<const reco::PFCandidate*>(candidate.get());
1171  etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta();
1173  phiAtECalEntrance = pfCandidate->positionAtECALEntrance().phi();
1174  } else {
1175  bool success = false;
1176  reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success);
1177  if (success) {
1178  phiAtECalEntrance = posAtECal.phi();
1179  }
1180  }
1181  track = getTrackFromPFCand(pfCandidate);
1182  } else {
1183  bool success = false;
1184  reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success);
1185  if (success) {
1186  etaAtECalEntrance = posAtECal.eta();
1187  phiAtECalEntrance = posAtECal.phi();
1188  }
1189  track = candidate->bestTrack();
1190  }
1191  if (track != nullptr) {
1192  if (track->pt() > tauVars.leadChargedPFCandPt) {
1193  tauVars.leadChargedPFCandEtaAtEcalEntrance = etaAtECalEntrance;
1194  tauVars.leadChargedPFCandPt = track->pt();
1195  }
1196  }
1197  sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy();
1198  sumPhiTimesEnergy += phiAtECalEntrance * candidate->energy();
1199  sumEnergy += candidate->energy();
1200  }
1201  if (sumEnergy > 0.) {
1202  tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy;
1203  tauVars.phi = sumPhiTimesEnergy / sumEnergy;
1204  }
1205  tauVars.emFraction = std::max(theTau.emFraction(), 0.f);
1206  } else { // Phase2
1207  for (const auto& candidate : theTau.signalCands()) {
1208  float etaAtECalEntrance = candidate->eta();
1209  const reco::Track* track = nullptr;
1210  if (isFromPFCands) {
1211  const reco::PFCandidate* pfCandidate = static_cast<const reco::PFCandidate*>(candidate.get());
1212  etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta();
1213  if (std::abs(theTau.eta()) >= ecalBarrelEndcapEtaBorder_) { //HGCal
1214  bool success = false;
1215  reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success);
1216  if (success) {
1217  etaAtECalEntrance = posAtECal.eta();
1218  }
1219  }
1220  track = getTrackFromPFCand(pfCandidate);
1221  } else {
1222  bool success = false;
1223  reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success);
1224  if (success) {
1225  etaAtECalEntrance = posAtECal.eta();
1226  }
1227  track = candidate->bestTrack();
1228  }
1229  if (track != nullptr) {
1230  if (track->pt() > tauVars.leadChargedPFCandPt) {
1231  tauVars.leadChargedPFCandEtaAtEcalEntrance = etaAtECalEntrance;
1232  tauVars.leadChargedPFCandPt = track->pt();
1233  }
1234  }
1235  sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy();
1236  sumEnergy += candidate->energy();
1237  }
1238  if (sumEnergy > 0.) {
1239  tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy;
1240  }
1241  if (isFromPFCands) {
1242  const reco::PFCandidate* pfLeadCandidte =
1243  static_cast<const reco::PFCandidate*>(theTau.leadChargedHadrCand().get());
1244  tauVars.emFraction =
1245  std::max(pfLeadCandidte->ecalEnergy() / (pfLeadCandidte->ecalEnergy() + pfLeadCandidte->hcalEnergy()), 0.);
1246  } else {
1247  const pat::PackedCandidate* patLeadCandiate =
1248  dynamic_cast<const pat::PackedCandidate*>(theTau.leadChargedHadrCand().get());
1249  if (patLeadCandiate != nullptr) {
1250  tauVars.emFraction = std::max(1. - patLeadCandiate->hcalFraction(), 0.);
1251  }
1252  }
1253  }
1254  tauVars.leadPFChargedHadrHoP = 0.;
1255  tauVars.leadPFChargedHadrEoP = 0.;
1256  if (theTau.leadChargedHadrCand()->p() > 0.) {
1257  if (isFromPFCands) {
1258  const reco::PFCandidate* pfLeadCandiate =
1259  static_cast<const reco::PFCandidate*>(theTau.leadChargedHadrCand().get());
1260  tauVars.leadPFChargedHadrHoP = pfLeadCandiate->hcalEnergy() / pfLeadCandiate->p();
1261  tauVars.leadPFChargedHadrEoP = pfLeadCandiate->ecalEnergy() / pfLeadCandiate->p();
1262  } else {
1263  const pat::PackedCandidate* patLeadCandiate =
1264  dynamic_cast<const pat::PackedCandidate*>(theTau.leadChargedHadrCand().get());
1265  if (patLeadCandiate != nullptr) {
1266  tauVars.leadPFChargedHadrHoP = patLeadCandiate->caloFraction() * patLeadCandiate->energy() *
1267  patLeadCandiate->hcalFraction() / patLeadCandiate->p();
1268  tauVars.leadPFChargedHadrEoP = patLeadCandiate->caloFraction() * patLeadCandiate->energy() *
1269  (1. - patLeadCandiate->hcalFraction()) / patLeadCandiate->p();
1270  }
1271  }
1272  }
1273 
1274  return tauVars;
1275 }
const CandidatePtr & leadChargedHadrCand() const
Definition: PFTau.cc:63
const std::vector< reco::CandidatePtr > & signalCands() const
Candidates in signal region.
Definition: PFTau.cc:74
const math::XYZPointF & positionAtECALEntrance() const
Definition: PFCandidate.h:388
float caloFraction() const
Set the fraction of ECAL+HCAL energy over candidate energy.
double p() const override
magnitude of momentum vector
PositionAtECalEntranceComputer positionAtECalEntrance_
double p() const final
magnitude of momentum vector
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
float emFraction() const
Definition: PFTau.cc:340
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
static constexpr float ecalBarrelEndcapEtaBorder_
float hcalFraction() const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
double energy() const override
energy
const CandidatePtr & leadCand() const
Definition: PFTau.cc:65
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
double phi() const final
momentum azimuthal angle
double eta() const final
momentum pseudorapidity

◆ getTauVarsTypeSpecific() [2/2]

template<class TauType , class ElectronType >
TauVars AntiElectronIDMVA6< TauType, ElectronType >::getTauVarsTypeSpecific ( const pat::Tau theTau)

Definition at line 1102 of file AntiElectronIDMVA6.cc.

References funct::abs(), pat::Tau::ecalEnergyLeadChargedHadrCand(), pat::Tau::emFraction_MVA(), reco::LeafCandidate::eta(), pat::Tau::etaAtEcalEntrance(), pat::Tau::etaAtEcalEntranceLeadChargedCand(), f, edm::Ptr< T >::get(), pat::Tau::hcalEnergyLeadChargedHadrCand(), pat::Tau::leadChargedHadrCand(), SiStripPI::max, reco::LeafCandidate::phi(), pat::Tau::phiAtEcalEntrance(), pat::Tau::ptLeadChargedCand(), summarizeEdmComparisonLogfiles::success, and leptonTimeLifeInfo_common_cff::tauVars.

1102  {
1103  TauVars tauVars;
1104  tauVars.etaAtEcalEntrance = theTau.etaAtEcalEntrance();
1105  tauVars.leadChargedPFCandEtaAtEcalEntrance = theTau.etaAtEcalEntranceLeadChargedCand();
1106  tauVars.leadChargedPFCandPt = theTau.ptLeadChargedCand();
1107  tauVars.phi = theTau.phi();
1108  if (!isPhase2_) {
1110  tauVars.phi = theTau.phiAtEcalEntrance();
1111  } else {
1112  float etaAtECal = 0.;
1113  float phiAtECal = 0.;
1114  bool success = energyWeightedEtaAndPhiAtECal(theTau, etaAtECal, phiAtECal);
1115  if (success) {
1116  tauVars.phi = phiAtECal;
1117  }
1118  }
1119  tauVars.emFraction = std::max(theTau.emFraction_MVA(), 0.f);
1120  } else {
1121  if (std::abs(theTau.eta()) >= ecalBarrelEndcapEtaBorder_) { //HGCal
1122  tauVars.etaAtEcalEntrance = -99.;
1123  tauVars.leadChargedPFCandEtaAtEcalEntrance = -99.;
1124  bool success = false;
1126  if (success) {
1127  tauVars.leadChargedPFCandEtaAtEcalEntrance = posAtECal.eta();
1128  }
1129  float phiAtECal = 0.;
1130  float etaAtECal = 0.;
1131  success = energyWeightedEtaAndPhiAtECal(theTau, etaAtECal, phiAtECal);
1132  if (success) {
1133  tauVars.etaAtEcalEntrance = etaAtECal;
1134  }
1135  }
1136  tauVars.emFraction = std::max(theTau.ecalEnergyLeadChargedHadrCand() /
1138  0.f);
1139  }
1140  tauVars.leadPFChargedHadrHoP = 0.;
1141  tauVars.leadPFChargedHadrEoP = 0.;
1142  if (theTau.leadChargedHadrCand()->p() > 0.) {
1143  tauVars.leadPFChargedHadrHoP = theTau.hcalEnergyLeadChargedHadrCand() / theTau.leadChargedHadrCand()->p();
1144  tauVars.leadPFChargedHadrEoP = theTau.ecalEnergyLeadChargedHadrCand() / theTau.leadChargedHadrCand()->p();
1145  }
1146 
1147  return tauVars;
1148 }
float etaAtEcalEntrance() const
return etaAtEcalEntrance
Definition: Tau.h:317
float ptLeadChargedCand() const
return pt from LeadChargedCand
Definition: Tau.h:321
float phiAtEcalEntrance() const
return phiAtEcalEntrance
Definition: Tau.h:315
float etaAtEcalEntranceLeadChargedCand() const
return etaAtEcalEntrance from LeadChargedCand
Definition: Tau.h:319
PositionAtECalEntranceComputer positionAtECalEntrance_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
const reco::CandidatePtr leadChargedHadrCand() const
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
bool energyWeightedEtaAndPhiAtECal(const pat::Tau &theTau, float &eta, float &phi)
float ecalEnergyLeadChargedHadrCand() const
Definition: Tau.h:311
static constexpr float ecalBarrelEndcapEtaBorder_
float emFraction_MVA() const
return emFraction_MVA
Definition: Tau.h:323
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
float hcalEnergyLeadChargedHadrCand() const
return hcal energy from LeadChargedHadrCand
Definition: Tau.h:313
double phi() const final
momentum azimuthal angle
double eta() const final
momentum pseudorapidity

◆ minimum()

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::minimum ( double  a,
double  b 
)
private

Definition at line 1005 of file AntiElectronIDMVA6.cc.

References a, funct::abs(), and b.

1005  {
1006  if (std::abs(b) < std::abs(a))
1007  return b;
1008  else
1009  return a;
1010 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

◆ mvaValue() [1/4]

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::mvaValue ( const antiElecIDMVA6_blocks::TauVars tauVars,
const antiElecIDMVA6_blocks::TauGammaVecs tauGammaVecs,
const antiElecIDMVA6_blocks::ElecVars elecVars 
)

Definition at line 217 of file AntiElectronIDMVA6.cc.

References antiElecIDMVA6_blocks::TauGammaMoms::gammaEnFracIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaEnFracOut, antiElecIDMVA6_blocks::TauGammaMoms::gammaEtaMomIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaEtaMomOut, antiElecIDMVA6_blocks::TauGammaMoms::gammaPhiMomIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaPhiMomOut, antiElecIDMVA6_blocks::TauGammaVecs::gammasdEtaInSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasdEtaOutSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasdPhiInSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasdPhiOutSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasPtInSigCone, antiElecIDMVA6_blocks::TauGammaVecs::gammasPtOutSigCone, mps_fire::i, M_PI, antiElecIDMVA6_blocks::TauGammaMoms::signalPFGammaCandsIn, antiElecIDMVA6_blocks::TauGammaMoms::signalPFGammaCandsOut, mathSSE::sqrt(), TtFullHadEvtBuilder_cfi::sumPt, and leptonTimeLifeInfo_common_cff::tauVars.

219  {
220  TauGammaMoms tauGammaMoms;
221  double sumPt = 0.;
222  double dEta2 = 0.;
223  double dPhi2 = 0.;
224  tauGammaMoms.signalPFGammaCandsIn = tauGammaVecs.gammasPtInSigCone.size();
225  for (size_t i = 0; i < tauGammaVecs.gammasPtInSigCone.size(); ++i) {
226  double pt_i = tauGammaVecs.gammasPtInSigCone[i];
227  double phi_i = tauGammaVecs.gammasdPhiInSigCone[i];
228  if (tauGammaVecs.gammasdPhiInSigCone[i] > M_PI)
229  phi_i = tauGammaVecs.gammasdPhiInSigCone[i] - 2 * M_PI;
230  else if (tauGammaVecs.gammasdPhiInSigCone[i] < -M_PI)
231  phi_i = tauGammaVecs.gammasdPhiInSigCone[i] + 2 * M_PI;
232  double eta_i = tauGammaVecs.gammasdEtaInSigCone[i];
233  sumPt += pt_i;
234  dEta2 += (pt_i * eta_i * eta_i);
235  dPhi2 += (pt_i * phi_i * phi_i);
236  }
237 
238  tauGammaMoms.gammaEnFracIn = -99.;
239  if (tauVars.pt > 0.) {
240  tauGammaMoms.gammaEnFracIn = sumPt / tauVars.pt;
241  }
242  if (sumPt > 0.) {
243  dEta2 /= sumPt;
244  dPhi2 /= sumPt;
245  }
246  tauGammaMoms.gammaEtaMomIn = std::sqrt(dEta2 * tauGammaMoms.gammaEnFracIn) * tauVars.pt;
247  tauGammaMoms.gammaPhiMomIn = std::sqrt(dPhi2 * tauGammaMoms.gammaEnFracIn) * tauVars.pt;
248 
249  sumPt = 0.;
250  dEta2 = 0.;
251  dPhi2 = 0.;
252  tauGammaMoms.signalPFGammaCandsOut = tauGammaVecs.gammasPtOutSigCone.size();
253  for (size_t i = 0; i < tauGammaVecs.gammasPtOutSigCone.size(); ++i) {
254  double pt_i = tauGammaVecs.gammasPtOutSigCone[i];
255  double phi_i = tauGammaVecs.gammasdPhiOutSigCone[i];
256  if (tauGammaVecs.gammasdPhiOutSigCone[i] > M_PI)
257  phi_i = tauGammaVecs.gammasdPhiOutSigCone[i] - 2 * M_PI;
258  else if (tauGammaVecs.gammasdPhiOutSigCone[i] < -M_PI)
259  phi_i = tauGammaVecs.gammasdPhiOutSigCone[i] + 2 * M_PI;
260  double eta_i = tauGammaVecs.gammasdEtaOutSigCone[i];
261  sumPt += pt_i;
262  dEta2 += (pt_i * eta_i * eta_i);
263  dPhi2 += (pt_i * phi_i * phi_i);
264  }
265 
266  tauGammaMoms.gammaEnFracOut = -99.;
267  if (tauVars.pt > 0.) {
268  tauGammaMoms.gammaEnFracOut = sumPt / tauVars.pt;
269  }
270  if (sumPt > 0.) {
271  dEta2 /= sumPt;
272  dPhi2 /= sumPt;
273  }
274  tauGammaMoms.gammaEtaMomOut = std::sqrt(dEta2 * tauGammaMoms.gammaEnFracOut) * tauVars.pt;
275  tauGammaMoms.gammaPhiMomOut = std::sqrt(dPhi2 * tauGammaMoms.gammaEnFracOut) * tauVars.pt;
276 
277  if (!isPhase2_) {
278  return mvaValue(tauVars, tauGammaMoms, elecVars);
279  } else {
280  return mvaValuePhase2(tauVars, tauGammaMoms, elecVars);
281  }
282 }
T sqrt(T t)
Definition: SSEVec.h:19
#define M_PI
double mvaValue(const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaVecs &tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars &elecVars)
double mvaValuePhase2(const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaMoms &tauGammaMoms, const antiElecIDMVA6_blocks::ElecVars &elecVars)

◆ mvaValue() [2/4]

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::mvaValue ( const antiElecIDMVA6_blocks::TauVars tauVars,
const antiElecIDMVA6_blocks::TauGammaMoms tauGammaMoms,
const antiElecIDMVA6_blocks::ElecVars elecVars 
)

Definition at line 285 of file AntiElectronIDMVA6.cc.

References funct::abs(), antiElecIDMVA6_blocks::ElecVars::chi2NormGSF, antiElecIDMVA6_blocks::ElecVars::chi2NormKF, antiElecIDMVA6_blocks::ElecVars::deltaEta, antiElecIDMVA6_blocks::ElecVars::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, antiElecIDMVA6_blocks::ElecVars::eEcal, antiElecIDMVA6_blocks::ElecVars::eta, antiElecIDMVA6_blocks::ElecVars::eTotOverPin, Exception, f, antiElecIDMVA6_blocks::TauGammaMoms::gammaEnFracIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaEnFracOut, antiElecIDMVA6_blocks::TauGammaMoms::gammaEtaMomIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaEtaMomOut, antiElecIDMVA6_blocks::TauGammaMoms::gammaPhiMomIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaPhiMomOut, antiElecIDMVA6_blocks::ElecVars::gsfNumHits, antiElecIDMVA6_blocks::ElecVars::gsfTracklnPt, antiElecIDMVA6_blocks::ElecVars::gsfTrackResol, antiElecIDMVA6_blocks::ElecVars::kfNumHits, dqm-mbProfile::log, SiStripPI::max, SiStripPI::min, antiElecIDMVA6_blocks::ElecVars::mvaInDeltaEta, antiElecIDMVA6_blocks::ElecVars::mvaInHadEnergy, antiElecIDMVA6_blocks::ElecVars::mvaInSigmaEtaEta, antiElecIDMVA6_blocks::ElecVars::phi, antiElecIDMVA6_blocks::ElecVars::pIn, antiElecIDMVA6_blocks::ElecVars::pOut, antiElecIDMVA6_blocks::TauGammaMoms::signalPFGammaCandsIn, antiElecIDMVA6_blocks::TauGammaMoms::signalPFGammaCandsOut, and leptonTimeLifeInfo_common_cff::tauVars.

287  {
288  if (!isInitialized_) {
289  throw cms::Exception("ClassNotInitialized") << " AntiElectronMVA6 not properly initialized !!\n";
290  }
291 
292  double mvaValue = -99.;
293 
294  float elecDeltaPinPoutOverPin = (elecVars.pIn > 0.0) ? (std::abs(elecVars.pIn - elecVars.pOut) / elecVars.pIn) : 1.0;
295  float elecEecalOverPout = (elecVars.pOut > 0.0) ? (elecVars.eEcal / elecVars.pOut) : 20.0;
296  float elecNumHitsDiffOverSum =
297  ((elecVars.gsfNumHits + elecVars.kfNumHits) > 0.0)
298  ? ((elecVars.gsfNumHits - elecVars.kfNumHits) / (elecVars.gsfNumHits + elecVars.kfNumHits))
299  : 1.0;
300 
301  if (deltaR(tauVars.etaAtEcalEntrance, tauVars.phi, elecVars.eta, elecVars.phi) > 0.3 &&
302  tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf < 0.5) {
303  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
304  var_NoEleMatch_woGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance;
305  var_NoEleMatch_woGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
306  var_NoEleMatch_woGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
309  var_NoEleMatch_woGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP;
310  var_NoEleMatch_woGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP;
315  } else {
316  var_NoEleMatch_woGwoGSF_Endcap_[0] = tauVars.etaAtEcalEntrance;
317  var_NoEleMatch_woGwoGSF_Endcap_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
318  var_NoEleMatch_woGwoGSF_Endcap_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
321  var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadPFChargedHadrHoP;
322  var_NoEleMatch_woGwoGSF_Endcap_[6] = tauVars.leadPFChargedHadrEoP;
326  }
327  } else if (deltaR(tauVars.etaAtEcalEntrance, tauVars.phi, elecVars.eta, elecVars.phi) > 0.3 &&
328  tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf < 0.5) {
329  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
330  var_NoEleMatch_wGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance;
331  var_NoEleMatch_wGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
332  var_NoEleMatch_wGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
334  var_NoEleMatch_wGwoGSF_Barrel_[4] = tauVars.emFraction;
337  var_NoEleMatch_wGwoGSF_Barrel_[7] = tauVars.leadPFChargedHadrHoP;
338  var_NoEleMatch_wGwoGSF_Barrel_[8] = tauVars.leadPFChargedHadrEoP;
346  var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.dCrackEta;
347  var_NoEleMatch_wGwoGSF_Barrel_[17] = tauVars.dCrackPhi;
349  } else {
350  var_NoEleMatch_wGwoGSF_Endcap_[0] = tauVars.etaAtEcalEntrance;
351  var_NoEleMatch_wGwoGSF_Endcap_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
352  var_NoEleMatch_wGwoGSF_Endcap_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
354  var_NoEleMatch_wGwoGSF_Endcap_[4] = tauVars.emFraction;
357  var_NoEleMatch_wGwoGSF_Endcap_[7] = tauVars.leadPFChargedHadrHoP;
358  var_NoEleMatch_wGwoGSF_Endcap_[8] = tauVars.leadPFChargedHadrEoP;
366  var_NoEleMatch_wGwoGSF_Endcap_[16] = tauVars.dCrackEta;
368  }
369  } else if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf > 0.5) {
370  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
371  var_woGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin);
372  var_woGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF));
373  var_woGwGSF_Barrel_[2] = elecVars.gsfNumHits;
374  var_woGwGSF_Barrel_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol));
375  var_woGwGSF_Barrel_[4] = elecVars.gsfTracklnPt;
376  var_woGwGSF_Barrel_[5] = elecNumHitsDiffOverSum;
377  var_woGwGSF_Barrel_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF));
378  var_woGwGSF_Barrel_[7] = std::min(elecDeltaPinPoutOverPin, 1.f);
379  var_woGwGSF_Barrel_[8] = std::min(elecEecalOverPout, 20.f);
380  var_woGwGSF_Barrel_[9] = elecVars.deltaEta;
381  var_woGwGSF_Barrel_[10] = elecVars.deltaPhi;
382  var_woGwGSF_Barrel_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f);
383  var_woGwGSF_Barrel_[12] = std::min(elecVars.mvaInHadEnergy, 20.f);
384  var_woGwGSF_Barrel_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f);
385  var_woGwGSF_Barrel_[14] = tauVars.etaAtEcalEntrance;
386  var_woGwGSF_Barrel_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
387  var_woGwGSF_Barrel_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
389  var_woGwGSF_Barrel_[18] = tauVars.emFraction;
390  var_woGwGSF_Barrel_[19] = tauVars.leadPFChargedHadrHoP;
391  var_woGwGSF_Barrel_[20] = tauVars.leadPFChargedHadrEoP;
392  var_woGwGSF_Barrel_[21] = tauVars.visMassIn;
393  var_woGwGSF_Barrel_[22] = tauVars.dCrackEta;
394  var_woGwGSF_Barrel_[23] = tauVars.dCrackPhi;
396  } else {
397  var_woGwGSF_Endcap_[0] = std::max(-0.1f, elecVars.eTotOverPin);
398  var_woGwGSF_Endcap_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF));
399  var_woGwGSF_Endcap_[2] = elecVars.gsfNumHits;
400  var_woGwGSF_Endcap_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol));
401  var_woGwGSF_Endcap_[4] = elecVars.gsfTracklnPt;
402  var_woGwGSF_Endcap_[5] = elecNumHitsDiffOverSum;
403  var_woGwGSF_Endcap_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF));
404  var_woGwGSF_Endcap_[7] = std::min(elecDeltaPinPoutOverPin, 1.f);
405  var_woGwGSF_Endcap_[8] = std::min(elecEecalOverPout, 20.f);
406  var_woGwGSF_Endcap_[9] = elecVars.deltaEta;
407  var_woGwGSF_Endcap_[10] = elecVars.deltaPhi;
408  var_woGwGSF_Endcap_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f);
409  var_woGwGSF_Endcap_[12] = std::min(elecVars.mvaInHadEnergy, 20.f);
410  var_woGwGSF_Endcap_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f);
411  var_woGwGSF_Endcap_[14] = tauVars.etaAtEcalEntrance;
412  var_woGwGSF_Endcap_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
413  var_woGwGSF_Endcap_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
415  var_woGwGSF_Endcap_[18] = tauVars.emFraction;
416  var_woGwGSF_Endcap_[19] = tauVars.leadPFChargedHadrHoP;
417  var_woGwGSF_Endcap_[20] = tauVars.leadPFChargedHadrEoP;
418  var_woGwGSF_Endcap_[21] = tauVars.visMassIn;
419  var_woGwGSF_Endcap_[22] = tauVars.dCrackEta;
421  }
422  } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf > 0.5) {
423  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
424  var_wGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin);
425  var_wGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF));
426  var_wGwGSF_Barrel_[2] = elecVars.gsfNumHits;
427  var_wGwGSF_Barrel_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol));
428  var_wGwGSF_Barrel_[4] = elecVars.gsfTracklnPt;
429  var_wGwGSF_Barrel_[5] = elecNumHitsDiffOverSum;
430  var_wGwGSF_Barrel_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF));
431  var_wGwGSF_Barrel_[7] = std::min(elecDeltaPinPoutOverPin, 1.f);
432  var_wGwGSF_Barrel_[8] = std::min(elecEecalOverPout, 20.f);
433  var_wGwGSF_Barrel_[9] = elecVars.deltaEta;
434  var_wGwGSF_Barrel_[10] = elecVars.deltaPhi;
435  var_wGwGSF_Barrel_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f);
436  var_wGwGSF_Barrel_[12] = std::min(elecVars.mvaInHadEnergy, 20.f);
437  var_wGwGSF_Barrel_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f);
438  var_wGwGSF_Barrel_[14] = tauVars.etaAtEcalEntrance;
439  var_wGwGSF_Barrel_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
440  var_wGwGSF_Barrel_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
442  var_wGwGSF_Barrel_[18] = tauVars.emFraction;
443  var_wGwGSF_Barrel_[19] = tauGammaMoms.signalPFGammaCandsIn;
444  var_wGwGSF_Barrel_[20] = tauGammaMoms.signalPFGammaCandsOut;
445  var_wGwGSF_Barrel_[21] = tauVars.leadPFChargedHadrHoP;
446  var_wGwGSF_Barrel_[22] = tauVars.leadPFChargedHadrEoP;
447  var_wGwGSF_Barrel_[23] = tauVars.visMassIn;
448  var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEtaMomIn;
449  var_wGwGSF_Barrel_[25] = tauGammaMoms.gammaEtaMomOut;
450  var_wGwGSF_Barrel_[26] = tauGammaMoms.gammaPhiMomIn;
451  var_wGwGSF_Barrel_[27] = tauGammaMoms.gammaPhiMomOut;
452  var_wGwGSF_Barrel_[28] = tauGammaMoms.gammaEnFracIn;
453  var_wGwGSF_Barrel_[29] = tauGammaMoms.gammaEnFracOut;
454  var_wGwGSF_Barrel_[30] = tauVars.dCrackEta;
455  var_wGwGSF_Barrel_[31] = tauVars.dCrackPhi;
457  } else {
458  var_wGwGSF_Endcap_[0] = std::max(-0.1f, elecVars.eTotOverPin);
459  var_wGwGSF_Endcap_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF));
460  var_wGwGSF_Endcap_[2] = elecVars.gsfNumHits;
461  var_wGwGSF_Endcap_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol));
462  var_wGwGSF_Endcap_[4] = elecVars.gsfTracklnPt;
463  var_wGwGSF_Endcap_[5] = elecNumHitsDiffOverSum;
464  var_wGwGSF_Endcap_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF));
465  var_wGwGSF_Endcap_[7] = std::min(elecDeltaPinPoutOverPin, 1.f);
466  var_wGwGSF_Endcap_[8] = std::min(elecEecalOverPout, 20.f);
467  var_wGwGSF_Endcap_[9] = elecVars.deltaEta;
468  var_wGwGSF_Endcap_[10] = elecVars.deltaPhi;
469  var_wGwGSF_Endcap_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f);
470  var_wGwGSF_Endcap_[12] = std::min(elecVars.mvaInHadEnergy, 20.f);
471  var_wGwGSF_Endcap_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f);
472  var_wGwGSF_Endcap_[14] = tauVars.etaAtEcalEntrance;
473  var_wGwGSF_Endcap_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
474  var_wGwGSF_Endcap_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
476  var_wGwGSF_Endcap_[18] = tauVars.emFraction;
477  var_wGwGSF_Endcap_[19] = tauGammaMoms.signalPFGammaCandsIn;
478  var_wGwGSF_Endcap_[20] = tauGammaMoms.signalPFGammaCandsOut;
479  var_wGwGSF_Endcap_[21] = tauVars.leadPFChargedHadrHoP;
480  var_wGwGSF_Endcap_[22] = tauVars.leadPFChargedHadrEoP;
481  var_wGwGSF_Endcap_[23] = tauVars.visMassIn;
482  var_wGwGSF_Endcap_[24] = tauGammaMoms.gammaEtaMomIn;
483  var_wGwGSF_Endcap_[25] = tauGammaMoms.gammaEtaMomOut;
484  var_wGwGSF_Endcap_[26] = tauGammaMoms.gammaPhiMomIn;
485  var_wGwGSF_Endcap_[27] = tauGammaMoms.gammaPhiMomOut;
486  var_wGwGSF_Endcap_[28] = tauGammaMoms.gammaEnFracIn;
487  var_wGwGSF_Endcap_[29] = tauGammaMoms.gammaEnFracOut;
488  var_wGwGSF_Endcap_[30] = tauVars.dCrackEta;
490  }
491  }
492  return mvaValue;
493 }
std::vector< float > var_NoEleMatch_wGwoGSF_Barrel_
std::vector< float > var_wGwGSF_Endcap_
const GBRForest * mva_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_woGwGSF_EC_
const GBRForest * mva_wGwGSF_EC_
std::vector< float > var_NoEleMatch_woGwoGSF_Endcap_
const GBRForest * mva_NoEleMatch_wGwoGSF_EC_
std::vector< float > var_wGwGSF_Barrel_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
std::vector< float > var_woGwGSF_Endcap_
const GBRForest * mva_woGwGSF_BL_
std::vector< float > var_NoEleMatch_woGwoGSF_Barrel_
double mvaValue(const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaVecs &tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars &elecVars)
const GBRForest * mva_NoEleMatch_woGwoGSF_EC_
const GBRForest * mva_NoEleMatch_woGwoGSF_BL_
double GetClassifier(const float *vector) const
Definition: GBRForest.h:33
static constexpr float ecalBarrelEndcapEtaBorder_
std::vector< float > var_NoEleMatch_wGwoGSF_Endcap_
const GBRForest * mva_wGwGSF_BL_
std::vector< float > var_woGwGSF_Barrel_

◆ mvaValue() [3/4]

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::mvaValue ( const TauType &  theTau,
const ElectronRef theEleRef 
)

Definition at line 824 of file AntiElectronIDMVA6.cc.

References AntiElectronIDMVA6< TauType, ElectronType >::getElecVars(), AntiElectronIDMVA6< TauType, ElectronType >::getTauGammaVecs(), AntiElectronIDMVA6< TauType, ElectronType >::getTauVars(), and leptonTimeLifeInfo_common_cff::tauVars.

826 {
827  // === tau variables ===
830 
831  // === electron variables ===
833 
834  return mvaValue(tauVars, tauGammaVecs, elecVars);
835 }
antiElecIDMVA6_blocks::TauVars getTauVars(const TauType &theTau)
double mvaValue(const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaVecs &tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars &elecVars)
antiElecIDMVA6_blocks::TauGammaVecs getTauGammaVecs(const TauType &theTau)
antiElecIDMVA6_blocks::ElecVars getElecVars(const ElectronRef &theEleRef)

◆ mvaValue() [4/4]

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::mvaValue ( const TauType &  theTau)

Definition at line 838 of file AntiElectronIDMVA6.cc.

References antiElecIDMVA6_blocks::ElecVars::eta, AntiElectronIDMVA6< TauType, ElectronType >::getTauGammaVecs(), AntiElectronIDMVA6< TauType, ElectronType >::getTauVars(), and leptonTimeLifeInfo_common_cff::tauVars.

838  {
839  // === tau variables ===
842 
843  // === electron variables ===
844  ElecVars elecVars;
845  elecVars.eta = 9.9; // Dummy value used in MVA training
846 
847  return mvaValue(tauVars, tauGammaVecs, elecVars);
848 }
antiElecIDMVA6_blocks::TauVars getTauVars(const TauType &theTau)
double mvaValue(const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaVecs &tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars &elecVars)
antiElecIDMVA6_blocks::TauGammaVecs getTauGammaVecs(const TauType &theTau)

◆ mvaValuePhase2()

template<class TauType , class ElectronType >
double AntiElectronIDMVA6< TauType, ElectronType >::mvaValuePhase2 ( const antiElecIDMVA6_blocks::TauVars tauVars,
const antiElecIDMVA6_blocks::TauGammaMoms tauGammaMoms,
const antiElecIDMVA6_blocks::ElecVars elecVars 
)

Definition at line 496 of file AntiElectronIDMVA6.cc.

References funct::abs(), antiElecIDMVA6_blocks::ElecVars::chi2NormGSF, antiElecIDMVA6_blocks::ElecVars::chi2NormKF, antiElecIDMVA6_blocks::ElecVars::deltaEta, antiElecIDMVA6_blocks::ElecVars::deltaPhi, antiElecIDMVA6_blocks::ElecVars::eEcal, antiElecIDMVA6_blocks::ElecVars::eSeedClusterOverPout, Exception, f, antiElecIDMVA6_blocks::TauGammaMoms::gammaEnFracIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaEnFracOut, antiElecIDMVA6_blocks::TauGammaMoms::gammaEtaMomIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaEtaMomOut, antiElecIDMVA6_blocks::TauGammaMoms::gammaPhiMomIn, antiElecIDMVA6_blocks::TauGammaMoms::gammaPhiMomOut, antiElecIDMVA6_blocks::ElecVars::gsfNumHits, antiElecIDMVA6_blocks::ElecVars::gsfTracklnPt, antiElecIDMVA6_blocks::ElecVars::gsfTrackResol, antiElecIDMVA6_blocks::ElecVars::hgcalDepthCompatibility, antiElecIDMVA6_blocks::ElecVars::hgcalEcEnergyEE, antiElecIDMVA6_blocks::ElecVars::hgcalEcEnergyFH, antiElecIDMVA6_blocks::ElecVars::hgcalExpectedDepth, antiElecIDMVA6_blocks::ElecVars::hgcalExpectedSigma, antiElecIDMVA6_blocks::ElecVars::hgcalFirstLayer, antiElecIDMVA6_blocks::ElecVars::hgcalLastLayer, antiElecIDMVA6_blocks::ElecVars::hgcalLayerEfrac10, antiElecIDMVA6_blocks::ElecVars::hgcalLayerEfrac90, antiElecIDMVA6_blocks::ElecVars::hgcalMeasuredDepth, antiElecIDMVA6_blocks::ElecVars::hgcalNLayers, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaEE, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaPP, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaUU, antiElecIDMVA6_blocks::ElecVars::hgcalSigmaVV, antiElecIDMVA6_blocks::ElecVars::kfNumHits, dqm-mbProfile::log, SiStripPI::max, SiStripPI::min, antiElecIDMVA6_blocks::ElecVars::mvaInDeltaEta, antiElecIDMVA6_blocks::ElecVars::mvaInHadEnergy, antiElecIDMVA6_blocks::ElecVars::mvaInSigmaEtaEta, antiElecIDMVA6_blocks::ElecVars::pIn, antiElecIDMVA6_blocks::ElecVars::pOut, antiElecIDMVA6_blocks::ElecVars::r9, antiElecIDMVA6_blocks::ElecVars::showerCircularity, antiElecIDMVA6_blocks::ElecVars::sigmaIEtaIEta5x5, antiElecIDMVA6_blocks::ElecVars::sigmaIPhiIPhi5x5, antiElecIDMVA6_blocks::TauGammaMoms::signalPFGammaCandsIn, antiElecIDMVA6_blocks::TauGammaMoms::signalPFGammaCandsOut, antiElecIDMVA6_blocks::ElecVars::superClusterEtaWidth, antiElecIDMVA6_blocks::ElecVars::superClusterPhiWidth, and leptonTimeLifeInfo_common_cff::tauVars.

498  {
499  if (!isInitialized_) {
500  throw cms::Exception("ClassNotInitialized") << " AntiElectronMVA6 not properly initialized !!\n";
501  }
502 
503  double mvaValue = -99.;
504 
505  //do not consider tau candidates outside the HGCal border at |eta|=3
506  if (std::abs(tauVars.etaAtEcalEntrance) > 3.0) {
507  return mvaValue;
508  }
509 
510  float elecDeltaPinPoutOverPin = (elecVars.pIn > 0.0) ? (std::abs(elecVars.pIn - elecVars.pOut) / elecVars.pIn) : 1.0;
511  float elecEecalOverPout = (elecVars.pOut > 0.0) ? (elecVars.eEcal / elecVars.pOut) : 20.0;
512  float elecNumHitsDiffOverSum =
513  ((elecVars.gsfNumHits + elecVars.kfNumHits) > 0.0)
514  ? ((elecVars.gsfNumHits - elecVars.kfNumHits) / (elecVars.gsfNumHits + elecVars.kfNumHits))
515  : 1.0;
516 
517  if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf < 0.5) {
518  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
519  var_NoEleMatch_woGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
522  var_NoEleMatch_woGwoGSF_Barrel_[3] = tauVars.leadPFChargedHadrHoP;
523  var_NoEleMatch_woGwoGSF_Barrel_[4] = tauVars.leadPFChargedHadrEoP;
526  var_NoEleMatch_woGwoGSF_Barrel_[7] = tauVars.etaAtEcalEntrance;
527  var_NoEleMatch_woGwoGSF_Barrel_[8] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
529  } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) {
530  var_NoEleMatch_woGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
534  var_NoEleMatch_woGwoGSF_Endcap_[4] = tauVars.etaAtEcalEntrance;
535  var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
537  } else {
538  var_NoEleMatch_woGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
542  var_NoEleMatch_woGwoGSF_VFEndcap_[4] = tauVars.etaAtEcalEntrance;
543  var_NoEleMatch_woGwoGSF_VFEndcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
545  }
546  } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf < 0.5) {
547  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
548  var_NoEleMatch_wGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
550  var_NoEleMatch_wGwoGSF_Barrel_[2] = tauVars.emFraction;
553  var_NoEleMatch_wGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP;
554  var_NoEleMatch_wGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP;
562  var_NoEleMatch_wGwoGSF_Barrel_[14] = tauVars.dCrackEta;
563  var_NoEleMatch_wGwoGSF_Barrel_[15] = tauVars.etaAtEcalEntrance;
564  var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
566  } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) {
567  var_NoEleMatch_wGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
578  var_NoEleMatch_wGwoGSF_Endcap_[11] = tauVars.dCrackEta;
579  var_NoEleMatch_wGwoGSF_Endcap_[12] = tauVars.etaAtEcalEntrance;
580  var_NoEleMatch_wGwoGSF_Endcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
582  } else {
583  var_NoEleMatch_wGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
595  var_NoEleMatch_wGwoGSF_VFEndcap_[12] = tauVars.etaAtEcalEntrance;
596  var_NoEleMatch_wGwoGSF_VFEndcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
598  }
599  } else if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf > 0.5) {
600  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
601  var_woGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF));
602  var_woGwGSF_Barrel_[1] = elecVars.gsfNumHits;
604  var_woGwGSF_Barrel_[3] = elecVars.gsfTracklnPt;
605  var_woGwGSF_Barrel_[4] = elecNumHitsDiffOverSum;
606  var_woGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF));
607  var_woGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f);
608  var_woGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f);
609  var_woGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f);
610  var_woGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f);
611  var_woGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f);
612  var_woGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
614  var_woGwGSF_Barrel_[13] = tauVars.emFraction;
615  var_woGwGSF_Barrel_[14] = tauVars.leadPFChargedHadrHoP;
616  var_woGwGSF_Barrel_[15] = tauVars.leadPFChargedHadrEoP;
617  var_woGwGSF_Barrel_[16] = tauVars.visMassIn;
618  var_woGwGSF_Barrel_[17] = tauVars.dCrackEta;
619  var_woGwGSF_Barrel_[18] = tauVars.etaAtEcalEntrance;
620  var_woGwGSF_Barrel_[19] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
621  var_woGwGSF_Barrel_[20] = elecVars.deltaEta;
622  var_woGwGSF_Barrel_[21] = elecVars.deltaPhi;
623  var_woGwGSF_Barrel_[22] = elecVars.sigmaIEtaIEta5x5;
624  var_woGwGSF_Barrel_[23] = elecVars.showerCircularity;
625  var_woGwGSF_Barrel_[24] = elecVars.r9;
629  } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) {
630  var_woGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF));
631  var_woGwGSF_Endcap_[1] = elecVars.gsfNumHits;
633  var_woGwGSF_Endcap_[3] = elecVars.gsfTracklnPt;
634  var_woGwGSF_Endcap_[4] = elecNumHitsDiffOverSum;
635  var_woGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF));
636  var_woGwGSF_Endcap_[6] = elecVars.eEcal;
637  var_woGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
639  var_woGwGSF_Endcap_[9] = tauVars.visMassIn;
640  var_woGwGSF_Endcap_[10] = tauVars.dCrackEta;
641  var_woGwGSF_Endcap_[11] = tauVars.etaAtEcalEntrance;
642  var_woGwGSF_Endcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
643  var_woGwGSF_Endcap_[13] = elecVars.hgcalSigmaUU;
644  var_woGwGSF_Endcap_[14] = elecVars.hgcalSigmaVV;
645  var_woGwGSF_Endcap_[15] = elecVars.hgcalSigmaEE;
646  var_woGwGSF_Endcap_[16] = elecVars.hgcalSigmaPP;
647  var_woGwGSF_Endcap_[17] = elecVars.hgcalNLayers;
648  var_woGwGSF_Endcap_[18] = elecVars.hgcalLastLayer;
649  var_woGwGSF_Endcap_[19] = elecVars.hgcalLayerEfrac10;
650  var_woGwGSF_Endcap_[20] = elecVars.hgcalLayerEfrac90;
651  var_woGwGSF_Endcap_[21] = elecVars.hgcalEcEnergyEE;
652  var_woGwGSF_Endcap_[22] = elecVars.hgcalEcEnergyFH;
656  var_woGwGSF_Endcap_[26] = elecVars.deltaEta;
657  var_woGwGSF_Endcap_[27] = elecVars.deltaPhi;
662  } else {
664  var_woGwGSF_VFEndcap_[1] = elecVars.gsfNumHits;
666  var_woGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt;
667  var_woGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum;
668  var_woGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF));
669  var_woGwGSF_VFEndcap_[6] = elecVars.eEcal;
670  var_woGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
672  var_woGwGSF_VFEndcap_[9] = tauVars.visMassIn;
673  var_woGwGSF_VFEndcap_[10] = tauVars.dCrackEta;
674  var_woGwGSF_VFEndcap_[11] = tauVars.etaAtEcalEntrance;
675  var_woGwGSF_VFEndcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
676  var_woGwGSF_VFEndcap_[13] = elecVars.hgcalSigmaUU;
677  var_woGwGSF_VFEndcap_[14] = elecVars.hgcalSigmaVV;
678  var_woGwGSF_VFEndcap_[15] = elecVars.hgcalSigmaEE;
679  var_woGwGSF_VFEndcap_[16] = elecVars.hgcalSigmaPP;
680  var_woGwGSF_VFEndcap_[17] = elecVars.hgcalNLayers;
681  var_woGwGSF_VFEndcap_[18] = elecVars.hgcalLastLayer;
684  var_woGwGSF_VFEndcap_[21] = elecVars.hgcalEcEnergyEE;
685  var_woGwGSF_VFEndcap_[22] = elecVars.hgcalEcEnergyFH;
690  var_woGwGSF_VFEndcap_[27] = elecVars.deltaEta;
691  var_woGwGSF_VFEndcap_[28] = elecVars.deltaPhi;
696  }
697  } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf > 0.5) {
698  if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) {
699  var_wGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF));
700  var_wGwGSF_Barrel_[1] = elecVars.gsfNumHits;
701  var_wGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol));
702  var_wGwGSF_Barrel_[3] = elecVars.gsfTracklnPt;
703  var_wGwGSF_Barrel_[4] = elecNumHitsDiffOverSum;
704  var_wGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF));
705  var_wGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f);
706  var_wGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f);
707  var_wGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f);
708  var_wGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f);
709  var_wGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f);
710  var_wGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
712  var_wGwGSF_Barrel_[13] = tauVars.emFraction;
713  var_wGwGSF_Barrel_[14] = tauGammaMoms.signalPFGammaCandsIn;
714  var_wGwGSF_Barrel_[15] = tauGammaMoms.signalPFGammaCandsOut;
715  var_wGwGSF_Barrel_[16] = tauVars.leadPFChargedHadrHoP;
716  var_wGwGSF_Barrel_[17] = tauVars.leadPFChargedHadrEoP;
717  var_wGwGSF_Barrel_[18] = tauVars.visMassIn;
718  var_wGwGSF_Barrel_[19] = tauGammaMoms.gammaEtaMomIn;
719  var_wGwGSF_Barrel_[20] = tauGammaMoms.gammaEtaMomOut;
720  var_wGwGSF_Barrel_[21] = tauGammaMoms.gammaPhiMomIn;
721  var_wGwGSF_Barrel_[22] = tauGammaMoms.gammaPhiMomOut;
722  var_wGwGSF_Barrel_[23] = tauGammaMoms.gammaEnFracIn;
723  var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEnFracOut;
724  var_wGwGSF_Barrel_[25] = tauVars.dCrackEta;
725  var_wGwGSF_Barrel_[26] = tauVars.etaAtEcalEntrance;
726  var_wGwGSF_Barrel_[27] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
727  var_wGwGSF_Barrel_[28] = elecVars.deltaEta;
728  var_wGwGSF_Barrel_[29] = elecVars.deltaPhi;
729  var_wGwGSF_Barrel_[30] = elecVars.sigmaIPhiIPhi5x5;
730  var_wGwGSF_Barrel_[31] = elecVars.sigmaIEtaIEta5x5;
731  var_wGwGSF_Barrel_[32] = elecVars.showerCircularity;
736  } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) {
737  var_wGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF));
738  var_wGwGSF_Endcap_[1] = elecVars.gsfNumHits;
739  var_wGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol));
740  var_wGwGSF_Endcap_[3] = elecVars.gsfTracklnPt;
741  var_wGwGSF_Endcap_[4] = elecNumHitsDiffOverSum;
742  var_wGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF));
743  var_wGwGSF_Endcap_[6] = elecVars.eEcal;
744  var_wGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
746  var_wGwGSF_Endcap_[9] = tauGammaMoms.signalPFGammaCandsIn;
747  var_wGwGSF_Endcap_[10] = tauGammaMoms.signalPFGammaCandsOut;
748  var_wGwGSF_Endcap_[11] = tauVars.visMassIn;
749  var_wGwGSF_Endcap_[12] = tauGammaMoms.gammaEtaMomIn;
750  var_wGwGSF_Endcap_[13] = tauGammaMoms.gammaEtaMomOut;
751  var_wGwGSF_Endcap_[14] = tauGammaMoms.gammaPhiMomIn;
752  var_wGwGSF_Endcap_[15] = tauGammaMoms.gammaPhiMomOut;
753  var_wGwGSF_Endcap_[16] = tauGammaMoms.gammaEnFracIn;
754  var_wGwGSF_Endcap_[17] = tauGammaMoms.gammaEnFracOut;
755  var_wGwGSF_Endcap_[18] = tauVars.dCrackEta;
756  var_wGwGSF_Endcap_[19] = tauVars.etaAtEcalEntrance;
757  var_wGwGSF_Endcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
758  var_wGwGSF_Endcap_[21] = elecVars.hgcalSigmaVV;
759  var_wGwGSF_Endcap_[22] = elecVars.hgcalSigmaEE;
760  var_wGwGSF_Endcap_[23] = elecVars.hgcalSigmaPP;
761  var_wGwGSF_Endcap_[24] = elecVars.hgcalNLayers;
762  var_wGwGSF_Endcap_[25] = elecVars.hgcalFirstLayer;
763  var_wGwGSF_Endcap_[26] = elecVars.hgcalLastLayer;
764  var_wGwGSF_Endcap_[27] = elecVars.hgcalLayerEfrac10;
765  var_wGwGSF_Endcap_[28] = elecVars.hgcalLayerEfrac90;
766  var_wGwGSF_Endcap_[29] = elecVars.hgcalEcEnergyEE;
767  var_wGwGSF_Endcap_[30] = elecVars.hgcalEcEnergyFH;
768  var_wGwGSF_Endcap_[31] = elecVars.hgcalMeasuredDepth;
769  var_wGwGSF_Endcap_[32] = elecVars.hgcalExpectedDepth;
770  var_wGwGSF_Endcap_[33] = elecVars.deltaEta;
771  var_wGwGSF_Endcap_[34] = elecVars.deltaPhi;
776  } else {
777  var_wGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF));
778  var_wGwGSF_VFEndcap_[1] = elecVars.gsfNumHits;
780  var_wGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt;
781  var_wGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum;
782  var_wGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF));
783  var_wGwGSF_VFEndcap_[6] = elecVars.eEcal;
784  var_wGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt));
786  var_wGwGSF_VFEndcap_[9] = tauGammaMoms.signalPFGammaCandsIn;
787  var_wGwGSF_VFEndcap_[10] = tauGammaMoms.signalPFGammaCandsOut;
788  var_wGwGSF_VFEndcap_[11] = tauVars.visMassIn;
789  var_wGwGSF_VFEndcap_[12] = tauGammaMoms.gammaEtaMomIn;
790  var_wGwGSF_VFEndcap_[13] = tauGammaMoms.gammaEtaMomOut;
791  var_wGwGSF_VFEndcap_[14] = tauGammaMoms.gammaPhiMomIn;
792  var_wGwGSF_VFEndcap_[15] = tauGammaMoms.gammaPhiMomOut;
793  var_wGwGSF_VFEndcap_[16] = tauGammaMoms.gammaEnFracIn;
794  var_wGwGSF_VFEndcap_[17] = tauGammaMoms.gammaEnFracOut;
795  var_wGwGSF_VFEndcap_[18] = tauVars.dCrackEta;
796  var_wGwGSF_VFEndcap_[19] = tauVars.etaAtEcalEntrance;
797  var_wGwGSF_VFEndcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance;
798  var_wGwGSF_VFEndcap_[21] = elecVars.hgcalSigmaUU;
799  var_wGwGSF_VFEndcap_[22] = elecVars.hgcalSigmaVV;
800  var_wGwGSF_VFEndcap_[23] = elecVars.hgcalSigmaEE;
801  var_wGwGSF_VFEndcap_[24] = elecVars.hgcalSigmaPP;
802  var_wGwGSF_VFEndcap_[25] = elecVars.hgcalNLayers;
803  var_wGwGSF_VFEndcap_[26] = elecVars.hgcalLastLayer;
806  var_wGwGSF_VFEndcap_[29] = elecVars.hgcalEcEnergyEE;
807  var_wGwGSF_VFEndcap_[30] = elecVars.hgcalEcEnergyFH;
812  var_wGwGSF_VFEndcap_[35] = elecVars.deltaEta;
813  var_wGwGSF_VFEndcap_[36] = elecVars.deltaPhi;
818  }
819  }
820  return mvaValue;
821 }
std::vector< float > var_NoEleMatch_wGwoGSF_Barrel_
std::vector< float > var_wGwGSF_Endcap_
std::vector< float > var_wGwGSF_VFEndcap_
const GBRForest * mva_NoEleMatch_wGwoGSF_BL_
const GBRForest * mva_woGwGSF_EC_
const GBRForest * mva_NoEleMatch_wGwoGSF_VFEC_
const GBRForest * mva_wGwGSF_EC_
std::vector< float > var_NoEleMatch_woGwoGSF_Endcap_
const GBRForest * mva_NoEleMatch_wGwoGSF_EC_
const GBRForest * mva_wGwGSF_VFEC_
static constexpr float ecalEndcapVFEndcapEtaBorder_
std::vector< float > var_wGwGSF_Barrel_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
std::vector< float > var_woGwGSF_Endcap_
const GBRForest * mva_woGwGSF_BL_
std::vector< float > var_NoEleMatch_woGwoGSF_Barrel_
const GBRForest * mva_NoEleMatch_woGwoGSF_VFEC_
const GBRForest * mva_woGwGSF_VFEC_
double mvaValue(const antiElecIDMVA6_blocks::TauVars &tauVars, const antiElecIDMVA6_blocks::TauGammaVecs &tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars &elecVars)
const GBRForest * mva_NoEleMatch_woGwoGSF_EC_
const GBRForest * mva_NoEleMatch_woGwoGSF_BL_
double GetClassifier(const float *vector) const
Definition: GBRForest.h:33
std::vector< float > var_NoEleMatch_wGwoGSF_VFEndcap_
static constexpr float ecalBarrelEndcapEtaBorder_
std::vector< float > var_NoEleMatch_wGwoGSF_Endcap_
const GBRForest * mva_wGwGSF_BL_
std::vector< float > var_woGwGSF_Barrel_
std::vector< float > var_NoEleMatch_woGwoGSF_VFEndcap_
std::vector< float > var_woGwGSF_VFEndcap_

Member Data Documentation

◆ ecalBarrelEndcapEtaBorder_

template<class TauType , class ElectronType >
constexpr float AntiElectronIDMVA6< TauType, ElectronType >::ecalBarrelEndcapEtaBorder_ = 1.479
staticprivate

Definition at line 162 of file AntiElectronIDMVA6.h.

◆ ecalEndcapVFEndcapEtaBorder_

template<class TauType , class ElectronType >
constexpr float AntiElectronIDMVA6< TauType, ElectronType >::ecalEndcapVFEndcapEtaBorder_ = 2.4
staticprivate

Definition at line 163 of file AntiElectronIDMVA6.h.

◆ electronIds_

template<class TauType , class ElectronType >
std::map<std::string, edm::Handle<edm::ValueMap<float> > > AntiElectronIDMVA6< TauType, ElectronType >::electronIds_
private

◆ electronIds_tokens_

template<class TauType , class ElectronType >
std::map<std::string, edm::EDGetTokenT<edm::ValueMap<float> > > AntiElectronIDMVA6< TauType, ElectronType >::electronIds_tokens_
private

◆ inputFileName_

template<class TauType , class ElectronType >
edm::FileInPath AntiElectronIDMVA6< TauType, ElectronType >::inputFileName_
private

◆ inputFilesToDelete_

template<class TauType , class ElectronType >
std::vector<TFile*> AntiElectronIDMVA6< TauType, ElectronType >::inputFilesToDelete_
private

Definition at line 223 of file AntiElectronIDMVA6.h.

◆ isInitialized_

template<class TauType , class ElectronType >
bool AntiElectronIDMVA6< TauType, ElectronType >::isInitialized_
private

Definition at line 165 of file AntiElectronIDMVA6.h.

◆ isPhase2_

template<class TauType , class ElectronType >
const bool AntiElectronIDMVA6< TauType, ElectronType >::isPhase2_
private

◆ loadMVAfromDB_

template<class TauType , class ElectronType >
bool AntiElectronIDMVA6< TauType, ElectronType >::loadMVAfromDB_
private

◆ mva_NoEleMatch_wGwoGSF_BL_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_NoEleMatch_wGwoGSF_BL_
private

Definition at line 211 of file AntiElectronIDMVA6.h.

◆ mva_NoEleMatch_wGwoGSF_EC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_NoEleMatch_wGwoGSF_EC_
private

Definition at line 215 of file AntiElectronIDMVA6.h.

◆ mva_NoEleMatch_wGwoGSF_VFEC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_NoEleMatch_wGwoGSF_VFEC_
private

Definition at line 219 of file AntiElectronIDMVA6.h.

◆ mva_NoEleMatch_woGwoGSF_BL_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_NoEleMatch_woGwoGSF_BL_
private

Definition at line 210 of file AntiElectronIDMVA6.h.

◆ mva_NoEleMatch_woGwoGSF_EC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_NoEleMatch_woGwoGSF_EC_
private

Definition at line 214 of file AntiElectronIDMVA6.h.

◆ mva_NoEleMatch_woGwoGSF_VFEC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_NoEleMatch_woGwoGSF_VFEC_
private

Definition at line 218 of file AntiElectronIDMVA6.h.

◆ mva_wGwGSF_BL_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_wGwGSF_BL_
private

Definition at line 213 of file AntiElectronIDMVA6.h.

◆ mva_wGwGSF_EC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_wGwGSF_EC_
private

Definition at line 217 of file AntiElectronIDMVA6.h.

◆ mva_wGwGSF_VFEC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_wGwGSF_VFEC_
private

Definition at line 221 of file AntiElectronIDMVA6.h.

◆ mva_woGwGSF_BL_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_woGwGSF_BL_
private

Definition at line 212 of file AntiElectronIDMVA6.h.

◆ mva_woGwGSF_EC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_woGwGSF_EC_
private

Definition at line 216 of file AntiElectronIDMVA6.h.

◆ mva_woGwGSF_VFEC_

template<class TauType , class ElectronType >
const GBRForest* AntiElectronIDMVA6< TauType, ElectronType >::mva_woGwGSF_VFEC_
private

Definition at line 220 of file AntiElectronIDMVA6.h.

◆ mvaName_NoEleMatch_wGwoGSF_BL_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_wGwoGSF_BL_
private

◆ mvaName_NoEleMatch_wGwoGSF_EC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_wGwoGSF_EC_
private

◆ mvaName_NoEleMatch_wGwoGSF_VFEC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_wGwoGSF_VFEC_
private

◆ mvaName_NoEleMatch_woGwoGSF_BL_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_woGwoGSF_BL_
private

◆ mvaName_NoEleMatch_woGwoGSF_EC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_woGwoGSF_EC_
private

◆ mvaName_NoEleMatch_woGwoGSF_VFEC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_NoEleMatch_woGwoGSF_VFEC_
private

◆ mvaName_wGwGSF_BL_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_wGwGSF_BL_
private

◆ mvaName_wGwGSF_EC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_wGwGSF_EC_
private

◆ mvaName_wGwGSF_VFEC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_wGwGSF_VFEC_
private

◆ mvaName_woGwGSF_BL_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_woGwGSF_BL_
private

◆ mvaName_woGwGSF_EC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_woGwGSF_EC_
private

◆ mvaName_woGwGSF_VFEC_

template<class TauType , class ElectronType >
std::string AntiElectronIDMVA6< TauType, ElectronType >::mvaName_woGwGSF_VFEC_
private

◆ mvaToken_NoEleMatch_wGwoGSF_BL_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_wGwoGSF_BL_
private

◆ mvaToken_NoEleMatch_wGwoGSF_EC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_wGwoGSF_EC_
private

◆ mvaToken_NoEleMatch_wGwoGSF_VFEC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_wGwoGSF_VFEC_
private

◆ mvaToken_NoEleMatch_woGwoGSF_BL_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_woGwoGSF_BL_
private

◆ mvaToken_NoEleMatch_woGwoGSF_EC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_woGwoGSF_EC_
private

◆ mvaToken_NoEleMatch_woGwoGSF_VFEC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_NoEleMatch_woGwoGSF_VFEC_
private

◆ mvaToken_wGwGSF_BL_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_wGwGSF_BL_
private

◆ mvaToken_wGwGSF_EC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_wGwGSF_EC_
private

◆ mvaToken_wGwGSF_VFEC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_wGwGSF_VFEC_
private

◆ mvaToken_woGwGSF_BL_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_woGwGSF_BL_
private

◆ mvaToken_woGwGSF_EC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_woGwGSF_EC_
private

◆ mvaToken_woGwGSF_VFEC_

template<class TauType , class ElectronType >
edm::ESGetToken<GBRForest, GBRWrapperRcd> AntiElectronIDMVA6< TauType, ElectronType >::mvaToken_woGwGSF_VFEC_
private

◆ positionAtECalEntrance_

template<class TauType , class ElectronType >
PositionAtECalEntranceComputer AntiElectronIDMVA6< TauType, ElectronType >::positionAtECalEntrance_
private

Definition at line 227 of file AntiElectronIDMVA6.h.

◆ usePhiAtEcalEntranceExtrapolation_

template<class TauType , class ElectronType >
bool AntiElectronIDMVA6< TauType, ElectronType >::usePhiAtEcalEntranceExtrapolation_
private

◆ var_NoEleMatch_wGwoGSF_Barrel_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_wGwoGSF_Barrel_
private

◆ var_NoEleMatch_wGwoGSF_Endcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_wGwoGSF_Endcap_
private

◆ var_NoEleMatch_wGwoGSF_VFEndcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_wGwoGSF_VFEndcap_
private

◆ var_NoEleMatch_woGwoGSF_Barrel_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_woGwoGSF_Barrel_
private

◆ var_NoEleMatch_woGwoGSF_Endcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_woGwoGSF_Endcap_
private

◆ var_NoEleMatch_woGwoGSF_VFEndcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_NoEleMatch_woGwoGSF_VFEndcap_
private

◆ var_wGwGSF_Barrel_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_wGwGSF_Barrel_
private

◆ var_wGwGSF_Endcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_wGwGSF_Endcap_
private

◆ var_wGwGSF_VFEndcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_wGwGSF_VFEndcap_
private

◆ var_woGwGSF_Barrel_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_woGwGSF_Barrel_
private

◆ var_woGwGSF_Endcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_woGwGSF_Endcap_
private

◆ var_woGwGSF_VFEndcap_

template<class TauType , class ElectronType >
std::vector<float> AntiElectronIDMVA6< TauType, ElectronType >::var_woGwGSF_VFEndcap_
private

◆ verbosity_

template<class TauType , class ElectronType >
const int AntiElectronIDMVA6< TauType, ElectronType >::verbosity_
private

Definition at line 232 of file AntiElectronIDMVA6.h.