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
HLTJetCollectionsForBoostedLeptonPlusJets< jetType > Class Template Reference

#include <HLTJetCollectionsForBoostedLeptonPlusJets.h>

Inheritance diagram for HLTJetCollectionsForBoostedLeptonPlusJets< jetType >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTJetCollectionsForBoostedLeptonPlusJets (const edm::ParameterSet &)
 
 ~HLTJetCollectionsForBoostedLeptonPlusJets ()
 
- 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 hltLeptonTag
 
edm::EDGetTokenT< std::vector
< jetType > > 
m_theJetToken
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
m_theLeptonToken
 
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 jetType>
class HLTJetCollectionsForBoostedLeptonPlusJets< jetType >

This class is an EDProducer implementing an HLT trigger for lepton and jet objects, cutting on variables relating to the jet 4-momentum representation. The producer checks for overlaps between leptons and jets and if a combination of one lepton + jets cleaned against this leptons 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 40 of file HLTJetCollectionsForBoostedLeptonPlusJets.h.

Constructor & Destructor Documentation

template<typename jetType >
HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::HLTJetCollectionsForBoostedLeptonPlusJets ( const edm::ParameterSet iConfig)
explicit

Definition at line 29 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

References HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::hltLeptonTag, HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::m_theJetToken, HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::m_theLeptonToken, and HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::sourceJetTag.

29  :
30  hltLeptonTag(iConfig.getParameter< edm::InputTag > ("HltLeptonTag")),
31  sourceJetTag(iConfig.getParameter< edm::InputTag > ("SourceJetTag")),
32  minDeltaR_(iConfig.getParameter< double > ("minDeltaR"))
33 {
34  using namespace edm;
35  using namespace std;
36  typedef vector<RefVector<vector<jetType>,jetType,refhelper::FindUsingAdvance<vector<jetType>,jetType> > > JetCollectionVector;
37  m_theLeptonToken = consumes<trigger::TriggerFilterObjectWithRefs>(hltLeptonTag);
38  m_theJetToken = consumes<std::vector<jetType>>(sourceJetTag);
39  produces<JetCollectionVector> ();
40 }
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken

Definition at line 43 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

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

Member Function Documentation

template<typename jetType >
void HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 52 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

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

52  {
54  desc.add<edm::InputTag> ("HltLeptonTag", edm::InputTag("triggerFilterObjectWithRefs"));
55  desc.add<edm::InputTag> ("SourceJetTag", edm::InputTag("jetCollection"));
56  desc.add<double> ("minDeltaR", 0.5);
58 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename jetType >
void HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 69 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

References deltaR(), edm::Event::getByToken(), j, HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::m_theJetToken, HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::m_theLeptonToken, HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::minDeltaR_, p4, position, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerMuon, trigger::TriggerPhoton, and w.

70 {
71  using namespace edm;
72  using namespace std;
73  using namespace reco;
74 
75  typedef vector<RefVector<vector<jetType>,jetType,refhelper::FindUsingAdvance<vector<jetType>,jetType> > > JetCollectionVector;
76  typedef vector<jetType> JetCollection;
80 
82  iEvent.getByToken(m_theLeptonToken,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  vector<Ref<reco::RecoEcalCandidateCollection> > clusCands;
87  PrevFilterOutput->getObjects(trigger::TriggerCluster,clusCands);
88 
89  vector<Ref<reco::ElectronCollection> > eleCands;
90  PrevFilterOutput->getObjects(trigger::TriggerElectron,eleCands);
91 
92  trigger::VRphoton photonCands;
93  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
94 
95  vector<reco::RecoChargedCandidateRef> muonCands;
96  PrevFilterOutput->getObjects(trigger::TriggerMuon,muonCands);
97 
98  Handle<JetCollection> theJetCollectionHandle;
99  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
100 
101  const JetCollection & theJetCollection = *theJetCollectionHandle;
102 
103  auto_ptr < JetCollectionVector > allSelections(new JetCollectionVector());
104 
105  if(!clusCands.empty()){ // try trigger clusters
106  for(size_t candNr=0;candNr<clusCands.size();candNr++){
107  JetRefVector refVector;
108  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
109  if (deltaR(clusCands[candNr]->superCluster()->position(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
110  else{
111  unsigned int w =0 ;
112  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
113  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
114  TVector3 ClusP(clusCands[candNr]->p4().Px(),clusCands[candNr]->p4().Py(), clusCands[candNr]->p4().Pz());
115  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
116  double deltaRPFConste = ClusP.DeltaR(PFJetConstP);
117  if(deltaRPFConste < 0.001 && w==0){
118  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - clusCands[candNr]->p4();
119  w ++;
120  } //if
121  }//for constituents
122  refVector.push_back(JetRef(theJetCollectionHandle, j));
123  }//else
124  }
125  allSelections->push_back(refVector);
126  }
127  }
128 
129  if(!eleCands.empty()){ // try electrons
130  for(size_t candNr=0;candNr<eleCands.size();candNr++){
131  JetRefVector refVector;
132  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
133  if (deltaR(eleCands[candNr]->superCluster()->position(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
134  else{
135  unsigned int w =0 ;
136  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
137  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
138  TVector3 ElectronP(eleCands[candNr]->p4().Px(),eleCands[candNr]->p4().Py(), eleCands[candNr]->p4().Pz());
139  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
140  double deltaRPFConste = ElectronP.DeltaR(PFJetConstP);
141  if(deltaRPFConste < 0.001 && w==0){
142  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - eleCands[candNr]->p4();
143  w ++;
144  } //if
145  }//for constituents
146  refVector.push_back(JetRef(theJetCollectionHandle, j));
147  }//else
148  }
149  allSelections->push_back(refVector);
150  }
151  }
152 
153  if(!photonCands.empty()){ // try photons
154  for(size_t candNr=0;candNr<photonCands.size();candNr++){
155  JetRefVector refVector;
156  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
157  if (deltaR(photonCands[candNr]->superCluster()->position(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
158  else{
159  unsigned int w =0 ;
160  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
161  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
162  TVector3 PhotonP(photonCands[candNr]->p4().Px(),photonCands[candNr]->p4().Py(), photonCands[candNr]->p4().Pz());
163  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
164  double deltaRPFConste = PhotonP.DeltaR(PFJetConstP);
165  if(deltaRPFConste < 0.001 && w==0){
166  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - photonCands[candNr]->p4();
167  w ++;
168  } //if
169  }//for constituents
170  refVector.push_back(JetRef(theJetCollectionHandle, j));
171  }//else
172  }
173  allSelections->push_back(refVector);
174  }
175  }
176 
177  if(!muonCands.empty()){ // muons
178  for(size_t candNr=0;candNr<muonCands.size();candNr++){
179  JetRefVector refVector;
180  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
181  if (deltaR(muonCands[candNr]->p4(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
182  else{
183  unsigned int w =0 ;
184  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
185  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
186  TVector3 MuP(muonCands[candNr]->p4().Px(),muonCands[candNr]->p4().Py(), muonCands[candNr]->p4().Pz());
187  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
188  double deltaRPFConste = MuP.DeltaR(PFJetConstP);
189  if(deltaRPFConste < 0.001 && w==0){
190  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - muonCands[candNr]->p4();
191  w ++;
192  } //if
193  }//for constituents
194  refVector.push_back(JetRef(theJetCollectionHandle, j));
195  }//else
196  }
197  allSelections->push_back(refVector);
198  }
199  }
200 
201 
202 
203 
204  iEvent.put(allSelections);
205 
206  return;
207 
208 }
const double w
Definition: UKUtility.cc:23
std::vector< Jet > JetCollection
Definition: Jet.h:49
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
edm::Ref< JetCollection > JetRef
Definition: Jet.h:51
edm::RefVector< JetCollection > JetRefVector
Definition: Jet.h:52
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double p4[4]
Definition: TauolaWrapper.h:92
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
Definition: analysisEnums.h:9
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::vector< reco::RecoEcalCandidateRef > VRphoton
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

template<typename jetType >
edm::InputTag HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::hltLeptonTag
private
template<typename jetType >
edm::EDGetTokenT<std::vector<jetType> > HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::m_theJetToken
private
template<typename jetType >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::m_theLeptonToken
private
template<typename jetType >
double HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::minDeltaR_
private
template<typename jetType >
edm::InputTag HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::sourceJetTag
private