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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTJetCollectionsForLeptonPlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForLeptonPlusJets () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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 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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 22 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

22  :
23  hltLeptonTag(iConfig.getParameter< edm::InputTag > ("HltLeptonTag")),
24  sourceJetTag(iConfig.getParameter< edm::InputTag > ("SourceJetTag")),
25  minDeltaR_(iConfig.getParameter< double > ("minDeltaR"))
26 {
27  using namespace edm;
28  using namespace std;
29  typedef vector<RefVector<vector<jetType>,jetType,refhelper::FindUsingAdvance<vector<jetType>,jetType> > > JetCollectionVector;
30  m_theLeptonToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltLeptonTag);
31  m_theJetToken = consumes<std::vector<jetType>>(sourceJetTag);
32  produces<JetCollectionVector> ();
33 }
T getParameter(std::string const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
HLT enums.
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
template<typename jetType >
HLTJetCollectionsForLeptonPlusJets< jetType >::~HLTJetCollectionsForLeptonPlusJets ( )
override

Definition at line 36 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

Member Function Documentation

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

Definition at line 45 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

45  {
47  desc.add<edm::InputTag> ("HltLeptonTag", edm::InputTag("triggerFilterObjectWithRefs"));
48  desc.add<edm::InputTag> ("SourceJetTag", edm::InputTag("caloJetCollection"));
49  desc.add<double> ("minDeltaR", 0.5);
51 }
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 62 of file HLTJetCollectionsForLeptonPlusJets.cc.

References deltaR(), edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), objects.autophobj::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.

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

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