4 #include "TMVA/MethodBDT.h" 9 MethodName_(
"BDTG method"),
10 phoChargedIsolationLabel_(conf.getParameter<
edm::InputTag>(
"phoChargedIsolation")),
11 phoPhotonIsolationLabel_(conf.getParameter<
edm::InputTag>(
"phoPhotonIsolation")),
12 phoWorstChargedIsolationLabel_(conf.getParameter<
edm::InputTag>(
"phoWorstChargedIsolation")),
13 rhoLabel_(conf.getParameter<
edm::InputTag>(
"rho")),
14 effectiveAreas_( (conf.getParameter<
edm::FileInPath>(
"effAreasConfigFile")).fullPath()),
15 phoIsoPtScalingCoeff_(conf.getParameter<
std::vector<double >>(
"phoIsoPtScalingCoeff")),
16 phoIsoCutoff_(conf.getParameter<double>(
"phoIsoCutoff"))
25 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
29 <<
"wrong number of weightfiles" << std::endl;
62 const bool debug =
false;
66 printf(
"Printout of the photon variable inputs for MVA:\n");
67 printf(
" varSCPhi_ %f\n", vars[0] );
68 printf(
" varR9_ %f\n", vars[1] );
69 printf(
" varSieie_ %f\n", vars[2] );
70 printf(
" varSieip_ %f\n", vars[3] );
71 printf(
" varE2x2overE5x5_ %f\n", vars[4] );
72 printf(
" varSCEta_ %f\n", vars[5] );
73 printf(
" varRawE_ %f\n", vars[6] );
74 printf(
" varSCEtaWidth_ %f\n", vars[7] );
75 printf(
" varSCPhiWidth_ %f\n", vars[8] );
76 printf(
" varRho_ %f\n", vars[9] );
78 printf(
" varPhoIsoRaw_ %f\n", vars[10] );
80 printf(
" varPhoIsoRawCorr_ %f\n", vars[10] );
82 printf(
" varChIsoRaw_ %f\n", vars[11] );
83 printf(
" varWorstChRaw_ %f\n", vars[12] );
85 printf(
" varESEnOverRawE_ %f\n", vars[13] );
86 printf(
" varESEffSigmaRR_ %f\n", vars[14] );
100 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
101 <<
" but appears to be neither" << std::endl;
159 if(! ( phoChargedIsolationMap.
isValid()
160 && phoPhotonIsolationMap.
isValid()
161 && phoWorstChargedIsolationMap.
isValid()
164 <<
"Failed to retrieve event content needed for this MVA" 166 <<
"Check python MVA configuration file and make sure all needed" 168 <<
"producers are running upstream" << std::endl;
175 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
176 <<
" but appears to be neither" << std::endl;
191 e2x2 = full5x5_pss.
e2x2;
192 e5x5 = full5x5_pss.e5x5;
193 full5x5_sigmaIetaIeta = full5x5_pss.sigmaIetaIeta;
194 full5x5_sigmaIetaIphi = full5x5_pss.sigmaIetaIphi;
195 effSigmaRR = full5x5_pss.effSigmaRR;
197 allMVAVars.
scPhi = superCluster->phi();
198 allMVAVars.
varR9 = phoRecoPtr->
r9() ;
199 allMVAVars.
varSieie = full5x5_sigmaIetaIeta;
200 allMVAVars.
varSieip = full5x5_sigmaIetaIphi;
202 allMVAVars.
varSCEta = superCluster->eta();
203 allMVAVars.
varRawE = superCluster->rawEnergy();
206 allMVAVars.
varESEnOverRawE = superCluster->preshowerEnergy() / superCluster->rawEnergy();
209 allMVAVars.
varPhoIsoRaw = (*phoPhotonIsolationMap)[phoRecoPtr];
210 allMVAVars.
varChIsoRaw = (*phoChargedIsolationMap)[phoRecoPtr];
211 allMVAVars.
varWorstChRaw = (*phoWorstChargedIsolationMap)[phoRecoPtr];
216 double phoIsoPtScalingCoeffVal = 0;
221 double phoIsoCorr = (*phoPhotonIsolationMap)[phoRecoPtr] - eA*(*rho) - phoIsoPtScalingCoeffVal*phoRecoPtr->
pt();
230 std::vector<float> vars;
290 "PhotonMVAEstimatorRun2Spring16NonTrig");
T getParameter(std::string const &) const
float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
~PhotonMVAEstimatorRun2Spring16NonTrig() override
double pt() const final
transverse momentum
const edm::InputTag rhoLabel_
PhotonMVAEstimatorRun2Spring16NonTrig(const edm::ParameterSet &conf)
const float getEffectiveArea(float eta) const
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
std::vector< float > packMVAVariables(const Args...args) const
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &iEvent) const override
void constrainMVAVariables(AllVariables &) const
bool isEndcapCategory(int category) const
bool isNull() const
Checks for null.
Abs< T >::type abs(const T &t)
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
const edm::InputTag phoPhotonIsolationLabel_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isEndcap(GeomDetEnumerators::SubDetector m)
const edm::InputTag phoChargedIsolationLabel_
EffectiveAreas effectiveAreas_
void setConsumes(edm::ConsumesCollector &&) const override
const ShowerShape & full5x5_showerShapeVariables() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
const edm::InputTag phoWorstChargedIsolationLabel_
std::vector< double > phoIsoPtScalingCoeff_