CMS 3D CMS Logo

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

#include <HLTJetL1MatchProducer.h>

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

Public Member Functions

virtual void beginJob ()
 
 HLTJetL1MatchProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTJetL1MatchProducer () override
 
- 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 L1CenJets_
 
edm::InputTag L1ForJets_
 
edm::InputTag L1TauJets_
 
edm::EDGetTokenT< std::vector< T > > m_theJetToken
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectionm_theL1CenJetToken
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectionm_theL1ForJetToken
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectionm_theL1TauJetToken
 

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

Definition at line 20 of file HLTJetL1MatchProducer.h.

Constructor & Destructor Documentation

◆ HLTJetL1MatchProducer()

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

Definition at line 14 of file HLTJetL1MatchProducer.cc.

References funct::abs().

14  {
15  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
16  L1TauJets_ = iConfig.template getParameter<edm::InputTag>("L1TauJets");
17  L1CenJets_ = iConfig.template getParameter<edm::InputTag>("L1CenJets");
18  L1ForJets_ = iConfig.template getParameter<edm::InputTag>("L1ForJets");
19 
20  // minimum delta-R^2 threshold with sign
21  auto const DeltaR = iConfig.template getParameter<double>("DeltaR");
23 
24  typedef std::vector<T> TCollection;
25  m_theJetToken = consumes<TCollection>(jetsInput_);
26  m_theL1TauJetToken = consumes<l1extra::L1JetParticleCollection>(L1TauJets_);
27  m_theL1CenJetToken = consumes<l1extra::L1JetParticleCollection>(L1CenJets_);
28  m_theL1ForJetToken = consumes<l1extra::L1JetParticleCollection>(L1ForJets_);
29  produces<TCollection>();
30 }
Definition: DeltaR.py:1
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1TauJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken

◆ ~HLTJetL1MatchProducer()

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

Member Function Documentation

◆ beginJob()

template<typename T >
void HLTJetL1MatchProducer< T >::beginJob ( void  )
virtual

Definition at line 33 of file HLTJetL1MatchProducer.cc.

33 {}

◆ fillDescriptions()

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

Definition at line 39 of file HLTJetL1MatchProducer.cc.

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

39  {
41  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT5PFJets"));
42  desc.add<edm::InputTag>("L1TauJets", edm::InputTag("hltL1extraParticles", "Tau"));
43  desc.add<edm::InputTag>("L1CenJets", edm::InputTag("hltL1extraParticles", "Central"));
44  desc.add<edm::InputTag>("L1ForJets", edm::InputTag("hltL1extraParticles", "Forward"));
45  desc.add<double>("DeltaR", 0.5);
47 }
std::string defaultModuleLabel()
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 50 of file HLTJetL1MatchProducer.cc.

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

50  {
51  auto const& jets = iEvent.get(m_theJetToken);
52 
53  auto result = std::make_unique<std::vector<T>>();
54  result->reserve(jets.size());
55 
56  auto const& l1TauJets = iEvent.get(m_theL1TauJetToken);
57  auto const& l1CenJets = iEvent.get(m_theL1CenJetToken);
58  auto const& l1ForJets = iEvent.get(m_theL1ForJetToken);
59 
60  for (auto const& jet : jets) {
61  bool isMatched = false;
62 
63  for (auto const& l1t_obj : l1TauJets) {
64  if (reco::deltaR2(jet.eta(), jet.phi(), l1t_obj.eta(), l1t_obj.phi()) < DeltaR2_) {
65  isMatched = true;
66  break;
67  }
68  }
69 
70  if (isMatched) {
71  result->emplace_back(jet);
72  continue;
73  }
74 
75  for (auto const& l1t_obj : l1CenJets) {
76  if (reco::deltaR2(jet.eta(), jet.phi(), l1t_obj.eta(), l1t_obj.phi()) < DeltaR2_) {
77  isMatched = true;
78  break;
79  }
80  }
81 
82  if (isMatched) {
83  result->emplace_back(jet);
84  continue;
85  }
86 
87  for (auto const& l1t_obj : l1ForJets) {
88  if (reco::deltaR2(jet.eta(), jet.phi(), l1t_obj.eta(), l1t_obj.phi()) < DeltaR2_) {
89  isMatched = true;
90  break;
91  }
92  }
93 
94  if (isMatched) {
95  result->emplace_back(jet);
96  continue;
97  }
98  }
99 
100  iEvent.put(std::move(result));
101 }
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
bool isMatched(TrackingRecHit const &hit)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1TauJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ DeltaR2_

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

Definition at line 37 of file HLTJetL1MatchProducer.h.

◆ jetsInput_

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

Definition at line 33 of file HLTJetL1MatchProducer.h.

◆ L1CenJets_

template<typename T >
edm::InputTag HLTJetL1MatchProducer< T >::L1CenJets_
private

Definition at line 35 of file HLTJetL1MatchProducer.h.

◆ L1ForJets_

template<typename T >
edm::InputTag HLTJetL1MatchProducer< T >::L1ForJets_
private

Definition at line 36 of file HLTJetL1MatchProducer.h.

◆ L1TauJets_

template<typename T >
edm::InputTag HLTJetL1MatchProducer< T >::L1TauJets_
private

Definition at line 34 of file HLTJetL1MatchProducer.h.

◆ m_theJetToken

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

Definition at line 29 of file HLTJetL1MatchProducer.h.

◆ m_theL1CenJetToken

template<typename T >
edm::EDGetTokenT<l1extra::L1JetParticleCollection> HLTJetL1MatchProducer< T >::m_theL1CenJetToken
private

Definition at line 31 of file HLTJetL1MatchProducer.h.

◆ m_theL1ForJetToken

template<typename T >
edm::EDGetTokenT<l1extra::L1JetParticleCollection> HLTJetL1MatchProducer< T >::m_theL1ForJetToken
private

Definition at line 32 of file HLTJetL1MatchProducer.h.

◆ m_theL1TauJetToken

template<typename T >
edm::EDGetTokenT<l1extra::L1JetParticleCollection> HLTJetL1MatchProducer< T >::m_theL1TauJetToken
private

Definition at line 30 of file HLTJetL1MatchProducer.h.