5 #include "TMVA/MethodBDT.h" 9 _MethodName(
"BDTG method"),
10 _useValueMaps(conf.getParameter<
bool>(
"useValueMaps")),
11 _full5x5SigmaIEtaIEtaMapLabel(conf.getParameter<
edm::InputTag>(
"full5x5SigmaIEtaIEtaMap")),
12 _full5x5SigmaIEtaIPhiMapLabel(conf.getParameter<
edm::InputTag>(
"full5x5SigmaIEtaIPhiMap")),
13 _full5x5E1x3MapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E1x3Map")),
14 _full5x5E2x2MapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E2x2Map")),
15 _full5x5E2x5MaxMapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E2x5MaxMap")),
16 _full5x5E5x5MapLabel(conf.getParameter<
edm::InputTag>(
"full5x5E5x5Map")),
17 _esEffSigmaRRMapLabel(conf.getParameter<
edm::InputTag>(
"esEffSigmaRRMap")),
18 _phoChargedIsolationLabel(conf.getParameter<
edm::InputTag>(
"phoChargedIsolation")),
19 _phoPhotonIsolationLabel(conf.getParameter<
edm::InputTag>(
"phoPhotonIsolation")),
20 _phoWorstChargedIsolationLabel(conf.getParameter<
edm::InputTag>(
"phoWorstChargedIsolation")),
21 _rhoLabel(conf.getParameter<
edm::InputTag>(
"rho"))
30 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
34 <<
"wrong number of weightfiles" << std::endl;
66 const bool debug =
false;
68 printf(
"Printout of the photon variable inputs for MVA:\n");
69 printf(
" varPhi_ %f\n", vars[0] );
70 printf(
" varR9_ %f\n", vars[1] );
71 printf(
" varSieie_ %f\n", vars[2] );
72 printf(
" varSieip_ %f\n", vars[3] );
73 printf(
" varE1x3overE5x5_ %f\n", vars[4] );
74 printf(
" varE2x2overE5x5_ %f\n", vars[5] );
75 printf(
" varE2x5overE5x5_ %f\n", vars[6] );
76 printf(
" varSCEta_ %f\n", vars[7] );
77 printf(
" varRawE_ %f\n", vars[8] );
78 printf(
" varSCEtaWidth_ %f\n", vars[9] );
79 printf(
" varSCPhiWidth_ %f\n", vars[10] );
80 printf(
" varRho_ %f\n", vars[11] );
81 printf(
" varPhoIsoRaw_ %f\n", vars[12] );
82 printf(
" varChIsoRaw_ %f\n", vars[13] );
83 printf(
" varWorstChRaw_ %f\n", vars[14] );
85 printf(
" varESEnOverRawE_ %f\n", vars[15] );
86 printf(
" varESEffSigmaRR_ %f\n", vars[16] );
88 printf(
" varPt_ %f\n", vars[17] );
89 printf(
" varEta_ %f\n", vars[18] );
92 printf(
" varPt_ %f\n", vars[15] );
93 printf(
" varEta_ %f\n", vars[16] );
107 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
108 <<
" but appears to be neither" << std::endl;
181 && full5x5SigmaIEtaIPhiMap.
isValid()
186 && esEffSigmaRRMap.
isValid() ) )
187 && phoChargedIsolationMap.
isValid()
188 && phoPhotonIsolationMap.
isValid()
189 && phoWorstChargedIsolationMap.
isValid()
192 <<
"Failed to retrieve event content needed for this MVA" 194 <<
"Check python MVA configuration file and make sure all needed" 196 <<
"producers are running upstream" << std::endl;
203 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
204 <<
" but appears to be neither" << std::endl;
223 e1x3 = (*full5x5E1x3Map )[ phoRecoPtr ];
224 e2x2 = (*full5x5E2x2Map )[ phoRecoPtr ];
225 e2x5 = (*full5x5E2x5MaxMap)[ phoRecoPtr ];
226 e5x5 = (*full5x5E5x5Map )[ phoRecoPtr ];
227 full5x5_sigmaIetaIeta = (*full5x5SigmaIEtaIEtaMap)[ phoRecoPtr ];
228 full5x5_sigmaIetaIphi = (*full5x5SigmaIEtaIPhiMap)[ phoRecoPtr ];
229 effSigmaRR = (*esEffSigmaRRMap)[ phoRecoPtr ];
233 e1x3 = full5x5_pss.
e1x3;
234 e2x2 = full5x5_pss.e2x2;
235 e2x5 = full5x5_pss.e2x5Max;
236 e5x5 = full5x5_pss.e5x5;
237 full5x5_sigmaIetaIeta = full5x5_pss.sigmaIetaIeta;
238 full5x5_sigmaIetaIphi = full5x5_pss.sigmaIetaIphi;
239 effSigmaRR = full5x5_pss.effSigmaRR;
243 allMVAVars.
varR9 = phoRecoPtr->
r9() ;
244 allMVAVars.
varSieie = full5x5_sigmaIetaIeta;
245 allMVAVars.
varSieip = full5x5_sigmaIetaIphi;
249 allMVAVars.
varSCEta = superCluster->eta();
250 allMVAVars.
varRawE = superCluster->rawEnergy();
253 allMVAVars.
varESEnOverRawE = superCluster->preshowerEnergy() / superCluster->rawEnergy();
256 allMVAVars.
varPhoIsoRaw = (*phoPhotonIsolationMap)[phoRecoPtr];
257 allMVAVars.
varChIsoRaw = (*phoChargedIsolationMap)[phoRecoPtr];
258 allMVAVars.
varWorstChRaw = (*phoWorstChargedIsolationMap)[phoRecoPtr];
260 allMVAVars.
varPt = phoRecoPtr->
pt();
265 std::vector<float> vars;
340 "PhotonMVAEstimatorRun2Spring15NonTrig");
T getParameter(std::string const &) const
const edm::InputTag _phoWorstChargedIsolationLabel
const edm::InputTag _full5x5E1x3MapLabel
double eta() const final
momentum pseudorapidity
const edm::InputTag _full5x5E2x2MapLabel
bool isEndcapCategory(int category) const
const edm::InputTag _phoChargedIsolationLabel
double pt() const final
transverse momentum
const edm::InputTag _full5x5SigmaIEtaIEtaMapLabel
const edm::InputTag _full5x5E5x5MapLabel
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
std::vector< float > packMVAVariables(const Args...args) const
const edm::InputTag _phoPhotonIsolationLabel
PhotonMVAEstimatorRun2Spring15NonTrig(const edm::ParameterSet &conf)
const edm::InputTag _full5x5E2x5MaxMapLabel
bool isNull() const
Checks for null.
void setConsumes(edm::ConsumesCollector &&) const override
Abs< T >::type abs(const T &t)
~PhotonMVAEstimatorRun2Spring15NonTrig() override
void constrainMVAVariables(AllVariables &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isEndcap(GeomDetEnumerators::SubDetector m)
const edm::InputTag _full5x5SigmaIEtaIPhiMapLabel
const edm::InputTag _rhoLabel
const edm::InputTag _esEffSigmaRRMapLabel
float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
const ShowerShape & full5x5_showerShapeVariables() const
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< const GBRForest > > _gbrForests
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &iEvent) const override
double phi() const final
momentum azimuthal angle