CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
- 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::TriggerFilterObjectWithRefs
m_theLeptonToken
 
double minDeltaR_
 
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 40 of file HLTJetCollectionsForLeptonPlusJets.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

20  : hltLeptonTag(iConfig.getParameter<edm::InputTag>("HltLeptonTag")),
21  sourceJetTag(iConfig.getParameter<edm::InputTag>("SourceJetTag")),
22  minDeltaR_(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 }
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
template<typename jetType >
HLTJetCollectionsForLeptonPlusJets< jetType >::~HLTJetCollectionsForLeptonPlusJets ( )
override

Definition at line 33 of file HLTJetCollectionsForLeptonPlusJets.cc.

33  {
34  // do anything here that needs to be done at desctruction time
35  // (e.g. close files, deallocate resources etc.)
36 }

Member Function Documentation

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

Definition at line 39 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

39  {
41  desc.add<edm::InputTag>("HltLeptonTag", edm::InputTag("triggerFilterObjectWithRefs"));
42  desc.add<edm::InputTag>("SourceJetTag", edm::InputTag("caloJetCollection"));
43  desc.add<double>("minDeltaR", 0.5);
45 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename jetType >
void HLTJetCollectionsForLeptonPlusJets< jetType >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 54 of file HLTJetCollectionsForLeptonPlusJets.cc.

References HLT_FULL_cff::deltaR, edm::Event::getByToken(), dqmiolumiharvest::j, HLT_FULL_cff::jetType, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theJetToken, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theLeptonToken, HLTJetCollectionsForLeptonPlusJets< jetType >::minDeltaR_, eostools::move(), edm::Event::put(), trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerMuon, and trigger::TriggerPhoton.

54  {
55  using namespace edm;
56  using namespace std;
57 
58  typedef vector<RefVector<vector<jetType>, jetType, refhelper::FindUsingAdvance<vector<jetType>, jetType>>>
59  JetCollectionVector;
60  typedef vector<jetType> JetCollection;
63 
65  iEvent.getByToken(m_theLeptonToken, PrevFilterOutput);
66 
67  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
68  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
69  vector<Ref<reco::RecoEcalCandidateCollection>> clusCands;
70  PrevFilterOutput->getObjects(trigger::TriggerCluster, clusCands);
71 
72  vector<Ref<reco::ElectronCollection>> eleCands;
73  PrevFilterOutput->getObjects(trigger::TriggerElectron, eleCands);
74 
75  trigger::VRphoton photonCands;
76  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
77 
78  vector<reco::RecoChargedCandidateRef> muonCands;
79  PrevFilterOutput->getObjects(trigger::TriggerMuon, muonCands);
80 
81  Handle<JetCollection> theJetCollectionHandle;
82  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
83 
84  const JetCollection& theJetCollection = *theJetCollectionHandle;
85 
86  unique_ptr<JetCollectionVector> allSelections(new JetCollectionVector());
87 
88  if (!clusCands.empty()) { // try trigger clusters
89  for (auto& clusCand : clusCands) {
90  JetRefVector refVector;
91  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
92  if (deltaR(clusCand->superCluster()->position(), theJetCollection[j]) > minDeltaR_)
93  refVector.push_back(JetRef(theJetCollectionHandle, j));
94  }
95  allSelections->push_back(refVector);
96  }
97  }
98 
99  if (!eleCands.empty()) { // try electrons
100  for (auto& eleCand : eleCands) {
101  JetRefVector refVector;
102  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
103  if (deltaR(eleCand->superCluster()->position(), theJetCollection[j]) > minDeltaR_)
104  refVector.push_back(JetRef(theJetCollectionHandle, j));
105  }
106  allSelections->push_back(refVector);
107  }
108  }
109 
110  if (!photonCands.empty()) { // try photons
111  for (auto& photonCand : photonCands) {
112  JetRefVector refVector;
113  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
114  if (deltaR(photonCand->superCluster()->position(), theJetCollection[j]) > minDeltaR_)
115  refVector.push_back(JetRef(theJetCollectionHandle, j));
116  }
117  allSelections->push_back(refVector);
118  }
119  }
120 
121  if (!muonCands.empty()) { // muons
122  for (auto& muonCand : muonCands) {
123  JetRefVector refVector;
124  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
125  if (deltaR(muonCand->p4(), theJetCollection[j]) > minDeltaR_)
126  refVector.push_back(JetRef(theJetCollectionHandle, j));
127  }
128  allSelections->push_back(refVector);
129  }
130  }
131 
132  iEvent.put(std::move(allSelections));
133 
134  return;
135 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
std::vector< Jet > JetCollection
Definition: Jet.h:53
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::Ref< JetBxCollection > JetRef
Definition: Jet.h:12
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
def move
Definition: eostools.py:511
edm::RefVector< JetBxCollection > JetRefVector
Definition: Jet.h:13
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
std::vector< reco::RecoEcalCandidateRef > VRphoton

Member Data Documentation

template<typename jetType >
edm::InputTag HLTJetCollectionsForLeptonPlusJets< jetType >::hltLeptonTag
private
template<typename jetType >
edm::EDGetTokenT<std::vector<jetType> > HLTJetCollectionsForLeptonPlusJets< jetType >::m_theJetToken
private
template<typename jetType >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTJetCollectionsForLeptonPlusJets< jetType >::m_theLeptonToken
private
template<typename jetType >
double HLTJetCollectionsForLeptonPlusJets< jetType >::minDeltaR_
private
template<typename jetType >
edm::InputTag HLTJetCollectionsForLeptonPlusJets< jetType >::sourceJetTag
private