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

#include <HLTJetCollForElePlusJets.h>

Inheritance diagram for HLTJetCollForElePlusJets< T >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTJetCollForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollForElePlusJets ()
 
- 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 maxAbsJetEta_
 
double minDeltaEta_
 
double minDeltaR_
 
double minJetPt_
 
unsigned int minNJets_
 
double minSoftJetPt_
 
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 HLTJetCollForElePlusJets< 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 41 of file HLTJetCollForElePlusJets.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file HLTJetCollForElePlusJets.cc.

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

16  :
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<T> TCollection;
28  m_theElectronToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltElectronTag);
29  m_theJetToken = consumes<TCollection>(sourceJetTag);
30  produces<TCollection>();
31 }
T getParameter(std::string const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken
template<typename T >
HLTJetCollForElePlusJets< T >::~HLTJetCollForElePlusJets ( )

Definition at line 35 of file HLTJetCollForElePlusJets.cc.

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

Member Function Documentation

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

Definition at line 43 of file HLTJetCollForElePlusJets.cc.

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

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

Implements edm::EDProducer.

Definition at line 65 of file HLTJetCollForElePlusJets.cc.

References funct::abs(), edm::Event::getByToken(), i, j, gen::k, position, edm::Event::put(), python.multivaluedict::sort(), trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerPhoton, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

66 {
67  using namespace edm;
68  using namespace std;
69 
70  typedef vector<T> TCollection;
71  typedef Ref<TCollection> TRef;
72  typedef edm::RefVector<TCollection> TRefVector;
73  typedef std::vector<edm::RefVector<std::vector<T>,T,edm::refhelper::FindUsingAdvance<std::vector<T>,T> > > TCollectionVector;
74 
76  iEvent.getByToken(m_theElectronToken,PrevFilterOutput);
77 
78  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
79  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
80  std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
81  PrevFilterOutput->getObjects(trigger::TriggerCluster,clusCands);
82 
83  std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
84  PrevFilterOutput->getObjects(trigger::TriggerElectron,eleCands);
85 
86  trigger::VRphoton photonCands;
87  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
88 
89  //prepare the collection of 3-D vector for electron momenta
90  std::vector<TVector3> ElePs;
91 
92  if(!clusCands.empty()){ //try trigger cluster
93  for(size_t candNr=0;candNr<clusCands.size();candNr++){
94  TVector3 positionVector(
95  clusCands[candNr]->superCluster()->position().x(),
96  clusCands[candNr]->superCluster()->position().y(),
97  clusCands[candNr]->superCluster()->position().z());
98  ElePs.push_back(positionVector);
99  }
100  }else if(!eleCands.empty()){ // try trigger electrons
101  for(size_t candNr=0;candNr<eleCands.size();candNr++){
102  TVector3 positionVector(
103  eleCands[candNr]->superCluster()->position().x(),
104  eleCands[candNr]->superCluster()->position().y(),
105  eleCands[candNr]->superCluster()->position().z());
106  ElePs.push_back(positionVector);
107  }
108  }
109  else if(!photonCands.empty()){ // try trigger photons
110  for(size_t candNr=0;candNr<photonCands.size();candNr++){
111  TVector3 positionVector(
112  photonCands[candNr]->superCluster()->position().x(),
113  photonCands[candNr]->superCluster()->position().y(),
114  photonCands[candNr]->superCluster()->position().z());
115  ElePs.push_back(positionVector);
116  }
117  }
118 
119  edm::Handle<TCollection> theJetCollectionHandle;
120  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
121 
122  const TCollection & theJetCollection = *theJetCollectionHandle;
123 
124  std::auto_ptr< TCollection > theFilteredJetCollection(new TCollection);
125 
126  std::auto_ptr < TCollectionVector > allSelections(new TCollectionVector());
127 
128  bool foundSolution(false);
129 
130  for (unsigned int i = 0; i < ElePs.size(); i++) {
131 
132  bool VBFJetPair = false;
133  std::vector<int> store_jet;
134  TRefVector refVector;
135 
136  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
137  TVector3 JetP(theJetCollection[j].px(), theJetCollection[j].py(),
138  theJetCollection[j].pz());
139  double DR = ElePs[i].DeltaR(JetP);
140 
141  if (JetP.Pt() > minJetPt_ && std::abs(JetP.Eta()) < maxAbsJetEta_ && DR > minDeltaR_) {
142  store_jet.push_back(j);
143  // The VBF part of the filter
144  if ( minDeltaEta_ > 0 ) {
145  for ( unsigned int k = j+1; k < theJetCollection.size(); k++ ) {
146  TVector3 SoftJetP(theJetCollection[k].px(), theJetCollection[k].py(),
147  theJetCollection[k].pz());
148  double softDR = ElePs[i].DeltaR(SoftJetP);
149 
150  if (SoftJetP.Pt() > minSoftJetPt_ && std::abs(SoftJetP.Eta()) < maxAbsJetEta_ && softDR > minDeltaR_)
151  if ( std::abs(SoftJetP.Eta() - JetP.Eta()) > minDeltaEta_ ) {
152  store_jet.push_back(k);
153  VBFJetPair = true;
154  }
155  }
156  }
157  }
158 
159  }
160 
161  // Now remove duplicates from the jet collection to store
162  std::sort( store_jet.begin(), store_jet.end() );
163  store_jet.erase( unique( store_jet.begin(), store_jet.end() ), store_jet.end() );
164 
165  // Now save the cleaned jets
166  for ( unsigned int ijet = 0; ijet < store_jet.size(); ijet++ )
167  {
168  //store all selections
169  refVector.push_back(TRef(theJetCollectionHandle, store_jet.at(ijet)));
170  //store first selection which matches the criteria
171  if(!foundSolution)
172  theFilteredJetCollection->push_back(theJetCollection[store_jet.at(ijet)]);
173  }
174  //store all selections
175  allSelections->push_back(refVector);
176 
177  if (theFilteredJetCollection->size() >= minNJets_ && minDeltaEta_ < 0)
178  foundSolution = true;
179  else if (VBFJetPair && minDeltaEta_ > 0)
180  foundSolution = true;
181  else if (!foundSolution)
182  theFilteredJetCollection->clear();
183 
184 
185  }
186 
187  iEvent.put(theFilteredJetCollection);
188 
189  return;
190 
191 }
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< std::vector< T > > m_theJetToken
float float float z
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
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 HLTJetCollForElePlusJets< T >::hltElectronTag
private
template<typename T >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTJetCollForElePlusJets< T >::m_theElectronToken
private
template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTJetCollForElePlusJets< T >::m_theJetToken
private
template<typename T >
double HLTJetCollForElePlusJets< T >::maxAbsJetEta_
private

Definition at line 56 of file HLTJetCollForElePlusJets.h.

template<typename T >
double HLTJetCollForElePlusJets< T >::minDeltaEta_
private

Definition at line 62 of file HLTJetCollForElePlusJets.h.

template<typename T >
double HLTJetCollForElePlusJets< T >::minDeltaR_
private

Definition at line 59 of file HLTJetCollForElePlusJets.h.

template<typename T >
double HLTJetCollForElePlusJets< T >::minJetPt_
private

Definition at line 55 of file HLTJetCollForElePlusJets.h.

template<typename T >
unsigned int HLTJetCollForElePlusJets< T >::minNJets_
private

Definition at line 57 of file HLTJetCollForElePlusJets.h.

template<typename T >
double HLTJetCollForElePlusJets< T >::minSoftJetPt_
private

Definition at line 61 of file HLTJetCollForElePlusJets.h.

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