CMS 3D CMS Logo

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

#include <HLTJetCollectionsForElePlusJets.h>

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

Public Member Functions

 HLTJetCollectionsForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForElePlusJets () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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 minDeltaR_
 
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 HLTJetCollectionsForElePlusJets< 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 HLTJetCollectionsForElePlusJets.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file HLTJetCollectionsForElePlusJets.cc.

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

17  : hltElectronTag(iConfig.getParameter<edm::InputTag>("HltElectronTag")),
18  sourceJetTag(iConfig.getParameter<edm::InputTag>("SourceJetTag")),
19  //minJetPt_(iConfig.getParameter<double> ("MinJetPt")),
20  //maxAbsJetEta_(iConfig.getParameter<double> ("MaxAbsJetEta")),
21  //minNJets_(iConfig.getParameter<unsigned int> ("MinNJets")),
22  minDeltaR_(iConfig.getParameter<double>("minDeltaR"))
23 //Only for VBF
24 //minSoftJetPt_(iConfig.getParameter< double > ("MinSoftJetPt")),
25 //minDeltaEta_(iConfig.getParameter< double > ("MinDeltaEta"))
26 {
27  typedef std::vector<edm::RefVector<std::vector<T>, T, edm::refhelper::FindUsingAdvance<std::vector<T>, T>>>
28  TCollectionVector;
29  m_theElectronToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltElectronTag);
30  m_theJetToken = consumes<std::vector<T>>(sourceJetTag);
31  produces<TCollectionVector>();
32 }
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< T > > m_theJetToken
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
long double T
template<typename T >
HLTJetCollectionsForElePlusJets< T >::~HLTJetCollectionsForElePlusJets ( )
override

Definition at line 35 of file HLTJetCollectionsForElePlusJets.cc.

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

Member Function Documentation

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

Definition at line 41 of file HLTJetCollectionsForElePlusJets.cc.

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

41  {
43  desc.add<edm::InputTag>("HltElectronTag", edm::InputTag("triggerFilterObjectWithRefs"));
44  desc.add<edm::InputTag>("SourceJetTag", edm::InputTag("jetCollection"));
45  // desc.add<double> ("MinJetPt", 30.);
46  // desc.add<double> ("MaxAbsJetEta", 2.6);
47  // desc.add<unsigned int> ("MinNJets", 1);
48  desc.add<double>("minDeltaR", 0.5);
49  //Only for VBF
50  // desc.add<double> ("MinSoftJetPt", 25.);
51  //desc.add<double> ("MinDeltaEta", -1.);
53 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
void HLTJetCollectionsForElePlusJets< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 61 of file HLTJetCollectionsForElePlusJets.cc.

References edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), dqmiolumiharvest::j, HLTJetCollectionsForElePlusJets< T >::m_theElectronToken, HLTJetCollectionsForElePlusJets< T >::m_theJetToken, HLTJetCollectionsForElePlusJets< T >::minDeltaR_, eostools::move(), edm::Event::put(), multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, trigger::TriggerCluster, trigger::TriggerElectron, and trigger::TriggerPhoton.

61  {
62  using namespace edm;
63  using namespace std;
64 
65  typedef vector<T> TCollection;
66  typedef Ref<TCollection> TRef;
67 
68  typedef edm::RefVector<TCollection> TRefVector;
69 
70  typedef std::vector<edm::RefVector<std::vector<T>, T, edm::refhelper::FindUsingAdvance<std::vector<T>, T>>>
71  TCollectionVector;
72 
74  iEvent.getByToken(m_theElectronToken, PrevFilterOutput);
75 
76  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
77  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
78  std::vector<edm::Ref<reco::RecoEcalCandidateCollection>> clusCands;
79  PrevFilterOutput->getObjects(trigger::TriggerCluster, clusCands);
80 
81  std::vector<edm::Ref<reco::ElectronCollection>> eleCands;
82  PrevFilterOutput->getObjects(trigger::TriggerElectron, eleCands);
83 
84  trigger::VRphoton photonCands;
85  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
86 
87  //prepare the collection of 3-D vector for electron momenta
88  std::vector<TVector3> ElePs;
89 
90  if (!clusCands.empty()) { //try trigger cluster
91  for (auto& clusCand : clusCands) {
92  TVector3 positionVector(clusCand->superCluster()->position().x(),
93  clusCand->superCluster()->position().y(),
94  clusCand->superCluster()->position().z());
95  ElePs.push_back(positionVector);
96  }
97  } else if (!eleCands.empty()) { // try trigger electrons
98  for (auto& eleCand : eleCands) {
99  TVector3 positionVector(eleCand->superCluster()->position().x(),
100  eleCand->superCluster()->position().y(),
101  eleCand->superCluster()->position().z());
102  ElePs.push_back(positionVector);
103  }
104  } else if (!photonCands.empty()) { // try trigger photons
105  for (auto& photonCand : photonCands) {
106  TVector3 positionVector(photonCand->superCluster()->position().x(),
107  photonCand->superCluster()->position().y(),
108  photonCand->superCluster()->position().z());
109  ElePs.push_back(positionVector);
110  }
111  }
112 
113  edm::Handle<TCollection> theJetCollectionHandle;
114  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
115 
116  const TCollection& theJetCollection = *theJetCollectionHandle;
117 
118  //std::unique_ptr< TCollection > theFilteredJetCollection(new TCollection);
119 
120  std::unique_ptr<TCollectionVector> allSelections(new TCollectionVector());
121 
122  //bool foundSolution(false);
123 
124  for (auto& EleP : ElePs) {
125  // bool VBFJetPair = false;
126  //std::vector<int> store_jet;
127  TRefVector refVector;
128 
129  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
130  TVector3 JetP(theJetCollection[j].px(), theJetCollection[j].py(), theJetCollection[j].pz());
131  double DR = EleP.DeltaR(JetP);
132 
133  if (DR > minDeltaR_)
134  refVector.push_back(TRef(theJetCollectionHandle, j));
135  }
136  allSelections->push_back(refVector);
137  }
138 
139  //iEvent.put(std::move(theFilteredJetCollection));
140  iEvent.put(std::move(allSelections));
141 
142  return;
143 }
edm::EDGetTokenT< std::vector< T > > m_theJetToken
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
HLT enums.
long double T
std::vector< reco::RecoEcalCandidateRef > VRphoton
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<typename T >
edm::InputTag HLTJetCollectionsForElePlusJets< T >::hltElectronTag
private
template<typename T >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTJetCollectionsForElePlusJets< T >::m_theElectronToken
private
template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTJetCollectionsForElePlusJets< T >::m_theJetToken
private
template<typename T >
double HLTJetCollectionsForElePlusJets< T >::minDeltaR_
private
template<typename T >
edm::InputTag HLTJetCollectionsForElePlusJets< T >::sourceJetTag
private