CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1CaloJetHTTProducer Class Reference

#include <L1CaloJetHTTProducer.cc>

Inheritance diagram for L1CaloJetHTTProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1CaloJetHTTProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
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)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::Handle< BXVector< l1t::Jet > > bxvCaloJetsHandle
 
edm::EDGetTokenT< BXVector< l1t::Jet > > bxvCaloJetsToken_
 
bool debug
 
double EtaMax
 
edm::Handle< std::vector< reco::GenJet > > genJetsHandle
 
edm::EDGetTokenT< std::vector< reco::GenJet > > genJetsToken_
 
double PtMin
 
bool use_gen_jets
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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

Description: Use the L1CaloJetProducer collections to calculate HTT energy sum for CaloJets

Implementation: [Notes on implementation]

Definition at line 39 of file L1CaloJetHTTProducer.cc.

Constructor & Destructor Documentation

◆ L1CaloJetHTTProducer()

L1CaloJetHTTProducer::L1CaloJetHTTProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 62 of file L1CaloJetHTTProducer.cc.

63  : EtaMax(iConfig.getParameter<double>("EtaMax")),
64  PtMin(iConfig.getParameter<double>("PtMin")),
65  bxvCaloJetsToken_(consumes<BXVector<l1t::Jet>>(iConfig.getParameter<edm::InputTag>("BXVCaloJetsInputTag"))),
66  genJetsToken_(consumes<std::vector<reco::GenJet>>(iConfig.getParameter<edm::InputTag>("genJets"))),
67  debug(iConfig.getParameter<bool>("debug")),
68  use_gen_jets(iConfig.getParameter<bool>("use_gen_jets"))
69 
70 {
71  produces<float>("CaloJetHTT");
72 }

Member Function Documentation

◆ produce()

void L1CaloJetHTTProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 74 of file L1CaloJetHTTProducer.cc.

74  {
75  // Output collections
76  std::unique_ptr<float> CaloJetHTT(new float);
77 
78  *CaloJetHTT = 0.;
79 
80  // CaloJet HTT for L1 collections
81  if (!use_gen_jets) {
83 
84  if (bxvCaloJetsHandle.isValid()) {
85  for (const auto& caloJet : *bxvCaloJetsHandle.product()) {
86  if (caloJet.pt() < PtMin)
87  continue;
88  if (fabs(caloJet.eta()) > EtaMax)
89  continue;
90  *CaloJetHTT += float(caloJet.pt());
91  }
92  }
93 
94  if (debug) {
95  LogDebug("L1CaloJetHTTProducer") << " BXV L1CaloJetCollection JetHTT = " << *CaloJetHTT << " for PtMin " << PtMin
96  << " and EtaMax " << EtaMax << "\n";
97  }
98  }
99 
100  // CaloJet HTT for gen jets
101  if (use_gen_jets) {
102  iEvent.getByToken(genJetsToken_, genJetsHandle);
103 
104  if (genJetsHandle.isValid()) {
105  for (const auto& genJet : *genJetsHandle.product()) {
106  if (genJet.pt() < PtMin)
107  continue;
108  if (fabs(genJet.eta()) > EtaMax)
109  continue;
110  *CaloJetHTT += float(genJet.pt());
111  }
112  }
113 
114  if (debug) {
115  LogDebug("L1CaloJetHTTProducer") << " Gen Jets HTT = " << *CaloJetHTT << " for PtMin " << PtMin << " and EtaMax "
116  << EtaMax << "\n";
117  }
118  }
119 
120  iEvent.put(std::move(CaloJetHTT), "CaloJetHTT");
121 }

References bxvCaloJetsHandle, bxvCaloJetsToken_, debug, EtaMax, dqmMemoryStats::float, genJetsHandle, genJetsToken_, iEvent, edm::HandleBase::isValid(), LogDebug, eostools::move(), edm::Handle< T >::product(), PtMin, and use_gen_jets.

Member Data Documentation

◆ bxvCaloJetsHandle

edm::Handle<BXVector<l1t::Jet> > L1CaloJetHTTProducer::bxvCaloJetsHandle
private

Definition at line 50 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

◆ bxvCaloJetsToken_

edm::EDGetTokenT<BXVector<l1t::Jet> > L1CaloJetHTTProducer::bxvCaloJetsToken_
private

Definition at line 49 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

◆ debug

bool L1CaloJetHTTProducer::debug
private

◆ EtaMax

double L1CaloJetHTTProducer::EtaMax
private

Definition at line 46 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

◆ genJetsHandle

edm::Handle<std::vector<reco::GenJet> > L1CaloJetHTTProducer::genJetsHandle
private

Definition at line 55 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

◆ genJetsToken_

edm::EDGetTokenT<std::vector<reco::GenJet> > L1CaloJetHTTProducer::genJetsToken_
private

Definition at line 54 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

◆ PtMin

double L1CaloJetHTTProducer::PtMin
private

Definition at line 47 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

◆ use_gen_jets

bool L1CaloJetHTTProducer::use_gen_jets
private

Definition at line 59 of file L1CaloJetHTTProducer.cc.

Referenced by produce().

L1CaloJetHTTProducer::EtaMax
double EtaMax
Definition: L1CaloJetHTTProducer.cc:46
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
edm::Handle::product
T const * product() const
Definition: Handle.h:70
L1CaloJetHTTProducer::use_gen_jets
bool use_gen_jets
Definition: L1CaloJetHTTProducer.cc:59
BXVector
Definition: BXVector.h:15
L1CaloJetHTTProducer::PtMin
double PtMin
Definition: L1CaloJetHTTProducer.cc:47
L1CaloJetHTTProducer::debug
bool debug
Definition: L1CaloJetHTTProducer.cc:57
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
L1CaloJetHTTProducer::genJetsToken_
edm::EDGetTokenT< std::vector< reco::GenJet > > genJetsToken_
Definition: L1CaloJetHTTProducer.cc:54
iEvent
int iEvent
Definition: GenABIO.cc:224
L1CaloJetHTTProducer::genJetsHandle
edm::Handle< std::vector< reco::GenJet > > genJetsHandle
Definition: L1CaloJetHTTProducer.cc:55
L1CaloJetHTTProducer::bxvCaloJetsToken_
edm::EDGetTokenT< BXVector< l1t::Jet > > bxvCaloJetsToken_
Definition: L1CaloJetHTTProducer.cc:49
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1CaloJetHTTProducer::bxvCaloJetsHandle
edm::Handle< BXVector< l1t::Jet > > bxvCaloJetsHandle
Definition: L1CaloJetHTTProducer.cc:50
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15