CMS 3D CMS Logo

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

#include <HLTrigger/JetMET/plugins/HLTScoutingCaloProducer.cc>

Inheritance diagram for HLTScoutingCaloProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTScoutingCaloProducer (const edm::ParameterSet &)
 
 ~HLTScoutingCaloProducer () 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
 
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)
 

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

void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
 

Private Attributes

const edm::EDGetTokenT< reco::JetTagCollectioncaloJetBTagCollection_
 
const edm::EDGetTokenT< reco::CaloJetCollectioncaloJetCollection_
 
const double caloJetEtaCut
 
const edm::EDGetTokenT< reco::JetTagCollectioncaloJetIDTagCollection_
 
const double caloJetPtCut
 
const bool doJetBTags
 
const bool doJetIDTags
 
const bool doMet
 
const edm::EDGetTokenT< reco::CaloMETCollectionmetCollection_
 
const edm::EDGetTokenT< double > rho_
 
const edm::EDGetTokenT< reco::VertexCollectionvertexCollection_
 

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

Description: Producer for Run3ScoutingCaloJets from reco::CaloJet objects

Definition at line 39 of file HLTScoutingCaloProducer.cc.

Constructor & Destructor Documentation

◆ HLTScoutingCaloProducer()

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

Definition at line 67 of file HLTScoutingCaloProducer.cc.

68  : caloJetCollection_(consumes<reco::CaloJetCollection>(iConfig.getParameter<edm::InputTag>("caloJetCollection"))),
70  consumes<reco::JetTagCollection>(iConfig.getParameter<edm::InputTag>("caloJetBTagCollection"))),
72  consumes<reco::JetTagCollection>(iConfig.getParameter<edm::InputTag>("caloJetIDTagCollection"))),
73  vertexCollection_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"))),
74  metCollection_(consumes<reco::CaloMETCollection>(iConfig.getParameter<edm::InputTag>("metCollection"))),
75  rho_(consumes<double>(iConfig.getParameter<edm::InputTag>("rho"))),
76  caloJetPtCut(iConfig.getParameter<double>("caloJetPtCut")),
77  caloJetEtaCut(iConfig.getParameter<double>("caloJetEtaCut")),
78  doMet(iConfig.getParameter<bool>("doMet")),
79  doJetBTags(iConfig.getParameter<bool>("doJetBTags")),
80  doJetIDTags(iConfig.getParameter<bool>("doJetIDTags")) {
81  //register products
82  produces<Run3ScoutingCaloJetCollection>();
83  produces<double>("rho");
84  produces<double>("caloMetPt");
85  produces<double>("caloMetPhi");
86 }

◆ ~HLTScoutingCaloProducer()

HLTScoutingCaloProducer::~HLTScoutingCaloProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 180 of file HLTScoutingCaloProducer.cc.

180  {
182  desc.add<edm::InputTag>("caloJetCollection", edm::InputTag("hltAK4CaloJets"));
183  desc.add<edm::InputTag>("caloJetBTagCollection", edm::InputTag("hltCombinedSecondaryVertexBJetTagsCalo"));
184  desc.add<edm::InputTag>("caloJetIDTagCollection", edm::InputTag("hltCaloJetFromPV"));
185  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"));
186  desc.add<edm::InputTag>("metCollection", edm::InputTag("hltMet"));
187  desc.add<edm::InputTag>("rho", edm::InputTag("hltFixedGridRhoFastjetAllCalo"));
188  desc.add<double>("caloJetPtCut", 20.0);
189  desc.add<double>("caloJetEtaCut", 3.0);
190  desc.add<bool>("doMet", true);
191  desc.add<bool>("doJetBTags", false);
192  desc.add<bool>("doJetIDTags", false);
193  descriptions.add("hltScoutingCaloProducer", desc);
194 }

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

◆ produce()

void HLTScoutingCaloProducer::produce ( edm::StreamID  sid,
edm::Event iEvent,
edm::EventSetup const &  setup 
) const
finalprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 91 of file HLTScoutingCaloProducer.cc.

91  {
92  using namespace edm;
93 
94  //get calo jets
96  std::unique_ptr<Run3ScoutingCaloJetCollection> outCaloJets(new Run3ScoutingCaloJetCollection());
97  if (iEvent.getByToken(caloJetCollection_, caloJetCollection)) {
98  //get jet tags
100  bool haveJetBTags = false;
102  haveJetBTags = true;
103  }
105  bool haveJetIDTags = false;
107  haveJetIDTags = true;
108  }
109 
110  for (auto& jet : *caloJetCollection) {
111  if (jet.pt() > caloJetPtCut && fabs(jet.eta()) < caloJetEtaCut) {
112  //find the jet tag(s) corresponding to the jet
113  float bTagValue = -20;
114  float bTagMinDR2 = 0.01;
115  if (haveJetBTags) {
116  for (auto& tag : *caloJetBTagCollection) {
117  float dR2 = reco::deltaR2(jet, *(tag.first));
118  if (dR2 < bTagMinDR2) {
119  bTagMinDR2 = dR2;
120  bTagValue = tag.second;
121  }
122  }
123  }
124  float idTagValue = -20;
125  float idTagMinDR2 = 0.01;
126  if (haveJetIDTags) {
127  for (auto& tag : *caloJetIDTagCollection) {
128  float dR2 = reco::deltaR2(jet, *(tag.first));
129  if (dR2 < idTagMinDR2) {
130  idTagMinDR2 = dR2;
131  idTagValue = tag.second;
132  }
133  }
134  }
135  outCaloJets->emplace_back(jet.pt(),
136  jet.eta(),
137  jet.phi(),
138  jet.mass(),
139  jet.jetArea(),
140  jet.maxEInEmTowers(),
141  jet.maxEInHadTowers(),
142  jet.hadEnergyInHB(),
143  jet.hadEnergyInHE(),
144  jet.hadEnergyInHF(),
145  jet.emEnergyInEB(),
146  jet.emEnergyInEE(),
147  jet.emEnergyInHF(),
148  jet.towersArea(),
149  idTagValue,
150  bTagValue);
151  }
152  }
153  }
154 
155  //get rho
157  std::unique_ptr<double> outRho(new double(-999));
158  if (iEvent.getByToken(rho_, rho)) {
159  outRho = std::make_unique<double>(*rho);
160  }
161 
162  //get MET
164  std::unique_ptr<double> outMetPt(new double(-999));
165  std::unique_ptr<double> outMetPhi(new double(-999));
166  if (doMet && iEvent.getByToken(metCollection_, metCollection)) {
167  outMetPt = std::make_unique<double>(metCollection->front().pt());
168  outMetPhi = std::make_unique<double>(metCollection->front().phi());
169  }
170 
171  //put output
172  iEvent.put(std::move(outCaloJets));
173  // iEvent.put(std::move(outVertices));
174  iEvent.put(std::move(outRho), "rho");
175  iEvent.put(std::move(outMetPt), "caloMetPt");
176  iEvent.put(std::move(outMetPhi), "caloMetPhi");
177 }

References HLT_FULL_cff::caloJetBTagCollection, caloJetBTagCollection_, pdwgLeptonRecoSkim_cfi::caloJetCollection, caloJetCollection_, caloJetEtaCut, HLT_FULL_cff::caloJetIDTagCollection, caloJetIDTagCollection_, caloJetPtCut, reco::deltaR2(), doJetBTags, doJetIDTags, doMet, iEvent, metsig::jet, susyDQM_cfi::metCollection, metCollection_, eostools::move(), rho, rho_, and makeGlobalPositionRcd_cfg::tag.

Member Data Documentation

◆ caloJetBTagCollection_

const edm::EDGetTokenT<reco::JetTagCollection> HLTScoutingCaloProducer::caloJetBTagCollection_
private

Definition at line 50 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ caloJetCollection_

const edm::EDGetTokenT<reco::CaloJetCollection> HLTScoutingCaloProducer::caloJetCollection_
private

Definition at line 49 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ caloJetEtaCut

const double HLTScoutingCaloProducer::caloJetEtaCut
private

Definition at line 57 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ caloJetIDTagCollection_

const edm::EDGetTokenT<reco::JetTagCollection> HLTScoutingCaloProducer::caloJetIDTagCollection_
private

Definition at line 51 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ caloJetPtCut

const double HLTScoutingCaloProducer::caloJetPtCut
private

Definition at line 56 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ doJetBTags

const bool HLTScoutingCaloProducer::doJetBTags
private

Definition at line 60 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ doJetIDTags

const bool HLTScoutingCaloProducer::doJetIDTags
private

Definition at line 61 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ doMet

const bool HLTScoutingCaloProducer::doMet
private

Definition at line 59 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ metCollection_

const edm::EDGetTokenT<reco::CaloMETCollection> HLTScoutingCaloProducer::metCollection_
private

Definition at line 53 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ rho_

const edm::EDGetTokenT<double> HLTScoutingCaloProducer::rho_
private

Definition at line 54 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

◆ vertexCollection_

const edm::EDGetTokenT<reco::VertexCollection> HLTScoutingCaloProducer::vertexCollection_
private

Definition at line 52 of file HLTScoutingCaloProducer.cc.

HLT_FULL_cff.caloJetBTagCollection
caloJetBTagCollection
Definition: HLT_FULL_cff.py:125507
susyDQM_cfi.metCollection
metCollection
Definition: susyDQM_cfi.py:11
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTScoutingCaloProducer::vertexCollection_
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
Definition: HLTScoutingCaloProducer.cc:52
edm::Handle< reco::CaloJetCollection >
HLTScoutingCaloProducer::caloJetCollection_
const edm::EDGetTokenT< reco::CaloJetCollection > caloJetCollection_
Definition: HLTScoutingCaloProducer.cc:49
HLTScoutingCaloProducer::metCollection_
const edm::EDGetTokenT< reco::CaloMETCollection > metCollection_
Definition: HLTScoutingCaloProducer.cc:53
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLT_FULL_cff.caloJetIDTagCollection
caloJetIDTagCollection
Definition: HLT_FULL_cff.py:125508
HLTScoutingCaloProducer::doMet
const bool doMet
Definition: HLTScoutingCaloProducer.cc:59
DDAxes::rho
HLTScoutingCaloProducer::doJetIDTags
const bool doJetIDTags
Definition: HLTScoutingCaloProducer.cc:61
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTScoutingCaloProducer::rho_
const edm::EDGetTokenT< double > rho_
Definition: HLTScoutingCaloProducer.cc:54
HLTScoutingCaloProducer::doJetBTags
const bool doJetBTags
Definition: HLTScoutingCaloProducer.cc:60
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTScoutingCaloProducer::caloJetIDTagCollection_
const edm::EDGetTokenT< reco::JetTagCollection > caloJetIDTagCollection_
Definition: HLTScoutingCaloProducer.cc:51
Run3ScoutingCaloJetCollection
std::vector< Run3ScoutingCaloJet > Run3ScoutingCaloJetCollection
Definition: Run3ScoutingCaloJet.h:99
HLTScoutingCaloProducer::caloJetEtaCut
const double caloJetEtaCut
Definition: HLTScoutingCaloProducer.cc:57
HLTScoutingCaloProducer::caloJetPtCut
const double caloJetPtCut
Definition: HLTScoutingCaloProducer.cc:56
HLTScoutingCaloProducer::caloJetBTagCollection_
const edm::EDGetTokenT< reco::JetTagCollection > caloJetBTagCollection_
Definition: HLTScoutingCaloProducer.cc:50
pdwgLeptonRecoSkim_cfi.caloJetCollection
caloJetCollection
Definition: pdwgLeptonRecoSkim_cfi.py:8
edm::InputTag
Definition: InputTag.h:15