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

virtual void beginJob ()
 
 HLTJetL1TMatchProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTJetL1TMatchProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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 L1Jets_
 
edm::EDGetTokenT< std::vector< T > > m_theJetToken
 
edm::EDGetTokenT< l1t::JetBxCollectionm_theL1JetToken
 

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 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.

14  {
15  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
16  L1Jets_ = iConfig.template getParameter<edm::InputTag>("L1Jets");
17  DeltaR_ = iConfig.template getParameter<double>("DeltaR");
18 
19  typedef std::vector<T> TCollection;
20  m_theJetToken = consumes<TCollection>(jetsInput_);
21  m_theL1JetToken = consumes<l1t::JetBxCollection>(L1Jets_);
22  produces<TCollection>();
23 }

◆ ~HLTJetL1TMatchProducer()

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

Member Function Documentation

◆ beginJob()

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

Definition at line 26 of file HLTJetL1TMatchProducer.cc.

26 {}

◆ fillDescriptions()

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

Definition at line 32 of file HLTJetL1TMatchProducer.cc.

32  {
34  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT5PFJets"));
35  desc.add<edm::InputTag>("L1Jets", edm::InputTag("hltCaloStage2Digis"));
36  desc.add<double>("DeltaR", 0.5);
38 }

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

◆ produce()

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

Definition at line 41 of file HLTJetL1TMatchProducer.cc.

41  {
42  typedef std::vector<T> TCollection;
43 
45  iEvent.getByToken(m_theJetToken, jets);
46 
47  std::unique_ptr<TCollection> result(new TCollection);
48 
50  iEvent.getByToken(m_theL1JetToken, l1Jets);
51  bool trigger_bx_only = true; // selection of BX not implemented
52 
53  if (l1Jets.isValid()) {
54  typename TCollection::const_iterator jet_iter;
55  for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
56  bool isMatched = false;
57  for (int ibx = l1Jets->getFirstBX(); ibx <= l1Jets->getLastBX(); ++ibx) {
58  if (trigger_bx_only && (ibx != 0))
59  continue;
60  for (auto it = l1Jets->begin(ibx); it != l1Jets->end(ibx); it++) {
61  if (it->et() == 0)
62  continue; // if you don't care about L1T candidates with zero ET.
63  const double deltaeta = jet_iter->eta() - it->eta();
64  const double deltaphi = deltaPhi(jet_iter->phi(), it->phi());
65  if (sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
66  isMatched = true;
67  //cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
68  }
69  }
70  if (isMatched == true)
71  result->push_back(*jet_iter);
72  } // jet_iter
73  } else {
74  edm::LogWarning("MissingProduct") << "L1Upgrade l1Jets bx collection not found." << std::endl;
75  }
76 
77  iEvent.put(std::move(result));
78 }

References BXVector< T >::begin(), SiPixelRawToDigiRegional_cfi::deltaPhi, BXVector< T >::end(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, trackerHitRTTI::isMatched(), edm::HandleBase::isValid(), singleTopDQM_cfi::jets, eostools::move(), mps_fire::result, and mathSSE::sqrt().

Member Data Documentation

◆ DeltaR_

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

Definition at line 35 of file HLTJetL1TMatchProducer.h.

◆ jetsInput_

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

Definition at line 32 of file HLTJetL1TMatchProducer.h.

◆ L1Jets_

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

Definition at line 33 of file HLTJetL1TMatchProducer.h.

◆ m_theJetToken

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

Definition at line 30 of file HLTJetL1TMatchProducer.h.

◆ m_theL1JetToken

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

Definition at line 31 of file HLTJetL1TMatchProducer.h.

HLTJetL1TMatchProducer::L1Jets_
edm::InputTag L1Jets_
Definition: HLTJetL1TMatchProducer.h:33
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTJetL1TMatchProducer
Definition: HLTJetL1TMatchProducer.h:21
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
BXVector::getFirstBX
int getFirstBX() const
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLTJetL1TMatchProducer::m_theL1JetToken
edm::EDGetTokenT< l1t::JetBxCollection > m_theL1JetToken
Definition: HLTJetL1TMatchProducer.h:31
BXVector::begin
const_iterator begin(int bx) const
trackerHitRTTI::isMatched
bool isMatched(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:33
BXVector::end
const_iterator end(int bx) const
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
HLTJetL1TMatchProducer::DeltaR_
double DeltaR_
Definition: HLTJetL1TMatchProducer.h:35
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTJetL1TMatchProducer::m_theJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken
Definition: HLTJetL1TMatchProducer.h:30
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLTJetL1TMatchProducer::jetsInput_
edm::InputTag jetsInput_
Definition: HLTJetL1TMatchProducer.h:32
mps_fire.result
result
Definition: mps_fire.py:311
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
BXVector::getLastBX
int getLastBX() const
edm::InputTag
Definition: InputTag.h:15