CMS 3D CMS Logo

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

#include <HLTJetCollectionsForLeptonPlusJets.h>

Inheritance diagram for HLTJetCollectionsForLeptonPlusJets< jetType >:
edm::stream::EDProducer<>

Public Member Functions

 HLTJetCollectionsForLeptonPlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForLeptonPlusJets () override=default
 
- 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 Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::InputTag hltLeptonTag
 
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsm_theLeptonToken
 
double minDeltaR2_
 
edm::InputTag sourceJetTag
 

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 jetType>
class HLTJetCollectionsForLeptonPlusJets< jetType >

This class is an EDProducer implementing an HLT trigger for lepton and jet objects, cutting on variables relating to the jet 4-momentum representation. The producer checks for overlaps between leptons and jets and if a combination of one lepton + jets cleaned against this leptons satisfy the cuts. These jets are then added to a cleaned jet collection which is put into the event.

Author
Lukasz Kreczko

Definition at line 34 of file HLTJetCollectionsForLeptonPlusJets.h.

Constructor & Destructor Documentation

◆ HLTJetCollectionsForLeptonPlusJets()

template<typename jetType >
HLTJetCollectionsForLeptonPlusJets< jetType >::HLTJetCollectionsForLeptonPlusJets ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file HLTJetCollectionsForLeptonPlusJets.cc.

References HLTJetCollectionsForLeptonPlusJets< jetType >::hltLeptonTag, HLT_2024v13_cff::jetType, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theJetToken, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theLeptonToken, and HLTJetCollectionsForLeptonPlusJets< jetType >::sourceJetTag.

19  : hltLeptonTag(iConfig.getParameter<edm::InputTag>("HltLeptonTag")),
20  sourceJetTag(iConfig.getParameter<edm::InputTag>("SourceJetTag")),
21  // minimum delta-R^2 threshold with sign
22  minDeltaR2_(iConfig.getParameter<double>("minDeltaR") * std::abs(iConfig.getParameter<double>("minDeltaR"))) {
23  using namespace edm;
24  using namespace std;
25  typedef vector<RefVector<vector<jetType>, jetType, refhelper::FindUsingAdvance<vector<jetType>, jetType>>>
26  JetCollectionVector;
27  m_theLeptonToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltLeptonTag);
28  m_theJetToken = consumes<std::vector<jetType>>(sourceJetTag);
29  produces<JetCollectionVector>();
30 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLT enums.
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken

◆ ~HLTJetCollectionsForLeptonPlusJets()

template<typename jetType >
HLTJetCollectionsForLeptonPlusJets< jetType >::~HLTJetCollectionsForLeptonPlusJets ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

template<typename jetType >
void HLTJetCollectionsForLeptonPlusJets< jetType >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 33 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

33  {
35  desc.add<edm::InputTag>("HltLeptonTag", edm::InputTag("triggerFilterObjectWithRefs"));
36  desc.add<edm::InputTag>("SourceJetTag", edm::InputTag("caloJetCollection"));
37  desc.add<double>("minDeltaR", 0.5);
39 }
std::string defaultModuleLabel()
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

template<typename jetType >
void HLTJetCollectionsForLeptonPlusJets< jetType >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 48 of file HLTJetCollectionsForLeptonPlusJets.cc.

References reco::deltaR2(), trigger::TriggerRefsCollections::getObjects(), iEvent, dqmiolumiharvest::j, HLT_2024v13_cff::jetType, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theJetToken, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theLeptonToken, HLTJetCollectionsForLeptonPlusJets< jetType >::minDeltaR2_, eostools::move(), trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerMuon, and trigger::TriggerPhoton.

48  {
49  using namespace edm;
50  using namespace std;
51 
52  typedef vector<RefVector<vector<jetType>, jetType, refhelper::FindUsingAdvance<vector<jetType>, jetType>>>
53  JetCollectionVector;
54  typedef vector<jetType> JetCollection;
57 
59  iEvent.getByToken(m_theLeptonToken, PrevFilterOutput);
60 
61  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
62  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
63  vector<Ref<reco::RecoEcalCandidateCollection>> clusCands;
64  PrevFilterOutput->getObjects(trigger::TriggerCluster, clusCands);
65 
66  vector<Ref<reco::ElectronCollection>> eleCands;
67  PrevFilterOutput->getObjects(trigger::TriggerElectron, eleCands);
68 
69  trigger::VRphoton photonCands;
70  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
71 
72  vector<reco::RecoChargedCandidateRef> muonCands;
73  PrevFilterOutput->getObjects(trigger::TriggerMuon, muonCands);
74 
75  Handle<JetCollection> theJetCollectionHandle;
76  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
77 
78  const JetCollection& theJetCollection = *theJetCollectionHandle;
79 
80  unique_ptr<JetCollectionVector> allSelections(new JetCollectionVector());
81 
82  if (!clusCands.empty()) { // try trigger clusters
83  for (auto const& clusCand : clusCands) {
84  JetRefVector refVector;
85  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
86  if (reco::deltaR2(clusCand->superCluster()->position(), theJetCollection[j]) > minDeltaR2_)
87  refVector.push_back(JetRef(theJetCollectionHandle, j));
88  }
89  allSelections->push_back(refVector);
90  }
91  }
92 
93  if (!eleCands.empty()) { // try electrons
94  for (auto const& eleCand : eleCands) {
95  JetRefVector refVector;
96  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
97  if (reco::deltaR2(eleCand->superCluster()->position(), theJetCollection[j]) > minDeltaR2_)
98  refVector.push_back(JetRef(theJetCollectionHandle, j));
99  }
100  allSelections->push_back(refVector);
101  }
102  }
103 
104  if (!photonCands.empty()) { // try photons
105  for (auto const& photonCand : photonCands) {
106  JetRefVector refVector;
107  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
108  if (reco::deltaR2(photonCand->superCluster()->position(), theJetCollection[j]) > minDeltaR2_)
109  refVector.push_back(JetRef(theJetCollectionHandle, j));
110  }
111  allSelections->push_back(refVector);
112  }
113  }
114 
115  if (!muonCands.empty()) { // muons
116  for (auto const& muonCand : muonCands) {
117  JetRefVector refVector;
118  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
119  if (reco::deltaR2(muonCand->p4(), theJetCollection[j]) > minDeltaR2_)
120  refVector.push_back(JetRef(theJetCollectionHandle, j));
121  }
122  allSelections->push_back(refVector);
123  }
124  }
125 
126  iEvent.put(std::move(allSelections));
127 
128  return;
129 }
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
std::vector< Jet > JetCollection
Definition: Jet.h:53
edm::Ref< JetBxCollection > JetRef
Definition: Jet.h:12
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
int iEvent
Definition: GenABIO.cc:224
edm::RefVector< JetBxCollection > JetRefVector
Definition: Jet.h:13
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
HLT enums.
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
std::vector< reco::RecoEcalCandidateRef > VRphoton
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ hltLeptonTag

template<typename jetType >
edm::InputTag HLTJetCollectionsForLeptonPlusJets< jetType >::hltLeptonTag
private

◆ m_theJetToken

template<typename jetType >
edm::EDGetTokenT<std::vector<jetType> > HLTJetCollectionsForLeptonPlusJets< jetType >::m_theJetToken
private

◆ m_theLeptonToken

template<typename jetType >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTJetCollectionsForLeptonPlusJets< jetType >::m_theLeptonToken
private

◆ minDeltaR2_

template<typename jetType >
double HLTJetCollectionsForLeptonPlusJets< jetType >::minDeltaR2_
private

◆ sourceJetTag

template<typename jetType >
edm::InputTag HLTJetCollectionsForLeptonPlusJets< jetType >::sourceJetTag
private