CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTJetL1TMatchProducer< T > Class Template Reference

#include <HLTJetL1TMatchProducer.h>

Inheritance diagram for HLTJetL1TMatchProducer< T >:
edm::stream::EDProducer<>

Public Member Functions

 HLTJetL1TMatchProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTJetL1TMatchProducer () override=default
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

double DeltaR2_
 
edm::InputTag jetsInput_
 
edm::InputTag L1Jets_
 
edm::EDGetTokenT< std::vector< T > > m_theJetToken
 
edm::EDGetTokenT< l1t::JetBxCollectionm_theL1JetToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename T>
class HLTJetL1TMatchProducer< T >

Definition at line 21 of file HLTJetL1TMatchProducer.h.

Constructor & Destructor Documentation

◆ HLTJetL1TMatchProducer()

template<typename T >
HLTJetL1TMatchProducer< T >::HLTJetL1TMatchProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 14 of file HLTJetL1TMatchProducer.cc.

References funct::abs().

14  {
15  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
16  L1Jets_ = iConfig.template getParameter<edm::InputTag>("L1Jets");
17 
18  // minimum delta-R^2 threshold with sign
19  auto const DeltaR = iConfig.template getParameter<double>("DeltaR");
21 
22  m_theJetToken = consumes(jetsInput_);
23  m_theL1JetToken = consumes(L1Jets_);
24 
25  produces<std::vector<T>>();
26 }
Definition: DeltaR.py:1
edm::EDGetTokenT< std::vector< T > > m_theJetToken
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< l1t::JetBxCollection > m_theL1JetToken

◆ ~HLTJetL1TMatchProducer()

template<typename T >
HLTJetL1TMatchProducer< T >::~HLTJetL1TMatchProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

template<typename T >
void HLTJetL1TMatchProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 29 of file HLTJetL1TMatchProducer.cc.

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

29  {
31  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT5PFJets"));
32  desc.add<edm::InputTag>("L1Jets", edm::InputTag("hltCaloStage2Digis"));
33  desc.add<double>("DeltaR", 0.5);
35 }
std::string defaultModuleLabel()
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

template<typename T >
void HLTJetL1TMatchProducer< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 38 of file HLTJetL1TMatchProducer.cc.

References reco::deltaR2(), iEvent, trackerHitRTTI::isMatched(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, metsig::jet, PDWG_EXODelayedJetMET_cff::jets, eostools::move(), and mps_fire::result.

38  {
39  auto const& jets = iEvent.get(m_theJetToken);
40  auto const l1Jets = iEvent.getHandle(m_theL1JetToken);
41 
42  bool trigger_bx_only = true; // selection of BX not implemented
43 
44  auto result = std::make_unique<std::vector<T>>();
45 
46  if (l1Jets.isValid()) {
47  for (auto const& jet : jets) {
48  bool isMatched = false;
49  for (int ibx = l1Jets->getFirstBX(); ibx <= l1Jets->getLastBX(); ++ibx) {
50  if (trigger_bx_only && (ibx != 0))
51  continue;
52  for (auto it = l1Jets->begin(ibx); it != l1Jets->end(ibx); it++) {
53  if (it->et() == 0)
54  continue; // if you don't care about L1T candidates with zero ET.
55  if (reco::deltaR2(jet.eta(), jet.phi(), it->eta(), it->phi()) < DeltaR2_) {
56  isMatched = true;
57  break;
58  }
59  }
60  }
61  if (isMatched) {
62  result->emplace_back(jet);
63  }
64  }
65  } else {
66  edm::LogWarning("MissingProduct") << "L1Upgrade l1Jets bx collection not found.";
67  }
68 
69  iEvent.put(std::move(result));
70 }
edm::EDGetTokenT< std::vector< T > > m_theJetToken
int iEvent
Definition: GenABIO.cc:224
bool isMatched(TrackingRecHit const &hit)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< l1t::JetBxCollection > m_theL1JetToken
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ DeltaR2_

template<typename T >
double HLTJetL1TMatchProducer< T >::DeltaR2_
private

Definition at line 33 of file HLTJetL1TMatchProducer.h.

◆ jetsInput_

template<typename T >
edm::InputTag HLTJetL1TMatchProducer< T >::jetsInput_
private

Definition at line 31 of file HLTJetL1TMatchProducer.h.

◆ L1Jets_

template<typename T >
edm::InputTag HLTJetL1TMatchProducer< T >::L1Jets_
private

Definition at line 32 of file HLTJetL1TMatchProducer.h.

◆ m_theJetToken

template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTJetL1TMatchProducer< T >::m_theJetToken
private

Definition at line 34 of file HLTJetL1TMatchProducer.h.

◆ m_theL1JetToken

template<typename T >
edm::EDGetTokenT<l1t::JetBxCollection> HLTJetL1TMatchProducer< T >::m_theL1JetToken
private

Definition at line 35 of file HLTJetL1TMatchProducer.h.