CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
EGFull5x5ShowerShapeModifierFromValueMaps Class Reference
Inheritance diagram for EGFull5x5ShowerShapeModifierFromValueMaps:
ModifyObjectValueBase

Classes

struct  electron_config
 
struct  photon_config
 

Public Member Functions

 EGFull5x5ShowerShapeModifierFromValueMaps (const edm::ParameterSet &conf)
 
void modifyObject (pat::Electron &) const overridefinal
 
void modifyObject (pat::Photon &) const overridefinal
 
void setConsumes (edm::ConsumesCollector &) overridefinal
 
void setEvent (const edm::Event &) overridefinal
 
void setEventContent (const edm::EventSetup &) overridefinal
 
- Public Member Functions inherited from ModifyObjectValueBase
virtual void modifyObject (pat::Muon &) const
 
virtual void modifyObject (pat::Tau &) const
 
virtual void modifyObject (pat::Jet &) const
 
 ModifyObjectValueBase (const edm::ParameterSet &conf)
 
const std::string & name () const
 
virtual ~ModifyObjectValueBase ()
 

Private Attributes

electron_config e_conf
 
unsigned ele_idx
 
std::unordered_map< unsigned,
edm::Handle< edm::ValueMap
< float > > > 
ele_vmaps
 
std::unordered_map< unsigned,
edm::Ptr< reco::GsfElectron > > 
eles_by_oop
 
photon_config ph_conf
 
unsigned pho_idx
 
std::unordered_map< unsigned,
edm::Handle< edm::ValueMap
< float > > > 
pho_vmaps
 
std::unordered_map< unsigned,
edm::Ptr< reco::Photon > > 
phos_by_oop
 

Detailed Description

Definition at line 17 of file EGFull5x5ShowerShapeModifier.cc.

Constructor & Destructor Documentation

EGFull5x5ShowerShapeModifierFromValueMaps::EGFull5x5ShowerShapeModifierFromValueMaps ( const edm::ParameterSet conf)

Definition at line 97 of file EGFull5x5ShowerShapeModifier.cc.

References EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e2x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::e2x5Max, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e3x3, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::electron_src, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::maxEnergyXtal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::photon_src, interactiveExample::photons, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::r9, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::sigmaIetaIeta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::sigmaIetaIeta, and EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::sigmaIphiIphi.

97  :
98  ModifyObjectValueBase(conf) {
99  if( conf.exists("electron_config") ) {
100  const edm::ParameterSet& electrons = conf.getParameter<edm::ParameterSet>("electron_config");
101  if( electrons.exists("electronSrc") ) e_conf.electron_src = electrons.getParameter<edm::InputTag>("electronSrc");
102  if( electrons.exists("sigmaEtaEta") ) e_conf.sigmaEtaEta = electrons.getParameter<edm::InputTag>("sigmaEtaEta");
103  if( electrons.exists("sigmaIetaIeta") ) e_conf.sigmaIetaIeta = electrons.getParameter<edm::InputTag>("sigmaIetaIeta");
104  if( electrons.exists("sigmaIphiIphi") ) e_conf.sigmaIphiIphi = electrons.getParameter<edm::InputTag>("sigmaIphiIphi");
105  if( electrons.exists("e1x5") ) e_conf.e1x5 = electrons.getParameter<edm::InputTag>("e1x5");
106  if( electrons.exists("e2x5Max") ) e_conf.e2x5Max = electrons.getParameter<edm::InputTag>("e2x5Max");
107  if( electrons.exists("e5x5") ) e_conf.e5x5 = electrons.getParameter<edm::InputTag>("e5x5");
108  if( electrons.exists("r9") ) e_conf.r9 = electrons.getParameter<edm::InputTag>("r9");
109  if( electrons.exists("hcalDepth1OverEcal") ) e_conf.hcalDepth1OverEcal = electrons.getParameter<edm::InputTag>("hcalDepth1OverEcal");
110  if( electrons.exists("hcalDepth2OverEcal") ) e_conf.hcalDepth2OverEcal = electrons.getParameter<edm::InputTag>("hcalDepth2OverEcal");
111  if( electrons.exists("hcalDepth1OverEcalBc") ) e_conf.hcalDepth1OverEcalBc = electrons.getParameter<edm::InputTag>("hcalDepth1OverEcalBc");
112  if( electrons.exists("hcalDepth2OverEcalBc") ) e_conf.hcalDepth2OverEcalBc = electrons.getParameter<edm::InputTag>("hcalDepth2OverEcalBc");
113  }
114  if( conf.exists("photon_config") ) {
115  const edm::ParameterSet& photons = conf.getParameter<edm::ParameterSet>("photon_config");
116  if( photons.exists("photonSrc") ) ph_conf.photon_src = photons.getParameter<edm::InputTag>("photonSrc");
117  if( photons.exists("sigmaEtaEta") ) ph_conf.sigmaEtaEta = photons.getParameter<edm::InputTag>("sigmaEtaEta");
118  if( photons.exists("sigmaIetaIeta") ) ph_conf.sigmaIetaIeta = photons.getParameter<edm::InputTag>("sigmaIetaIeta");
119  if( photons.exists("e1x5") ) ph_conf.e1x5 = photons.getParameter<edm::InputTag>("e1x5");
120  if( photons.exists("e2x5") ) ph_conf.e2x5 = photons.getParameter<edm::InputTag>("e2x5");
121  if( photons.exists("e3x3") ) ph_conf.e3x3 = photons.getParameter<edm::InputTag>("e3x3");
122  if( photons.exists("e5x5") ) ph_conf.e5x5 = photons.getParameter<edm::InputTag>("e5x5");
123  if( photons.exists("maxEnergyXtal") ) ph_conf.maxEnergyXtal = photons.getParameter<edm::InputTag>("maxEnergyXtal");
124  if( photons.exists("hcalDepth1OverEcal") ) ph_conf.hcalDepth1OverEcal = photons.getParameter<edm::InputTag>("hcalDepth1OverEcal");
125  if( photons.exists("hcalDepth2OverEcal") ) ph_conf.hcalDepth2OverEcal = photons.getParameter<edm::InputTag>("hcalDepth2OverEcal");
126  if( photons.exists("hcalDepth1OverEcalBc") ) ph_conf.hcalDepth1OverEcalBc = photons.getParameter<edm::InputTag>("hcalDepth1OverEcalBc");
127  if( photons.exists("hcalDepth2OverEcalBc") ) ph_conf.hcalDepth2OverEcalBc = photons.getParameter<edm::InputTag>("hcalDepth2OverEcalBc");
128  }
129 
130  ele_idx = pho_idx = 0;
131 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
ModifyObjectValueBase(const edm::ParameterSet &conf)

Member Function Documentation

void EGFull5x5ShowerShapeModifierFromValueMaps::modifyObject ( pat::Electron ele) const
finaloverridevirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 244 of file EGFull5x5ShowerShapeModifier.cc.

References e_conf, ele_idx, ele_vmaps, eles_by_oop, Exception, reco::GsfElectron::full5x5_setShowerShape(), reco::GsfElectron::full5x5_showerShape(), edm::EDGetTokenT< T >::isUninitialized(), edm::Ptr< T >::key(), relval_steps::key, pat::PATObject< ObjectType >::originalObjectRef(), EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e2x5Max, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_electron_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_r9, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaIetaIeta, and EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaIphiIphi.

244  {
245  // we encounter two cases here, either we are running AOD -> MINIAOD
246  // and the value maps are to the reducedEG object, can use original object ptr
247  // or we are running MINIAOD->MINIAOD and we need to fetch the pat objects to reference
250  auto key = eles_by_oop.find(ele_idx);
251  if( key != eles_by_oop.end() ) {
252  ptr = key->second;
253  } else {
254  throw cms::Exception("BadElectronKey")
255  << "Original object pointer with key = " << ele.originalObjectRef().key() << " not found in cache!";
256  }
257  }
258  //now we go through and modify the objects using the valuemaps we read in
259  auto full5x5 = ele.full5x5_showerShape();
260  assignValue(ptr,e_conf.tok_sigmaEtaEta,ele_vmaps,full5x5.sigmaEtaEta);
261  assignValue(ptr,e_conf.tok_sigmaIetaIeta,ele_vmaps,full5x5.sigmaIetaIeta);
262  assignValue(ptr,e_conf.tok_sigmaIphiIphi,ele_vmaps,full5x5.sigmaIphiIphi);
263  assignValue(ptr,e_conf.tok_e1x5,ele_vmaps,full5x5.e1x5);
264  assignValue(ptr,e_conf.tok_e2x5Max,ele_vmaps,full5x5.e2x5Max);
265  assignValue(ptr,e_conf.tok_e5x5,ele_vmaps,full5x5.e5x5);
266  assignValue(ptr,e_conf.tok_r9,ele_vmaps,full5x5.r9);
267  assignValue(ptr,e_conf.tok_hcalDepth1OverEcal,ele_vmaps,full5x5.hcalDepth1OverEcal);
268  assignValue(ptr,e_conf.tok_hcalDepth2OverEcal,ele_vmaps,full5x5.hcalDepth2OverEcal);
269  assignValue(ptr,e_conf.tok_hcalDepth1OverEcalBc,ele_vmaps,full5x5.hcalDepth1OverEcalBc);
270  assignValue(ptr,e_conf.tok_hcalDepth2OverEcalBc,ele_vmaps,full5x5.hcalDepth2OverEcalBc);
271 
272  ele.full5x5_setShowerShape(full5x5);
273  ++ele_idx;
274 }
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcalBc
key_type key() const
Definition: Ptr.h:186
edm::EDGetTokenT< edm::View< pat::Electron > > tok_electron_src
std::unordered_map< unsigned, edm::Ptr< reco::GsfElectron > > eles_by_oop
std::unordered_map< unsigned, edm::Handle< edm::ValueMap< float > > > ele_vmaps
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
Definition: PATObject.h:498
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const ShowerShape & full5x5_showerShape() const
Definition: GsfElectron.h:431
bool isUninitialized() const
Definition: EDGetToken.h:71
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcalBc
void full5x5_setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:435
void EGFull5x5ShowerShapeModifierFromValueMaps::modifyObject ( pat::Photon pho) const
finaloverridevirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 278 of file EGFull5x5ShowerShapeModifier.cc.

References Exception, reco::Photon::full5x5_setShowerShapeVariables(), reco::Photon::full5x5_showerShapeVariables(), edm::EDGetTokenT< T >::isUninitialized(), edm::Ptr< T >::key(), relval_steps::key, pat::PATObject< ObjectType >::originalObjectRef(), ph_conf, pho_idx, pho_vmaps, phos_by_oop, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e2x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e3x3, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_maxEnergyXtal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_photon_src, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_sigmaEtaEta, and EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_sigmaIetaIeta.

278  {
279  // we encounter two cases here, either we are running AOD -> MINIAOD
280  // and the value maps are to the reducedEG object, can use original object ptr
281  // or we are running MINIAOD->MINIAOD and we need to fetch the pat objects to reference
284  auto key = phos_by_oop.find(pho_idx);
285  if( key != phos_by_oop.end() ) {
286  ptr = key->second;
287  } else {
288  throw cms::Exception("BadPhotonKey")
289  << "Original object pointer with key = " << pho.originalObjectRef().key() << " not found in cache!";
290  }
291  }
292  //now we go through and modify the objects using the valuemaps we read in
293  auto full5x5 = pho.full5x5_showerShapeVariables();
294  assignValue(ptr,ph_conf.tok_sigmaEtaEta,pho_vmaps,full5x5.sigmaEtaEta);
295  assignValue(ptr,ph_conf.tok_sigmaIetaIeta,pho_vmaps,full5x5.sigmaIetaIeta);
296  assignValue(ptr,ph_conf.tok_e1x5,pho_vmaps,full5x5.e1x5);
297  assignValue(ptr,ph_conf.tok_e2x5,pho_vmaps,full5x5.e2x5);
298  assignValue(ptr,ph_conf.tok_e3x3,pho_vmaps,full5x5.e3x3);
299  assignValue(ptr,ph_conf.tok_e5x5,pho_vmaps,full5x5.e5x5);
300  assignValue(ptr,ph_conf.tok_maxEnergyXtal,pho_vmaps,full5x5.maxEnergyXtal);
301  assignValue(ptr,ph_conf.tok_hcalDepth1OverEcal,pho_vmaps,full5x5.hcalDepth1OverEcal);
302  assignValue(ptr,ph_conf.tok_hcalDepth2OverEcal,pho_vmaps,full5x5.hcalDepth2OverEcal);
303  assignValue(ptr,ph_conf.tok_hcalDepth1OverEcalBc,pho_vmaps,full5x5.hcalDepth1OverEcalBc);
304  assignValue(ptr,ph_conf.tok_hcalDepth2OverEcalBc,pho_vmaps,full5x5.hcalDepth2OverEcalBc);
305 
306  pho.full5x5_setShowerShapeVariables(full5x5);
307  ++pho_idx;
308 }
edm::EDGetTokenT< edm::View< pat::Photon > > tok_photon_src
key_type key() const
Definition: Ptr.h:186
std::unordered_map< unsigned, edm::Ptr< reco::Photon > > phos_by_oop
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcalBc
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcal
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcal
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
Definition: PATObject.h:498
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcalBc
void full5x5_setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:171
const ShowerShape & full5x5_showerShapeVariables() const
Definition: Photon.h:168
bool isUninitialized() const
Definition: EDGetToken.h:71
std::unordered_map< unsigned, edm::Handle< edm::ValueMap< float > > > pho_vmaps
void EGFull5x5ShowerShapeModifierFromValueMaps::setConsumes ( edm::ConsumesCollector sumes)
finaloverridevirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 206 of file EGFull5x5ShowerShapeModifier.cc.

References edm::ConsumesCollector::consumes(), EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e2x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::e2x5Max, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e3x3, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::e5x5, e_conf, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::electron_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::maxEnergyXtal, ph_conf, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::photon_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::r9, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::sigmaIetaIeta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::sigmaIetaIeta, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::sigmaIphiIphi, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e2x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e2x5Max, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e3x3, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_electron_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_maxEnergyXtal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_photon_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_r9, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaIetaIeta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_sigmaIetaIeta, and EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaIphiIphi.

206  {
207  //setup electrons
209  make_consumes(e_conf.sigmaEtaEta,e_conf.tok_sigmaEtaEta,sumes);
210  make_consumes(e_conf.sigmaIetaIeta,e_conf.tok_sigmaIetaIeta,sumes);
211  make_consumes(e_conf.sigmaIphiIphi,e_conf.tok_sigmaIphiIphi,sumes);
212  make_consumes(e_conf.e1x5,e_conf.tok_e1x5,sumes);
213  make_consumes(e_conf.e2x5Max,e_conf.tok_e2x5Max,sumes);
214  make_consumes(e_conf.e5x5,e_conf.tok_e5x5,sumes);
215  make_consumes(e_conf.r9,e_conf.tok_r9,sumes);
220 
221  // setup photons
223  make_consumes(ph_conf.sigmaEtaEta,ph_conf.tok_sigmaEtaEta,sumes);
224  make_consumes(ph_conf.sigmaIetaIeta,ph_conf.tok_sigmaIetaIeta,sumes);
225  make_consumes(ph_conf.e1x5,ph_conf.tok_e1x5,sumes);
226  make_consumes(ph_conf.e2x5,ph_conf.tok_e2x5,sumes);
227  make_consumes(ph_conf.e3x3,ph_conf.tok_e3x3,sumes);
228  make_consumes(ph_conf.e5x5,ph_conf.tok_e5x5,sumes);
229  make_consumes(ph_conf.maxEnergyXtal,ph_conf.tok_maxEnergyXtal,sumes);
234 }
edm::EDGetTokenT< edm::View< pat::Photon > > tok_photon_src
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcalBc
edm::EDGetTokenT< edm::View< pat::Electron > > tok_electron_src
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcalBc
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcal
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcal
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcalBc
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcalBc
void EGFull5x5ShowerShapeModifierFromValueMaps::setEvent ( const edm::Event evt)
finaloverridevirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 142 of file EGFull5x5ShowerShapeModifier.cc.

References e_conf, ele_idx, ele_vmaps, eles_by_oop, edm::Event::getByToken(), i, edm::EDGetTokenT< T >::isUninitialized(), ph_conf, pho_idx, pho_vmaps, phos_by_oop, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e1x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e2x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e2x5Max, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e3x3, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_e5x5, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_electron_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth1OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth1OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth2OverEcal, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_hcalDepth2OverEcalBc, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_maxEnergyXtal, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_photon_src, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_r9, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_sigmaEtaEta, EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaIetaIeta, EGFull5x5ShowerShapeModifierFromValueMaps::photon_config::tok_sigmaIetaIeta, and EGFull5x5ShowerShapeModifierFromValueMaps::electron_config::tok_sigmaIphiIphi.

142  {
143  eles_by_oop.clear();
144  phos_by_oop.clear();
145  ele_vmaps.clear();
146  pho_vmaps.clear();
147 
148  ele_idx = pho_idx = 0;
149 
153 
154  for( unsigned i = 0; i < eles->size(); ++i ) {
155  edm::Ptr<pat::Electron> ptr = eles->ptrAt(i);
156  eles_by_oop[i] = ptr;
157  }
158  }
159 
160  get_product(evt,e_conf.tok_sigmaEtaEta,ele_vmaps);
161  get_product(evt,e_conf.tok_sigmaIetaIeta,ele_vmaps);
162  get_product(evt,e_conf.tok_sigmaIphiIphi,ele_vmaps);
163  get_product(evt,e_conf.tok_e1x5,ele_vmaps);
164  get_product(evt,e_conf.tok_e2x5Max,ele_vmaps);
165  get_product(evt,e_conf.tok_e5x5,ele_vmaps);
166  get_product(evt,e_conf.tok_r9,ele_vmaps);
167  get_product(evt,e_conf.tok_hcalDepth1OverEcal,ele_vmaps);
168  get_product(evt,e_conf.tok_hcalDepth2OverEcal,ele_vmaps);
169  get_product(evt,e_conf.tok_hcalDepth1OverEcalBc,ele_vmaps);
170  get_product(evt,e_conf.tok_hcalDepth2OverEcalBc,ele_vmaps);
171 
175 
176  for( unsigned i = 0; i < phos->size(); ++i ) {
177  edm::Ptr<pat::Photon> ptr = phos->ptrAt(i);
178  phos_by_oop[i] = ptr;
179  }
180  }
181 
182  get_product(evt,ph_conf.tok_sigmaEtaEta,pho_vmaps);
183  get_product(evt,ph_conf.tok_sigmaIetaIeta,pho_vmaps);
184  get_product(evt,ph_conf.tok_e1x5,pho_vmaps);
185  get_product(evt,ph_conf.tok_e2x5,pho_vmaps);
186  get_product(evt,ph_conf.tok_e3x3,pho_vmaps);
187  get_product(evt,ph_conf.tok_e5x5,pho_vmaps);
188  get_product(evt,ph_conf.tok_maxEnergyXtal,pho_vmaps);
189  get_product(evt,ph_conf.tok_hcalDepth1OverEcal,pho_vmaps);
190  get_product(evt,ph_conf.tok_hcalDepth2OverEcal,pho_vmaps);
191  get_product(evt,ph_conf.tok_hcalDepth1OverEcalBc,pho_vmaps);
192  get_product(evt,ph_conf.tok_hcalDepth2OverEcalBc,pho_vmaps);
193 
194 }
edm::EDGetTokenT< edm::View< pat::Photon > > tok_photon_src
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcalBc
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::unordered_map< unsigned, edm::Ptr< reco::Photon > > phos_by_oop
edm::EDGetTokenT< edm::View< pat::Electron > > tok_electron_src
std::unordered_map< unsigned, edm::Ptr< reco::GsfElectron > > eles_by_oop
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcalBc
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth2OverEcal
std::unordered_map< unsigned, edm::Handle< edm::ValueMap< float > > > ele_vmaps
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcal
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcalBc
bool isUninitialized() const
Definition: EDGetToken.h:71
edm::EDGetTokenT< edm::ValueMap< float > > tok_hcalDepth1OverEcalBc
std::unordered_map< unsigned, edm::Handle< edm::ValueMap< float > > > pho_vmaps
void EGFull5x5ShowerShapeModifierFromValueMaps::setEventContent ( const edm::EventSetup evs)
finaloverridevirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 197 of file EGFull5x5ShowerShapeModifier.cc.

197  {
198 }

Member Data Documentation

electron_config EGFull5x5ShowerShapeModifierFromValueMaps::e_conf
private

Definition at line 83 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), setConsumes(), and setEvent().

unsigned EGFull5x5ShowerShapeModifierFromValueMaps::ele_idx
mutableprivate

Definition at line 89 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), and setEvent().

std::unordered_map<unsigned,edm::Handle<edm::ValueMap<float> > > EGFull5x5ShowerShapeModifierFromValueMaps::ele_vmaps
private

Definition at line 86 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), and setEvent().

std::unordered_map<unsigned,edm::Ptr<reco::GsfElectron> > EGFull5x5ShowerShapeModifierFromValueMaps::eles_by_oop
private

Definition at line 85 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), and setEvent().

photon_config EGFull5x5ShowerShapeModifierFromValueMaps::ph_conf
private

Definition at line 84 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), setConsumes(), and setEvent().

unsigned EGFull5x5ShowerShapeModifierFromValueMaps::pho_idx
mutableprivate

Definition at line 89 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), and setEvent().

std::unordered_map<unsigned,edm::Handle<edm::ValueMap<float> > > EGFull5x5ShowerShapeModifierFromValueMaps::pho_vmaps
private

Definition at line 88 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), and setEvent().

std::unordered_map<unsigned,edm::Ptr<reco::Photon> > EGFull5x5ShowerShapeModifierFromValueMaps::phos_by_oop
private

Definition at line 87 of file EGFull5x5ShowerShapeModifier.cc.

Referenced by modifyObject(), and setEvent().