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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

template<typename T>
class HLTJetL1MatchProducer< T >

Definition at line 20 of file HLTJetL1MatchProducer.h.

Constructor & Destructor Documentation

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
template<typename T >
HLTJetL1MatchProducer< T >::~HLTJetL1MatchProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 35 of file HLTJetL1MatchProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), and HLT_2018_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);
42  descriptions.add(defaultModuleLabel<HLTJetL1MatchProducer<T>>(), desc);
43 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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, edm::Event::getByToken(), trackerHitRTTI::isMatched(), singleTopDQM_cfi::jets, eostools::move(), edm::Event::put(), 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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
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

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

Definition at line 38 of file HLTJetL1MatchProducer.h.

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

Definition at line 33 of file HLTJetL1MatchProducer.h.

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

Definition at line 35 of file HLTJetL1MatchProducer.h.

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

Definition at line 36 of file HLTJetL1MatchProducer.h.

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

Definition at line 34 of file HLTJetL1MatchProducer.h.

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

Definition at line 29 of file HLTJetL1MatchProducer.h.

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

Definition at line 31 of file HLTJetL1MatchProducer.h.

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

Definition at line 32 of file HLTJetL1MatchProducer.h.

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

Definition at line 30 of file HLTJetL1MatchProducer.h.