CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTElectronTrackIsolationProducers Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTElectronTrackIsolationProducers.h>

Inheritance diagram for EgammaHLTElectronTrackIsolationProducers:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTElectronTrackIsolationProducers (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTElectronTrackIsolationProducers () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT< reco::BeamSpotbeamSpotProducer_
 
const double egTrkIsoConeSize_
 
const double egTrkIsoPtMin_
 
const double egTrkIsoRSpan_
 
const double egTrkIsoStripBarrel_
 
const double egTrkIsoStripEndcap_
 
const double egTrkIsoVetoConeSizeBarrel_
 
const double egTrkIsoVetoConeSizeEndcap_
 
const double egTrkIsoZSpan_
 
const edm::EDGetTokenT< reco::ElectronCollectionelectronProducer_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateProducer_
 
const edm::EDGetTokenT< reco::TrackCollectiontrackProducer_
 
const bool useGsfTrack_
 
const bool useSCRefs_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 40 of file EgammaHLTElectronTrackIsolationProducers.cc.

Constructor & Destructor Documentation

◆ EgammaHLTElectronTrackIsolationProducers()

EgammaHLTElectronTrackIsolationProducers::EgammaHLTElectronTrackIsolationProducers ( const edm::ParameterSet config)
explicit

Definition at line 66 of file EgammaHLTElectronTrackIsolationProducers.cc.

67  : electronProducer_(consumes<reco::ElectronCollection>(config.getParameter<edm::InputTag>("electronProducer"))),
68  trackProducer_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackProducer"))),
70  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
71  beamSpotProducer_(consumes<reco::BeamSpot>(config.getParameter<edm::InputTag>("beamSpotProducer"))),
72  useGsfTrack_(config.getParameter<bool>("useGsfTrack")),
73  useSCRefs_(config.getParameter<bool>("useSCRefs")),
74  egTrkIsoPtMin_(config.getParameter<double>("egTrkIsoPtMin")),
75  egTrkIsoConeSize_(config.getParameter<double>("egTrkIsoConeSize")),
76  egTrkIsoZSpan_(config.getParameter<double>("egTrkIsoZSpan")),
77  egTrkIsoRSpan_(config.getParameter<double>("egTrkIsoRSpan")),
78  egTrkIsoVetoConeSizeBarrel_(config.getParameter<double>("egTrkIsoVetoConeSizeBarrel")),
79  egTrkIsoVetoConeSizeEndcap_(config.getParameter<double>("egTrkIsoVetoConeSizeEndcap")),
80  egTrkIsoStripBarrel_(config.getParameter<double>("egTrkIsoStripBarrel")),
81  egTrkIsoStripEndcap_(config.getParameter<double>("egTrkIsoStripEndcap")) {
82  //register your products
83  if (useSCRefs_)
84  produces<reco::RecoEcalCandidateIsolationMap>();
85  else
86  produces<reco::ElectronIsolationMap>();
87 }

References useSCRefs_.

◆ ~EgammaHLTElectronTrackIsolationProducers()

EgammaHLTElectronTrackIsolationProducers::~EgammaHLTElectronTrackIsolationProducers ( )
override

Definition at line 89 of file EgammaHLTElectronTrackIsolationProducers.cc.

89 {}

Member Function Documentation

◆ fillDescriptions()

void EgammaHLTElectronTrackIsolationProducers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 91 of file EgammaHLTElectronTrackIsolationProducers.cc.

91  {
93  desc.add<edm::InputTag>("electronProducer", edm::InputTag("hltEleAnyWP80PixelMatchElectronsL1Seeded"));
94  desc.add<edm::InputTag>("trackProducer", edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
95  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag());
96  desc.add<edm::InputTag>("beamSpotProducer", edm::InputTag("hltOnlineBeamSpot"));
97  desc.add<double>("egTrkIsoPtMin", 1.0);
98  desc.add<double>("egTrkIsoConeSize", 0.3);
99  desc.add<double>("egTrkIsoZSpan", 0.15);
100  desc.add<double>("egTrkIsoRSpan", 999999.0);
101  desc.add<double>("egTrkIsoVetoConeSizeBarrel", 0.03);
102  desc.add<double>("egTrkIsoVetoConeSizeEndcap", 0.03);
103  desc.add<double>("egTrkIsoStripBarrel", 0.03);
104  desc.add<double>("egTrkIsoStripEndcap", 0.03);
105  desc.add<bool>("useGsfTrack", false);
106  desc.add<bool>("useSCRefs", false);
107 
108  descriptions.add("hltEgammaHLTElectronTrackIsolationProducers", desc);
109 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

void EgammaHLTElectronTrackIsolationProducers::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 110 of file EgammaHLTElectronTrackIsolationProducers.cc.

112  {
114  iEvent.getByToken(electronProducer_, electronHandle);
115 
116  // Get the general tracks
118  iEvent.getByToken(trackProducer_, trackHandle);
119  const reco::TrackCollection* trackCollection = trackHandle.product();
120 
121  reco::ElectronIsolationMap eleMap(electronHandle);
122 
123  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
124  iEvent.getByToken(beamSpotProducer_, recoBeamSpotHandle);
125 
126  const reco::BeamSpot::Point& beamSpotPosition = recoBeamSpotHandle->position();
127 
137  beamSpotPosition);
138 
139  if (useSCRefs_) {
141  iEvent.getByToken(recoEcalCandidateProducer_, recoEcalCandHandle);
142  reco::RecoEcalCandidateIsolationMap recoEcalCandMap(recoEcalCandHandle);
143 
144  for (reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin();
145  iRecoEcalCand != recoEcalCandHandle->end();
146  iRecoEcalCand++) {
147  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle, iRecoEcalCand - recoEcalCandHandle->begin());
148 
149  reco::ElectronRef eleRef;
150  for (reco::ElectronCollection::const_iterator eleIt = electronHandle->begin(); eleIt != electronHandle->end();
151  eleIt++) {
152  if (eleIt->superCluster() == recoEcalCandRef->superCluster()) {
153  eleRef = reco::ElectronRef(electronHandle, eleIt - electronHandle->begin());
154  break;
155  }
156  }
157  float isol = 999999;
158  if (eleRef.isNonnull()) {
159  const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track();
160  isol = isoAlgo.getIso(eleTrk).second;
161  }
162  recoEcalCandMap.insert(recoEcalCandRef, isol);
163  } //end reco ecal candidate ref
164 
165  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandMap));
166 
167  } else { //we are going to loop over electron instead
168  for (reco::ElectronCollection::const_iterator iElectron = electronHandle->begin();
169  iElectron != electronHandle->end();
170  iElectron++) {
171  reco::ElectronRef eleRef(reco::ElectronRef(electronHandle, iElectron - electronHandle->begin()));
172  const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track();
173  float isol = isoAlgo.getIso(eleTrk).second;
174  eleMap.insert(eleRef, isol);
175  }
176 
177  iEvent.put(std::make_unique<reco::ElectronIsolationMap>(eleMap));
178  }
179 }

References beamSpotProducer_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSizeBarrel_, egTrkIsoVetoConeSizeEndcap_, egTrkIsoZSpan_, electronProducer_, ElectronTkIsolation::getIso(), iEvent, edm::AssociationMap< Tag >::insert(), reco::BeamSpot::position(), edm::Handle< T >::product(), recoEcalCandidateProducer_, duplicaterechits_cfi::trackCollection, trackProducer_, useGsfTrack_, and useSCRefs_.

Member Data Documentation

◆ beamSpotProducer_

const edm::EDGetTokenT<reco::BeamSpot> EgammaHLTElectronTrackIsolationProducers::beamSpotProducer_
private

Definition at line 51 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoConeSize_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoConeSize_
private

Definition at line 57 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoPtMin_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoPtMin_
private

Definition at line 56 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoRSpan_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoRSpan_
private

Definition at line 59 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoStripBarrel_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripBarrel_
private

Definition at line 62 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoStripEndcap_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripEndcap_
private

Definition at line 63 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoVetoConeSizeBarrel_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeBarrel_
private

Definition at line 60 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoVetoConeSizeEndcap_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeEndcap_
private

Definition at line 61 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ egTrkIsoZSpan_

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoZSpan_
private

Definition at line 58 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ electronProducer_

const edm::EDGetTokenT<reco::ElectronCollection> EgammaHLTElectronTrackIsolationProducers::electronProducer_
private

Definition at line 48 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ recoEcalCandidateProducer_

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTElectronTrackIsolationProducers::recoEcalCandidateProducer_
private

Definition at line 50 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ trackProducer_

const edm::EDGetTokenT<reco::TrackCollection> EgammaHLTElectronTrackIsolationProducers::trackProducer_
private

Definition at line 49 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ useGsfTrack_

const bool EgammaHLTElectronTrackIsolationProducers::useGsfTrack_
private

Definition at line 53 of file EgammaHLTElectronTrackIsolationProducers.cc.

Referenced by produce().

◆ useSCRefs_

const bool EgammaHLTElectronTrackIsolationProducers::useSCRefs_
private
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaHLTElectronTrackIsolationProducers::egTrkIsoPtMin_
const double egTrkIsoPtMin_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:56
edm::Handle
Definition: AssociativeIterator.h:50
reco::ElectronRef
edm::Ref< ElectronCollection > ElectronRef
reference to an object in a collection of Electron objects
Definition: ElectronFwd.h:15
EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeBarrel_
const double egTrkIsoVetoConeSizeBarrel_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:60
edm::Ref
Definition: AssociativeIterator.h:58
EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripEndcap_
const double egTrkIsoStripEndcap_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:63
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaHLTElectronTrackIsolationProducers::beamSpotProducer_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotProducer_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:51
reco::Track
Definition: Track.h:27
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
ElectronTkIsolation
Definition: ElectronTkIsolation.h:26
EgammaHLTElectronTrackIsolationProducers::trackProducer_
const edm::EDGetTokenT< reco::TrackCollection > trackProducer_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:49
EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeEndcap_
const double egTrkIsoVetoConeSizeEndcap_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:61
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
edm::AssociationMap
Definition: AssociationMap.h:48
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaHLTElectronTrackIsolationProducers::useSCRefs_
const bool useSCRefs_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:54
EgammaHLTElectronTrackIsolationProducers::electronProducer_
const edm::EDGetTokenT< reco::ElectronCollection > electronProducer_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:48
EgammaHLTElectronTrackIsolationProducers::egTrkIsoConeSize_
const double egTrkIsoConeSize_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:57
EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripBarrel_
const double egTrkIsoStripBarrel_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:62
EgammaHLTElectronTrackIsolationProducers::useGsfTrack_
const bool useGsfTrack_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:53
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
EgammaHLTElectronTrackIsolationProducers::egTrkIsoZSpan_
const double egTrkIsoZSpan_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:58
EgammaHLTElectronTrackIsolationProducers::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:50
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
EgammaHLTElectronTrackIsolationProducers::egTrkIsoRSpan_
const double egTrkIsoRSpan_
Definition: EgammaHLTElectronTrackIsolationProducers.cc:59