CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes
PhotonMVAEstimatorRun2Phys14NonTrig Class Reference

#include <PhotonMVAEstimatorRun2Phys14NonTrig.h>

Inheritance diagram for PhotonMVAEstimatorRun2Phys14NonTrig:
AnyMVAEstimatorRun2Base

Classes

struct  AllVariables
 

Public Types

enum  mvaCategories { UNDEFINED = -1, CAT_EB = 0, CAT_EE = 1 }
 

Public Member Functions

void constrainMVAVariables (AllVariables &vars) const
 
std::vector< float > fillMVAVariables (const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
 
int findCategory (const edm::Ptr< reco::Candidate > &particle) const override
 
const std::string & getName () const final
 
int getNCategories () const final
 
const std::string & getTag () const final
 
bool isEndcapCategory (int category) const
 
float mvaValue (const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
 
 PhotonMVAEstimatorRun2Phys14NonTrig (const edm::ParameterSet &conf)
 
void setConsumes (edm::ConsumesCollector &&) const override
 
 ~PhotonMVAEstimatorRun2Phys14NonTrig () override
 
- Public Member Functions inherited from AnyMVAEstimatorRun2Base
 AnyMVAEstimatorRun2Base (const edm::ParameterSet &conf)
 
virtual void getEventContent (const edm::Event &iEvent) const final
 
template<typename... Args>
std::vector< float > packMVAVariables (const Args...args) const
 
virtual ~AnyMVAEstimatorRun2Base ()
 

Public Attributes

const int nCategories = 2
 
- Public Attributes inherited from AnyMVAEstimatorRun2Base
const edm::ParameterSet _conf
 

Private Attributes

AllVariables _allMVAVars
 
const edm::InputTag _esEffSigmaRRMapLabel
 
const edm::InputTag _full5x5E1x3MapLabel
 
const edm::InputTag _full5x5E2x2MapLabel
 
const edm::InputTag _full5x5E2x5MaxMapLabel
 
const edm::InputTag _full5x5E5x5MapLabel
 
const edm::InputTag _full5x5SigmaIEtaIEtaMapLabel
 
const edm::InputTag _full5x5SigmaIEtaIPhiMapLabel
 
std::vector< std::unique_ptr< const GBRForest > > _gbrForests
 
const std::string _MethodName
 
const std::string _name = "PhotonMVAEstimatorRun2Phys14NonTrig"
 
const edm::InputTag _phoChargedIsolationLabel
 
const edm::InputTag _phoPhotonIsolationLabel
 
const edm::InputTag _phoWorstChargedIsolationLabel
 
const edm::InputTag _rhoLabel
 
std::string _tag
 
const bool _useValueMaps
 

Detailed Description

Definition at line 21 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

PhotonMVAEstimatorRun2Phys14NonTrig::PhotonMVAEstimatorRun2Phys14NonTrig ( const edm::ParameterSet conf)

Definition at line 7 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References _gbrForests, _tag, GBRForestTools::createGBRForest(), Exception, edm::ParameterSet::getParameter(), mps_fire::i, nCategories, AlCaHLTBitMon_QueryRunRegistry::string, electrons_cff::weightFile, mvaElectronID_Fall17_iso_V1_cff::weightFileNames, and ~PhotonMVAEstimatorRun2Phys14NonTrig().

7  :
9  // The method name is just a key to retrieve this method later, it is not
10  // a control parameter for a reader (the full definition of the MVA type and
11  // everything else comes from the xml weight files).
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")),
25 {
26  //
27  // Construct the MVA estimators
28  //
29  _tag = conf.getParameter<std::string>("mvaTag");
30 
31  const std::vector <std::string> weightFileNames
32  = conf.getParameter<std::vector<std::string> >("weightFileNames");
33 
34  if( (int)(weightFileNames.size()) != nCategories )
35  throw cms::Exception("MVA config failure: ")
36  << "wrong number of weightfiles" << std::endl;
37 
38  // Create a TMVA reader object for each category
39  for(int i=0; i<nCategories; i++){
40  // Use unique_ptr so that all MVAs are properly cleaned up
41  // in the destructor
42  edm::FileInPath weightFile( weightFileNames[i] );
44  }
45 }
T getParameter(std::string const &) const
AnyMVAEstimatorRun2Base(const edm::ParameterSet &conf)
static std::unique_ptr< const GBRForest > createGBRForest(const std::string &weightFile)
std::vector< std::unique_ptr< const GBRForest > > _gbrForests
PhotonMVAEstimatorRun2Phys14NonTrig::~PhotonMVAEstimatorRun2Phys14NonTrig ( )
override

Definition at line 48 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References mvaValue().

Referenced by PhotonMVAEstimatorRun2Phys14NonTrig().

48  {
49 }

Member Function Documentation

void PhotonMVAEstimatorRun2Phys14NonTrig::constrainMVAVariables ( AllVariables vars) const

Definition at line 304 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

Referenced by fillMVAVariables(), and getTag().

304  {
305 
306  // Check that variables do not have crazy values
307 
308  // This function is currently empty as this specific MVA was not
309  // developed with restricting variables to specific physical ranges.
310  return;
311 
312 }
std::vector< float > PhotonMVAEstimatorRun2Phys14NonTrig::fillMVAVariables ( const edm::Ptr< reco::Candidate > &  particle,
const edm::Event iEvent 
) const
overridevirtual

Implements AnyMVAEstimatorRun2Base.

Definition at line 133 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References _esEffSigmaRRMapLabel, _full5x5E1x3MapLabel, _full5x5E2x2MapLabel, _full5x5E2x5MaxMapLabel, _full5x5E5x5MapLabel, _full5x5SigmaIEtaIEtaMapLabel, _full5x5SigmaIEtaIPhiMapLabel, _phoChargedIsolationLabel, _phoPhotonIsolationLabel, _phoWorstChargedIsolationLabel, _rhoLabel, _useValueMaps, constrainMVAVariables(), reco::Photon::ShowerShape::e1x3, heepElectronID_HEEPV50_CSA14_25ns_cff::e2x5, heepElectronID_HEEPV50_CSA14_25ns_cff::e5x5, mvaPhotonID_PHYS14_PU20bx25_nonTrig_V1_cff::esEffSigmaRRMap, reco::LeafCandidate::eta(), Exception, findCategory(), reco::Photon::full5x5_showerShapeVariables(), mvaPhotonID_PHYS14_PU20bx25_nonTrig_V1_cff::full5x5E1x3Map, mvaPhotonID_PHYS14_PU20bx25_nonTrig_V1_cff::full5x5E2x2Map, mvaPhotonID_PHYS14_PU20bx25_nonTrig_V1_cff::full5x5E2x5MaxMap, mvaPhotonID_PHYS14_PU20bx25_nonTrig_V1_cff::full5x5E5x5Map, cutBasedElectronID_CSA14_50ns_V1_cff::full5x5SigmaIEtaIEtaMap, mvaPhotonID_PHYS14_PU20bx25_nonTrig_V1_cff::full5x5SigmaIEtaIPhiMap, edm::Event::getByLabel(), isEndcapCategory(), edm::Ptr< T >::isNull(), edm::HandleBase::isValid(), SiStripPI::max, eostools::move(), AnyMVAEstimatorRun2Base::packMVAVariables(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::Photon::r9(), rho, reco::Photon::superCluster(), PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varChIsoRaw, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varE1x3overE5x5, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varE2x2overE5x5, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varE2x5overE5x5, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varESEffSigmaRR, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varESEnOverRawE, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varEta, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varPhi, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varPhoIsoRaw, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varPt, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varR9, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varRawE, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varRho, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varSCEta, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varSCEtaWidth, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varSCPhiWidth, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varSieie, PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varSieip, and PhotonMVAEstimatorRun2Phys14NonTrig::AllVariables::varWorstChRaw.

Referenced by getTag(), and mvaValue().

133  {
134  //
135  // Declare all value maps corresponding to the above tokens
136  //
144  //
145  edm::Handle<edm::ValueMap<float> > phoChargedIsolationMap;
146  edm::Handle<edm::ValueMap<float> > phoPhotonIsolationMap;
147  edm::Handle<edm::ValueMap<float> > phoWorstChargedIsolationMap;
148 
149  // Rho will be pulled from the event content
151 
152  // Get the full5x5 and ES maps
153  if( _useValueMaps ) {
154  iEvent.getByLabel(_full5x5SigmaIEtaIEtaMapLabel, full5x5SigmaIEtaIEtaMap);
155  iEvent.getByLabel(_full5x5SigmaIEtaIPhiMapLabel, full5x5SigmaIEtaIPhiMap);
156  iEvent.getByLabel(_full5x5E1x3MapLabel, full5x5E1x3Map);
157  iEvent.getByLabel(_full5x5E2x2MapLabel, full5x5E2x2Map);
158  iEvent.getByLabel(_full5x5E2x5MaxMapLabel, full5x5E2x5MaxMap);
159  iEvent.getByLabel(_full5x5E5x5MapLabel, full5x5E5x5Map);
160  iEvent.getByLabel(_esEffSigmaRRMapLabel, esEffSigmaRRMap);
161  }
162 
163  // Get the isolation maps
164  iEvent.getByLabel(_phoChargedIsolationLabel, phoChargedIsolationMap);
165  iEvent.getByLabel(_phoPhotonIsolationLabel, phoPhotonIsolationMap);
166  iEvent.getByLabel(_phoWorstChargedIsolationLabel, phoWorstChargedIsolationMap);
167 
168  // Get rho
169  iEvent.getByLabel(_rhoLabel,rho);
170 
171  // Make sure everything is retrieved successfully
172  if(! ( ( !_useValueMaps || ( full5x5SigmaIEtaIEtaMap.isValid()
173  && full5x5SigmaIEtaIPhiMap.isValid()
174  && full5x5E1x3Map.isValid()
175  && full5x5E2x2Map.isValid()
176  && full5x5E2x5MaxMap.isValid()
177  && full5x5E5x5Map.isValid()
178  && esEffSigmaRRMap.isValid() ) )
179  && phoChargedIsolationMap.isValid()
180  && phoPhotonIsolationMap.isValid()
181  && phoWorstChargedIsolationMap.isValid()
182  && rho.isValid() ) )
183  throw cms::Exception("MVA failure: ")
184  << "Failed to retrieve event content needed for this MVA"
185  << std::endl
186  << "Check python MVA configuration file and make sure all needed"
187  << std::endl
188  << "producers are running upstream" << std::endl;
189 
190  // Try to cast the particle into a reco particle.
191  // This should work for both reco and pat.
192  const edm::Ptr<reco::Photon> phoRecoPtr = ( edm::Ptr<reco::Photon> )particle;
193  AllVariables allMVAVars;
194  if( phoRecoPtr.isNull() )
195  throw cms::Exception("MVA failure: ")
196  << " given particle is expected to be reco::Photon or pat::Photon," << std::endl
197  << " but appears to be neither" << std::endl;
198 
199  // Both pat and reco particles have exactly the same accessors.
200  auto superCluster = phoRecoPtr->superCluster();
201  // Full 5x5 cluster shapes. We could take some of this directly from
202  // the photon object, but some of these are not available.
203  float e1x3 = std::numeric_limits<float>::max();
204  float e2x2 = std::numeric_limits<float>::max();
207  float full5x5_sigmaIetaIeta = std::numeric_limits<float>::max();
208  float full5x5_sigmaIetaIphi = std::numeric_limits<float>::max();
209  float effSigmaRR = std::numeric_limits<float>::max();
210 
211  if( _useValueMaps ) { //(before 752)
212  // in principle, in the photon object as well
213  // not in the photon object
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 ];
221  } else {
222  // from 753
223  const auto& full5x5_pss = phoRecoPtr->full5x5_showerShapeVariables();
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;
231  }
232 
233  allMVAVars.varPhi = phoRecoPtr->phi();
234  allMVAVars.varR9 = phoRecoPtr->r9() ;
235  allMVAVars.varSieie = full5x5_sigmaIetaIeta;
236  allMVAVars.varSieip = full5x5_sigmaIetaIphi;
237  allMVAVars.varE1x3overE5x5 = e1x3/e5x5;
238  allMVAVars.varE2x2overE5x5 = e2x2/e5x5;
239  allMVAVars.varE2x5overE5x5 = e2x5/e5x5;
240  allMVAVars.varSCEta = superCluster->eta();
241  allMVAVars.varRawE = superCluster->rawEnergy();
242  allMVAVars.varSCEtaWidth = superCluster->etaWidth();
243  allMVAVars.varSCPhiWidth = superCluster->phiWidth();
244  allMVAVars.varESEnOverRawE = superCluster->preshowerEnergy() / superCluster->rawEnergy();
245  allMVAVars.varESEffSigmaRR = effSigmaRR;
246  allMVAVars.varRho = *rho;
247  allMVAVars.varPhoIsoRaw = (*phoPhotonIsolationMap)[phoRecoPtr];
248  allMVAVars.varChIsoRaw = (*phoChargedIsolationMap)[phoRecoPtr];
249  allMVAVars.varWorstChRaw = (*phoWorstChargedIsolationMap)[phoRecoPtr];
250  // Declare spectator vars
251  allMVAVars.varPt = phoRecoPtr->pt();
252  allMVAVars.varEta = phoRecoPtr->eta();
253 
254  constrainMVAVariables(allMVAVars);
255 
256  std::vector<float> vars;
257  if( isEndcapCategory( findCategory( particle ) ) ) {
258  vars = std::move( packMVAVariables(allMVAVars.varPhi,
259  allMVAVars.varR9,
260  allMVAVars.varSieie,
261  allMVAVars.varSieip,
262  allMVAVars.varE1x3overE5x5,
263  allMVAVars.varE2x2overE5x5,
264  allMVAVars.varE2x5overE5x5,
265  allMVAVars.varSCEta,
266  allMVAVars.varRawE,
267  allMVAVars.varSCEtaWidth,
268  allMVAVars.varSCPhiWidth,
269  allMVAVars.varESEnOverRawE,
270  allMVAVars.varESEffSigmaRR,
271  allMVAVars.varRho,
272  allMVAVars.varPhoIsoRaw,
273  allMVAVars.varChIsoRaw,
274  allMVAVars.varWorstChRaw,
275  // Declare spectator vars
276  allMVAVars.varPt,
277  allMVAVars.varEta)
278  );
279  } else {
280  vars = std::move( packMVAVariables(allMVAVars.varPhi,
281  allMVAVars.varR9,
282  allMVAVars.varSieie,
283  allMVAVars.varSieip,
284  allMVAVars.varE1x3overE5x5,
285  allMVAVars.varE2x2overE5x5,
286  allMVAVars.varE2x5overE5x5,
287  allMVAVars.varSCEta,
288  allMVAVars.varRawE,
289  allMVAVars.varSCEtaWidth,
290  allMVAVars.varSCPhiWidth,
291  allMVAVars.varRho,
292  allMVAVars.varPhoIsoRaw,
293  allMVAVars.varChIsoRaw,
294  allMVAVars.varWorstChRaw,
295  // Declare spectator vars
296  allMVAVars.varPt,
297  allMVAVars.varEta)
298  );
299  }
300 
301  return vars;
302 }
double eta() const final
momentum pseudorapidity
double pt() const final
transverse momentum
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
std::vector< float > packMVAVariables(const Args...args) const
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
bool isNull() const
Checks for null.
Definition: Ptr.h:164
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:464
const ShowerShape & full5x5_showerShapeVariables() const
Definition: Photon.h:198
float r9() const
Definition: Photon.h:228
double phi() const final
momentum azimuthal angle
def move(src, dest)
Definition: eostools.py:510
int PhotonMVAEstimatorRun2Phys14NonTrig::findCategory ( const edm::Ptr< reco::Candidate > &  particle) const
overridevirtual

Implements AnyMVAEstimatorRun2Base.

Definition at line 93 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References funct::abs(), CAT_EB, CAT_EE, constexpr, mvaElectronID_Fall17_iso_V1_cff::ebeeSplit, PVValHelper::eta, isEndcapCategory(), edm::Ptr< T >::isNull(), reco::Photon::superCluster(), and UNDEFINED.

Referenced by fillMVAVariables(), getTag(), and mvaValue().

93  {
94 
95  // Try to cast the particle into a reco particle.
96  // This should work for both reco and pat.
97  const edm::Ptr<reco::Photon> phoRecoPtr(particle);
98  if( phoRecoPtr.isNull() )
99  throw cms::Exception("MVA failure: ")
100  << " given particle is expected to be reco::Photon or pat::Photon," << std::endl
101  << " but appears to be neither" << std::endl;
102 
103  const float eta = phoRecoPtr->superCluster()->eta();
104 
105  //
106  // Determine the category
107  //
108  int iCategory = UNDEFINED;
109  constexpr float ebeeSplit = 1.479; // division between barrel and endcap
110 
111  if( std::abs(eta) < ebeeSplit )
112  iCategory = CAT_EB;
113 
114  if( std::abs(eta) >= ebeeSplit )
115  iCategory = CAT_EE;
116 
117  return iCategory;
118 }
#define constexpr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::string& PhotonMVAEstimatorRun2Phys14NonTrig::getName ( void  ) const
inlinefinalvirtual

Implements AnyMVAEstimatorRun2Base.

Definition at line 71 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

References _name.

Referenced by plotting.Plot::draw().

int PhotonMVAEstimatorRun2Phys14NonTrig::getNCategories ( ) const
inlinefinalvirtual
const std::string& PhotonMVAEstimatorRun2Phys14NonTrig::getTag ( void  ) const
inlinefinalvirtual
bool PhotonMVAEstimatorRun2Phys14NonTrig::isEndcapCategory ( int  category) const

Definition at line 121 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References CAT_EE, and GeomDetEnumerators::isEndcap().

Referenced by fillMVAVariables(), findCategory(), getNCategories(), and mvaValue().

121  {
122 
123  // For this specific MVA the function is trivial, but kept for possible
124  // future evolution to an MVA with more categories in eta
125  bool isEndcap = false;
126  if( category == CAT_EE )
127  isEndcap = true;
128 
129  return isEndcap;
130 }
bool isEndcap(GeomDetEnumerators::SubDetector m)
float PhotonMVAEstimatorRun2Phys14NonTrig::mvaValue ( const edm::Ptr< reco::Candidate > &  particle,
const edm::Event iEvent 
) const
overridevirtual

Implements AnyMVAEstimatorRun2Base.

Definition at line 52 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References _gbrForests, constexpr, debug, fillMVAVariables(), findCategory(), isEndcapCategory(), eostools::move(), and mps_fire::result.

Referenced by ~PhotonMVAEstimatorRun2Phys14NonTrig().

52  {
53 
54  const int iCategory = findCategory( particle );
55  const std::vector<float> vars = std::move( fillMVAVariables( particle, iEvent ) );
56  const float result = _gbrForests.at(iCategory)->GetResponse(vars.data()); // The BDT score
57 
58  // DEBUG
59  constexpr bool debug = false;
60  if( debug ){
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] );
77  if( isEndcapCategory( iCategory ) ) {
78  printf(" varESEnOverRawE_ %f\n", vars[15] ); // for endcap MVA only
79  printf(" varESEffSigmaRR_ %f\n", vars[16] ); // for endcap MVA only
80  // The spectators
81  printf(" varPt_ %f\n", vars[17] );
82  printf(" varEta_ %f\n", vars[18] );
83  } else {
84  // The spectators
85  printf(" varPt_ %f\n", vars[15] );
86  printf(" varEta_ %f\n", vars[16] );
87  }
88  }
89 
90  return result;
91 }
#define constexpr
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
#define debug
Definition: HDRShower.cc:19
std::vector< std::unique_ptr< const GBRForest > > _gbrForests
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
def move(src, dest)
Definition: eostools.py:510
void PhotonMVAEstimatorRun2Phys14NonTrig::setConsumes ( edm::ConsumesCollector &&  cc) const
overridevirtual

Reimplemented from AnyMVAEstimatorRun2Base.

Definition at line 314 of file PhotonMVAEstimatorRun2Phys14NonTrig.cc.

References _esEffSigmaRRMapLabel, _full5x5E1x3MapLabel, _full5x5E2x2MapLabel, _full5x5E2x5MaxMapLabel, _full5x5E5x5MapLabel, _full5x5SigmaIEtaIEtaMapLabel, _full5x5SigmaIEtaIPhiMapLabel, _phoChargedIsolationLabel, _phoPhotonIsolationLabel, _phoWorstChargedIsolationLabel, _rhoLabel, _useValueMaps, and DEFINE_EDM_PLUGIN.

Referenced by getTag().

314  {
315  if( _useValueMaps ) {
323  }
327  cc.consumes<double>(_rhoLabel);
328 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)

Member Data Documentation

AllVariables PhotonMVAEstimatorRun2Phys14NonTrig::_allMVAVars
private

Definition at line 108 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_esEffSigmaRRMapLabel
private

Definition at line 124 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_full5x5E1x3MapLabel
private

Definition at line 120 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_full5x5E2x2MapLabel
private

Definition at line 121 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_full5x5E2x5MaxMapLabel
private

Definition at line 122 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_full5x5E5x5MapLabel
private

Definition at line 123 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_full5x5SigmaIEtaIEtaMapLabel
private

Definition at line 118 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_full5x5SigmaIEtaIPhiMapLabel
private

Definition at line 119 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

std::vector<std::unique_ptr<const GBRForest> > PhotonMVAEstimatorRun2Phys14NonTrig::_gbrForests
private
const std::string PhotonMVAEstimatorRun2Phys14NonTrig::_MethodName
private

Definition at line 107 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

const std::string PhotonMVAEstimatorRun2Phys14NonTrig::_name = "PhotonMVAEstimatorRun2Phys14NonTrig"
private
const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_phoChargedIsolationLabel
private

Definition at line 126 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_phoPhotonIsolationLabel
private

Definition at line 127 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_phoWorstChargedIsolationLabel
private

Definition at line 128 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const edm::InputTag PhotonMVAEstimatorRun2Phys14NonTrig::_rhoLabel
private

Definition at line 130 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

std::string PhotonMVAEstimatorRun2Phys14NonTrig::_tag
private
const bool PhotonMVAEstimatorRun2Phys14NonTrig::_useValueMaps
private

Definition at line 117 of file PhotonMVAEstimatorRun2Phys14NonTrig.h.

Referenced by fillMVAVariables(), and setConsumes().

const int PhotonMVAEstimatorRun2Phys14NonTrig::nCategories = 2