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
HLTJetCollectionsForElePlusJets< T > Class Template Reference

#include <HLTJetCollectionsForElePlusJets.h>

Inheritance diagram for HLTJetCollectionsForElePlusJets< T >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTJetCollectionsForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForElePlusJets ()
 
- 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 hltElectronTag
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
m_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, 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 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 42 of file HLTJetCollectionsForElePlusJets.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file HLTJetCollectionsForElePlusJets.cc.

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

17  :
18  hltElectronTag(iConfig.getParameter< edm::InputTag > ("HltElectronTag")),
19  sourceJetTag(iConfig.getParameter< edm::InputTag > ("SourceJetTag")),
20  //minJetPt_(iConfig.getParameter<double> ("MinJetPt")),
21  //maxAbsJetEta_(iConfig.getParameter<double> ("MaxAbsJetEta")),
22  //minNJets_(iConfig.getParameter<unsigned int> ("MinNJets")),
23  minDeltaR_(iConfig.getParameter< double > ("minDeltaR"))
24  //Only for VBF
25  //minSoftJetPt_(iConfig.getParameter< double > ("MinSoftJetPt")),
26  //minDeltaEta_(iConfig.getParameter< double > ("MinDeltaEta"))
27 {
28  typedef std::vector<edm::RefVector<std::vector<T>,T,edm::refhelper::FindUsingAdvance<std::vector<T>,T> > > 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

Definition at line 36 of file HLTJetCollectionsForElePlusJets.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 T >
void HLTJetCollectionsForElePlusJets< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 44 of file HLTJetCollectionsForElePlusJets.cc.

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

44  {
46  desc.add<edm::InputTag> ("HltElectronTag", edm::InputTag("triggerFilterObjectWithRefs"));
47  desc.add<edm::InputTag> ("SourceJetTag", edm::InputTag("jetCollection"));
48  // desc.add<double> ("MinJetPt", 30.);
49  // desc.add<double> ("MaxAbsJetEta", 2.6);
50  // desc.add<unsigned int> ("MinNJets", 1);
51  desc.add<double> ("minDeltaR", 0.5);
52  //Only for VBF
53  // desc.add<double> ("MinSoftJetPt", 25.);
54  //desc.add<double> ("MinDeltaEta", -1.);
56 }
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 
)
privatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 66 of file HLTJetCollectionsForElePlusJets.cc.

References edm::Event::getByToken(), i, j, position, edm::Event::put(), trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerPhoton, and x().

67 {
68  using namespace edm;
69  using namespace std;
70 
71  typedef vector<T> TCollection;
72  typedef Ref<TCollection> TRef;
73 
74  typedef edm::RefVector<TCollection> TRefVector;
75 
76  typedef std::vector<edm::RefVector<std::vector<T>,T,edm::refhelper::FindUsingAdvance<std::vector<T>,T> > > TCollectionVector;
77 
79  iEvent.getByToken(m_theElectronToken,PrevFilterOutput);
80 
81  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
82  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
83  std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
84  PrevFilterOutput->getObjects(trigger::TriggerCluster,clusCands);
85 
86  std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
87  PrevFilterOutput->getObjects(trigger::TriggerElectron,eleCands);
88 
89  trigger::VRphoton photonCands;
90  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
91 
92  //prepare the collection of 3-D vector for electron momenta
93  std::vector<TVector3> ElePs;
94 
95  if(!clusCands.empty()){ //try trigger cluster
96  for(size_t candNr=0;candNr<clusCands.size();candNr++){
97  TVector3 positionVector(
98  clusCands[candNr]->superCluster()->position().x(),
99  clusCands[candNr]->superCluster()->position().y(),
100  clusCands[candNr]->superCluster()->position().z());
101  ElePs.push_back(positionVector);
102  }
103  }else if(!eleCands.empty()){ // try trigger electrons
104  for(size_t candNr=0;candNr<eleCands.size();candNr++){
105  TVector3 positionVector(
106  eleCands[candNr]->superCluster()->position().x(),
107  eleCands[candNr]->superCluster()->position().y(),
108  eleCands[candNr]->superCluster()->position().z());
109  ElePs.push_back(positionVector);
110  }
111  }
112  else if(!photonCands.empty()){ // try trigger photons
113  for(size_t candNr=0;candNr<photonCands.size();candNr++){
114  TVector3 positionVector(
115  photonCands[candNr]->superCluster()->position().x(),
116  photonCands[candNr]->superCluster()->position().y(),
117  photonCands[candNr]->superCluster()->position().z());
118  ElePs.push_back(positionVector);
119  }
120  }
121 
122  edm::Handle<TCollection> theJetCollectionHandle;
123  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
124 
125  const TCollection & theJetCollection = *theJetCollectionHandle;
126 
127  //std::auto_ptr< TCollection > theFilteredJetCollection(new TCollection);
128 
129  std::auto_ptr < TCollectionVector > allSelections(new TCollectionVector());
130 
131  //bool foundSolution(false);
132 
133  for (unsigned int i = 0; i < ElePs.size(); i++) {
134 
135  // bool VBFJetPair = false;
136  //std::vector<int> store_jet;
137  TRefVector refVector;
138 
139  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
140  TVector3 JetP(theJetCollection[j].px(), theJetCollection[j].py(), theJetCollection[j].pz());
141  double DR = ElePs[i].DeltaR(JetP);
142 
143  if (DR > minDeltaR_)
144  refVector.push_back(TRef(theJetCollectionHandle, j));
145  }
146  allSelections->push_back(refVector);
147  }
148 
149  //iEvent.put(theFilteredJetCollection);
150  iEvent.put(allSelections);
151 
152  return;
153 
154 }
edm::EDGetTokenT< std::vector< T > > m_theJetToken
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
static int position[264][3]
Definition: ReadPGInfo.cc:509
long double T
std::vector< reco::RecoEcalCandidateRef > VRphoton

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

Definition at line 60 of file HLTJetCollectionsForElePlusJets.h.

template<typename T >
edm::InputTag HLTJetCollectionsForElePlusJets< T >::sourceJetTag
private