CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EG8XObjectUpdateModifier Class Reference
Inheritance diagram for EG8XObjectUpdateModifier:
ModifyObjectValueBase

Public Member Functions

 EG8XObjectUpdateModifier (const edm::ParameterSet &conf)
 
void modifyObject (reco::GsfElectron &ele) const final
 
void modifyObject (reco::Photon &pho) const final
 
void modifyObject (pat::Electron &ele) const final
 
void modifyObject (pat::Photon &pho) const final
 
void setConsumes (edm::ConsumesCollector &) final
 
void setEvent (const edm::Event &) final
 
void setEventContent (const edm::EventSetup &) final
 
 ~EG8XObjectUpdateModifier () override
 
- Public Member Functions inherited from ModifyObjectValueBase
virtual void modifyObject (reco::Muon &) const
 
virtual void modifyObject (reco::BaseTau &) const
 
virtual void modifyObject (reco::Jet &) const
 
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 Member Functions

std::pair< int, bool > getSaturationInfo (const reco::SuperCluster &superClus) const
 

Private Attributes

edm::ESHandle< CaloTopologycaloTopoHandle_
 
edm::Handle< EcalRecHitCollectionecalRecHitsEBHandle_
 
edm::InputTag ecalRecHitsEBTag_
 
edm::EDGetTokenT< EcalRecHitCollectionecalRecHitsEBToken_
 
edm::Handle< EcalRecHitCollectionecalRecHitsEEHandle_
 
edm::InputTag ecalRecHitsEETag_
 
edm::EDGetTokenT< EcalRecHitCollectionecalRecHitsEEToken_
 

Detailed Description

Definition at line 20 of file EG8XObjectUpdateModifier.cc.

Constructor & Destructor Documentation

EG8XObjectUpdateModifier::EG8XObjectUpdateModifier ( const edm::ParameterSet conf)

Definition at line 48 of file EG8XObjectUpdateModifier.cc.

48  :
50  ecalRecHitsEBTag_(conf.getParameter<edm::InputTag>("ecalRecHitsEB")),
51  ecalRecHitsEETag_(conf.getParameter<edm::InputTag>("ecalRecHitsEE"))
52 {
53 
54 
55 }
T getParameter(std::string const &) const
ModifyObjectValueBase(const edm::ParameterSet &conf)
EG8XObjectUpdateModifier::~EG8XObjectUpdateModifier ( )
inlineoverride

Definition at line 23 of file EG8XObjectUpdateModifier.cc.

References modifyObject(), setConsumes(), setEvent(), and setEventContent().

23 {}

Member Function Documentation

std::pair< int, bool > EG8XObjectUpdateModifier::getSaturationInfo ( const reco::SuperCluster superClus) const
private

Definition at line 113 of file EG8XObjectUpdateModifier.cc.

References DEFINE_EDM_PLUGIN, EcalBarrel, ecalRecHitsEBHandle_, ecalRecHitsEEHandle_, and reco::SuperCluster::seed().

Referenced by modifyObject().

114 {
115  bool isEB = superClus.seed()->seed().subdetId()==EcalBarrel;
116  const auto& ecalRecHits = isEB ? *ecalRecHitsEBHandle_ : *ecalRecHitsEEHandle_;
117 
118  int nrSatCrys = 0;
119  bool seedSaturated = false;
120  const auto& hitsAndFractions = superClus.seed()->hitsAndFractions();
121  for(const auto& hitFractionPair : hitsAndFractions) {
122  auto ecalRecHitIt = ecalRecHits.find(hitFractionPair.first);
123  if(ecalRecHitIt != ecalRecHits.end() &&
124  ecalRecHitIt->checkFlag(EcalRecHit::Flags::kSaturated)){
125  nrSatCrys++;
126  if(hitFractionPair.first == superClus.seed()->seed()) seedSaturated = true;
127  }
128  }
129  return {nrSatCrys,seedSaturated};
130 }
edm::Handle< EcalRecHitCollection > ecalRecHitsEBHandle_
edm::Handle< EcalRecHitCollection > ecalRecHitsEEHandle_
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
void EG8XObjectUpdateModifier::modifyObject ( reco::GsfElectron ele) const
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 75 of file EG8XObjectUpdateModifier.cc.

References caloTopoHandle_, EcalClusterToolsT< noZS >::e2x5Bottom(), EcalClusterToolsT< noZS >::e2x5Left(), reco::GsfElectron::ShowerShape::e2x5Left, EcalClusterToolsT< noZS >::e2x5Right(), EcalClusterToolsT< noZS >::e2x5Top(), ecalRecHitsEBHandle_, ecalRecHitsEEHandle_, reco::GsfElectron::full5x5_setShowerShape(), reco::GsfElectron::full5x5_showerShape(), getSaturationInfo(), reco::GsfElectron::isEB(), reco::GsfElectron::SaturationInfo::isSeedSaturated, reco::GsfElectron::SaturationInfo::nSaturatedXtals, edm::ESHandle< T >::product(), reco::GsfElectron::setSaturationInfo(), reco::GsfElectron::setShowerShape(), reco::GsfElectron::showerShape(), and reco::GsfElectron::superCluster().

Referenced by ~EG8XObjectUpdateModifier().

76 {
77 
78  const reco::CaloCluster& seedClus = *(ele.superCluster()->seed());
79  const EcalRecHitCollection* ecalRecHits = ele.isEB() ? &*ecalRecHitsEBHandle_ : &*ecalRecHitsEEHandle_;
80  const auto* caloTopo = caloTopoHandle_.product();
81 
82  auto full5x5ShowerShapes = ele.full5x5_showerShape();
83  full5x5ShowerShapes.e2x5Left = noZS::EcalClusterTools::e2x5Left (seedClus,ecalRecHits,caloTopo);
84  full5x5ShowerShapes.e2x5Right = noZS::EcalClusterTools::e2x5Right (seedClus,ecalRecHits,caloTopo);
85  full5x5ShowerShapes.e2x5Top = noZS::EcalClusterTools::e2x5Top (seedClus,ecalRecHits,caloTopo);
86  full5x5ShowerShapes.e2x5Bottom = noZS::EcalClusterTools::e2x5Bottom(seedClus,ecalRecHits,caloTopo);
87  ele.full5x5_setShowerShape(full5x5ShowerShapes);
88 
89  auto showerShapes = ele.showerShape();
90  showerShapes.e2x5Left = EcalClusterTools::e2x5Left (seedClus,ecalRecHits,caloTopo);
91  showerShapes.e2x5Right = EcalClusterTools::e2x5Right (seedClus,ecalRecHits,caloTopo);
92  showerShapes.e2x5Top = EcalClusterTools::e2x5Top (seedClus,ecalRecHits,caloTopo);
93  showerShapes.e2x5Bottom = EcalClusterTools::e2x5Bottom(seedClus,ecalRecHits,caloTopo);
94  ele.setShowerShape(showerShapes);
95 
97  auto satInfo = getSaturationInfo(*ele.superCluster());
98  eleSatInfo.nSaturatedXtals = satInfo.first;
99  eleSatInfo.isSeedSaturated = satInfo.second;
100  ele.setSaturationInfo(eleSatInfo);
101 }
const ShowerShape & showerShape() const
Definition: GsfElectron.h:454
static float e2x5Bottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void setSaturationInfo(const SaturationInfo &s)
Definition: GsfElectron.h:519
void setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:482
bool isEB() const
Definition: GsfElectron.h:352
static float e2x5Top(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::Handle< EcalRecHitCollection > ecalRecHitsEBHandle_
edm::ESHandle< CaloTopology > caloTopoHandle_
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
std::pair< int, bool > getSaturationInfo(const reco::SuperCluster &superClus) const
edm::Handle< EcalRecHitCollection > ecalRecHitsEEHandle_
static float e2x5Left(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
const ShowerShape & full5x5_showerShape() const
Definition: GsfElectron.h:479
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:184
void full5x5_setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:483
T const * product() const
Definition: ESHandle.h:86
void EG8XObjectUpdateModifier::modifyObject ( reco::Photon pho) const
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 103 of file EG8XObjectUpdateModifier.cc.

References getSaturationInfo(), reco::Photon::SaturationInfo::isSeedSaturated, reco::Photon::SaturationInfo::nSaturatedXtals, reco::Photon::setSaturationInfo(), and reco::Photon::superCluster().

104 {
105  reco::Photon::SaturationInfo phoSatInfo;
106  auto satInfo = getSaturationInfo(*pho.superCluster());
107  phoSatInfo.nSaturatedXtals = satInfo.first;
108  phoSatInfo.isSeedSaturated = satInfo.second;
109  pho.setSaturationInfo(phoSatInfo);
110 }
void setSaturationInfo(const SaturationInfo &s)
Definition: Photon.h:263
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
std::pair< int, bool > getSaturationInfo(const reco::SuperCluster &superClus) const
void EG8XObjectUpdateModifier::modifyObject ( pat::Electron ele) const
inlinefinalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 32 of file EG8XObjectUpdateModifier.cc.

References modifyObject().

Referenced by modifyObject().

32 {return modifyObject(static_cast<reco::GsfElectron&>(ele));}
void modifyObject(reco::GsfElectron &ele) const final
void EG8XObjectUpdateModifier::modifyObject ( pat::Photon pho) const
inlinefinalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 33 of file EG8XObjectUpdateModifier.cc.

References getSaturationInfo(), and modifyObject().

Referenced by modifyObject().

33 {return modifyObject(static_cast<reco::Photon&>(pho));}
void modifyObject(reco::GsfElectron &ele) const final
void EG8XObjectUpdateModifier::setConsumes ( edm::ConsumesCollector cc)
finalvirtual
void EG8XObjectUpdateModifier::setEvent ( const edm::Event iEvent)
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 63 of file EG8XObjectUpdateModifier.cc.

References ecalRecHitsEBHandle_, ecalRecHitsEBToken_, ecalRecHitsEEHandle_, ecalRecHitsEEToken_, and edm::Event::getByToken().

Referenced by ~EG8XObjectUpdateModifier().

64 {
67 }
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEBToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::Handle< EcalRecHitCollection > ecalRecHitsEBHandle_
edm::Handle< EcalRecHitCollection > ecalRecHitsEEHandle_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEEToken_
void EG8XObjectUpdateModifier::setEventContent ( const edm::EventSetup iSetup)
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 69 of file EG8XObjectUpdateModifier.cc.

References caloTopoHandle_, and edm::EventSetup::get().

Referenced by ~EG8XObjectUpdateModifier().

70 {
71  iSetup.get<CaloTopologyRecord>().get(caloTopoHandle_);
72 }
edm::ESHandle< CaloTopology > caloTopoHandle_
T get() const
Definition: EventSetup.h:63

Member Data Documentation

edm::ESHandle<CaloTopology> EG8XObjectUpdateModifier::caloTopoHandle_
private

Definition at line 38 of file EG8XObjectUpdateModifier.cc.

Referenced by modifyObject(), and setEventContent().

edm::Handle<EcalRecHitCollection> EG8XObjectUpdateModifier::ecalRecHitsEBHandle_
private

Definition at line 39 of file EG8XObjectUpdateModifier.cc.

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

edm::InputTag EG8XObjectUpdateModifier::ecalRecHitsEBTag_
private

Definition at line 43 of file EG8XObjectUpdateModifier.cc.

Referenced by setConsumes().

edm::EDGetTokenT<EcalRecHitCollection> EG8XObjectUpdateModifier::ecalRecHitsEBToken_
private

Definition at line 41 of file EG8XObjectUpdateModifier.cc.

Referenced by setConsumes(), and setEvent().

edm::Handle<EcalRecHitCollection> EG8XObjectUpdateModifier::ecalRecHitsEEHandle_
private

Definition at line 40 of file EG8XObjectUpdateModifier.cc.

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

edm::InputTag EG8XObjectUpdateModifier::ecalRecHitsEETag_
private

Definition at line 44 of file EG8XObjectUpdateModifier.cc.

Referenced by setConsumes().

edm::EDGetTokenT<EcalRecHitCollection> EG8XObjectUpdateModifier::ecalRecHitsEEToken_
private

Definition at line 42 of file EG8XObjectUpdateModifier.cc.

Referenced by setConsumes(), and setEvent().