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::ProductRegistryHelper

Public Member Functions

 HLTJetCollForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollForElePlusJets ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
 
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
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

Date:
2012/02/12 11:41:59
Revision:
1.2
Author
Lukasz Kreczko

Definition at line 40 of file HLTJetCollForElePlusJets.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file HLTJetCollForElePlusJets.cc.

22  :
23  hltElectronTag(iConfig.getParameter< edm::InputTag > ("HltElectronTag")),
24  sourceJetTag(iConfig.getParameter< edm::InputTag > ("SourceJetTag")),
25  minJetPt_(iConfig.getParameter<double> ("MinJetPt")),
26  maxAbsJetEta_(iConfig.getParameter<double> ("MaxAbsJetEta")),
27  minNJets_(iConfig.getParameter<unsigned int> ("MinNJets")),
28  minDeltaR_(iConfig.getParameter< double > ("minDeltaR")),
29  //Only for VBF
30  minSoftJetPt_(iConfig.getParameter< double > ("MinSoftJetPt")),
31  minDeltaEta_(iConfig.getParameter< double > ("MinDeltaEta"))
32 {
33  typedef std::vector<T> TCollection;
34  produces<TCollection>();
35 }
T getParameter(std::string const &) const
template<typename T >
HLTJetCollForElePlusJets< T >::~HLTJetCollForElePlusJets ( )

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

Definition at line 47 of file HLTJetCollForElePlusJets.cc.

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

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(HLTJetCollForElePlusJets<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 HLTJetCollForElePlusJets< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 69 of file HLTJetCollForElePlusJets.cc.

References abs, edm::Event::getByLabel(), i, j, gen::k, position, edm::Event::put(), python.multivaluedict::sort(), trigger::TriggerCluster, trigger::TriggerElectron, vdt::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  typedef edm::RefVector<TCollection> TRefVector;
77  typedef std::vector<edm::RefVector<std::vector<T>,T,edm::refhelper::FindUsingAdvance<std::vector<T>,T> > > TCollectionVector;
78 
80  iEvent.getByLabel(hltElectronTag,PrevFilterOutput);
81 
82  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
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  //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 
110  edm::Handle<TCollection> theJetCollectionHandle;
111  iEvent.getByLabel(sourceJetTag, theJetCollectionHandle);
112 
113  const TCollection & theJetCollection = *theJetCollectionHandle;
114 
115  std::auto_ptr< TCollection > theFilteredJetCollection(new TCollection);
116 
117  std::auto_ptr < TCollectionVector > allSelections(new TCollectionVector());
118 
119  bool foundSolution(false);
120 
121  for (unsigned int i = 0; i < ElePs.size(); i++) {
122 
123  bool VBFJetPair = false;
124  std::vector<int> store_jet;
125  TRefVector refVector;
126 
127  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
128  TVector3 JetP(theJetCollection[j].px(), theJetCollection[j].py(),
129  theJetCollection[j].pz());
130  double DR = ElePs[i].DeltaR(JetP);
131 
132  if (JetP.Pt() > minJetPt_ && std::abs(JetP.Eta()) < maxAbsJetEta_ && DR > minDeltaR_) {
133  store_jet.push_back(j);
134  // The VBF part of the filter
135  if ( minDeltaEta_ > 0 ) {
136  for ( unsigned int k = j+1; k < theJetCollection.size(); k++ ) {
137  TVector3 SoftJetP(theJetCollection[k].px(), theJetCollection[k].py(),
138  theJetCollection[k].pz());
139  double softDR = ElePs[i].DeltaR(SoftJetP);
140 
141  if (SoftJetP.Pt() > minSoftJetPt_ && std::abs(SoftJetP.Eta()) < maxAbsJetEta_ && softDR > minDeltaR_)
142  if ( std::abs(SoftJetP.Eta() - JetP.Eta()) > minDeltaEta_ ) {
143  store_jet.push_back(k);
144  VBFJetPair = true;
145  }
146  }
147  }
148  }
149 
150  }
151 
152  // Now remove duplicates from the jet collection to store
153  std::sort( store_jet.begin(), store_jet.end() );
154  store_jet.erase( unique( store_jet.begin(), store_jet.end() ), store_jet.end() );
155 
156  // Now save the cleaned jets
157  for ( unsigned int ijet = 0; ijet < store_jet.size(); ijet++ )
158  {
159  //store all selections
160  refVector.push_back(TRef(theJetCollectionHandle, store_jet.at(ijet)));
161  //store first selection which matches the criteria
162  if(!foundSolution)
163  theFilteredJetCollection->push_back(theJetCollection[store_jet.at(ijet)]);
164  }
165  //store all selections
166  allSelections->push_back(refVector);
167 
168  if (theFilteredJetCollection->size() >= minNJets_ && minDeltaEta_ < 0)
169  foundSolution = true;
170  else if (VBFJetPair && minDeltaEta_ > 0)
171  foundSolution = true;
172  else if (!foundSolution)
173  theFilteredJetCollection->clear();
174 
175 
176  }
177 
178  iEvent.put(theFilteredJetCollection);
179 
180  return;
181 
182 }
int i
Definition: DBlmapReader.cc:9
#define abs(x)
Definition: mlp_lapack.h:159
double double double z
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
int j
Definition: DBlmapReader.cc:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
int k[5][pyjets_maxn]
static int position[264][3]
Definition: ReadPGInfo.cc:509
x
Definition: VDTMath.h:216
long double T

Member Data Documentation

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

Definition at line 49 of file HLTJetCollForElePlusJets.h.

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

Definition at line 53 of file HLTJetCollForElePlusJets.h.

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

Definition at line 59 of file HLTJetCollForElePlusJets.h.

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

Definition at line 56 of file HLTJetCollForElePlusJets.h.

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

Definition at line 52 of file HLTJetCollForElePlusJets.h.

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

Definition at line 54 of file HLTJetCollForElePlusJets.h.

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

Definition at line 58 of file HLTJetCollForElePlusJets.h.

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

Definition at line 50 of file HLTJetCollForElePlusJets.h.