test
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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTJetCollectionsForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForElePlusJets ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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::EDProducer
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::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 20 of file HLTJetCollectionsForElePlusJets.cc.

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

20  :
21  hltElectronTag(iConfig.getParameter< edm::InputTag > ("HltElectronTag")),
22  sourceJetTag(iConfig.getParameter< edm::InputTag > ("SourceJetTag")),
23  //minJetPt_(iConfig.getParameter<double> ("MinJetPt")),
24  //maxAbsJetEta_(iConfig.getParameter<double> ("MaxAbsJetEta")),
25  //minNJets_(iConfig.getParameter<unsigned int> ("MinNJets")),
26  minDeltaR_(iConfig.getParameter< double > ("minDeltaR"))
27  //Only for VBF
28  //minSoftJetPt_(iConfig.getParameter< double > ("MinSoftJetPt")),
29  //minDeltaEta_(iConfig.getParameter< double > ("MinDeltaEta"))
30 {
31  typedef std::vector<edm::RefVector<std::vector<T>,T,edm::refhelper::FindUsingAdvance<std::vector<T>,T> > > TCollectionVector;
32  m_theElectronToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltElectronTag);
33  m_theJetToken = consumes<std::vector<T>>(sourceJetTag);
34  produces<TCollectionVector> ();
35 }
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 39 of file HLTJetCollectionsForElePlusJets.cc.

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

Member Function Documentation

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

Definition at line 47 of file HLTJetCollectionsForElePlusJets.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

47  {
49  desc.add<edm::InputTag> ("HltElectronTag", edm::InputTag("triggerFilterObjectWithRefs"));
50  desc.add<edm::InputTag> ("SourceJetTag", edm::InputTag("jetCollection"));
51  // desc.add<double> ("MinJetPt", 30.);
52  // desc.add<double> ("MaxAbsJetEta", 2.6);
53  // desc.add<unsigned int> ("MinNJets", 1);
54  desc.add<double> ("minDeltaR", 0.5);
55  //Only for VBF
56  // desc.add<double> ("MinSoftJetPt", 25.);
57  //desc.add<double> ("MinDeltaEta", -1.);
58  descriptions.add(std::string("hlt")+std::string(typeid(HLTJetCollectionsForElePlusJets<T>).name()),desc);
59 }
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::EDProducer.

Definition at line 69 of file HLTJetCollectionsForElePlusJets.cc.

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

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