5 #include "TMVA/MethodBDT.h" 12 _MethodName(
"BDTG method"),
13 _useValueMaps(conf.getParameter<
bool>(
"useValueMaps")),
14 _full5x5SigmaIEtaIEtaMapLabel(conf.getParameter<
edm::InputTag>(
"full5x5SigmaIEtaIEtaMap")),
15 _full5x5SigmaIEtaIPhiMapLabel(conf.getParameter<
edm::InputTag>(
"full5x5SigmaIEtaIPhiMap")),
16 _full5x5E1x3MapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E1x3Map")),
17 _full5x5E2x2MapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E2x2Map")),
18 _full5x5E2x5MaxMapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E2x5MaxMap")),
19 _full5x5E5x5MapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E5x5Map")),
20 _esEffSigmaRRMapLabel(conf.getParameter<
edm::InputTag>(
"esEffSigmaRRMap")),
21 _phoChargedIsolationLabel(conf.getParameter<
edm::InputTag>(
"phoChargedIsolation")),
22 _phoPhotonIsolationLabel(conf.getParameter<
edm::InputTag>(
"phoPhotonIsolation")),
23 _phoWorstChargedIsolationLabel(conf.getParameter<
edm::InputTag>(
"phoWorstChargedIsolation")),
24 _rhoLabel(conf.getParameter<
edm::InputTag>(
"rho"))
32 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
36 <<
"wrong number of weightfiles" << std::endl;
61 printf(
"Printout of the photon variable inputs for MVA:\n");
62 printf(
" varPhi_ %f\n", vars[0] );
63 printf(
" varR9_ %f\n", vars[1] );
64 printf(
" varSieie_ %f\n", vars[2] );
65 printf(
" varSieip_ %f\n", vars[3] );
66 printf(
" varE1x3overE5x5_ %f\n", vars[4] );
67 printf(
" varE2x2overE5x5_ %f\n", vars[5] );
68 printf(
" varE2x5overE5x5_ %f\n", vars[6] );
69 printf(
" varSCEta_ %f\n", vars[7] );
70 printf(
" varRawE_ %f\n", vars[8] );
71 printf(
" varSCEtaWidth_ %f\n", vars[9] );
72 printf(
" varSCPhiWidth_ %f\n", vars[10] );
73 printf(
" varRho_ %f\n", vars[11] );
74 printf(
" varPhoIsoRaw_ %f\n", vars[12] );
75 printf(
" varChIsoRaw_ %f\n", vars[13] );
76 printf(
" varWorstChRaw_ %f\n", vars[14] );
78 printf(
" varESEnOverRawE_ %f\n", vars[15] );
79 printf(
" varESEffSigmaRR_ %f\n", vars[16] );
81 printf(
" varPt_ %f\n", vars[17] );
82 printf(
" varEta_ %f\n", vars[18] );
85 printf(
" varPt_ %f\n", vars[15] );
86 printf(
" varEta_ %f\n", vars[16] );
100 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
101 <<
" but appears to be neither" << std::endl;
173 && full5x5SigmaIEtaIPhiMap.
isValid()
178 && esEffSigmaRRMap.
isValid() ) )
179 && phoChargedIsolationMap.
isValid()
180 && phoPhotonIsolationMap.
isValid()
181 && phoWorstChargedIsolationMap.
isValid()
184 <<
"Failed to retrieve event content needed for this MVA" 186 <<
"Check python MVA configuration file and make sure all needed" 188 <<
"producers are running upstream" << std::endl;
196 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
197 <<
" but appears to be neither" << std::endl;
214 e1x3 = (*full5x5E1x3Map )[ phoRecoPtr ];
215 e2x2 = (*full5x5E2x2Map )[ phoRecoPtr ];
216 e2x5 = (*full5x5E2x5MaxMap)[ phoRecoPtr ];
217 e5x5 = (*full5x5E5x5Map )[ phoRecoPtr ];
218 full5x5_sigmaIetaIeta = (*full5x5SigmaIEtaIEtaMap)[ phoRecoPtr ];
219 full5x5_sigmaIetaIphi = (*full5x5SigmaIEtaIPhiMap)[ phoRecoPtr ];
220 effSigmaRR = (*esEffSigmaRRMap)[ phoRecoPtr ];
224 e1x3 = full5x5_pss.
e1x3;
225 e2x2 = full5x5_pss.e2x2;
226 e2x5 = full5x5_pss.e2x5Max;
227 e5x5 = full5x5_pss.e5x5;
228 full5x5_sigmaIetaIeta = full5x5_pss.sigmaIetaIeta;
229 full5x5_sigmaIetaIphi = full5x5_pss.sigmaIetaIphi;
230 effSigmaRR = full5x5_pss.effSigmaRR;
234 allMVAVars.
varR9 = phoRecoPtr->
r9() ;
235 allMVAVars.
varSieie = full5x5_sigmaIetaIeta;
236 allMVAVars.
varSieip = full5x5_sigmaIetaIphi;
240 allMVAVars.
varSCEta = superCluster->eta();
241 allMVAVars.
varRawE = superCluster->rawEnergy();
244 allMVAVars.
varESEnOverRawE = superCluster->preshowerEnergy() / superCluster->rawEnergy();
247 allMVAVars.
varPhoIsoRaw = (*phoPhotonIsolationMap)[phoRecoPtr];
248 allMVAVars.
varChIsoRaw = (*phoChargedIsolationMap)[phoRecoPtr];
249 allMVAVars.
varWorstChRaw = (*phoWorstChargedIsolationMap)[phoRecoPtr];
251 allMVAVars.
varPt = phoRecoPtr->
pt();
256 std::vector<float> vars;
332 "PhotonMVAEstimatorRun2Phys14NonTrig");
T getParameter(std::string const &) const
const edm::InputTag _esEffSigmaRRMapLabel
const edm::InputTag _full5x5E2x5MaxMapLabel
double eta() const final
momentum pseudorapidity
void setConsumes(edm::ConsumesCollector &&) const override
const edm::InputTag _rhoLabel
const edm::InputTag _full5x5E2x2MapLabel
double pt() const final
transverse momentum
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
const edm::InputTag _phoPhotonIsolationLabel
std::vector< float > packMVAVariables(const Args...args) const
float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
const edm::InputTag _phoWorstChargedIsolationLabel
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
const edm::InputTag _full5x5SigmaIEtaIPhiMapLabel
bool isEndcapCategory(int category) const
bool isNull() const
Checks for null.
Abs< T >::type abs(const T &t)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const edm::InputTag _full5x5E5x5MapLabel
bool isEndcap(GeomDetEnumerators::SubDetector m)
~PhotonMVAEstimatorRun2Phys14NonTrig() override
const edm::InputTag _full5x5E1x3MapLabel
PhotonMVAEstimatorRun2Phys14NonTrig(const edm::ParameterSet &conf)
void constrainMVAVariables(AllVariables &vars) const
const edm::InputTag _full5x5SigmaIEtaIEtaMapLabel
const ShowerShape & full5x5_showerShapeVariables() const
const edm::InputTag _phoChargedIsolationLabel
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< const GBRForest > > _gbrForests
double phi() const final
momentum azimuthal angle
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override