CMS 3D CMS Logo

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

Public Member Functions

 EgammaHLTCaloTowerProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, edm::EventSetup const &) const final
 
 ~EgammaHLTCaloTowerProducer () override
 
- 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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)
 

Public Attributes

const double cone_
 
const double EThreshold_
 
const double EtThreshold_
 
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1isoseeds_
 
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1nonisoseeds_
 
const edm::EDGetTokenT< CaloTowerCollectiontowers_
 

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

Framework module that produces a collection of calo towers in the region of interest for Egamma HLT reconnstruction,

Author
M. Sani (UCSD)

Definition at line 31 of file EgammaHLTCaloTowerProducer.cc.

Constructor & Destructor Documentation

◆ EgammaHLTCaloTowerProducer()

EgammaHLTCaloTowerProducer::EgammaHLTCaloTowerProducer ( const edm::ParameterSet p)

Definition at line 51 of file EgammaHLTCaloTowerProducer.cc.

52  : towers_(consumes<CaloTowerCollection>(p.getParameter<InputTag>("towerCollection"))),
53  cone_(p.getParameter<double>("useTowersInCone")),
54  l1isoseeds_(consumes<edm::View<reco::Candidate>>(p.getParameter<edm::InputTag>("L1IsoCand"))),
55  l1nonisoseeds_(consumes<edm::View<reco::Candidate>>(p.getParameter<edm::InputTag>("L1NonIsoCand"))),
56  EtThreshold_(p.getParameter<double>("EtMin")),
57  EThreshold_(p.getParameter<double>("EMin")) {
58  produces<CaloTowerCollection>();
59 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< CaloTowerCollection > towers_
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1isoseeds_
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1nonisoseeds_

◆ ~EgammaHLTCaloTowerProducer()

EgammaHLTCaloTowerProducer::~EgammaHLTCaloTowerProducer ( )
inlineoverride

Definition at line 34 of file EgammaHLTCaloTowerProducer.cc.

34 {};

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 61 of file EgammaHLTCaloTowerProducer.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

61  {
63 
64  desc.add<edm::InputTag>(("towerCollection"), edm::InputTag("hltRecoEcalCandidate"));
65  desc.add<edm::InputTag>(("L1IsoCand"), edm::InputTag("hltTowerMakerForAll"));
66  desc.add<edm::InputTag>(("L1NonIsoCand"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
67  desc.add<double>(("useTowersInCone"), 0.8);
68  desc.add<double>(("EtMin"), 1.0);
69  desc.add<double>(("EMin"), 1.0);
70  descriptions.add(("hltCaloTowerForEgamma"), desc);
71 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void EgammaHLTCaloTowerProducer::produce ( edm::StreamID  ,
edm::Event evt,
edm::EventSetup const &   
) const
finalvirtual

Implements edm::global::EDProducerBase.

Definition at line 73 of file EgammaHLTCaloTowerProducer.cc.

References eleHcalExtractorBlocks_cff::caloTowers, HLT_2024v12_cff::cands, cone_, dumpMFGeometry_cfg::delta, electronAnalyzer_cfi::DeltaR, reco::LeafCandidate::energy(), CaloTower::et(), reco::LeafCandidate::eta(), EThreshold_, EtThreshold_, ntuplemaker::fill, edm::Event::getByToken(), heavyIonCSV_trainingSettings::idx, l1isoseeds_, l1nonisoseeds_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::phi(), edm::Event::put(), and towers_.

73  {
76 
78  evt.getByToken(l1isoseeds_, emIsolColl);
80  evt.getByToken(l1nonisoseeds_, emNonIsolColl);
81  auto cands = std::make_unique<CaloTowerCollection>();
82  cands->reserve(caloTowers->size());
83 
84  for (unsigned idx = 0; idx < caloTowers->size(); idx++) {
85  const CaloTower* cal = &((*caloTowers)[idx]);
86  if (cal->et() >= EtThreshold_ && cal->energy() >= EThreshold_) {
87  bool fill = false;
88  math::PtEtaPhiELorentzVector p(cal->et(), cal->eta(), cal->phi(), cal->energy());
89  for (edm::View<reco::Candidate>::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end();
90  ++emItr) {
91  double delta = ROOT::Math::VectorUtil::DeltaR((*emItr).p4().Vect(), p);
92  if (delta < cone_) {
93  cands->push_back(*cal);
94  fill = true;
95  break;
96  }
97  }
98 
99  if (!fill) {
100  for (edm::View<reco::Candidate>::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end();
101  ++emItr) {
102  double delta = ROOT::Math::VectorUtil::DeltaR((*emItr).p4().Vect(), p);
103  if (delta < cone_) {
104  cands->push_back(*cal);
105  break;
106  }
107  }
108  }
109  }
110  }
111 
112  evt.put(std::move(cands));
113 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
double et(double vtxZ) const
Definition: CaloTower.h:150
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:27
const edm::EDGetTokenT< CaloTowerCollection > towers_
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1isoseeds_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1nonisoseeds_
double phi() const final
momentum azimuthal angle
def move(src, dest)
Definition: eostools.py:511
double energy() const final
energy
double eta() const final
momentum pseudorapidity

Member Data Documentation

◆ cone_

const double EgammaHLTCaloTowerProducer::cone_

Definition at line 39 of file EgammaHLTCaloTowerProducer.cc.

Referenced by produce().

◆ EThreshold_

const double EgammaHLTCaloTowerProducer::EThreshold_

Definition at line 43 of file EgammaHLTCaloTowerProducer.cc.

Referenced by produce().

◆ EtThreshold_

const double EgammaHLTCaloTowerProducer::EtThreshold_

Definition at line 42 of file EgammaHLTCaloTowerProducer.cc.

Referenced by produce().

◆ l1isoseeds_

const edm::EDGetTokenT<edm::View<reco::Candidate> > EgammaHLTCaloTowerProducer::l1isoseeds_

Definition at line 40 of file EgammaHLTCaloTowerProducer.cc.

Referenced by produce().

◆ l1nonisoseeds_

const edm::EDGetTokenT<edm::View<reco::Candidate> > EgammaHLTCaloTowerProducer::l1nonisoseeds_

Definition at line 41 of file EgammaHLTCaloTowerProducer.cc.

Referenced by produce().

◆ towers_

const edm::EDGetTokenT<CaloTowerCollection> EgammaHLTCaloTowerProducer::towers_

Definition at line 38 of file EgammaHLTCaloTowerProducer.cc.

Referenced by produce().