CMS 3D CMS Logo

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

#include <EgammaHLTCaloTowerProducer.h>

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 override final
 
 ~EgammaHLTCaloTowerProducer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

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 24 of file EgammaHLTCaloTowerProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file EgammaHLTCaloTowerProducer.cc.

27  : towers_ (consumes<CaloTowerCollection>(p.getParameter<InputTag> ("towerCollection"))),
28  cone_ (p.getParameter<double> ("useTowersInCone")),
31  EtThreshold_ (p.getParameter<double> ("EtMin")),
32  EThreshold_ (p.getParameter<double> ("EMin")) {
33 
34  produces<CaloTowerCollection>();
35 }
T getParameter(std::string const &) const
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 ( )
inline

Definition at line 28 of file EgammaHLTCaloTowerProducer.h.

28 {};

Member Function Documentation

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

Definition at line 37 of file EgammaHLTCaloTowerProducer.cc.

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

37  {
38 
40 
41  desc.add<edm::InputTag>(("towerCollection"), edm::InputTag("hltRecoEcalCandidate"));
42  desc.add<edm::InputTag>(("L1IsoCand"), edm::InputTag("hltTowerMakerForAll"));
43  desc.add<edm::InputTag>(("L1NonIsoCand"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
44  desc.add<double>(("useTowersInCone"), 0.8);
45  desc.add<double>(("EtMin"), 1.0);
46  desc.add<double>(("EMin"), 1.0);
47  descriptions.add(("hltCaloTowerForEgamma"), desc);
48 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTCaloTowerProducer::produce ( edm::StreamID  ,
edm::Event evt,
edm::EventSetup const &   
) const
finaloverridevirtual

Implements edm::global::EDProducerBase.

Definition at line 51 of file EgammaHLTCaloTowerProducer.cc.

References eleHcalExtractorBlocks_cff::caloTowers, cone_, delta, HiRegitMuonDetachedTripletStep_cff::DeltaR, reco::LeafCandidate::energy(), CaloTower::et(), reco::LeafCandidate::eta(), EThreshold_, EtThreshold_, lumiContext::fill, edm::Event::getByToken(), training_settings::idx, l1isoseeds_, l1nonisoseeds_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::phi(), edm::Event::put(), edm::SortedCollection< T, SORT >::size(), and towers_.

52 {
54  evt.getByToken(towers_, caloTowers);
55 
57  evt.getByToken(l1isoseeds_, emIsolColl);
59  evt.getByToken(l1nonisoseeds_, emNonIsolColl);
60  auto cands = std::make_unique<CaloTowerCollection>();
61  cands->reserve(caloTowers->size());
62 
63  for (unsigned idx = 0; idx < caloTowers->size(); idx++) {
64  const CaloTower* cal = &((*caloTowers) [idx]);
65  if (cal->et() >= EtThreshold_ && cal->energy() >= EThreshold_) {
66  bool fill = false;
67  math::PtEtaPhiELorentzVector p(cal->et(), cal->eta(), cal->phi(), cal->energy());
68  for (edm::View<reco::Candidate>::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end() ;++emItr) {
69  double delta = ROOT::Math::VectorUtil::DeltaR((*emItr).p4().Vect(), p);
70  if(delta < cone_) {
71  cands->push_back(*cal);
72  fill = true;
73  break;
74  }
75  }
76 
77  if (!fill) {
78  for(edm::View<reco::Candidate>::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end() ;++emItr) {
79  double delta = ROOT::Math::VectorUtil::DeltaR((*emItr).p4().Vect(), p);
80  if(delta < cone_) {
81  cands->push_back(*cal);
82  break;
83  }
84  }
85  }
86  }
87  }
88 
89  evt.put(std::move(cands));
90 }
dbl * delta
Definition: mlp_gen.cc:36
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
virtual double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
virtual double phi() const final
momentum azimuthal angle
virtual double energy() const final
energy
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:86
size_type size() const
const edm::EDGetTokenT< edm::View< reco::Candidate > > l1nonisoseeds_
double et(double vtxZ) const
Definition: CaloTower.h:132
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const double EgammaHLTCaloTowerProducer::cone_

Definition at line 33 of file EgammaHLTCaloTowerProducer.h.

Referenced by produce().

const double EgammaHLTCaloTowerProducer::EThreshold_

Definition at line 37 of file EgammaHLTCaloTowerProducer.h.

Referenced by produce().

const double EgammaHLTCaloTowerProducer::EtThreshold_

Definition at line 36 of file EgammaHLTCaloTowerProducer.h.

Referenced by produce().

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

Definition at line 34 of file EgammaHLTCaloTowerProducer.h.

Referenced by produce().

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

Definition at line 35 of file EgammaHLTCaloTowerProducer.h.

Referenced by produce().

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

Definition at line 32 of file EgammaHLTCaloTowerProducer.h.

Referenced by produce().