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 DeltaR_
 
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 13 of file HLTJetL1MatchProducer.cc.

13  {
14  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
15  L1TauJets_ = iConfig.template getParameter<edm::InputTag>("L1TauJets");
16  L1CenJets_ = iConfig.template getParameter<edm::InputTag>("L1CenJets");
17  L1ForJets_ = iConfig.template getParameter<edm::InputTag>("L1ForJets");
18  DeltaR_ = iConfig.template getParameter<double>("DeltaR");
19 
20  typedef std::vector<T> TCollection;
21  m_theJetToken = consumes<TCollection>(jetsInput_);
22  m_theL1TauJetToken = consumes<l1extra::L1JetParticleCollection>(L1TauJets_);
23  m_theL1CenJetToken = consumes<l1extra::L1JetParticleCollection>(L1CenJets_);
24  m_theL1ForJetToken = consumes<l1extra::L1JetParticleCollection>(L1ForJets_);
25  produces<TCollection>();
26 }
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
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 29 of file HLTJetL1MatchProducer.cc.

29 {}

◆ fillDescriptions()

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

Definition at line 35 of file HLTJetL1MatchProducer.cc.

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

35  {
37  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT5PFJets"));
38  desc.add<edm::InputTag>("L1TauJets", edm::InputTag("hltL1extraParticles", "Tau"));
39  desc.add<edm::InputTag>("L1CenJets", edm::InputTag("hltL1extraParticles", "Central"));
40  desc.add<edm::InputTag>("L1ForJets", edm::InputTag("hltL1extraParticles", "Forward"));
41  desc.add<double>("DeltaR", 0.5);
43 }
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 46 of file HLTJetL1MatchProducer.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, iEvent, trackerHitRTTI::isMatched(), PDWG_EXODelayedJetMET_cff::jets, eostools::move(), mps_fire::result, and mathSSE::sqrt().

46  {
47  typedef std::vector<T> TCollection;
48 
50  iEvent.getByToken(m_theJetToken, jets);
51 
52  std::unique_ptr<TCollection> result(new TCollection);
53 
55  iEvent.getByToken(m_theL1TauJetToken, l1TauJets);
56 
58  iEvent.getByToken(m_theL1CenJetToken, l1CenJets);
59 
61  iEvent.getByToken(m_theL1ForJetToken, l1ForJets);
62 
63  typename TCollection::const_iterator jet_iter;
64  for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
65  bool isMatched = false;
66 
67  //std::cout << "FL: l1TauJets.size = " << l1TauJets->size() << std::endl;
68  for (unsigned int jetc = 0; jetc < l1TauJets->size(); ++jetc) {
69  const double deltaeta = jet_iter->eta() - (*l1TauJets)[jetc].eta();
70  const double deltaphi = deltaPhi(jet_iter->phi(), (*l1TauJets)[jetc].phi());
71  //std::cout << "FL: sqrt(2) = " << sqrt(2) << std::endl;
72  if (sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
73  isMatched = true;
74  }
75 
76  for (unsigned int jetc = 0; jetc < l1CenJets->size(); ++jetc) {
77  const double deltaeta = jet_iter->eta() - (*l1CenJets)[jetc].eta();
78  const double deltaphi = deltaPhi(jet_iter->phi(), (*l1CenJets)[jetc].phi());
79  if (sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
80  isMatched = true;
81  }
82 
83  for (unsigned int jetc = 0; jetc < l1ForJets->size(); ++jetc) {
84  const double deltaeta = jet_iter->eta() - (*l1ForJets)[jetc].eta();
85  const double deltaphi = deltaPhi(jet_iter->phi(), (*l1ForJets)[jetc].phi());
86  if (sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
87  isMatched = true;
88  }
89 
90  if (isMatched == true)
91  result->push_back(*jet_iter);
92 
93  } // jet_iter
94 
95  iEvent.put(std::move(result));
96 }
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
T sqrt(T t)
Definition: SSEVec.h:19
bool isMatched(TrackingRecHit const &hit)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1TauJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ DeltaR_

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

Definition at line 38 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.