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, edm::ConsumesCollector &cc)
 
void modifyObject (pat::Electron &ele) const final
 
void modifyObject (pat::Photon &pho) const final
 
void modifyObject (reco::GsfElectron &ele) const final
 
void modifyObject (reco::Photon &pho) const final
 
void setEvent (const edm::Event &) final
 
void setEventContent (const edm::EventSetup &) final
 
 ~EG8XObjectUpdateModifier () override
 
- Public Member Functions inherited from ModifyObjectValueBase
virtual void modifyObject (pat::Jet &) const
 
virtual void modifyObject (pat::Muon &) const
 
virtual void modifyObject (pat::Tau &) const
 
virtual void modifyObject (reco::BaseTau &) const
 
virtual void modifyObject (reco::Jet &) const
 
virtual void modifyObject (reco::Muon &) 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::EDGetTokenT< EcalRecHitCollectionecalRecHitsEBToken_
 
edm::Handle< EcalRecHitCollectionecalRecHitsEEHandle_
 
edm::EDGetTokenT< EcalRecHitCollectionecalRecHitsEEToken_
 

Detailed Description

Definition at line 20 of file EG8XObjectUpdateModifier.cc.

Constructor & Destructor Documentation

◆ EG8XObjectUpdateModifier()

EG8XObjectUpdateModifier::EG8XObjectUpdateModifier ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)

Definition at line 44 of file EG8XObjectUpdateModifier.cc.

45  : ModifyObjectValueBase(conf),
46  ecalRecHitsEBToken_(cc.consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("ecalRecHitsEB"))),
47  ecalRecHitsEEToken_(cc.consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("ecalRecHitsEE"))) {}

◆ ~EG8XObjectUpdateModifier()

EG8XObjectUpdateModifier::~EG8XObjectUpdateModifier ( )
inlineoverride

Definition at line 23 of file EG8XObjectUpdateModifier.cc.

23 {}

Member Function Documentation

◆ getSaturationInfo()

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

Definition at line 92 of file EG8XObjectUpdateModifier.cc.

92  {
93  bool isEB = superClus.seed()->seed().subdetId() == EcalBarrel;
94  const auto& ecalRecHits = isEB ? *ecalRecHitsEBHandle_ : *ecalRecHitsEEHandle_;
95 
96  int nrSatCrys = 0;
97  bool seedSaturated = false;
98  const auto& hitsAndFractions = superClus.seed()->hitsAndFractions();
99  for (const auto& hitFractionPair : hitsAndFractions) {
100  auto ecalRecHitIt = ecalRecHits.find(hitFractionPair.first);
101  if (ecalRecHitIt != ecalRecHits.end() && ecalRecHitIt->checkFlag(EcalRecHit::Flags::kSaturated)) {
102  nrSatCrys++;
103  if (hitFractionPair.first == superClus.seed()->seed())
104  seedSaturated = true;
105  }
106  }
107  return {nrSatCrys, seedSaturated};
108 }

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

Referenced by modifyObject().

◆ modifyObject() [1/4]

void EG8XObjectUpdateModifier::modifyObject ( pat::Electron ele) const
inlinefinalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 31 of file EG8XObjectUpdateModifier.cc.

31 { return modifyObject(static_cast<reco::GsfElectron&>(ele)); }

References modifyObject().

Referenced by modifyObject().

◆ modifyObject() [2/4]

void EG8XObjectUpdateModifier::modifyObject ( pat::Photon pho) const
inlinefinalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 32 of file EG8XObjectUpdateModifier.cc.

32 { return modifyObject(static_cast<reco::Photon&>(pho)); }

References modifyObject().

Referenced by modifyObject().

◆ modifyObject() [3/4]

void EG8XObjectUpdateModifier::modifyObject ( reco::GsfElectron ele) const
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 58 of file EG8XObjectUpdateModifier.cc.

58  {
59  const reco::CaloCluster& seedClus = *(ele.superCluster()->seed());
60  const EcalRecHitCollection* ecalRecHits = ele.isEB() ? &*ecalRecHitsEBHandle_ : &*ecalRecHitsEEHandle_;
61  const auto* caloTopo = caloTopoHandle_.product();
62 
63  auto full5x5ShowerShapes = ele.full5x5_showerShape();
64  full5x5ShowerShapes.e2x5Left = noZS::EcalClusterTools::e2x5Left(seedClus, ecalRecHits, caloTopo);
65  full5x5ShowerShapes.e2x5Right = noZS::EcalClusterTools::e2x5Right(seedClus, ecalRecHits, caloTopo);
66  full5x5ShowerShapes.e2x5Top = noZS::EcalClusterTools::e2x5Top(seedClus, ecalRecHits, caloTopo);
67  full5x5ShowerShapes.e2x5Bottom = noZS::EcalClusterTools::e2x5Bottom(seedClus, ecalRecHits, caloTopo);
68  ele.full5x5_setShowerShape(full5x5ShowerShapes);
69 
70  auto showerShapes = ele.showerShape();
71  showerShapes.e2x5Left = EcalClusterTools::e2x5Left(seedClus, ecalRecHits, caloTopo);
72  showerShapes.e2x5Right = EcalClusterTools::e2x5Right(seedClus, ecalRecHits, caloTopo);
73  showerShapes.e2x5Top = EcalClusterTools::e2x5Top(seedClus, ecalRecHits, caloTopo);
74  showerShapes.e2x5Bottom = EcalClusterTools::e2x5Bottom(seedClus, ecalRecHits, caloTopo);
75  ele.setShowerShape(showerShapes);
76 
78  auto satInfo = getSaturationInfo(*ele.superCluster());
79  eleSatInfo.nSaturatedXtals = satInfo.first;
80  eleSatInfo.isSeedSaturated = satInfo.second;
81  ele.setSaturationInfo(eleSatInfo);
82 }

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().

◆ modifyObject() [4/4]

void EG8XObjectUpdateModifier::modifyObject ( reco::Photon pho) const
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 84 of file EG8XObjectUpdateModifier.cc.

84  {
86  auto satInfo = getSaturationInfo(*pho.superCluster());
87  phoSatInfo.nSaturatedXtals = satInfo.first;
88  phoSatInfo.isSeedSaturated = satInfo.second;
89  pho.setSaturationInfo(phoSatInfo);
90 }

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

◆ setEvent()

void EG8XObjectUpdateModifier::setEvent ( const edm::Event iEvent)
finalvirtual

◆ setEventContent()

void EG8XObjectUpdateModifier::setEventContent ( const edm::EventSetup iSetup)
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 54 of file EG8XObjectUpdateModifier.cc.

54  {
56 }

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

Member Data Documentation

◆ caloTopoHandle_

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

Definition at line 37 of file EG8XObjectUpdateModifier.cc.

Referenced by modifyObject(), and setEventContent().

◆ ecalRecHitsEBHandle_

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

Definition at line 38 of file EG8XObjectUpdateModifier.cc.

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

◆ ecalRecHitsEBToken_

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

Definition at line 40 of file EG8XObjectUpdateModifier.cc.

Referenced by setEvent().

◆ ecalRecHitsEEHandle_

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

Definition at line 39 of file EG8XObjectUpdateModifier.cc.

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

◆ ecalRecHitsEEToken_

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

Definition at line 41 of file EG8XObjectUpdateModifier.cc.

Referenced by setEvent().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::GsfElectron::isEB
bool isEB() const
Definition: GsfElectron.h:336
EG8XObjectUpdateModifier::getSaturationInfo
std::pair< int, bool > getSaturationInfo(const reco::SuperCluster &superClus) const
Definition: EG8XObjectUpdateModifier.cc:92
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
reco::GsfElectron::setSaturationInfo
void setSaturationInfo(const SaturationInfo &s)
Definition: GsfElectron.h:500
reco::Photon::SaturationInfo::nSaturatedXtals
int nSaturatedXtals
Definition: Photon.h:259
EcalClusterToolsT::e2x5Bottom
static float e2x5Bottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:593
reco::Photon::SaturationInfo
Definition: Photon.h:258
edm::SortedCollection< EcalRecHit >
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
reco::GsfElectron::full5x5_setShowerShape
void full5x5_setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:468
reco::GsfElectron::SaturationInfo::nSaturatedXtals
int nSaturatedXtals
Definition: GsfElectron.h:491
EG8XObjectUpdateModifier::ecalRecHitsEBToken_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEBToken_
Definition: EG8XObjectUpdateModifier.cc:40
reco::GsfElectron::showerShape
const ShowerShape & showerShape() const
Definition: GsfElectron.h:439
ModifyObjectValueBase::ModifyObjectValueBase
ModifyObjectValueBase(const edm::ParameterSet &conf)
Definition: ModifyObjectValueBase.h:20
EcalBarrel
Definition: EcalSubdetector.h:10
reco::GsfElectron::setShowerShape
void setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:467
reco::GsfElectron::full5x5_showerShape
const ShowerShape & full5x5_showerShape() const
Definition: GsfElectron.h:464
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
EcalClusterToolsT::e2x5Top
static float e2x5Top(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:585
reco::CaloCluster
Definition: CaloCluster.h:31
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
EG8XObjectUpdateModifier::caloTopoHandle_
edm::ESHandle< CaloTopology > caloTopoHandle_
Definition: EG8XObjectUpdateModifier.cc:37
EG8XObjectUpdateModifier::modifyObject
void modifyObject(reco::GsfElectron &ele) const final
Definition: EG8XObjectUpdateModifier.cc:58
reco::GsfElectron::ShowerShape::e2x5Left
float e2x5Left
Definition: GsfElectron.h:388
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::GsfElectron::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: GsfElectron.h:492
get
#define get
cc
EcalClusterToolsT::e2x5Right
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:569
EG8XObjectUpdateModifier::ecalRecHitsEEHandle_
edm::Handle< EcalRecHitCollection > ecalRecHitsEEHandle_
Definition: EG8XObjectUpdateModifier.cc:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EcalClusterToolsT::e2x5Left
static float e2x5Left(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:577
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:260
reco::GsfElectron::superCluster
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:163
reco::Photon::setSaturationInfo
void setSaturationInfo(const SaturationInfo &s)
Definition: Photon.h:268
EG8XObjectUpdateModifier::ecalRecHitsEEToken_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEEToken_
Definition: EG8XObjectUpdateModifier.cc:41
reco::GsfElectron::SaturationInfo
Definition: GsfElectron.h:490
edm::InputTag
Definition: InputTag.h:15
EG8XObjectUpdateModifier::ecalRecHitsEBHandle_
edm::Handle< EcalRecHitCollection > ecalRecHitsEBHandle_
Definition: EG8XObjectUpdateModifier.cc:38