CMS 3D CMS Logo

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

#include <HLTJetCollForElePlusJets.h>

Inheritance diagram for HLTJetCollForElePlusJets< T >:
edm::stream::EDProducer<>

Public Member Functions

 HLTJetCollForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollForElePlusJets () 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 Member Functions

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

Private Attributes

edm::InputTag hltElectronTag
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsm_theElectronToken
 
edm::EDGetTokenT< std::vector< T > > m_theJetToken
 
double maxAbsJetEta_
 
double minDeltaEta_
 
double minDeltaR_
 
double minJetPt_
 
unsigned int minNJets_
 
double minSoftJetPt_
 
edm::InputTag sourceJetTag
 

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 HLTJetCollForElePlusJets< T >

This class is an EDProducer implementing an HLT trigger for electron and jet objects, cutting on variables relating to the jet 4-momentum representation. The producer checks for overlaps between electrons and jets and if a combination of one electron + jets cleaned against this electrons 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 HLTJetCollForElePlusJets.h.

Constructor & Destructor Documentation

◆ HLTJetCollForElePlusJets()

template<typename T >
HLTJetCollForElePlusJets< T >::HLTJetCollForElePlusJets ( const edm::ParameterSet iConfig)
explicit

Definition at line 15 of file HLTJetCollForElePlusJets.cc.

16  : hltElectronTag(iConfig.getParameter<edm::InputTag>("HltElectronTag")),
17  sourceJetTag(iConfig.getParameter<edm::InputTag>("SourceJetTag")),
18  minJetPt_(iConfig.getParameter<double>("MinJetPt")),
19  maxAbsJetEta_(iConfig.getParameter<double>("MaxAbsJetEta")),
20  minNJets_(iConfig.getParameter<unsigned int>("MinNJets")),
21  minDeltaR_(iConfig.getParameter<double>("minDeltaR")),
22  //Only for VBF
23  minSoftJetPt_(iConfig.getParameter<double>("MinSoftJetPt")),
24  minDeltaEta_(iConfig.getParameter<double>("MinDeltaEta")) {
25  typedef std::vector<T> TCollection;
26  m_theElectronToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltElectronTag);
27  m_theJetToken = consumes<TCollection>(sourceJetTag);
28  produces<TCollection>();
29 }

References HLTJetCollForElePlusJets< T >::hltElectronTag, HLTJetCollForElePlusJets< T >::m_theElectronToken, HLTJetCollForElePlusJets< T >::m_theJetToken, and HLTJetCollForElePlusJets< T >::sourceJetTag.

◆ ~HLTJetCollForElePlusJets()

template<typename T >
HLTJetCollForElePlusJets< T >::~HLTJetCollForElePlusJets ( )
override

Definition at line 32 of file HLTJetCollForElePlusJets.cc.

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 38 of file HLTJetCollForElePlusJets.cc.

38  {
40  desc.add<edm::InputTag>("HltElectronTag", edm::InputTag("triggerFilterObjectWithRefs"));
41  desc.add<edm::InputTag>("SourceJetTag", edm::InputTag("jetCollection"));
42  desc.add<double>("MinJetPt", 30.);
43  desc.add<double>("MaxAbsJetEta", 2.6);
44  desc.add<unsigned int>("MinNJets", 1);
45  desc.add<double>("minDeltaR", 0.5);
46  //Only for VBF
47  desc.add<double>("MinSoftJetPt", 25.);
48  desc.add<double>("MinDeltaEta", -1.);
50 }

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

◆ produce()

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

Definition at line 58 of file HLTJetCollForElePlusJets.cc.

58  {
59  using namespace edm;
60  using namespace std;
61 
62  typedef vector<T> TCollection;
63  typedef Ref<TCollection> TRef;
64  typedef edm::RefVector<TCollection> TRefVector;
65  typedef std::vector<edm::RefVector<std::vector<T>, T, edm::refhelper::FindUsingAdvance<std::vector<T>, T>>>
66  TCollectionVector;
67 
69  iEvent.getByToken(m_theElectronToken, PrevFilterOutput);
70 
71  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
72  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
73  std::vector<edm::Ref<reco::RecoEcalCandidateCollection>> clusCands;
74  PrevFilterOutput->getObjects(trigger::TriggerCluster, clusCands);
75 
76  std::vector<edm::Ref<reco::ElectronCollection>> eleCands;
77  PrevFilterOutput->getObjects(trigger::TriggerElectron, eleCands);
78 
79  trigger::VRphoton photonCands;
80  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
81 
82  //prepare the collection of 3-D vector for electron momenta
83  std::vector<TVector3> ElePs;
84 
85  if (!clusCands.empty()) { //try trigger cluster
86  for (auto& clusCand : clusCands) {
87  TVector3 positionVector(clusCand->superCluster()->position().x(),
88  clusCand->superCluster()->position().y(),
89  clusCand->superCluster()->position().z());
90  ElePs.push_back(positionVector);
91  }
92  } else if (!eleCands.empty()) { // try trigger electrons
93  for (auto& eleCand : eleCands) {
94  TVector3 positionVector(eleCand->superCluster()->position().x(),
95  eleCand->superCluster()->position().y(),
96  eleCand->superCluster()->position().z());
97  ElePs.push_back(positionVector);
98  }
99  } else if (!photonCands.empty()) { // try trigger photons
100  for (auto& photonCand : photonCands) {
101  TVector3 positionVector(photonCand->superCluster()->position().x(),
102  photonCand->superCluster()->position().y(),
103  photonCand->superCluster()->position().z());
104  ElePs.push_back(positionVector);
105  }
106  }
107 
108  edm::Handle<TCollection> theJetCollectionHandle;
109  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
110 
111  const TCollection& theJetCollection = *theJetCollectionHandle;
112 
113  std::unique_ptr<TCollection> theFilteredJetCollection(new TCollection);
114 
115  std::unique_ptr<TCollectionVector> allSelections(new TCollectionVector());
116 
117  bool foundSolution(false);
118 
119  for (auto& EleP : ElePs) {
120  bool VBFJetPair = false;
121  std::vector<int> store_jet;
122  TRefVector refVector;
123 
124  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
125  TVector3 JetP(theJetCollection[j].px(), theJetCollection[j].py(), theJetCollection[j].pz());
126  double DR = EleP.DeltaR(JetP);
127 
128  if (JetP.Pt() > minJetPt_ && std::abs(JetP.Eta()) < maxAbsJetEta_ && DR > minDeltaR_) {
129  store_jet.push_back(j);
130  // The VBF part of the filter
131  if (minDeltaEta_ > 0) {
132  for (unsigned int k = j + 1; k < theJetCollection.size(); k++) {
133  TVector3 SoftJetP(theJetCollection[k].px(), theJetCollection[k].py(), theJetCollection[k].pz());
134  double softDR = EleP.DeltaR(SoftJetP);
135 
136  if (SoftJetP.Pt() > minSoftJetPt_ && std::abs(SoftJetP.Eta()) < maxAbsJetEta_ && softDR > minDeltaR_)
137  if (std::abs(SoftJetP.Eta() - JetP.Eta()) > minDeltaEta_) {
138  store_jet.push_back(k);
139  VBFJetPair = true;
140  }
141  }
142  }
143  }
144  }
145 
146  // Now remove duplicates from the jet collection to store
147  std::sort(store_jet.begin(), store_jet.end());
148  store_jet.erase(unique(store_jet.begin(), store_jet.end()), store_jet.end());
149 
150  // Now save the cleaned jets
151  for (int& ijet : store_jet) {
152  //store all selections
153  refVector.push_back(TRef(theJetCollectionHandle, ijet));
154  //store first selection which matches the criteria
155  if (!foundSolution)
156  theFilteredJetCollection->push_back(theJetCollection[ijet]);
157  }
158  //store all selections
159  allSelections->push_back(refVector);
160 
161  if (theFilteredJetCollection->size() >= minNJets_ && minDeltaEta_ < 0)
162  foundSolution = true;
163  else if (VBFJetPair && minDeltaEta_ > 0)
164  foundSolution = true;
165  else if (!foundSolution)
166  theFilteredJetCollection->clear();
167  }
168 
169  iEvent.put(std::move(theFilteredJetCollection));
170 
171  return;
172 }

References funct::abs(), trigger::TriggerRefsCollections::getObjects(), iEvent, dqmiolumiharvest::j, dqmdumpme::k, eostools::move(), multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerPhoton, and tier0::unique().

Member Data Documentation

◆ hltElectronTag

template<typename T >
edm::InputTag HLTJetCollForElePlusJets< T >::hltElectronTag
private

◆ m_theElectronToken

template<typename T >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTJetCollForElePlusJets< T >::m_theElectronToken
private

◆ m_theJetToken

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

◆ maxAbsJetEta_

template<typename T >
double HLTJetCollForElePlusJets< T >::maxAbsJetEta_
private

Definition at line 55 of file HLTJetCollForElePlusJets.h.

◆ minDeltaEta_

template<typename T >
double HLTJetCollForElePlusJets< T >::minDeltaEta_
private

Definition at line 61 of file HLTJetCollForElePlusJets.h.

◆ minDeltaR_

template<typename T >
double HLTJetCollForElePlusJets< T >::minDeltaR_
private

Definition at line 58 of file HLTJetCollForElePlusJets.h.

◆ minJetPt_

template<typename T >
double HLTJetCollForElePlusJets< T >::minJetPt_
private

Definition at line 54 of file HLTJetCollForElePlusJets.h.

◆ minNJets_

template<typename T >
unsigned int HLTJetCollForElePlusJets< T >::minNJets_
private

Definition at line 56 of file HLTJetCollForElePlusJets.h.

◆ minSoftJetPt_

template<typename T >
double HLTJetCollForElePlusJets< T >::minSoftJetPt_
private

Definition at line 60 of file HLTJetCollForElePlusJets.h.

◆ sourceJetTag

template<typename T >
edm::InputTag HLTJetCollForElePlusJets< T >::sourceJetTag
private
HLTJetCollForElePlusJets::m_theJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken
Definition: HLTJetCollForElePlusJets.h:50
trigger::TriggerElectron
Definition: TriggerTypeDefs.h:67
trigger::VRphoton
std::vector< reco::RecoEcalCandidateRef > VRphoton
Definition: TriggerRefsCollections.h:60
HLTJetCollForElePlusJets::minSoftJetPt_
double minSoftJetPt_
Definition: HLTJetCollForElePlusJets.h:60
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
edm
HLT enums.
Definition: AlignableModifier.h:19
HLTJetCollForElePlusJets::maxAbsJetEta_
double maxAbsJetEta_
Definition: HLTJetCollForElePlusJets.h:55
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::RefVector
Definition: EDProductfwd.h:27
HLTJetCollForElePlusJets::minDeltaR_
double minDeltaR_
Definition: HLTJetCollForElePlusJets.h:58
HLTJetCollForElePlusJets::minDeltaEta_
double minDeltaEta_
Definition: HLTJetCollForElePlusJets.h:61
edm::Handle< trigger::TriggerFilterObjectWithRefs >
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:452
edm::Ref
Definition: AssociativeIterator.h:58
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HLTJetCollForElePlusJets::m_theElectronToken
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
Definition: HLTJetCollForElePlusJets.h:49
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
HLTJetCollForElePlusJets
Definition: HLTJetCollForElePlusJets.h:40
iEvent
int iEvent
Definition: GenABIO.cc:224
trigger::TriggerCluster
Definition: TriggerTypeDefs.h:77
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
tier0.unique
def unique(seq, keepstr=True)
Definition: tier0.py:24
T
long double T
Definition: Basic3DVectorLD.h:48
HLTJetCollForElePlusJets::sourceJetTag
edm::InputTag sourceJetTag
Definition: HLTJetCollForElePlusJets.h:52
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
trigger::TriggerPhoton
HLT.
Definition: TriggerTypeDefs.h:66
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLTJetCollForElePlusJets::hltElectronTag
edm::InputTag hltElectronTag
Definition: HLTJetCollForElePlusJets.h:51
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HLTJetCollForElePlusJets::minJetPt_
double minJetPt_
Definition: HLTJetCollForElePlusJets.h:54
edm::InputTag
Definition: InputTag.h:15
HLTJetCollForElePlusJets::minNJets_
unsigned int minNJets_
Definition: HLTJetCollForElePlusJets.h:56
edm::refhelper::FindUsingAdvance
Definition: RefTraits.h:14