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

#include <HLTJetCollForElePlusJets.h>

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

Public Member Functions

 HLTJetCollForElePlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollForElePlusJets ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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 maxAbsJetEta_
 
double minDeltaEta_
 
double minDeltaR_
 
double minJetPt_
 
unsigned int minNJets_
 
double minSoftJetPt_
 
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 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 15 of file HLTJetCollForElePlusJets.cc.

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

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

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

Member Function Documentation

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

Definition at line 42 of file HLTJetCollForElePlusJets.cc.

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

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

Definition at line 64 of file HLTJetCollForElePlusJets.cc.

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

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