CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTEleL1TrackIsolProducer Class Reference
Inheritance diagram for EgammaHLTEleL1TrackIsolProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTEleL1TrackIsolProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTEleL1TrackIsolProducer () override=default
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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::RecoEcalCandidateCollectionecalCandsToken_
 
const edm::EDGetTokenT< reco::ElectronCollectionelesToken_
 
EgammaL1TkIsolation isolAlgo_
 
const edm::EDGetTokenT< L1TrackCollectionl1TrksToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 35 of file EgammaHLTEleL1TrackIsolProducer.cc.

Constructor & Destructor Documentation

◆ EgammaHLTEleL1TrackIsolProducer()

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

Definition at line 49 of file EgammaHLTEleL1TrackIsolProducer.cc.

50  : ecalCandsToken_(consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("ecalCands"))),
51  elesToken_(consumes<reco::ElectronCollection>(config.getParameter<edm::InputTag>("eles"))),
52  l1TrksToken_(consumes<L1TrackCollection>(config.getParameter<edm::InputTag>("l1Tracks"))),
53  isolAlgo_(config.getParameter<edm::ParameterSet>("isolCfg")) {
54  produces<reco::RecoEcalCandidateIsolationMap>();
55 }
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > ecalCandsToken_
Definition: config.py:1
const edm::EDGetTokenT< reco::ElectronCollection > elesToken_
const edm::EDGetTokenT< L1TrackCollection > l1TrksToken_

◆ ~EgammaHLTEleL1TrackIsolProducer()

EgammaHLTEleL1TrackIsolProducer::~EgammaHLTEleL1TrackIsolProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 57 of file EgammaHLTEleL1TrackIsolProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v15_cff::InputTag, and EgammaL1TkIsolation::makePSetDescription().

57  {
59  desc.add<edm::InputTag>("ecalCands", edm::InputTag("hltEgammaCandidates"));
60  desc.add<edm::InputTag>("eles", edm::InputTag("hltEgammaGsfElectrons"));
61  desc.add<edm::InputTag>("l1Tracks", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"));
63  descriptions.add("hltEgammaHLTEleL1TrackIsolProducer", desc);
64 }
static edm::ParameterSetDescription makePSetDescription()
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 65 of file EgammaHLTEleL1TrackIsolProducer.cc.

References EgammaL1TkIsolation::calIsol(), hltEgammaEleL1TrkIsoL1Seeded_cfi::ecalCands, ecalCandsToken_, hltEgammaEleL1TrkIsoL1Seeded_cfi::eles, elesToken_, iEvent, edm::Ref< C, T, F >::isNonnull(), isolAlgo_, l1TrksToken_, SiStripPI::max, eostools::move(), and edm::second().

67  {
68  auto ecalCands = iEvent.getHandle(ecalCandsToken_);
69  auto eles = iEvent.getHandle(elesToken_);
70  auto l1Trks = iEvent.getHandle(l1TrksToken_);
71 
72  auto recoEcalCandMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(ecalCands);
73 
74  for (size_t candNr = 0; candNr < ecalCands->size(); candNr++) {
75  reco::RecoEcalCandidateRef recoEcalCandRef(ecalCands, candNr);
76  reco::ElectronRef eleRef;
77  for (size_t eleNr = 0; eleNr < eles->size(); eleNr++) {
78  if ((*eles)[eleNr].superCluster() == recoEcalCandRef->superCluster()) {
79  eleRef = reco::ElectronRef(eles, eleNr);
80  break;
81  }
82  }
83 
84  float isol =
85  eleRef.isNonnull() ? isolAlgo_.calIsol(*eleRef->gsfTrack(), *l1Trks).second : std::numeric_limits<float>::max();
86 
87  recoEcalCandMap->insert(recoEcalCandRef, isol);
88  }
89  iEvent.put(std::move(recoEcalCandMap));
90 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > ecalCandsToken_
edm::Ref< ElectronCollection > ElectronRef
reference to an object in a collection of Electron objects
Definition: ElectronFwd.h:15
U second(std::pair< T, U > const &p)
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< reco::ElectronCollection > elesToken_
std::pair< int, double > calIsol(const reco::TrackBase &trk, const L1TrackCollection &l1Tks) const
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< L1TrackCollection > l1TrksToken_

Member Data Documentation

◆ ecalCandsToken_

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTEleL1TrackIsolProducer::ecalCandsToken_
private

Definition at line 43 of file EgammaHLTEleL1TrackIsolProducer.cc.

Referenced by produce().

◆ elesToken_

const edm::EDGetTokenT<reco::ElectronCollection> EgammaHLTEleL1TrackIsolProducer::elesToken_
private

Definition at line 44 of file EgammaHLTEleL1TrackIsolProducer.cc.

Referenced by produce().

◆ isolAlgo_

EgammaL1TkIsolation EgammaHLTEleL1TrackIsolProducer::isolAlgo_
private

Definition at line 46 of file EgammaHLTEleL1TrackIsolProducer.cc.

Referenced by produce().

◆ l1TrksToken_

const edm::EDGetTokenT<L1TrackCollection> EgammaHLTEleL1TrackIsolProducer::l1TrksToken_
private

Definition at line 45 of file EgammaHLTEleL1TrackIsolProducer.cc.

Referenced by produce().