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

Public Member Functions

 HLTJetCollectionsForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForElePlusJets ()
 
- 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 minDeltaR_
 
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 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.

Date:
2012/02/12 10:24:17
Revision:
1.2
Author
Lukasz Kreczko

Definition at line 40 of file HLTJetCollectionsForElePlusJets.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file HLTJetCollectionsForElePlusJets.cc.

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

Definition at line 41 of file HLTJetCollectionsForElePlusJets.cc.

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

Member Function Documentation

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

Definition at line 49 of file HLTJetCollectionsForElePlusJets.cc.

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

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

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

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

Member Data Documentation

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

Definition at line 49 of file HLTJetCollectionsForElePlusJets.h.

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

Definition at line 56 of file HLTJetCollectionsForElePlusJets.h.

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

Definition at line 50 of file HLTJetCollectionsForElePlusJets.h.