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 30 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

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

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

Definition at line 44 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

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

Member Function Documentation

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

Definition at line 53 of file HLTJetCollectionsForBoostedLeptonPlusJets.cc.

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

53  {
55  desc.add<edm::InputTag> ("HltLeptonTag", edm::InputTag("triggerFilterObjectWithRefs"));
56  //(2)
57  desc.add<edm::InputTag> ("SourceJetTag", edm::InputTag("jetCollection"));
58  //(2)
59  desc.add<double> ("minDeltaR", 0.5);
61 }
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 72 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().

73 {
74  using namespace edm;
75  using namespace std;
76  //(3)
77  using namespace reco;
78  //(3)
79 
80  typedef vector<RefVector<vector<jetType>,jetType,refhelper::FindUsingAdvance<vector<jetType>,jetType> > > JetCollectionVector;
81  typedef vector<jetType> JetCollection;
84  //(4)
86  //(4)
87 
89  iEvent.getByToken(m_theLeptonToken,PrevFilterOutput);
90 
91  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
92  // Electrons can be stored as objects of types TriggerCluster, TriggerElectron, or TriggerPhoton
93  vector<Ref<reco::RecoEcalCandidateCollection> > clusCands;
94  PrevFilterOutput->getObjects(trigger::TriggerCluster,clusCands);
95 
96  vector<Ref<reco::ElectronCollection> > eleCands;
97  PrevFilterOutput->getObjects(trigger::TriggerElectron,eleCands);
98 
99  trigger::VRphoton photonCands;
100  PrevFilterOutput->getObjects(trigger::TriggerPhoton, photonCands);
101 
102  vector<reco::RecoChargedCandidateRef> muonCands;
103  PrevFilterOutput->getObjects(trigger::TriggerMuon,muonCands);
104 
105  Handle<JetCollection> theJetCollectionHandle;
106  iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
107 
108  const JetCollection & theJetCollection = *theJetCollectionHandle;
109 
110  auto_ptr < JetCollectionVector > allSelections(new JetCollectionVector());
111 
112  if(!clusCands.empty()){ // try trigger clusters
113  for(size_t candNr=0;candNr<clusCands.size();candNr++){
114  JetRefVector refVector;
115  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
116  if (deltaR(clusCands[candNr]->superCluster()->position(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
117  else{
118  unsigned int w =0 ;
119  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
120  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
121  TVector3 ClusP(clusCands[candNr]->p4().Px(),clusCands[candNr]->p4().Py(), clusCands[candNr]->p4().Pz());
122  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
123  double deltaRPFConste = ClusP.DeltaR(PFJetConstP);
124  if(deltaRPFConste < 0.001 && w==0){
125  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - clusCands[candNr]->p4();
126  w ++;
127  } //if
128  }//for constituents
129  refVector.push_back(JetRef(theJetCollectionHandle, j));
130  }//else
131  }
132  allSelections->push_back(refVector);
133  }
134  }
135 
136  if(!eleCands.empty()){ // try electrons
137  for(size_t candNr=0;candNr<eleCands.size();candNr++){
138  JetRefVector refVector;
139  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
140  if (deltaR(eleCands[candNr]->superCluster()->position(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
141  else{
142  unsigned int w =0 ;
143  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
144  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
145  TVector3 ElectronP(eleCands[candNr]->p4().Px(),eleCands[candNr]->p4().Py(), eleCands[candNr]->p4().Pz());
146  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
147  double deltaRPFConste = ElectronP.DeltaR(PFJetConstP);
148  if(deltaRPFConste < 0.001 && w==0){
149  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - eleCands[candNr]->p4();
150  w ++;
151  } //if
152  }//for constituents
153  refVector.push_back(JetRef(theJetCollectionHandle, j));
154  }//else
155  }//for jet collection
156 
157  allSelections->push_back(refVector);
158  }
159  }
160 
161  if(!photonCands.empty()){ // try photons
162  for(size_t candNr=0;candNr<photonCands.size();candNr++){
163  JetRefVector refVector;
164  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
165  if (deltaR(photonCands[candNr]->superCluster()->position(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
166  else{
167  unsigned int w =0 ;
168  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
169  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
170  TVector3 PhotonP(photonCands[candNr]->p4().Px(),photonCands[candNr]->p4().Py(), photonCands[candNr]->p4().Pz());
171  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
172  double deltaRPFConste = PhotonP.DeltaR(PFJetConstP);
173  if(deltaRPFConste < 0.001 && w==0){
174  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - photonCands[candNr]->p4();
175  w ++;
176  } //if
177  }//for constituents
178  refVector.push_back(JetRef(theJetCollectionHandle, j));
179  }//else
180  }//for jet collection
181  allSelections->push_back(refVector);
182  }
183  }
184 
185  if(!muonCands.empty()){ // muons
186  for(size_t candNr=0;candNr<muonCands.size();candNr++){
187  JetRefVector refVector;
188  for (unsigned int j = 0; j < theJetCollection.size(); j++) {
189  if (deltaR(muonCands[candNr]->p4(),theJetCollection[j]) > minDeltaR_) refVector.push_back(JetRef(theJetCollectionHandle, j));
190  else{
191  unsigned int w =0 ;
192  std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[j].getPFConstituents();
193  for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
194  TVector3 MuP(muonCands[candNr]->p4().Px(),muonCands[candNr]->p4().Py(), muonCands[candNr]->p4().Pz());
195  TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
196  double deltaRPFConste = MuP.DeltaR(PFJetConstP);
197  if(deltaRPFConste < 0.001 && w==0){
198  const_cast<LorentzVector&>(theJetCollection[j].p4()) = theJetCollection[j].p4() - muonCands[candNr]->p4();
199  w ++;
200  } //if
201  }//for constituents
202  refVector.push_back(JetRef(theJetCollectionHandle, j));
203  }//else
204  }
205  allSelections->push_back(refVector);
206  }
207  }
208 
209 
210 
211 
212  iEvent.put(allSelections);
213 
214  return;
215 
216 }
std::vector< Jet > JetCollection
Definition: Jet.h:49
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
edm::Ref< JetCollection > JetRef
Definition: Jet.h:51
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
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:113
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
T w() const
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