#include <PFTauElecRejectionBenchmark.h>
Definition at line 36 of file PFTauElecRejectionBenchmark.h.
PFTauElecRejectionBenchmark::PFTauElecRejectionBenchmark | ( | ) |
Definition at line 24 of file PFTauElecRejectionBenchmark.cc.
: file_(0) {}
PFTauElecRejectionBenchmark::~PFTauElecRejectionBenchmark | ( | ) | [virtual] |
Definition at line 26 of file PFTauElecRejectionBenchmark.cc.
References file_.
bool PFTauElecRejectionBenchmark::isInEcalCrack | ( | double | eta | ) | const [private] |
void PFTauElecRejectionBenchmark::process | ( | edm::Handle< edm::HepMCProduct > | mcevt, |
edm::Handle< reco::PFTauCollection > | pfTaus, | ||
edm::Handle< reco::PFTauDiscriminator > | pfTauIsoDiscr, | ||
edm::Handle< reco::PFTauDiscriminator > | pfTauElecDiscr | ||
) |
Definition at line 216 of file PFTauElecRejectionBenchmark.cc.
References _GenObjects, abs, applyEcalCrackCut_, HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, reco::tau::disc::Eta(), hElecMVA, hEmfrac, hEmfrac_barrel, hEmfrac_endcap, hEmfrac_preid0, hEmfrac_preid1, hEmfracvsEoP, hEmfracvsEoP_preid0, hEmfracvsEoP_preid1, hEoverP, hEoverP_barrel, hEoverP_endcap, hEoverP_preid0, hEoverP_preid1, hHoPvsEoP, hHoPvsEoP_preid0, hHoPvsEoP_preid1, hHoverP, hHoverP_barrel, hHoverP_endcap, hHoverP_preid0, hHoverP_preid1, hleadTk_eta, hleadTk_phi, hleadTk_pt, hpfcand_deltaEta, hpfcand_deltaEta_weightE, hpfcand_deltaPhiOverQ, hpfcand_deltaPhiOverQ_weightE, hTauElecDiscriminant, i, isInEcalCrack(), edm::Ref< C, T, F >::isNonnull(), maxDeltaR_, maxMCAbsEta_, maxRecoAbsEta_, minMCPt_, minRecoPt_, AlCaHLTBitMon_ParallelJobs::p, sGenMatchObjectLabel_, edm::RefVector< C, T, F >::size(), metsig::tau, and z.
{ // Find Gen Objects to be matched with HepMC::GenEvent * generated_event = new HepMC::GenEvent(*(mcevt->GetEvent())); _GenObjects.clear(); TLorentzVector taunet; HepMC::GenEvent::particle_iterator p; for (p = generated_event->particles_begin(); p != generated_event->particles_end(); p++) { if(std::abs((*p)->pdg_id()) == 15&&(*p)->status()==2) { bool lept_decay = false; TLorentzVector tau((*p)->momentum().px(),(*p)->momentum().py(),(*p)->momentum().pz(),(*p)->momentum().e()); HepMC::GenVertex::particle_iterator z = (*p)->end_vertex()->particles_begin(HepMC::descendants); for(; z != (*p)->end_vertex()->particles_end(HepMC::descendants); z++) { if(std::abs((*z)->pdg_id()) == 11 || std::abs((*z)->pdg_id()) == 13) lept_decay=true; if(std::abs((*z)->pdg_id()) == 16) taunet.SetPxPyPzE((*z)->momentum().px(),(*z)->momentum().py(),(*z)->momentum().pz(),(*z)->momentum().e()); } if(lept_decay==false) { TLorentzVector jetMom=tau-taunet; if (sGenMatchObjectLabel_=="tau") _GenObjects.push_back(jetMom); } } else if(std::abs((*p)->pdg_id()) == 11&&(*p)->status()==1) { TLorentzVector elec((*p)->momentum().px(),(*p)->momentum().py(),(*p)->momentum().pz(),(*p)->momentum().e()); if (sGenMatchObjectLabel_=="e") _GenObjects.push_back(elec); } } // Loop over all PFTaus math::XYZPointF myleadTkEcalPos; for (PFTauCollection::size_type iPFTau=0;iPFTau<pfTaus->size();iPFTau++) { PFTauRef thePFTau(pfTaus,iPFTau); if ((*pfTauIsoDiscr)[thePFTau] == 1) { if ((*thePFTau).et() > minRecoPt_ && std::abs((*thePFTau).eta()) < maxRecoAbsEta_) { // Check if track goes to Ecal crack TrackRef myleadTk; if(thePFTau->leadPFChargedHadrCand().isNonnull()){ myleadTk=thePFTau->leadPFChargedHadrCand()->trackRef(); myleadTkEcalPos = thePFTau->leadPFChargedHadrCand()->positionAtECALEntrance(); if(myleadTk.isNonnull()){ if (applyEcalCrackCut_ && isInEcalCrack(std::abs((double)myleadTkEcalPos.eta()))) { continue; // do nothing } else { // Match with gen object for (unsigned int i = 0; i<_GenObjects.size();i++) { if (_GenObjects[i].Et() >= minMCPt_ && std::abs(_GenObjects[i].Eta()) < maxMCAbsEta_ ) { TLorentzVector pftau((*thePFTau).px(),(*thePFTau).py(),(*thePFTau).pz(),(*thePFTau).energy()); double GenDeltaR = pftau.DeltaR(_GenObjects[i]); if (GenDeltaR<maxDeltaR_) { hleadTk_pt->Fill((float)myleadTk->pt()); hleadTk_eta->Fill((float)myleadTk->eta()); hleadTk_phi->Fill((float)myleadTk->phi()); hEoverP->Fill((*thePFTau).ecalStripSumEOverPLead()); hHoverP->Fill((*thePFTau).hcal3x3OverPLead()); hEmfrac->Fill((*thePFTau).emFraction()); if (std::abs(myleadTk->eta())<1.5) { hEoverP_barrel->Fill((*thePFTau).ecalStripSumEOverPLead()); hHoverP_barrel->Fill((*thePFTau).hcal3x3OverPLead()); hEmfrac_barrel->Fill((*thePFTau).emFraction()); } else if (std::abs(myleadTk->eta())>1.5 && std::abs(myleadTk->eta())<2.5) { hEoverP_endcap->Fill((*thePFTau).ecalStripSumEOverPLead()); hHoverP_endcap->Fill((*thePFTau).hcal3x3OverPLead()); hEmfrac_endcap->Fill((*thePFTau).emFraction()); } // if -999 fill in -1 bin! if ((*thePFTau).electronPreIDOutput()<-1) hElecMVA->Fill(-1); else hElecMVA->Fill((*thePFTau).electronPreIDOutput()); hTauElecDiscriminant->Fill((*pfTauElecDiscr)[thePFTau]); hHoPvsEoP->Fill((*thePFTau).ecalStripSumEOverPLead(),(*thePFTau).hcal3x3OverPLead()); hEmfracvsEoP->Fill((*thePFTau).emFraction(),(*thePFTau).hcal3x3OverPLead()); if ((*thePFTau).electronPreIDDecision()==1) { hEoverP_preid1->Fill((*thePFTau).ecalStripSumEOverPLead()); hHoverP_preid1->Fill((*thePFTau).hcal3x3OverPLead()); hEmfrac_preid1->Fill((*thePFTau).emFraction()); hHoPvsEoP_preid1->Fill((*thePFTau).ecalStripSumEOverPLead(),(*thePFTau).hcal3x3OverPLead()); hEmfracvsEoP_preid1->Fill((*thePFTau).emFraction(),(*thePFTau).hcal3x3OverPLead()); } else { hEoverP_preid0->Fill((*thePFTau).ecalStripSumEOverPLead()); hHoverP_preid0->Fill((*thePFTau).hcal3x3OverPLead()); hEmfrac_preid0->Fill((*thePFTau).emFraction()); hHoPvsEoP_preid0->Fill((*thePFTau).ecalStripSumEOverPLead(),(*thePFTau).hcal3x3OverPLead()); hEmfracvsEoP_preid0->Fill((*thePFTau).emFraction(),(*thePFTau).hcal3x3OverPLead()); } } } // Loop over all PFCands for cluster plots PFCandidateRefVector myPFCands=(*thePFTau).pfTauTagInfoRef()->PFCands(); for(int i=0;i<(int)myPFCands.size();i++){ math::XYZPointF candPos; if (myPFCands[i]->particleId()==1 || myPFCands[i]->particleId()==2) // if charged hadron or electron candPos = myPFCands[i]->positionAtECALEntrance(); else candPos = math::XYZPointF(myPFCands[i]->px(),myPFCands[i]->py(),myPFCands[i]->pz()); //double deltaR = ROOT::Math::VectorUtil::DeltaR(myleadTkEcalPos,candPos); double deltaPhi = ROOT::Math::VectorUtil::DeltaPhi(myleadTkEcalPos,candPos); double deltaEta = std::abs(myleadTkEcalPos.eta()-myPFCands[i]->eta()); double deltaPhiOverQ = deltaPhi/(double)myleadTk->charge(); hpfcand_deltaEta->Fill(deltaEta); hpfcand_deltaEta_weightE->Fill(deltaEta*myPFCands[i]->ecalEnergy()); hpfcand_deltaPhiOverQ->Fill(deltaPhiOverQ); hpfcand_deltaPhiOverQ_weightE->Fill(deltaPhiOverQ*myPFCands[i]->ecalEnergy()); } } } } } } } } }
void PFTauElecRejectionBenchmark::setup | ( | std::string | Filename, |
std::string | benchmarkLabel, | ||
double | maxDeltaR, | ||
double | minRecoPt, | ||
double | maxRecoAbsEta, | ||
double | minMCPt, | ||
double | maxMCAbsEta, | ||
std::string | sGenMatchObjectLabel, | ||
bool | applyEcalCrackCut, | ||
DQMStore * | db_store | ||
) |
void PFTauElecRejectionBenchmark::write | ( | void | ) |
Definition at line 30 of file PFTauElecRejectionBenchmark.cc.
References gather_cfg::cout, db_, file_, outputFile_, and DQMStore::save().
{ // Store the DAQ Histograms if (outputFile_.size() != 0) { if (db_) db_->save(outputFile_.c_str()); // use bare Root if no DQM (FWLite applications) else if (file_) { file_->Write(outputFile_.c_str()); cout << "Benchmark output written to file " << outputFile_.c_str() << endl; file_->Close(); } } else cout << "No output file specified ("<<outputFile_<<"). Results will not be saved!" << endl; }
std::vector<TLorentzVector> PFTauElecRejectionBenchmark::_GenObjects [private] |
Definition at line 122 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
bool PFTauElecRejectionBenchmark::applyEcalCrackCut_ [private] |
Definition at line 72 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
std::string PFTauElecRejectionBenchmark::benchmarkLabel_ [private] |
Definition at line 65 of file PFTauElecRejectionBenchmark.h.
DQMStore* PFTauElecRejectionBenchmark::db_ [protected] |
Definition at line 126 of file PFTauElecRejectionBenchmark.h.
Referenced by write().
TFile* PFTauElecRejectionBenchmark::file_ [private] |
Definition at line 63 of file PFTauElecRejectionBenchmark.h.
Referenced by write(), and ~PFTauElecRejectionBenchmark().
TH1F* PFTauElecRejectionBenchmark::hElecMVA [private] |
Definition at line 96 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hElecPreID [private] |
Definition at line 95 of file PFTauElecRejectionBenchmark.h.
TH1F* PFTauElecRejectionBenchmark::hEmfrac [private] |
Definition at line 77 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEmfrac_barrel [private] |
Definition at line 81 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEmfrac_endcap [private] |
Definition at line 85 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEmfrac_preid0 [private] |
Definition at line 89 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEmfrac_preid1 [private] |
Definition at line 93 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH2F* PFTauElecRejectionBenchmark::hEmfracvsEoP [private] |
Definition at line 103 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH2F* PFTauElecRejectionBenchmark::hEmfracvsEoP_preid0 [private] |
Definition at line 104 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH2F* PFTauElecRejectionBenchmark::hEmfracvsEoP_preid1 [private] |
Definition at line 105 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEoverP [private] |
Definition at line 75 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEoverP_barrel [private] |
Definition at line 79 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEoverP_endcap [private] |
Definition at line 83 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEoverP_preid0 [private] |
Definition at line 87 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hEoverP_preid1 [private] |
Definition at line 91 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH2F* PFTauElecRejectionBenchmark::hHoPvsEoP [private] |
Definition at line 99 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH2F* PFTauElecRejectionBenchmark::hHoPvsEoP_preid0 [private] |
Definition at line 100 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH2F* PFTauElecRejectionBenchmark::hHoPvsEoP_preid1 [private] |
Definition at line 101 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hHoverP [private] |
Definition at line 76 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hHoverP_barrel [private] |
Definition at line 80 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hHoverP_endcap [private] |
Definition at line 84 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hHoverP_preid0 [private] |
Definition at line 88 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hHoverP_preid1 [private] |
Definition at line 92 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hleadGsfTk_eta [private] |
Definition at line 118 of file PFTauElecRejectionBenchmark.h.
TH1F* PFTauElecRejectionBenchmark::hleadGsfTk_phi [private] |
Definition at line 119 of file PFTauElecRejectionBenchmark.h.
TH1F* PFTauElecRejectionBenchmark::hleadGsfTk_pt [private] |
Definition at line 117 of file PFTauElecRejectionBenchmark.h.
TH1F* PFTauElecRejectionBenchmark::hleadTk_eta [private] |
Definition at line 113 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hleadTk_phi [private] |
Definition at line 114 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hleadTk_pt [private] |
Definition at line 112 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hpfcand_deltaEta [private] |
Definition at line 107 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hpfcand_deltaEta_weightE [private] |
Definition at line 108 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hpfcand_deltaPhiOverQ [private] |
Definition at line 109 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hpfcand_deltaPhiOverQ_weightE [private] |
Definition at line 110 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
TH1F* PFTauElecRejectionBenchmark::hTauElecDiscriminant [private] |
Definition at line 97 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
double PFTauElecRejectionBenchmark::maxDeltaR_ [private] |
Definition at line 66 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
double PFTauElecRejectionBenchmark::maxMCAbsEta_ [private] |
Definition at line 68 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
double PFTauElecRejectionBenchmark::maxRecoAbsEta_ [private] |
Definition at line 70 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
double PFTauElecRejectionBenchmark::minMCPt_ [private] |
Definition at line 67 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
double PFTauElecRejectionBenchmark::minRecoPt_ [private] |
Definition at line 69 of file PFTauElecRejectionBenchmark.h.
Referenced by process().
std::string PFTauElecRejectionBenchmark::outputFile_ [private] |
Definition at line 64 of file PFTauElecRejectionBenchmark.h.
Referenced by write().
std::string PFTauElecRejectionBenchmark::sGenMatchObjectLabel_ [private] |
Definition at line 71 of file PFTauElecRejectionBenchmark.h.
Referenced by process().