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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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.

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  DeltaR_ = iConfig.template getParameter<double>("DeltaR");
20 
21  typedef std::vector<T> TCollection;
22  m_theJetToken = consumes<TCollection>(jetsInput_);
23  m_theL1TauJetToken = consumes<l1extra::L1JetParticleCollection>(L1TauJets_);
24  m_theL1CenJetToken = consumes<l1extra::L1JetParticleCollection>(L1CenJets_);
25  m_theL1ForJetToken = consumes<l1extra::L1JetParticleCollection>(L1ForJets_);
26  produces<TCollection> ();
27 
28 }
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

Definition at line 31 of file HLTJetL1MatchProducer.cc.

References HLTJetL1MatchProducer< T >::~HLTJetL1MatchProducer().

32 {
33 
34 }
template<typename T >
void HLTJetL1MatchProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 40 of file HLTJetL1MatchProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and defaultModuleLabel().

40  {
42  desc.add<edm::InputTag>("jetsInput",edm::InputTag("hltAntiKT5PFJets"));
43  desc.add<edm::InputTag>("L1TauJets",edm::InputTag("hltL1extraParticles","Tau"));
44  desc.add<edm::InputTag>("L1CenJets",edm::InputTag("hltL1extraParticles","Central"));
45  desc.add<edm::InputTag>("L1ForJets",edm::InputTag("hltL1extraParticles","Forward"));
46  desc.add<double>("DeltaR",0.5);
47  descriptions.add(defaultModuleLabel<HLTJetL1MatchProducer<T>>(), desc);
48 }
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 51 of file HLTJetL1MatchProducer.cc.

References hiPixelPairStep_cff::deltaPhi, edm::Event::getByToken(), trackerHitRTTI::isMatched(), fwrapper::jets, eostools::move(), edm::Event::put(), mps_fire::result, and mathSSE::sqrt().

52 {
53 
54  typedef std::vector<T> TCollection;
55 
57  iEvent.getByToken(m_theJetToken, jets);
58 
59  std::unique_ptr<TCollection> result (new TCollection);
60 
61 
63  iEvent.getByToken(m_theL1TauJetToken,l1TauJets);
64 
66  iEvent.getByToken(m_theL1CenJetToken,l1CenJets);
67 
69  iEvent.getByToken(m_theL1ForJetToken,l1ForJets);
70 
71  typename TCollection::const_iterator jet_iter;
72  for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
73 
74  bool isMatched=false;
75 
76  //std::cout << "FL: l1TauJets.size = " << l1TauJets->size() << std::endl;
77  for (unsigned int jetc=0;jetc<l1TauJets->size();++jetc)
78  {
79  const double deltaeta=jet_iter->eta()-(*l1TauJets)[jetc].eta();
80  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1TauJets)[jetc].phi());
81  //std::cout << "FL: sqrt(2) = " << sqrt(2) << std::endl;
82  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
83  }
84 
85  for (unsigned int jetc=0;jetc<l1CenJets->size();++jetc)
86  {
87  const double deltaeta=jet_iter->eta()-(*l1CenJets)[jetc].eta();
88  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1CenJets)[jetc].phi());
89  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
90  }
91 
92  for (unsigned int jetc=0;jetc<l1ForJets->size();++jetc)
93  {
94  const double deltaeta=jet_iter->eta()-(*l1ForJets)[jetc].eta();
95  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1ForJets)[jetc].phi());
96  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
97  }
98 
99 
100  if (isMatched==true) result->push_back(*jet_iter);
101 
102  } // jet_iter
103 
104  iEvent.put(std::move(result));
105 
106 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
T sqrt(T t)
Definition: SSEVec.h:18
vector< PseudoJet > jets
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:510

Member Data Documentation

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

Definition at line 37 of file HLTJetL1MatchProducer.h.

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

Definition at line 32 of file HLTJetL1MatchProducer.h.

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

Definition at line 34 of file HLTJetL1MatchProducer.h.

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

Definition at line 35 of file HLTJetL1MatchProducer.h.

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

Definition at line 33 of file HLTJetL1MatchProducer.h.

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

Definition at line 28 of file HLTJetL1MatchProducer.h.

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

Definition at line 30 of file HLTJetL1MatchProducer.h.

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

Definition at line 31 of file HLTJetL1MatchProducer.h.

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

Definition at line 29 of file HLTJetL1MatchProducer.h.