CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
L1JetRecoTreeProducer Class Reference

#include <L1Trigger/L1TNtuples/src/L1JetRecoTreeProducer.cc>

Inheritance diagram for L1JetRecoTreeProducer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1JetRecoTreeProducer (const edm::ParameterSet &)
 
 ~L1JetRecoTreeProducer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 

Public Attributes

L1Analysis::L1AnalysisRecoJetDataFormatjet_data
 
L1Analysis::L1AnalysisRecoMetDataFormatmet_data
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
void doCaloJets (edm::Handle< reco::CaloJetCollection > caloJets)
 
void doCaloMet (edm::Handle< reco::CaloMETCollection > caloMet)
 
void doCaloMetBE (edm::Handle< reco::CaloMETCollection > caloMetBE)
 
void doPFJetCorr (edm::Handle< reco::PFJetCollection > pfJets, edm::Handle< reco::JetCorrector > pfJetCorr)
 
void doPFJets (edm::Handle< reco::PFJetCollection > pfJets)
 
void doPFMet (edm::Handle< reco::PFMETCollection > pfMet)
 
virtual void endJob ()
 
bool jetId (const reco::PFJet &jet)
 

Private Attributes

bool caloMetBEMissing_
 
edm::EDGetTokenT
< reco::CaloMETCollection
caloMetBEToken_
 
bool caloMetMissing_
 
edm::EDGetTokenT
< reco::CaloMETCollection
caloMetToken_
 
edm::Service< TFileServicefs_
 
edm::EDGetTokenT
< reco::JetCorrector
jecToken_
 
double jetetaMax_
 
double jetptThreshold_
 
unsigned int maxCl_
 
unsigned int maxJet_
 
unsigned int maxTrk_
 
unsigned int maxVtx_
 
bool pfJetCorrMissing_
 
bool pfJetsMissing_
 
edm::EDGetTokenT
< reco::PFJetCollection
pfJetToken_
 
bool pfMetMissing_
 
edm::EDGetTokenT
< reco::PFMETCollection
pfMetToken_
 
TTree * tree_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

Description: Produces tree containing reco quantities

Definition at line 58 of file L1JetRecoTreeProducer.cc.

Constructor & Destructor Documentation

L1JetRecoTreeProducer::L1JetRecoTreeProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 119 of file L1JetRecoTreeProducer.cc.

References caloMetBEToken_, caloMetToken_, fs_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_25ns10e33_v2_cff::InputTag, jecToken_, jet_data, jetetaMax_, jetptThreshold_, TFileService::make(), maxJet_, met_data, pfJetToken_, pfMetToken_, and tree_.

119  :
120  pfJetsMissing_(false),
121  pfMetMissing_(false),
122  pfJetCorrMissing_(false),
123  caloMetMissing_(false),
124  caloMetBEMissing_(false)
125 {
126 
127  // caloJetToken_ = consumes<reco::CaloJetCollection>(iConfig.getUntrackedParameter("caloJetToken",edm::InputTag("ak4CaloJets")));
128  pfJetToken_ = consumes<reco::PFJetCollection>(iConfig.getUntrackedParameter("pfJetToken",edm::InputTag("ak4PFJetsCHS")));
129  // caloJetIdToken_ = consumes<edm::ValueMap<reco::JetID> >(iConfig.getUntrackedParameter("jetIdToken",edm::InputTag("ak4JetID")));
130  jecToken_ = consumes<reco::JetCorrector>(iConfig.getUntrackedParameter<edm::InputTag>("jecToken",edm::InputTag("ak4PFCHSL1FastL2L3ResidualCorrector")));
131 
132  pfMetToken_ = consumes<reco::PFMETCollection>(iConfig.getUntrackedParameter("pfMetToken",edm::InputTag("pfMetT1")));
133  caloMetToken_ = consumes<reco::CaloMETCollection>(iConfig.getUntrackedParameter("caloMetToken",edm::InputTag("caloMet")));
134  caloMetBEToken_ = consumes<reco::CaloMETCollection>(iConfig.getUntrackedParameter("caloMetBEToken",edm::InputTag("caloMetBE")));
135 
136  jetptThreshold_ = iConfig.getParameter<double> ("jetptThreshold");
137  jetetaMax_ = iConfig.getParameter<double> ("jetetaMax");
138  maxJet_ = iConfig.getParameter<unsigned int>("maxJet");
139 
142 
143  // set up output
144  tree_=fs_->make<TTree>("JetRecoTree", "JetRecoTree");
145  tree_->Branch("Jet", "L1Analysis::L1AnalysisRecoJetDataFormat", &jet_data, 32000, 3);
146  tree_->Branch("Sums", "L1Analysis::L1AnalysisRecoMetDataFormat", &met_data, 32000, 3);
147 
148 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
edm::Service< TFileService > fs_
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
edm::EDGetTokenT< reco::JetCorrector > jecToken_
edm::EDGetTokenT< reco::PFJetCollection > pfJetToken_
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken_
edm::EDGetTokenT< reco::CaloMETCollection > caloMetBEToken_
L1JetRecoTreeProducer::~L1JetRecoTreeProducer ( )

Definition at line 151 of file L1JetRecoTreeProducer.cc.

152 {
153 
154  // do anything here that needs to be done at desctruction time
155  // (e.g. close files, deallocate resources etc.)
156 
157 }

Member Function Documentation

void L1JetRecoTreeProducer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 165 of file L1JetRecoTreeProducer.cc.

References CaloMET_cfi::caloMet, CaloMET_cfi::caloMetBE, caloMetBEMissing_, caloMetBEToken_, caloMetMissing_, caloMetToken_, doCaloMet(), doCaloMetBE(), doPFJetCorr(), doPFJets(), doPFMet(), edm::Event::getByToken(), edm::HandleBase::isValid(), jecToken_, jet_data, met_data, L1Analysis::L1AnalysisRecoJetDataFormat::nJets, pfJetCorrMissing_, pfJets_cff::pfJets, pfJetsMissing_, pfJetToken_, PFMET_cfi::pfMet, pfMetMissing_, pfMetToken_, L1Analysis::L1AnalysisRecoMetDataFormat::Reset(), L1Analysis::L1AnalysisRecoJetDataFormat::Reset(), and tree_.

166 {
167 
168  jet_data->Reset();
169  met_data->Reset();
170 
171  // get jets
173  iEvent.getByToken(pfJetToken_, pfJets);
174 
175  //get sums
177  iEvent.getByToken(pfMetToken_, pfMet);
178 
179  // get jet ID
180  // edm::Handle<edm::ValueMap<reco::JetID> > jetsID;
181  //iEvent.getByLabel(jetIdTag_,jetsID);
182 
184  iEvent.getByToken(jecToken_, pfJetCorr);
185 
187  iEvent.getByToken(caloMetToken_, caloMet);
188 
190  iEvent.getByToken(caloMetBEToken_, caloMetBE);
191 
192  if (pfJets.isValid()) {
193 
194  jet_data->nJets=0;
195 
196  doPFJets(pfJets);
197 
198  }
199  else {
200  if (!pfJetsMissing_) {edm::LogWarning("MissingProduct") << "PFJets not found. Branch will not be filled" << std::endl;}
201  pfJetsMissing_ = true;
202  }
203 
204  if (pfJetCorr.isValid()) {
205 
206  doPFJetCorr(pfJets,pfJetCorr);
207 
208  }
209  else {
210  if (!pfJetCorrMissing_) {edm::LogWarning("MissingProduct") << "Jet Corrector not found. Branch will not be filled" << std::endl;}
211  pfJetCorrMissing_ = true;
212  }
213 
214  if (pfMet.isValid()) {
215 
216  doPFMet(pfMet);
217 
218  }
219  else {
220  if (!pfMetMissing_) {edm::LogWarning("MissingProduct") << "PFMet not found. Branch will not be filled" << std::endl;}
221  pfMetMissing_ = true;
222  }
223 
224  if (caloMet.isValid()) {
225 
226  doCaloMet(caloMet);
227 
228  }
229  else {
230  if (!caloMetMissing_) {edm::LogWarning("MissingProduct") << "CaloMet not found. Branch will not be filled" << std::endl;}
231  caloMetMissing_ = true;
232  }
233 
234  if (caloMetBE.isValid()) {
235 
236  doCaloMetBE(caloMetBE);
237 
238  }
239  else {
240  if (!caloMetBEMissing_) {edm::LogWarning("MissingProduct") << "CaloMetBE not found. Branch will not be filled" << std::endl;}
241  caloMetBEMissing_ = true;
242  }
243 
244  tree_->Fill();
245 
246 }
void doPFMet(edm::Handle< reco::PFMETCollection > pfMet)
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
tuple caloMet
____________________________________________________________________________||
Definition: CaloMET_cfi.py:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void doPFJetCorr(edm::Handle< reco::PFJetCollection > pfJets, edm::Handle< reco::JetCorrector > pfJetCorr)
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken_
void doPFJets(edm::Handle< reco::PFJetCollection > pfJets)
void doCaloMetBE(edm::Handle< reco::CaloMETCollection > caloMetBE)
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
edm::EDGetTokenT< reco::JetCorrector > jecToken_
tuple pfMet
____________________________________________________________________________||
Definition: PFMET_cfi.py:4
edm::EDGetTokenT< reco::PFJetCollection > pfJetToken_
bool isValid() const
Definition: HandleBase.h:75
void doCaloMet(edm::Handle< reco::CaloMETCollection > caloMet)
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken_
tuple pfJets
Definition: pfJets_cff.py:8
edm::EDGetTokenT< reco::CaloMETCollection > caloMetBEToken_
tuple caloMetBE
____________________________________________________________________________||
Definition: CaloMET_cfi.py:19
void L1JetRecoTreeProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 456 of file L1JetRecoTreeProducer.cc.

457 {
458 }
void L1JetRecoTreeProducer::doCaloJets ( edm::Handle< reco::CaloJetCollection caloJets)
private

Definition at line 250 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoJetDataFormat::e, L1Analysis::L1AnalysisRecoJetDataFormat::eEmEB, L1Analysis::L1AnalysisRecoJetDataFormat::eEmEE, L1Analysis::L1AnalysisRecoJetDataFormat::eEMF, L1Analysis::L1AnalysisRecoJetDataFormat::eEmHF, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHB, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHE, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHF, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHO, L1Analysis::L1AnalysisRecoJetDataFormat::eMaxEcalTow, L1Analysis::L1AnalysisRecoJetDataFormat::eMaxHcalTow, L1Analysis::L1AnalysisRecoJetDataFormat::et, L1Analysis::L1AnalysisRecoJetDataFormat::eta, L1Analysis::L1AnalysisRecoJetDataFormat::isPF, jet_data, maxJet_, L1Analysis::L1AnalysisRecoJetDataFormat::nJets, L1Analysis::L1AnalysisRecoJetDataFormat::phi, and L1Analysis::L1AnalysisRecoJetDataFormat::towerArea.

250  {
251 
252 
253  for( auto it=caloJets->begin();
254  it!=caloJets->end() && jet_data->nJets < maxJet_;
255  ++it) {
256 
257  jet_data->et.push_back(it->et());
258  jet_data->eta.push_back(it->eta());
259  jet_data->phi.push_back(it->phi());
260  jet_data->e.push_back(it->energy());
261  jet_data->isPF.push_back(false);
262 
263  jet_data->eEMF.push_back(it->emEnergyFraction());
264  jet_data->eEmEB.push_back(it->emEnergyInEB());
265  jet_data->eEmEE.push_back(it->emEnergyInEE());
266  jet_data->eEmHF.push_back(it->emEnergyInHF());
267  jet_data->eHadHB.push_back(it->hadEnergyInHB());
268  jet_data->eHadHE.push_back(it->hadEnergyInHE());
269  jet_data->eHadHO.push_back(it->hadEnergyInHO());
270  jet_data->eHadHF.push_back(it->hadEnergyInHF());
271  jet_data->eMaxEcalTow.push_back(it->maxEInEmTowers());
272  jet_data->eMaxHcalTow.push_back(it->maxEInHadTowers());
273  jet_data->towerArea.push_back(it->towersArea());
274 
275  jet_data->nJets++;
276 
277  }
278 
279 
280 }
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
void L1JetRecoTreeProducer::doCaloMet ( edm::Handle< reco::CaloMETCollection caloMet)
private

Definition at line 403 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoMetDataFormat::caloMet, L1Analysis::L1AnalysisRecoMetDataFormat::caloMetPhi, L1Analysis::L1AnalysisRecoMetDataFormat::caloSumEt, reco::LeafCandidate::et(), met_data, reco::LeafCandidate::phi(), edm::Handle< T >::product(), and reco::MET::sumEt().

Referenced by analyze().

403  {
404 
405  const reco::CaloMETCollection *metCol = caloMet.product();
406  const reco::CaloMET theMet = metCol->front();
407 
408  met_data->caloMet = theMet.et();
409  met_data->caloMetPhi = theMet.phi();
410  met_data->caloSumEt = theMet.sumEt();
411 
412 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
virtual double phi() const final
momentum azimuthal angle
double sumEt() const
Definition: MET.h:56
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
Definition: Handle.h:81
virtual double et() const final
transverse energy
void L1JetRecoTreeProducer::doCaloMetBE ( edm::Handle< reco::CaloMETCollection caloMetBE)
private

Definition at line 415 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoMetDataFormat::caloMetBE, L1Analysis::L1AnalysisRecoMetDataFormat::caloMetPhiBE, L1Analysis::L1AnalysisRecoMetDataFormat::caloSumEtBE, reco::LeafCandidate::et(), met_data, reco::LeafCandidate::phi(), edm::Handle< T >::product(), and reco::MET::sumEt().

Referenced by analyze().

415  {
416 
417  const reco::CaloMETCollection *metCol = caloMetBE.product();
418  const reco::CaloMET theMet = metCol->front();
419 
420  met_data->caloMetBE = theMet.et();
421  met_data->caloMetPhiBE = theMet.phi();
422  met_data->caloSumEtBE = theMet.sumEt();
423 
424 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
virtual double phi() const final
momentum azimuthal angle
double sumEt() const
Definition: MET.h:56
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
Definition: Handle.h:81
virtual double et() const final
transverse energy
void L1JetRecoTreeProducer::doPFJetCorr ( edm::Handle< reco::PFJetCollection pfJets,
edm::Handle< reco::JetCorrector pfJetCorr 
)
private

Definition at line 325 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoJetDataFormat::corrFactor, L1Analysis::L1AnalysisRecoJetDataFormat::etCorr, L1Analysis::L1AnalysisRecoMetDataFormat::Ht, jet_data, jetetaMax_, jetptThreshold_, maxJet_, met_data, L1Analysis::L1AnalysisRecoMetDataFormat::mHt, L1Analysis::L1AnalysisRecoMetDataFormat::mHtPhi, and edm::Handle< T >::product().

Referenced by analyze().

325  {
326 
327 
328  float corrFactor = 1.;
329  unsigned int nJets = 0;
330 
331  float mHx = 0;
332  float mHy = 0;
333 
334  met_data->Ht = 0;
335  met_data->mHt = -999.;
336  met_data->mHtPhi = -999.;
337 
338 
339  for( auto it=pfJets->begin();
340  it!=pfJets->end() && nJets < maxJet_;
341  ++it) {
342 
343  corrFactor = pfJetCorr.product()->correction(*it);
344 
345  jet_data->etCorr.push_back(it->et()*corrFactor);
346  jet_data->corrFactor.push_back(corrFactor);
347 
348  nJets++;
349 
350  if (it->pt()*corrFactor > jetptThreshold_ && fabs(it->eta())<jetetaMax_) {
351  mHx += -1.*it->px()*corrFactor;
352  mHy += -1.*it->py()*corrFactor;
353  met_data->Ht += it->pt()*corrFactor;
354  }
355 
356  }
357 
358  TVector2 *tv2 = new TVector2(mHx,mHy);
359  met_data->mHt = tv2->Mod();
360  met_data->mHtPhi = tv2->Phi();
361 
362  // std::vector< std::pair<float,float> > corrJetEtsAndCorrs;
363 
364  // //get jet correction and fill corrected jet ets and corrections
365  // for( auto it=pfJets->begin(); it!=pfJets->end(); ++it)
366  // {
367  // float corr = pfJetCorr.product()->correction(*it);
368  // std::pair<float,float> corrJetEtAndCorr(corr*it->et(),corr);
369  // corrJetEtsAndCorrs.push_back(corrJetEtAndCorr);
370  // }
371 
372  // // sort corrected jet ets and correction factors
373  // // by corrected jet et
374  // std::sort(corrJetEtsAndCorrs.rbegin(),corrJetEtsAndCorrs.rend());
375 
376  // //fill jet data array with sorted jet ets and corr factors
377  // std::vector<std::pair<float,float> >::iterator it;
378  // unsigned int nJets = 0;
379 
380  // for(it = corrJetEtsAndCorrs.begin(); it != corrJetEtsAndCorrs.end() && nJets < maxJet_; ++it){
381  // jet_data->etCorr.push_back(it->first);
382  // jet_data->corrFactor.push_back(it->second);
383  // nJets++
384  // }
385 
386 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
T const * product() const
Definition: Handle.h:81
void L1JetRecoTreeProducer::doPFJets ( edm::Handle< reco::PFJetCollection pfJets)
private

Definition at line 284 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoJetDataFormat::cemef, L1Analysis::L1AnalysisRecoJetDataFormat::chef, L1Analysis::L1AnalysisRecoJetDataFormat::chMult, L1Analysis::L1AnalysisRecoJetDataFormat::cmef, L1Analysis::L1AnalysisRecoJetDataFormat::cMult, L1Analysis::L1AnalysisRecoJetDataFormat::e, L1Analysis::L1AnalysisRecoJetDataFormat::eef, L1Analysis::L1AnalysisRecoJetDataFormat::elMult, L1Analysis::L1AnalysisRecoJetDataFormat::et, L1Analysis::L1AnalysisRecoJetDataFormat::eta, L1Analysis::L1AnalysisRecoJetDataFormat::hfemef, L1Analysis::L1AnalysisRecoJetDataFormat::hfemMult, L1Analysis::L1AnalysisRecoJetDataFormat::hfhef, L1Analysis::L1AnalysisRecoJetDataFormat::hfhMult, L1Analysis::L1AnalysisRecoJetDataFormat::isPF, jet_data, maxJet_, L1Analysis::L1AnalysisRecoJetDataFormat::mef, L1Analysis::L1AnalysisRecoJetDataFormat::muMult, L1Analysis::L1AnalysisRecoJetDataFormat::nemef, L1Analysis::L1AnalysisRecoJetDataFormat::nhef, L1Analysis::L1AnalysisRecoJetDataFormat::nhMult, L1Analysis::L1AnalysisRecoJetDataFormat::nJets, L1Analysis::L1AnalysisRecoJetDataFormat::nMult, L1Analysis::L1AnalysisRecoJetDataFormat::pef, L1Analysis::L1AnalysisRecoJetDataFormat::phi, and L1Analysis::L1AnalysisRecoJetDataFormat::phMult.

Referenced by analyze().

284  {
285 
286 
287  for( auto it=pfJets->begin();
288  it!=pfJets->end() && jet_data->nJets < maxJet_;
289  ++it) {
290  jet_data->et.push_back(it->et());
291  jet_data->eta.push_back(it->eta());
292  jet_data->phi.push_back(it->phi());
293  jet_data->e.push_back(it->energy());
294  jet_data->isPF.push_back(true);
295 
296  jet_data->chef.push_back(it->chargedHadronEnergyFraction());
297  jet_data->nhef.push_back(it->neutralHadronEnergyFraction());
298  jet_data->pef.push_back(it->photonEnergyFraction());
299  jet_data->eef.push_back(it->electronEnergyFraction());
300  jet_data->mef.push_back(it->muonEnergyFraction());
301  jet_data->hfhef.push_back(it->HFHadronEnergyFraction());
302  jet_data->hfemef.push_back(it->HFEMEnergyFraction());
303  jet_data->chMult.push_back(it->chargedHadronMultiplicity());
304  jet_data->nhMult.push_back(it->neutralHadronMultiplicity());
305  jet_data->phMult.push_back(it->photonMultiplicity());
306  jet_data->elMult.push_back(it->electronMultiplicity());
307  jet_data->muMult.push_back(it->muonMultiplicity());
308  jet_data->hfhMult.push_back(it->HFHadronMultiplicity());
309  jet_data->hfemMult.push_back(it->HFEMMultiplicity());
310 
311  jet_data->cemef.push_back(it->chargedEmEnergyFraction());
312  jet_data->cmef.push_back(it->chargedMuEnergyFraction());
313  jet_data->nemef.push_back(it->neutralEmEnergyFraction());
314  jet_data->cMult.push_back(it->chargedMultiplicity());
315  jet_data->nMult.push_back(it->neutralMultiplicity());
316 
317  jet_data->nJets++;
318 
319  }
320 
321 }
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
void L1JetRecoTreeProducer::doPFMet ( edm::Handle< reco::PFMETCollection pfMet)
private

Definition at line 389 of file L1JetRecoTreeProducer.cc.

References reco::LeafCandidate::et(), L1Analysis::L1AnalysisRecoMetDataFormat::met, met_data, L1Analysis::L1AnalysisRecoMetDataFormat::metPhi, L1Analysis::L1AnalysisRecoMetDataFormat::metPx, L1Analysis::L1AnalysisRecoMetDataFormat::metPy, reco::LeafCandidate::phi(), edm::Handle< T >::product(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), L1Analysis::L1AnalysisRecoMetDataFormat::sumEt, and reco::MET::sumEt().

Referenced by analyze().

389  {
390 
391  const reco::PFMETCollection *metCol = pfMet.product();
392  const reco::PFMET theMet = metCol->front();
393 
394  met_data->met = theMet.et();
395  met_data->metPhi = theMet.phi();
396  met_data->sumEt = theMet.sumEt();
397  met_data->metPx = theMet.px();
398  met_data->metPy = theMet.py();
399 
400 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
virtual double phi() const final
momentum azimuthal angle
double sumEt() const
Definition: MET.h:56
virtual double py() const final
y coordinate of momentum vector
T const * product() const
Definition: Handle.h:81
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
virtual double px() const final
x coordinate of momentum vector
virtual double et() const final
transverse energy
void L1JetRecoTreeProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 462 of file L1JetRecoTreeProducer.cc.

462  {
463 }
bool L1JetRecoTreeProducer::jetId ( const reco::PFJet jet)
private

Definition at line 427 of file L1JetRecoTreeProducer.cc.

References reco::PFJet::chargedEmEnergyFraction(), reco::PFJet::chargedHadronEnergyFraction(), reco::PFJet::chargedMultiplicity(), reco::PFJet::electronMultiplicity(), reco::LeafCandidate::eta(), reco::PFJet::muonEnergyFraction(), reco::PFJet::muonMultiplicity(), reco::PFJet::neutralEmEnergyFraction(), reco::PFJet::neutralHadronEnergyFraction(), reco::PFJet::neutralMultiplicity(), and tmp.

427  {
428 
429  bool tmp = true;
430 
431  tmp &= jet.neutralHadronEnergyFraction() < 0.9 ;
432  tmp &= jet.neutralEmEnergyFraction() < 0.9 ;
433  tmp &= (jet.chargedMultiplicity() + jet.neutralMultiplicity()) > 1 ;
434  tmp &= jet.muonEnergyFraction() < 0.8 ;
435  if (fabs(jet.eta()) < 2.4) {
436  tmp &= jet.chargedHadronEnergyFraction() > 0.0 ;
437  tmp &= jet.chargedMultiplicity() > 0 ;
438  tmp &= jet.chargedEmEnergyFraction() < 0.9 ;
439  }
440  if (fabs(jet.eta()) > 3.0) {
441  tmp &= jet.neutralEmEnergyFraction() < 0.9 ;
442  tmp &= jet.neutralMultiplicity() > 10 ;
443  }
444 
445  // our custom selection
446  tmp &= jet.muonMultiplicity() == 0;
447  tmp &= jet.electronMultiplicity() == 0;
448 
449  return tmp;
450 
451 }
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction
Definition: PFJet.h:100
int chargedMultiplicity() const
chargedMultiplicity
Definition: PFJet.h:155
float neutralEmEnergyFraction() const
neutralEmEnergyFraction
Definition: PFJet.h:152
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction
Definition: PFJet.h:104
int neutralMultiplicity() const
neutralMultiplicity
Definition: PFJet.h:157
float chargedEmEnergyFraction() const
chargedEmEnergyFraction
Definition: PFJet.h:144
int muonMultiplicity() const
muonMultiplicity
Definition: PFJet.h:135
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual double eta() const final
momentum pseudorapidity
float muonEnergyFraction() const
muonEnergyFraction
Definition: PFJet.h:116
int electronMultiplicity() const
electronMultiplicity
Definition: PFJet.h:133

Member Data Documentation

bool L1JetRecoTreeProducer::caloMetBEMissing_
private

Definition at line 114 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::CaloMETCollection> L1JetRecoTreeProducer::caloMetBEToken_
private

Definition at line 99 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

bool L1JetRecoTreeProducer::caloMetMissing_
private

Definition at line 113 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::CaloMETCollection> L1JetRecoTreeProducer::caloMetToken_
private

Definition at line 98 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

edm::Service<TFileService> L1JetRecoTreeProducer::fs_
private

Definition at line 86 of file L1JetRecoTreeProducer.cc.

Referenced by L1JetRecoTreeProducer().

edm::EDGetTokenT<reco::JetCorrector> L1JetRecoTreeProducer::jecToken_
private

Definition at line 95 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

L1Analysis::L1AnalysisRecoJetDataFormat* L1JetRecoTreeProducer::jet_data
double L1JetRecoTreeProducer::jetetaMax_
private

Definition at line 105 of file L1JetRecoTreeProducer.cc.

Referenced by doPFJetCorr(), and L1JetRecoTreeProducer().

double L1JetRecoTreeProducer::jetptThreshold_
private

Definition at line 104 of file L1JetRecoTreeProducer.cc.

Referenced by doPFJetCorr(), and L1JetRecoTreeProducer().

unsigned int L1JetRecoTreeProducer::maxCl_
private

Definition at line 106 of file L1JetRecoTreeProducer.cc.

unsigned int L1JetRecoTreeProducer::maxJet_
private

Definition at line 107 of file L1JetRecoTreeProducer.cc.

Referenced by doCaloJets(), doPFJetCorr(), doPFJets(), and L1JetRecoTreeProducer().

unsigned int L1JetRecoTreeProducer::maxTrk_
private

Definition at line 109 of file L1JetRecoTreeProducer.cc.

unsigned int L1JetRecoTreeProducer::maxVtx_
private

Definition at line 108 of file L1JetRecoTreeProducer.cc.

L1Analysis::L1AnalysisRecoMetDataFormat* L1JetRecoTreeProducer::met_data
bool L1JetRecoTreeProducer::pfJetCorrMissing_
private

Definition at line 112 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

bool L1JetRecoTreeProducer::pfJetsMissing_
private

Definition at line 103 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::PFJetCollection> L1JetRecoTreeProducer::pfJetToken_
private

Definition at line 92 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

bool L1JetRecoTreeProducer::pfMetMissing_
private

Definition at line 111 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::PFMETCollection> L1JetRecoTreeProducer::pfMetToken_
private

Definition at line 97 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

TTree* L1JetRecoTreeProducer::tree_
private

Definition at line 89 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().