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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
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::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
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 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 }

◆ ~EgammaHLTEleL1TrackIsolProducer()

EgammaHLTEleL1TrackIsolProducer::~EgammaHLTEleL1TrackIsolProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 57 of file EgammaHLTEleL1TrackIsolProducer.cc.

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("TTTracksFromTrackletEmulation", "Level1TTTracks"));
63  descriptions.add("hltEgammaHLTEleL1TrackIsolProducer", desc);
64 }

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

◆ 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.

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 }

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

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

EgammaHLTEleL1TrackIsolProducer::isolAlgo_
EgammaL1TkIsolation isolAlgo_
Definition: EgammaHLTEleL1TrackIsolProducer.cc:46
EgammaHLTEleL1TrackIsolProducer::ecalCandsToken_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > ecalCandsToken_
Definition: EgammaHLTEleL1TrackIsolProducer.cc:43
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
EgammaHLTEleL1TrackIsolProducer::l1TrksToken_
const edm::EDGetTokenT< L1TrackCollection > l1TrksToken_
Definition: EgammaHLTEleL1TrackIsolProducer.cc:45
reco::ElectronRef
edm::Ref< ElectronCollection > ElectronRef
reference to an object in a collection of Electron objects
Definition: ElectronFwd.h:15
edm::Ref
Definition: AssociativeIterator.h:58
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaL1TkIsolation::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EgammaL1TkIsolation.h:18
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
iEvent
int iEvent
Definition: GenABIO.cc:224
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
EgammaHLTEleL1TrackIsolProducer::elesToken_
const edm::EDGetTokenT< reco::ElectronCollection > elesToken_
Definition: EgammaHLTEleL1TrackIsolProducer.cc:44
eostools.move
def move(src, dest)
Definition: eostools.py:511
hltEgammaHLTExtra_cfi.ecalCands
ecalCands
Definition: hltEgammaHLTExtra_cfi.py:7
edm::InputTag
Definition: InputTag.h:15
EgammaL1TkIsolation::calIsol
std::pair< int, double > calIsol(const reco::TrackBase &trk, const L1TrackCollection &l1Tks) const
Definition: EgammaL1TkIsolation.cc:32