CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTJetCollectionsForLeptonPlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForLeptonPlusJets ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

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

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<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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, HLT_25ns10e33_v2_cff::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
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
template<typename jetType >
HLTJetCollectionsForLeptonPlusJets< jetType >::~HLTJetCollectionsForLeptonPlusJets ( )

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(), defaultModuleLabel(), and HLT_25ns10e33_v2_cff::InputTag.

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 
)
privatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 62 of file HLTJetCollectionsForLeptonPlusJets.cc.

References deltaR(), edm::Event::getByToken(), j, HLT_25ns10e33_v2_cff::jetType, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theJetToken, HLTJetCollectionsForLeptonPlusJets< jetType >::m_theLeptonToken, HLTJetCollectionsForLeptonPlusJets< jetType >::minDeltaR_, p4, position, edm::RefVector< C, T, F >::push_back(), 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  auto_ptr < JetCollectionVector > allSelections(new JetCollectionVector());
95 
96  if(!clusCands.empty()){ // try trigger clusters
97  for(size_t candNr=0;candNr<clusCands.size();candNr++){
98  JetRefVector refVector;
99  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
100  if (deltaR(clusCands[candNr]->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(size_t candNr=0;candNr<eleCands.size();candNr++){
108  JetRefVector refVector;
109  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
110  if (deltaR(eleCands[candNr]->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(size_t candNr=0;candNr<photonCands.size();candNr++){
118  JetRefVector refVector;
119  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
120  if (deltaR(photonCands[candNr]->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(size_t candNr=0;candNr<muonCands.size();candNr++){
128  JetRefVector refVector;
129  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
130  if (deltaR(muonCands[candNr]->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(allSelections);
140 
141  return;
142 
143 }
std::vector< Jet > JetCollection
Definition: Jet.h:52
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
edm::RefVector< JetBxCollection > JetRefVector
Definition: Jet.h:13
edm::Ref< JetBxCollection > JetRef
Definition: Jet.h:12
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
double p4[4]
Definition: TauolaWrapper.h:92
int j
Definition: DBlmapReader.cc:9
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
static int position[264][3]
Definition: ReadPGInfo.cc:509
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
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