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 &&)=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)
 

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

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 }

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

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 }

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

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

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 }

References eleHcalExtractorBlocks_cff::caloTowers, HLT_FULL_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_.

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

EgammaHLTCaloTowerProducer::EtThreshold_
const double EtThreshold_
Definition: EgammaHLTCaloTowerProducer.cc:42
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
math::PtEtaPhiELorentzVector
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:27
EgammaHLTCaloTowerProducer::towers_
const edm::EDGetTokenT< CaloTowerCollection > towers_
Definition: EgammaHLTCaloTowerProducer.cc:38
EgammaHLTCaloTowerProducer::EThreshold_
const double EThreshold_
Definition: EgammaHLTCaloTowerProducer.cc:43
edm::Handle
Definition: AssociativeIterator.h:50
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
EgammaHLTCaloTowerProducer::l1nonisoseeds_
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1nonisoseeds_
Definition: EgammaHLTCaloTowerProducer.cc:41
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
edm::View
Definition: CaloClusterFwd.h:14
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15144
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
eleHcalExtractorBlocks_cff.caloTowers
caloTowers
Definition: eleHcalExtractorBlocks_cff.py:15
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
CaloTower
Definition: CaloTower.h:26
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
CaloTower::et
double et(double vtxZ) const
Definition: CaloTower.h:150
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
EgammaHLTCaloTowerProducer::l1isoseeds_
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1isoseeds_
Definition: EgammaHLTCaloTowerProducer.cc:40
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
EgammaHLTCaloTowerProducer::cone_
const double cone_
Definition: EgammaHLTCaloTowerProducer.cc:39
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:155
edm::InputTag
Definition: InputTag.h:15