diff --git a/PhysicsAnalysis/TauID/TauDQA/src/PhysValTau.cxx b/PhysicsAnalysis/TauID/TauDQA/src/PhysValTau.cxx index 2edec5e894485ac6c9d11ea77b690fb32aa47296..023ac1b1b6fd429c27d1cd6a9349ee7f3b49f638 100644 --- a/PhysicsAnalysis/TauID/TauDQA/src/PhysValTau.cxx +++ b/PhysicsAnalysis/TauID/TauDQA/src/PhysValTau.cxx @@ -34,17 +34,15 @@ using CLHEP::GeV; // Constructors //////////////// -PhysValTau::PhysValTau( const std::string& type, - const std::string& name, - const IInterface* parent ) : - ManagedMonitorToolBase( type, name, parent ) +PhysValTau::PhysValTau(const std::string& type, + const std::string& name, + const IInterface* parent) : + ManagedMonitorToolBase(type, name, parent) { - declareProperty( "TauContainerName", m_TauJetContainerName = "TauRecContainer" ); - declareProperty( "TruthParticleContainerName", m_TruthParticleContainerName = "TruthParticle" ); - declareProperty( "TauDetailsContainerName", m_TauDetailsContainerName = "TauRecDetailsContainer" ); - declareProperty("isMC", m_isMC= false); - - // std::cout << "Match tool Core Var Truth Cuts Et " << matchtool.getvisETCut() << " eta " << matchtool.getvisEtaCut() << std::endl; + declareProperty("TauContainerName", m_TauJetContainerName = "TauRecContainer"); + declareProperty("TruthParticleContainerName", m_TruthParticleContainerName = "TruthParticle"); + declareProperty("TauDetailsContainerName", m_TauDetailsContainerName = "TauRecDetailsContainer"); + declareProperty("isMC", m_isMC= false); } // Destructor @@ -56,193 +54,187 @@ PhysValTau::~PhysValTau() //////////////////////////// StatusCode PhysValTau::initialize() { - ATH_MSG_INFO ("Initializing " << name() << "..."); - ATH_CHECK(ManagedMonitorToolBase::initialize()); - - // geometrical matching between Reco Tau and MC tau - m_DeltaRMatchCut = 0.2; - m_LeadingChPiPt_Threshold = 0.0; - - //Truth Matching Cuts - m_visETcut = 10.; - m_visEtacut = 2.5; - - - //Initialize Counters - - m_truth_all = 0; - m_truth_1p = 0; - m_truth_3p = 0; + ATH_MSG_INFO ("Initializing " << name() << "..."); + ATH_CHECK(ManagedMonitorToolBase::initialize()); + + // geometrical matching between Reco Tau and MC tau + m_DeltaRMatchCut = 0.2; + m_LeadingChPiPt_Threshold = 0.0; + + //Truth Matching Cuts + m_visETcut = 10.; + m_visEtacut = 2.5; - m_truth_all_matched = 0; - m_truth_1p_matched = 0; - m_truth_3p_matched = 0; - - return StatusCode::SUCCESS; + //Initialize Counters + m_truth_all = 0; + m_truth_1p = 0; + m_truth_3p = 0; + + m_truth_all_matched = 0; + m_truth_1p_matched = 0; + m_truth_3p_matched = 0; + + return StatusCode::SUCCESS; } StatusCode PhysValTau::bookHistograms() { - ATH_MSG_INFO ("Booking hists " << name() << "..."); - - // Physics validation plots are level 10 - m_oTauValidationPlots.reset(new TauValidationPlots(0,"Tau/" /* + m_TauJetContainerName*/, m_TauJetContainerName)); - m_oTauValidationPlots->setDetailLevel(100); - m_oTauValidationPlots->initialize(); - std::vector<HistData> hists = m_oTauValidationPlots->retrieveBookedHistograms(); - ATH_MSG_INFO ("Filling n of hists " << hists.size() << " "); - for (auto hist : hists) { - ATH_CHECK(regHist(hist.first,hist.second,all)); - } - - return StatusCode::SUCCESS; + ATH_MSG_INFO ("Booking hists " << name() << "..."); + + // Physics validation plots are level 10 + m_oTauValidationPlots.reset(new TauValidationPlots(0,"Tau/" /* + m_TauJetContainerName*/, m_TauJetContainerName)); + m_oTauValidationPlots->setDetailLevel(100); + m_oTauValidationPlots->initialize(); + std::vector<HistData> hists = m_oTauValidationPlots->retrieveBookedHistograms(); + ATH_MSG_INFO ("Filling n of hists " << hists.size() << " "); + for (auto hist : hists) { + ATH_CHECK(regHist(hist.first,hist.second,all)); + } + + return StatusCode::SUCCESS; } StatusCode PhysValTau::fillHistograms() { - ATH_MSG_INFO ("Filling hists " << name() << "..."); - //////////////////////////////////////////////////////////////////////////////////////////////// - // Retrieve tau container: - const xAOD::TauJetContainer* taus = evtStore()->retrieve< const xAOD::TauJetContainer >( m_TauJetContainerName ); - if (!taus) { - ATH_MSG_ERROR ("Couldn't retrieve tau container with key: " << m_TauJetContainerName); - return StatusCode::FAILURE; - } - ATH_MSG_DEBUG( "Number of taus: " << taus->size() ); + ATH_MSG_INFO ("Filling hists " << name() << "..."); + //////////////////////////////////////////////////////////////////////////////////////////////// + // Retrieve tau container: + const xAOD::TauJetContainer* taus = evtStore()->retrieve< const xAOD::TauJetContainer >( m_TauJetContainerName ); + if ( !taus ) { + ATH_MSG_ERROR ("Couldn't retrieve tau container with key: " << m_TauJetContainerName); + return StatusCode::FAILURE; + } + ATH_MSG_DEBUG("Number of taus: " << taus->size()); - //////////////////////////////////////////////////////////////////////////////////////////////// - // Retrieve truth container: - const xAOD::TruthParticleContainer* truth = 0; - if (m_isMC){ - truth = evtStore()->retrieve< const xAOD::TruthParticleContainer >( m_TruthParticleContainerName ); - if (!truth) { - ATH_MSG_ERROR ("Couldn't retrieve tau container with key: " << m_TruthParticleContainerName); - return StatusCode::FAILURE; - } - // ATH_MSG_DEBUG( "Number of truth: " << truth->size() ); - } - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Retrieve true hadronic tau container from truth container - // getHaderonicTruth finds true taus (ID == 15) with correct status and no leptonic decay. - const xAOD::TruthParticleContainer* trueTauContainer = 0; - if (m_isMC){ - trueTauContainer = truthHandler.getHadronicTruth(truth); - ATH_MSG_DEBUG( "Number of true had taus: " << trueTauContainer->size() ); - } - - - ////////////////////////////////////////// - // Plotting TauRec Variables - - // Loop through reco tau jet container - for (auto tau : *taus) { - if (m_detailLevel < 10) continue; - if (tau->pt()/GeV < 20) continue; - m_oTauValidationPlots->m_oRecoTauAllProngsPlots.fill(*tau); // Substructure/PFO histograms filled - m_oTauValidationPlots->m_oNewCorePlots.fill(*tau); // NewCore histograms filled - m_oTauValidationPlots->m_oRecTauEffPlots.fill(*tau); //Eff Reco Tau plots - m_oTauValidationPlots->m_oRecoGeneralTauAllProngsPlots.fill(*tau); //Reco Tau General Plots - if(tau->nTracks()==1){ - m_oTauValidationPlots->m_oRecoHad1ProngPlots.fill(*tau); //Reco Tau 1P plots - m_oTauValidationPlots->m_oRecTauEff1PPlots.fill(*tau); //Eff Reco Tau 1P plots - - } - if(tau->nTracks()==3){ - m_oTauValidationPlots->m_oRecoHad3ProngPlots.fill(*tau); //Reco Tau 3P plots - m_oTauValidationPlots->m_oRecTauEff3PPlots.fill(*tau); //Eff Reco Tau 3P plots - } - } - m_matched_itr.clear(); - ////////////////////////////////////////// - // Plotting TruthMatched Variables - // Loop through reco tau jet container - - // + //////////////////////////////////////////////////////////////////////////////////////////////// + // Retrieve truth container: + const xAOD::TruthParticleContainer* truth = 0; + if ( m_isMC ) { + truth = evtStore()->retrieve<const xAOD::TruthParticleContainer>(m_TruthParticleContainerName); + if ( !truth ) { + ATH_MSG_ERROR ("Couldn't retrieve tau container with key: " << m_TruthParticleContainerName); + return StatusCode::FAILURE; + } + // ATH_MSG_DEBUG( "Number of truth: " << truth->size() ); + } + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Retrieve true hadronic tau container from truth container + // getHaderonicTruth finds true taus (ID == 15) with correct status and no leptonic decay. + const xAOD::TruthParticleContainer* trueTauContainer = 0; + if ( m_isMC ) { + trueTauContainer = truthHandler.getHadronicTruth(truth); + ATH_MSG_DEBUG("Number of true had taus: " << trueTauContainer->size()); + } - if(trueTauContainer != 0 && m_isMC==true){ - xAOD::TruthParticleContainer::const_iterator truth_itr = trueTauContainer->begin(); - xAOD::TruthParticleContainer::const_iterator truth_end = trueTauContainer->end(); - // std::cout<<"new true tau container"<<std::endl; - - for (; truth_itr != truth_end; truth_itr++) { - - ATH_MSG_DEBUG( "Trying to match tau :"); - xAOD::TruthParticle* trueTau = const_cast<xAOD::TruthParticle*>(*truth_itr); - const xAOD::TauJet *matchedRecTau = 0; - ATH_MSG_DEBUG("Matching Tau"); - bool matched = matchTrueAndRecoTau(taus,trueTau,matchedRecTau); - if(matched) { - m_oTauValidationPlots->m_oGeneralTauAllProngsPlots.fill(*matchedRecTau); - m_oTauValidationPlots->m_oNewCoreMatchedPlots.fill(*matchedRecTau); // NewCore histograms filled - m_oTauValidationPlots->m_oMatchedTauAllProngsPlots.fill(*matchedRecTau); // Substructure/PFO histograms filled - m_oTauValidationPlots->m_oMatchedTauEffPlots.fill(*matchedRecTau); - - if(matchedRecTau->nTracks() == 1){ - m_oTauValidationPlots->m_oHad1ProngPlots.fill(*matchedRecTau); - m_oTauValidationPlots->m_oMatchedTauEff1PPlots.fill(*matchedRecTau); - - - } - if(matchedRecTau->nTracks() == 3){ - m_oTauValidationPlots->m_oHad3ProngPlots.fill(*matchedRecTau); - m_oTauValidationPlots->m_oMatchedTauEff3PPlots.fill(*matchedRecTau); - } + ////////////////////////////////////////// + // Plotting TauRec Variables + + // Loop through reco tau jet container + for (auto tau : *taus) { + if (m_detailLevel < 10) continue; + if (tau->pt()/GeV < 20) continue; + // fill Substructure/PFO histograms + m_oTauValidationPlots->m_oRecoTauAllProngsPlots.fill(*tau); + m_oTauValidationPlots->m_oNewCorePlots.fill(*tau); + m_oTauValidationPlots->m_oRecTauEffPlots.fill(*tau); + //Reco Tau General Plots + m_oTauValidationPlots->m_oRecoGeneralTauAllProngsPlots.fill(*tau); + if ( tau->nTracks()==1 ) { + m_oTauValidationPlots->m_oRecoHad1ProngPlots.fill(*tau); + m_oTauValidationPlots->m_oRecTauEff1PPlots.fill(*tau); + + } + if ( tau->nTracks()==3 ) { + m_oTauValidationPlots->m_oRecoHad3ProngPlots.fill(*tau); + m_oTauValidationPlots->m_oRecTauEff3PPlots.fill(*tau); + } + } + m_matched_itr.clear(); + ////////////////////////////////////////// + // Plotting TruthMatched Variables + // Loop through reco tau jet container + + // + + if ( (trueTauContainer != 0) && (m_isMC == true) ) { + xAOD::TruthParticleContainer::const_iterator truth_itr = trueTauContainer->begin(); + xAOD::TruthParticleContainer::const_iterator truth_end = trueTauContainer->end(); + for ( ; truth_itr != truth_end; truth_itr++ ) { + ATH_MSG_DEBUG( "Trying to match tau :"); + xAOD::TruthParticle* trueTau = const_cast<xAOD::TruthParticle*>(*truth_itr); + const xAOD::TauJet *matchedRecTau = 0; + ATH_MSG_DEBUG("Matching Tau"); + bool matched = matchTrueAndRecoTau(taus,trueTau,matchedRecTau); + if ( matched ) { + m_oTauValidationPlots->m_oGeneralTauAllProngsPlots.fill(*matchedRecTau); + m_oTauValidationPlots->m_oNewCoreMatchedPlots.fill(*matchedRecTau); + // Substructure/PFO histograms + m_oTauValidationPlots->m_oMatchedTauAllProngsPlots.fill(*matchedRecTau); + m_oTauValidationPlots->m_oMatchedTauEffPlots.fill(*matchedRecTau); + // 1-prong + if ( matchedRecTau->nTracks() == 1 ) { + m_oTauValidationPlots->m_oHad1ProngPlots.fill(*matchedRecTau); + m_oTauValidationPlots->m_oMatchedTauEff1PPlots.fill(*matchedRecTau); } - } - - // std::cout<<"Number of matched: "<<m_matched_itr.size()<<std::endl; - if(taus != 0){ - xAOD::TauJetContainer::const_iterator tau_itr = taus->begin(); - xAOD::TauJetContainer::const_iterator tau_end = taus->end(); - for (size_t iRecTau = 0 ; iRecTau < taus->size(); iRecTau++) { - bool alreadymatched = false; - if(m_matched_itr.size()>0) - for (size_t i = 0; i<m_matched_itr.size(); i++) - if(m_matched_itr.at(i) == iRecTau) alreadymatched = true; - if(alreadymatched)continue; - const xAOD::TauJet *recTau = taus->at(iRecTau); - if (m_detailLevel < 10) continue; - if (recTau->pt()/GeV < 20) continue; - bool eleMatch = false; - // Matching to electrons (Improvements needed) - for (auto mc_candidate : *truth) { - - if(abs(mc_candidate->pdgId())==11 && mc_candidate->pt()>10000.) - { - float dr = sqrt( (mc_candidate->eta()-recTau->eta())*(mc_candidate->eta()-recTau->eta()) + (mc_candidate->phi()-recTau->phi())*(mc_candidate->phi()-recTau->phi())); - if( dr < 0.2 ) { - eleMatch = true; - continue; - } - } - } - if(eleMatch){ - m_oTauValidationPlots->m_oElMatchedParamPlots.fill(*recTau); - - }else{ - m_oTauValidationPlots->m_oFakeGeneralTauAllProngsPlots.fill(*recTau); - m_oTauValidationPlots->m_oFakeTauAllProngsPlots.fill(*recTau); // Substructure/PFO histograms filled - m_oTauValidationPlots->m_oNewCoreFakePlots.fill(*recTau); // NewCore histograms filled - m_oTauValidationPlots->m_oFakeTauEffPlots.fill(*recTau); - if(recTau->nTracks()==1) - { - m_oTauValidationPlots->m_oFakeHad1ProngPlots.fill(*recTau); - m_oTauValidationPlots->m_oFakeTauEff1PPlots.fill(*recTau); - } - if(recTau->nTracks()==3) - { - m_oTauValidationPlots->m_oFakeTauEff3PPlots.fill(*recTau); - m_oTauValidationPlots->m_oFakeHad3ProngPlots.fill(*recTau); - } - - } - + // 3-prong + else if( matchedRecTau->nTracks() == 3 ) { + m_oTauValidationPlots->m_oHad3ProngPlots.fill(*matchedRecTau); + m_oTauValidationPlots->m_oMatchedTauEff3PPlots.fill(*matchedRecTau); } - } - } ///////////////////////////////////////////////////////////////////////////////////////////////// - - return StatusCode::SUCCESS; + } + } + if ( taus != 0 ) { + xAOD::TauJetContainer::const_iterator tau_itr = taus->begin(); + xAOD::TauJetContainer::const_iterator tau_end = taus->end(); + for ( size_t iRecTau = 0 ; iRecTau < taus->size(); iRecTau++ ) { + bool alreadymatched = false; + if ( m_matched_itr.size() > 0 ) { + for ( size_t i = 0; i < m_matched_itr.size(); i++ ) { + if(m_matched_itr.at(i) == iRecTau) alreadymatched = true; + } + } + if ( alreadymatched ) continue; + const xAOD::TauJet *recTau = taus->at(iRecTau); + if ( m_detailLevel < 10 ) continue; + if ( recTau->pt()/GeV < 20 ) continue; + bool eleMatch = false; + // Matching to electrons (Improvements needed) + for ( auto mc_candidate : *truth ) { + if ( abs(mc_candidate->pdgId())==11 && mc_candidate->pt()>10000. ) { + float dr = sqrt( (mc_candidate->eta()-recTau->eta())*(mc_candidate->eta()-recTau->eta()) + + (mc_candidate->phi()-recTau->phi())*(mc_candidate->phi()-recTau->phi())); + if( dr < 0.2 ) { + eleMatch = true; + continue; + } + } + } + // electron matched taus + if ( eleMatch ) { + m_oTauValidationPlots->m_oElMatchedParamPlots.fill(*recTau); + m_oTauValidationPlots->m_oElMatchedEVetoPlots.fill(*recTau); + } + else { + m_oTauValidationPlots->m_oFakeGeneralTauAllProngsPlots.fill(*recTau); + // Substructure/PFO histograms + m_oTauValidationPlots->m_oFakeTauAllProngsPlots.fill(*recTau); + m_oTauValidationPlots->m_oNewCoreFakePlots.fill(*recTau); + m_oTauValidationPlots->m_oFakeTauEffPlots.fill(*recTau); + if ( recTau->nTracks()==1 ) { + m_oTauValidationPlots->m_oFakeHad1ProngPlots.fill(*recTau); + m_oTauValidationPlots->m_oFakeTauEff1PPlots.fill(*recTau); + } + if ( recTau->nTracks()==3 ) { + m_oTauValidationPlots->m_oFakeTauEff3PPlots.fill(*recTau); + m_oTauValidationPlots->m_oFakeHad3ProngPlots.fill(*recTau); + } + } + } + } + } ///////////////////////////////////////////////////////////////////////////////////////////////// + + return StatusCode::SUCCESS; } StatusCode PhysValTau::procHistograms() @@ -266,11 +258,11 @@ bool PhysValTau::matchTrueAndRecoTau(const xAOD::TauJetContainer *&taus, const x ATH_MSG_DEBUG( "True decay mode is " << nCharged << "p" << nNeutral << "n" ); if (!RecoTypes::IsValidMode(trueDecayMode)) { - ATH_MSG_DEBUG(" Decay mode is not valid, skipping..." ); + ATH_MSG_DEBUG(" Decay mode is not valid, skipping..." ); return false; } - TLorentzVector visSum = truthHandler.getTauVisibleSumTruth(trueTau); // Get visible TLV for true had tau + TLorentzVector visSum = truthHandler.getTauVisibleSumTruth(trueTau); // Get visible TLV for true had tau if ((visSum.Et()/GeV < m_visETcut) || (fabs(visSum.Eta()) > m_visEtacut)) return false; // Detector limitations xAOD::TauJetContainer::const_iterator tau_itr = taus->begin(); @@ -288,7 +280,7 @@ bool PhysValTau::matchTrueAndRecoTau(const xAOD::TauJetContainer *&taus, const x double recM = recTau->mIntermediateAxis(); TLorentzVector hlv_recTau; hlv_recTau.SetPtEtaPhiM(recPt, recEta, recPhi, recM); - + double curDeltaR = visSum.DeltaR(hlv_recTau); if (curDeltaR < minDeltaR) { minDeltaR = curDeltaR; @@ -300,10 +292,10 @@ bool PhysValTau::matchTrueAndRecoTau(const xAOD::TauJetContainer *&taus, const x } if(matched){ - const xAOD::TauJet *recTau = taus->at(iMatchedRecTau); - m_oTauValidationPlots->m_oMigrationPlots.fill(*recTau,nCharged,nNeutral); //Migration - m_matched_itr.push_back(iMatchedRecTau); - // std::cout<<"Number of matched between: "<<m_matched_itr.size()<<std::endl; + const xAOD::TauJet *recTau = taus->at(iMatchedRecTau); + m_oTauValidationPlots->m_oMigrationPlots.fill(*recTau,nCharged,nNeutral); //Migration + m_matched_itr.push_back(iMatchedRecTau); + // std::cout<<"Number of matched between: "<<m_matched_itr.size()<<std::endl; } return matched; diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h index 6c20f83560d8602ac07adbefe455c5cf62a05391..1ff5648c0c729028eac58492b1642f95acb6efc9 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h @@ -24,6 +24,9 @@ class EVetoPlots: public PlotBase { TH1* m_pt_eleBDTloose; TH1* m_pt_eleBDTmed; TH1* m_pt_eleBDTtight; + TH1* m_pt_eleBDTlooseHighPt; + TH1* m_pt_eleBDTmedHighPt; + TH1* m_pt_eleBDTtightHighPt; private: void initializePlots(); diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h index c5e4f3673c174ebe432ea9e3c0af3f866a5af686..ade7ba15a6ac5b131d3ba1f3ff05204b8f11885d 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h @@ -21,6 +21,9 @@ class EfficiencyPtPlots: public PlotBase { TProfile* m_eff_pt_jetBDTloose; TProfile* m_eff_pt_jetBDTmed; TProfile* m_eff_pt_jetBDTtight; + TProfile* m_eff_pt_jetBDTlooseHighPt; + TProfile* m_eff_pt_jetBDTmedHighPt; + TProfile* m_eff_pt_jetBDTtightHighPt; TProfile* m_eff_jetBDTloose; TProfile* m_eff_jetBDTmed; diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h index 151ced0f00b5cf43395c60f73ec086382cf0e475..3dd320031eb119b15f1db545743151c2f4c1906d 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h @@ -13,24 +13,27 @@ namespace Tau{ class GeneralTauPlots: public PlotBase { - public: - GeneralTauPlots(PlotBase *pParent, std::string sDir, std::string sTauJetContainerName); - virtual ~GeneralTauPlots(); - - void fill(const xAOD::TauJet& tau); - - Tau::ParamPlots m_oParamPlots; - TH1* m_tauCharge; - TH1* m_tauNCoreTracks; - TH1* m_tauNWideTracks; - TH1* m_id_BDTJetScore; - TH1* m_pt_jetBDTloose; - TH1* m_pt_jetBDTmed; - TH1* m_pt_jetBDTtight; - - private: - void initializePlots(); - std::string m_sTauJetContainerName; + public: + GeneralTauPlots(PlotBase *pParent, std::string sDir, std::string sTauJetContainerName); + virtual ~GeneralTauPlots(); + + void fill(const xAOD::TauJet& tau); + + Tau::ParamPlots m_oParamPlots; + TH1* m_tauCharge; + TH1* m_tauNCoreTracks; + TH1* m_tauNWideTracks; + TH1* m_id_BDTJetScore; + TH1* m_pt_jetBDTloose; + TH1* m_pt_jetBDTmed; + TH1* m_pt_jetBDTtight; + TH1* m_pt_jetBDTlooseHighPt; + TH1* m_pt_jetBDTmedHighPt; + TH1* m_pt_jetBDTtightHighPt; + + private: + void initializePlots(); + std::string m_sTauJetContainerName; }; } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h index d43b568f477a91d618c3379a8dd8d542c344a4a4..ed51f467c757556acf2f37d2b078ee08a3a09f8a 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h @@ -57,39 +57,14 @@ namespace Tau{ "t1r3", "t3r1" }; - /* - "t10r10", - "t10r11", - "t10r1x", - "t10r30", - "t10r3x", - "t11r10", - "t11r11", - "t11r1x", - "t11r30", - "t11r3x", - "t1xr10", - "t1xr11", - "t1xr1x", - "t1xr30", - "t1xr3x", - "t30r10", - "t30r11", - "t30r1x", - "t30r30", - "t30r3x", - "t3xr10", - "t3xr11", - "t3xr1x", - "t3xr30", - "t3xr3x"*/ - TH1* m_migration_tauRec; - TH1* m_migration_eflow; + TH1* m_migration_panTau; + TH1* m_migration_panTauProto; TH1* m_migration_cellBased; private: void initializePlots(); std::string m_sTauJetContainerName; + void decayModeFill(int trueMode, int recP, int recN,TH1 *histo); void decayModeFill(int trueP,int trueN,int recP, int recN,TH1 *histo); }; diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h index fe4019f2316065016f990bb16e940bbf3357f2cd..11627c1380bf0a0217c75c7905e1b2ae50f4dcad 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h @@ -11,20 +11,21 @@ namespace Tau{ class ParamPlots:public PlotBase { - public: - ParamPlots(PlotBase *pParent, std::string sDir, std::string sParticleType); - void fill(const xAOD::IParticle& prt); - - TH1* eta; - TH1* phi; - TH1* pt; - - TH1* eta_phi; - TH1* eta_pt; - - private: - void initializePlots(); - std::string m_sParticleType; + public: + ParamPlots(PlotBase *pParent, std::string sDir, std::string sParticleType); + ~ParamPlots(); + void fill(const xAOD::IParticle& prt); + + TH1* eta; + TH1* phi; + TH1* pt; + + TH1* eta_phi; + TH1* eta_pt; + + private: + void initializePlots(); + std::string m_sParticleType; }; } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h index 758ad287fde4dfecb72feb22554c87cef8709ff5..cc053e394770730cf193deb48dda6d262ff927c4 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h @@ -22,18 +22,6 @@ class RecoTauPlots: public PlotBase { Tau::ParamPlots m_oParamPlots; - //Here I try to include eflowRec substructure variables, from the Particle FLow Object (PFO), begining with basic charged and neutral PFO 4-vector. - TH1* m_eflowRec_charPFO_Pt; - TH1* m_eflowRec_charPFO_Eta; - TH1* m_eflowRec_charPFO_Phi; - TH1* m_eflowRec_charPFO_E; - - TH1* m_eflowRec_neuPFO_Pt; - TH1* m_eflowRec_neuPFO_Eta; - TH1* m_eflowRec_neuPFO_Phi; - TH1* m_eflowRec_neuPFO_E; - TH1* m_eflowRec_neuPFO_bdtPi0Score; - //Here I try to include CellBased substructure variables, from the Particle FLow Object (PFO), begining with basic charged and neutral PFO 4-vector. TH1* m_cellBased_charPFO_Pt; TH1* m_cellBased_charPFO_Eta; @@ -63,22 +51,6 @@ class RecoTauPlots: public PlotBase { TH1* m_pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed; TH1* m_pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged; - TH1* m_pantau_eflowRecInput_isPanTauCandidate; - TH1* m_pantau_eflowRecInput_DecayMode; - TH1* m_pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n; - TH1* m_pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn; - TH1* m_pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn; - TH1* m_pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts; - TH1* m_pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts; - TH1* m_pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts; - TH1* m_pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM; - TH1* m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1; - TH1* m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2; - TH1* m_pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts; - TH1* m_pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts; - TH1* m_pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged; - - // BDT output TH1* m_id_BDTJetScore; diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx index 67392e0bc310759f1db159c19c0c4e6c82170b94..deb71166dae027c0c835786b2a8d685c50f2e611 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx @@ -16,6 +16,9 @@ EVetoPlots::EVetoPlots(PlotBase* pParent, std::string sDir, std::string sTauJetC m_pt_eleBDTloose(nullptr), m_pt_eleBDTmed(nullptr), m_pt_eleBDTtight(nullptr), + m_pt_eleBDTlooseHighPt(nullptr), + m_pt_eleBDTmedHighPt(nullptr), + m_pt_eleBDTtightHighPt(nullptr), m_sTauJetContainerName(sTauJetContainerName) { } @@ -33,9 +36,12 @@ void EVetoPlots::initializePlots(){ m_CentFrac = Book1D("CentFrac",m_sTauJetContainerName + " Cent Frac; Cent Frac; # Part",20,0,1.); m_id_BDTEleScore = Book1D("id_BDTEleScore",m_sTauJetContainerName + " BDTEleScore ; BDTEleScore; # Tau",10,0.,1.05); - m_pt_eleBDTloose = Book1D("Pt_eleBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_eleBDTmed = Book1D("Pt_eleBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_eleBDTtight = Book1D("Pt_eleBDTtight",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_pt_eleBDTloose = Book1D("Pt_eleBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,150.); + m_pt_eleBDTmed = Book1D("Pt_eleBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,150.); + m_pt_eleBDTtight = Book1D("Pt_eleBDTtight",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,150.); + m_pt_eleBDTlooseHighPt = Book1D("Pt_eleBDTlooseHighPt",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,1500.); + m_pt_eleBDTmedHighPt = Book1D("Pt_eleBDTmedHighPt",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,1500.); + m_pt_eleBDTtightHighPt = Book1D("Pt_eleBDTtightHighPt",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,1500.); } @@ -59,9 +65,18 @@ void EVetoPlots::fill(const xAOD::TauJet& tau) { if (test) m_CentFrac->Fill(avariable,1.); if(tau.hasDiscriminant(xAOD::TauJetParameters::BDTEleScore) )m_id_BDTEleScore->Fill(tau.discriminant(xAOD::TauJetParameters::BDTEleScore)); - if(tau.isTau(xAOD::TauJetParameters::EleBDTLoose)) m_pt_eleBDTloose->Fill( tau.pt()/1000,1); - if(tau.isTau(xAOD::TauJetParameters::EleBDTMedium)) m_pt_eleBDTmed ->Fill( tau.pt()/1000,1); - if(tau.isTau(xAOD::TauJetParameters::EleBDTTight)) m_pt_eleBDTtight->Fill( tau.pt()/1000,1); + if ( tau.isTau(xAOD::TauJetParameters::EleBDTLoose) ) { + m_pt_eleBDTloose ->Fill(tau.pt()/1000.0, 1.0); + m_pt_eleBDTlooseHighPt->Fill(tau.pt()/1000.0, 1.0); + } + if ( tau.isTau(xAOD::TauJetParameters::EleBDTMedium) ) { + m_pt_eleBDTmed ->Fill(tau.pt()/1000.0, 1.0); + m_pt_eleBDTmedHighPt->Fill(tau.pt()/1000.0, 1.0); + } + if ( tau.isTau(xAOD::TauJetParameters::EleBDTTight) ) { + m_pt_eleBDTtight ->Fill(tau.pt()/1000.0, 1.0); + m_pt_eleBDTtightHighPt->Fill(tau.pt()/1000.0, 1.0); + } } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx index 9aa1ecbcdc8ef2c2cf66bc2ab803012d29ca4b72..b48cb72af1ff4bc61b5e44c131beccaadb4a9a96 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx @@ -22,45 +22,53 @@ EfficiencyPtPlots::~EfficiencyPtPlots() { } -void EfficiencyPtPlots::initializePlots(){ - - m_eff_pt_jetBDTloose = BookTProfile("Eff_Pt_jetBDTloose"," Matched Tau loose eff in pt; pt; eff",15,0.,300.); - m_eff_pt_jetBDTmed = BookTProfile("Eff_Pt_jetBDTmed","Matched Tau med eff in pt; pt; eff",15,0.,300.); - m_eff_pt_jetBDTtight = BookTProfile("Eff_Pt_jetBDTtight","Matched Tau tight eff in pt; pt; eff",15,0.,300.); - - m_eff_jetBDTloose = BookTProfile("Eff_jetBDTloose"," Matched Tau loose eff total; bin; eff",3,-1.5,1.5); - m_eff_jetBDTmed = BookTProfile("Eff_jetBDTmed","Matched Tau med eff total; bin; eff",3,-1.5,1.5); - m_eff_jetBDTtight = BookTProfile("Eff_jetBDTtight","Matched Tau tight eff total; bin; eff",3,-1.5,1.5); - - +void EfficiencyPtPlots::initializePlots() +{ + m_eff_pt_jetBDTloose = BookTProfile("Eff_Pt_jetBDTloose"," Matched Tau loose eff in pt; pt; eff", 20, 0., 150.0); + m_eff_pt_jetBDTmed = BookTProfile("Eff_Pt_jetBDTmed","Matched Tau med eff in pt; pt; eff", 20, 0.0, 150.0); + m_eff_pt_jetBDTtight = BookTProfile("Eff_Pt_jetBDTtight","Matched Tau tight eff in pt; pt; eff", 20, 0.0, 150.0); + m_eff_pt_jetBDTlooseHighPt = BookTProfile("Eff_Pt_jetBDTlooseHightPt"," Matched Tau loose eff in pt; pt; eff", 20, 0.0, 1500.0); + m_eff_pt_jetBDTmedHighPt = BookTProfile("Eff_Pt_jetBDTmedHightPt","Matched Tau med eff in pt; pt; eff", 20, 0.0, 1500.0); + m_eff_pt_jetBDTtightHighPt = BookTProfile("Eff_Pt_jetBDTtightHightPt","Matched Tau tight eff in pt; pt; eff", 20, 0.0, 1500.0); + m_eff_jetBDTloose = BookTProfile("Eff_jetBDTloose"," Matched Tau loose eff total; bin; eff",3,-1.5,1.5); + m_eff_jetBDTmed = BookTProfile("Eff_jetBDTmed","Matched Tau med eff total; bin; eff",3,-1.5,1.5); + m_eff_jetBDTtight = BookTProfile("Eff_jetBDTtight","Matched Tau tight eff total; bin; eff",3,-1.5,1.5); } -void EfficiencyPtPlots::fill(const xAOD::TauJet& tau) { - if(tau.isTau(xAOD::TauJetParameters::JetBDTSigLoose)){ - m_eff_pt_jetBDTloose->Fill( tau.pt()/1000,1,1); - m_eff_jetBDTloose->Fill( 0.,1.,1.); - } - else{ - m_eff_pt_jetBDTloose->Fill( tau.pt()/1000,0,1); - m_eff_jetBDTloose->Fill( 0.,0.,1.); - } +void EfficiencyPtPlots::fill(const xAOD::TauJet& tau) +{ + if ( tau.isTau(xAOD::TauJetParameters::JetBDTSigLoose) ) { + m_eff_pt_jetBDTloose ->Fill(tau.pt()/1000, 1.0, 1.0); + m_eff_pt_jetBDTlooseHighPt->Fill(tau.pt()/1000, 1.0, 1.0); + m_eff_jetBDTloose ->Fill(0.0, 1.0, 1.0); + } + else { + m_eff_pt_jetBDTloose ->Fill(tau.pt()/1000, 0.0, 1.0); + m_eff_pt_jetBDTlooseHighPt->Fill(tau.pt()/1000, 0.0, 1.0); + m_eff_jetBDTloose ->Fill(0.0, 0.0, 1.0); + } + + if ( tau.isTau(xAOD::TauJetParameters::JetBDTSigMedium) ) { + m_eff_pt_jetBDTmed ->Fill(tau.pt()/1000, 1.0, 1.0); + m_eff_pt_jetBDTmedHighPt->Fill(tau.pt()/1000, 1.0, 1.0); + m_eff_jetBDTmed ->Fill(0.0, 1.0, 1.0); + } + else { + m_eff_pt_jetBDTmed ->Fill(tau.pt()/1000, 0.0, 1.0); + m_eff_pt_jetBDTmedHighPt->Fill(tau.pt()/1000, 0.0, 1.0); + m_eff_jetBDTmed ->Fill(0.0, 0.0, 1.0); + } - if(tau.isTau(xAOD::TauJetParameters::JetBDTSigMedium)){ - m_eff_pt_jetBDTmed ->Fill( tau.pt()/1000,1,1); - m_eff_jetBDTmed ->Fill( 0.,1.,1.); - } - else{ - m_eff_pt_jetBDTmed ->Fill( tau.pt()/1000,0,1); - m_eff_jetBDTmed ->Fill( 0.,0.,1.); - } - if(tau.isTau(xAOD::TauJetParameters::JetBDTSigTight)){ - m_eff_pt_jetBDTtight->Fill( tau.pt()/1000,1,1); - m_eff_jetBDTtight->Fill( 0.,1.,1.); - } - else{ - m_eff_pt_jetBDTtight->Fill( tau.pt()/1000,0,1); - m_eff_jetBDTtight->Fill( 0.,0.,1.); - } + if ( tau.isTau(xAOD::TauJetParameters::JetBDTSigTight) ) { + m_eff_pt_jetBDTtight ->Fill(tau.pt()/1000, 1.0, 1.0); + m_eff_pt_jetBDTtightHighPt->Fill(tau.pt()/1000, 1.0, 1.0); + m_eff_jetBDTtight ->Fill(0.0, 1.0, 1.0); + } + else { + m_eff_pt_jetBDTtight ->Fill(tau.pt()/1000, 0.0, 1.0); + m_eff_pt_jetBDTtightHighPt->Fill(tau.pt()/1000, 0.0, 1.0); + m_eff_jetBDTtight ->Fill(0.0, 0.0, 1.0); + } } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx index 98ecb3514154b2640dfa56b6d42990f59f187ec2..5fa54b51875e323cecd880b3aac56448e65281e8 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx @@ -17,6 +17,9 @@ GeneralTauPlots::GeneralTauPlots(PlotBase* pParent, std::string sDir, std::strin m_pt_jetBDTloose(nullptr), m_pt_jetBDTmed(nullptr), m_pt_jetBDTtight(nullptr), + m_pt_jetBDTlooseHighPt(nullptr), + m_pt_jetBDTmedHighPt(nullptr), + m_pt_jetBDTtightHighPt(nullptr), m_sTauJetContainerName(sTauJetContainerName) { } @@ -26,17 +29,18 @@ GeneralTauPlots::~GeneralTauPlots() } void GeneralTauPlots::initializePlots(){ - - // m_oParamPlots.initialize(); - m_tauCharge = Book1D("Charge",m_sTauJetContainerName + " Tau charge; charge; # Taus",7,-3.,4.); - m_tauNCoreTracks = Book1D("NCoreTracks",m_sTauJetContainerName + " Tau n core tracks; nCore; # Taus",10,0.,10.); - m_tauNWideTracks = Book1D("NWideTracks",m_sTauJetContainerName + " Tau n wide tracks; nWide; # Taus",10,0.,10.); - m_id_BDTJetScore = Book1D("id_BDTJetScore",m_sTauJetContainerName + " BDTJetScore ; BDTJetScore; # Tau",10,1.01,1.01); - m_pt_jetBDTloose = Book1D("Pt_jetBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_jetBDTmed = Book1D("Pt_jetBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_jetBDTtight = Book1D("Pt_jetBDTtigth",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - - + // m_oParamPlots.initialize(); + m_tauCharge = Book1D("Charge",m_sTauJetContainerName + " Tau charge; charge; # Taus",7,-3.,4.); + m_tauNCoreTracks = Book1D("NCoreTracks",m_sTauJetContainerName + " Tau n core tracks; nCore; # Taus",10,0.,10.); + m_tauNWideTracks = Book1D("NWideTracks",m_sTauJetContainerName + " Tau n wide tracks; nWide; # Taus",10,0.,10.); + m_id_BDTJetScore = Book1D("id_BDTJetScore",m_sTauJetContainerName + " BDTJetScore ; BDTJetScore; # Tau",10,1.01,1.01); + + m_pt_jetBDTloose = Book1D("Pt_jetBDTloose",m_sTauJetContainerName + " Loose tau pt; pt; # Taus",20, 0.0, 150.0); + m_pt_jetBDTmed = Book1D("Pt_jetBDTmed",m_sTauJetContainerName + " Medium tau pt; pt; # Taus",20, 0.0, 150.0); + m_pt_jetBDTtight = Book1D("Pt_jetBDTtigth",m_sTauJetContainerName + " Tight tau pt; pt; # Taus",20, 0.0, 150.0); + m_pt_jetBDTlooseHighPt = Book1D("Pt_jetBDTlooseHighPt",m_sTauJetContainerName + " Loose tau pt; pt; # Taus", 20, 0.0, 1500.0); + m_pt_jetBDTmedHighPt = Book1D("Pt_jetBDTmedHighPt",m_sTauJetContainerName + " Medium tau pt; pt; # Taus", 20, 0.0, 1500.0); + m_pt_jetBDTtightHighPt = Book1D("Pt_jetBDTtigthHighPt",m_sTauJetContainerName + " Tight tau pt; pt; # Taus", 20, 0.0, 1500.0); } void GeneralTauPlots::fill(const xAOD::TauJet& tau) { @@ -46,9 +50,18 @@ void GeneralTauPlots::fill(const xAOD::TauJet& tau) { // m_tauNWideTracks->Fill(tau.nWideTracks(), 1.); m_tauNWideTracks->Fill(tau.nTracks(xAOD::TauJetParameters::classifiedIsolation), 1.); // if( tau.hasDiscriminant(xAOD::TauJetParameters::BDTJetScore) )m_id_BDTJetScore->Fill(tau.discriminant(xAOD::TauJetParameters::BDTJetScore)); - if(tau.isTau(xAOD::TauJetParameters::JetBDTSigLoose)) m_pt_jetBDTloose->Fill( tau.pt()/1000,1); - if(tau.isTau(xAOD::TauJetParameters::JetBDTSigMedium)) m_pt_jetBDTmed ->Fill( tau.pt()/1000,1); - if(tau.isTau(xAOD::TauJetParameters::JetBDTSigTight)) m_pt_jetBDTtight->Fill( tau.pt()/1000,1); + if ( tau.isTau(xAOD::TauJetParameters::JetBDTSigLoose) ) { + m_pt_jetBDTloose -> Fill(tau.pt()/1000, 1.0); + m_pt_jetBDTlooseHighPt -> Fill(tau.pt()/1000, 1.0); + } + if ( tau.isTau(xAOD::TauJetParameters::JetBDTSigMedium) ) { + m_pt_jetBDTmed -> Fill(tau.pt()/1000, 1.0); + m_pt_jetBDTmedHighPt -> Fill(tau.pt()/1000, 1.0); + } + if ( tau.isTau(xAOD::TauJetParameters::JetBDTSigTight) ) { + m_pt_jetBDTtight -> Fill(tau.pt()/1000, 1.0); + m_pt_jetBDTtightHighPt -> Fill(tau.pt()/1000, 1.0); + } } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx index 771ed5820c1628ea86a6a1e6530e285526631760..09d2198cf1df95c46b217f7c0ad4db93e9c482c1 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx @@ -6,7 +6,8 @@ namespace Tau{ -Had1ProngPlots::Had1ProngPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): +Had1ProngPlots::Had1ProngPlots(PlotBase* pParent, std::string sDir, + std::string sTauJetContainerName): PlotBase(pParent, sDir), m_oGeneralTauPlots(this, "", sTauJetContainerName), m_tauNWideTracks(nullptr), @@ -36,27 +37,27 @@ Had1ProngPlots::~Had1ProngPlots() void Had1ProngPlots::initializePlots(){ - // m_oGeneralTauPlots.initialize(); - m_tauCoreFrac = Book1D("CoreFrac",m_sTauJetContainerName + " Tau CoreFrac; CoreFrac; # Taus",40,0.,2.); - m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.); - m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8); - m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.); - - m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5); - m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.); - m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",50,-1.,10.); - m_SumPtTrkFrac = Book1D("SumPtTrkFrac",m_sTauJetContainerName + " Tau Sum PtTrk Frac ; SumPtTrkFrac; # Taus",100,-10.,20.); - - m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8); - m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10); - m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0,300); - - m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15); - m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20); - - m_HadRadius = Book1D("HadRadius",m_sTauJetContainerName + " Had Radius; HadRadius; # Part",20,0,2.); - m_EMRadius = Book1D("EMRadius",m_sTauJetContainerName + " EM Radius; EMRadius; # Part",20,0,2.); - m_IsoFrac = Book1D("IsoFrac",m_sTauJetContainerName + " Iso Frac; Iso Frac; # Part",20,0,1.); + // m_oGeneralTauPlots.initialize(); + m_tauCoreFrac = Book1D("CoreFrac",m_sTauJetContainerName + " Tau CoreFrac; CoreFrac; # Taus",40,0.,2.); + m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.); + m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8); + m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.); + + m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5); + m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.); + m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",50,-1.,10.); + m_SumPtTrkFrac = Book1D("SumPtTrkFrac",m_sTauJetContainerName + " Tau Sum PtTrk Frac ; SumPtTrkFrac; # Taus",100,-10.,20.); + + m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8); + m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10); + m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0); + + m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15); + m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20); + + m_HadRadius = Book1D("HadRadius",m_sTauJetContainerName + " Had Radius; HadRadius; # Part",20,0,2.); + m_EMRadius = Book1D("EMRadius",m_sTauJetContainerName + " EM Radius; EMRadius; # Part",20,0,2.); + m_IsoFrac = Book1D("IsoFrac",m_sTauJetContainerName + " Iso Frac; Iso Frac; # Part",20,0,1.); } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx index 86e2db83fc65444b600fb502bcd54801618c397e..bccd482e37ee4f8647404efa893c2a18fcc54ad6 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx @@ -42,7 +42,7 @@ void Had3ProngPlots::initializePlots(){ m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus", 10,-0.2,.8); m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10); - m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0,300); + m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0); m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15); m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20); diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx index 1955adc11a2e4e25359bfef59cd1f7b82a82a338..17032bda135321cbf02e8900c3576efd070399dc 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx @@ -8,8 +8,8 @@ namespace Tau{ Migration::Migration(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): PlotBase(pParent, sDir), - m_migration_tauRec(nullptr), - m_migration_eflow(nullptr), + m_migration_panTau(nullptr), + m_migration_panTauProto(nullptr), m_migration_cellBased(nullptr), m_sTauJetContainerName(sTauJetContainerName) { @@ -19,94 +19,141 @@ Migration::~Migration() { } - void Migration::initializePlots(){ - m_migration_tauRec = Book1D("tauRec_migration",m_sTauJetContainerName + " TauRec migration",DECAYSIZE,0,DECAYSIZE); - m_migration_eflow = Book1D("eflow_migration",m_sTauJetContainerName + " eflow migration",DECAYSIZE,0,DECAYSIZE); - m_migration_cellBased = Book1D("cellBased_migration",m_sTauJetContainerName + " cellBased migration",DECAYSIZE,0,DECAYSIZE); - for(int i=1; i<= DECAYSIZE;i++){ - m_migration_tauRec->GetXaxis()->SetBinLabel(i,m_lable[i-1]); - m_migration_eflow->GetXaxis()->SetBinLabel(i,m_lable[i-1]); - m_migration_cellBased->GetXaxis()->SetBinLabel(i,m_lable[i-1]); - } - } - - void Migration::fill(const xAOD::TauJet& thisTau,int nProng, int nNeu) { - //RecTau - - - - - /*+++++++++++++++++++++++++++++++++++++++++++++++++ - +++++++++++++++++++EFLOW_REC+++++++++++++++++++++ - +++++++++++++++++++++++++++++++++++++++++++++++++*/ - - //Charged Pions - // FIXME!!! taujet v2 does no longer have eflowrec pfos - // std::vector< ElementLink< xAOD::PFOContainer > > eflowRec_chargedPFO = thisTau.eflowRec_Charged_PFOLinks(); - // int efP = eflowRec_chargedPFO.size(); - // //Neutral Pions - // std::vector< ElementLink< xAOD::PFOContainer > > eflowRec_neutralPFO = thisTau.eflowRec_Pi0_PFOLinks(); - // int efN = eflowRec_neutralPFO.size(); - // decayModeFill(nProng,nNeu,efP,efN,m_migration_eflow); - /*+++++++++++++++++++++++++++++++++++++++++++++++++ - +++++++++++++++++++CellBased+++++++++++++++++++++ - +++++++++++++++++++++++++++++++++++++++++++++++++*/ - - //Charged Pions - std::vector< ElementLink< xAOD::PFOContainer > > cellBased_chargedPFO = thisTau.protoChargedPFOLinks(); - int cellP = cellBased_chargedPFO.size(); +void Migration::initializePlots() +{ + m_migration_panTau = Book1D("panTau_migration",m_sTauJetContainerName + " panTau migration",DECAYSIZE,0,DECAYSIZE); + m_migration_panTauProto = Book1D("panTauProto_migration",m_sTauJetContainerName + " panTau proto migration",DECAYSIZE,0,DECAYSIZE); + m_migration_cellBased = Book1D("cellBased_migration",m_sTauJetContainerName + " cellBased migration",DECAYSIZE,0,DECAYSIZE); + m_migration_panTau->GetXaxis()->SetLabelSize(0.05); + m_migration_panTauProto->GetXaxis()->SetLabelSize(0.05); + m_migration_cellBased->GetXaxis()->SetLabelSize(0.05); + for(int i=1; i<= DECAYSIZE;i++){ + m_migration_panTauProto->GetXaxis()->SetBinLabel(i,m_lable[i-1]); + m_migration_panTau->GetXaxis()->SetBinLabel(i,m_lable[i-1]); + m_migration_cellBased->GetXaxis()->SetBinLabel(i,m_lable[i-1]); + } +} + +void Migration::fill(const xAOD::TauJet& thisTau,int nProng, int nNeu) { + // panTau + int isPanTauCandidate = 0; + bool foundDetail = thisTau.panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate); + if ( !foundDetail || !isPanTauCandidate ) return; + + int decayMode = xAOD::TauJetParameters::DecayMode::Mode_Error; + foundDetail = thisTau.panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, decayMode); + if ( foundDetail ) decayModeFill(decayMode, nProng, nNeu, m_migration_panTau); + + decayMode = xAOD::TauJetParameters::DecayMode::Mode_Error; + foundDetail = thisTau.panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayModeProto, decayMode); + if ( foundDetail ) decayModeFill(decayMode, nProng, nNeu, m_migration_panTauProto); + + +//RecTau + - //Neutral Pions - int nPi0_tau = 0; - std::vector< ElementLink< xAOD::PFOContainer > > cellBased_neutralPFO = thisTau.protoNeutralPFOLinks(); - std::vector< ElementLink< xAOD::PFOContainer > >::iterator first_cellBased_neutralPFO = cellBased_neutralPFO.begin(); - std::vector< ElementLink< xAOD::PFOContainer > >::iterator last_cellBased_neutralPFO = cellBased_neutralPFO.end(); - for (; first_cellBased_neutralPFO != last_cellBased_neutralPFO; ++first_cellBased_neutralPFO){ - ElementLink<xAOD::PFOContainer> thisLink = *first_cellBased_neutralPFO; - const xAOD::PFO* thisPFO = *thisLink; - int myNPi0Proto = 0; - if(thisPFO->attribute(xAOD::PFODetails::nPi0Proto, myNPi0Proto)) nPi0_tau+=myNPi0Proto; - - } - decayModeFill(nProng,nNeu,cellP,nPi0_tau,m_migration_cellBased); - - - - /*+++++++++++++++++++++++++++++++++++++++++++++++++ - +++++++++++++++++++Pantau+++++++++++++++++++++ - +++++++++++++++++++++++++++++++++++++++++++++++++*/ + + + /*+++++++++++++++++++++++++++++++++++++++++++++++++ + +++++++++++++++++++CellBased+++++++++++++++++++++ + +++++++++++++++++++++++++++++++++++++++++++++++++*/ + + + //Charged Pions + std::vector< ElementLink< xAOD::PFOContainer > > cellBased_chargedPFO = thisTau.protoChargedPFOLinks(); + int cellP = cellBased_chargedPFO.size(); - } - void Migration::decayModeFill(int trueP,int trueN,int recP, int recN,TH1 *histo){ - if(recP == 1 && recN== 0){ - if(trueP == 1 && trueN== 0) histo->Fill(t10r10 + 0.5); - if(trueP == 1 && trueN== 1) histo->Fill(t11r10 + 0.5); - if(trueP == 1 && trueN > 1) histo->Fill(t1xr10 + 0.5); - if(trueP == 3) histo->Fill(t3r1 + 0.5); - } - if(recP == 1 && recN== 1){ - if(trueP == 1 && trueN== 0) histo->Fill(t10r11 + 0.5); - if(trueP == 1 && trueN== 1) histo->Fill(t11r11 + 0.5); - if(trueP == 1 && trueN > 1) histo->Fill(t1xr11 + 0.5); - if(trueP == 3 ) histo->Fill(t3r1 + 0.5); - } - if(recP == 1 && recN > 1){ - if(trueP == 1 && trueN== 0) histo->Fill(t10r1x + 0.5); - if(trueP == 1 && trueN== 1) histo->Fill(t11r1x + 0.5); - if(trueP == 1 && trueN > 1) histo->Fill(t1xr1x + 0.5); - if(trueP == 3 ) histo->Fill(t3r1 + 0.5); - } - if(recP == 3 && recN== 0){ - if(trueP == 1 ) histo->Fill(t1r3 + 0.5); - if(trueP == 3 && trueN== 0) histo->Fill(t30r30 + 0.5); - if(trueP == 3 && trueN>= 1) histo->Fill(t3xr30 + 0.5); - } - if(recP == 3 && recN>= 1){ - if(trueP == 1 ) histo->Fill(t1r3 + 0.5); - if(trueP == 3 && trueN== 0) histo->Fill(t30r3x + 0.5); - if(trueP == 3 && trueN>= 1) histo->Fill(t3xr3x + 0.5); - } - return; - } + + //Neutral Pions + int nPi0_tau = 0; + std::vector< ElementLink< xAOD::PFOContainer > > cellBased_neutralPFO = thisTau.protoNeutralPFOLinks(); + std::vector< ElementLink< xAOD::PFOContainer > >::iterator first_cellBased_neutralPFO = cellBased_neutralPFO.begin(); + std::vector< ElementLink< xAOD::PFOContainer > >::iterator last_cellBased_neutralPFO = cellBased_neutralPFO.end(); + for (; first_cellBased_neutralPFO != last_cellBased_neutralPFO; ++first_cellBased_neutralPFO){ + ElementLink<xAOD::PFOContainer> thisLink = *first_cellBased_neutralPFO; + const xAOD::PFO* thisPFO = *thisLink; + int myNPi0Proto = 0; + if(thisPFO->attribute(xAOD::PFODetails::nPi0Proto, myNPi0Proto)) nPi0_tau+=myNPi0Proto; + + } + decayModeFill(nProng,nNeu,cellP,nPi0_tau,m_migration_cellBased); + + + + /*+++++++++++++++++++++++++++++++++++++++++++++++++ + +++++++++++++++++++Pantau+++++++++++++++++++++ + +++++++++++++++++++++++++++++++++++++++++++++++++*/ + +} + + +void Migration::decayModeFill(int trueMode, int recP, int recN,TH1 *histo) +{ + switch (trueMode) { + case xAOD::TauJetParameters::DecayMode::Mode_1p0n: + if ( recP == 1 && recN == 0 ) histo->Fill(t10r10 + 0.5); + else if ( recP == 1 && recN == 1 ) histo->Fill(t10r11 + 0.5); + else if ( recP == 1 && recN > 1 ) histo->Fill(t10r1x + 0.5); + else if ( recP == 3 ) histo->Fill(t1r3 + 0.5); + break; + case xAOD::TauJetParameters::DecayMode::Mode_1p1n: + if ( recP == 1 && recN == 0 ) histo->Fill(t11r10 + 0.5); + else if ( recP == 1 && recN == 1 ) histo->Fill(t11r11 + 0.5); + else if ( recP == 1 && recN > 1 ) histo->Fill(t11r1x + 0.5); + else if ( recP == 3 ) histo->Fill(t1r3 + 0.5); + break; + case xAOD::TauJetParameters::DecayMode::Mode_1pXn: + if ( recP == 1 && recN == 0 ) histo->Fill(t1xr10 + 0.5); + else if ( recP == 1 && recN == 1 ) histo->Fill(t1xr11 + 0.5); + else if ( recP == 1 && recN > 1 ) histo->Fill(t1xr1x + 0.5); + else if ( recP == 3 ) histo->Fill(t1r3 + 0.5); + break; + case xAOD::TauJetParameters::DecayMode::Mode_3p0n: + if ( recP == 3 && recN == 0 ) histo->Fill(t30r30 + 0.5); + else if ( recP == 3 && recN >= 1 ) histo->Fill(t30r3x + 0.5); + else if ( recP == 1 ) histo->Fill(t3r1 + 0.5); + break; + case xAOD::TauJetParameters::DecayMode::Mode_3pXn: + if ( recP == 3 && recN == 0 ) histo->Fill(t3xr30 + 0.5); + else if ( recP == 3 && recN >= 1 ) histo->Fill(t3xr3x + 0.5); + else if ( recP == 1 ) histo->Fill(t3r1 + 0.5); + break; + } + return; +} + + +void Migration::decayModeFill(int trueP,int trueN,int recP, int recN,TH1 *histo){ + if(recP == 1 && recN== 0){ + if(trueP == 1 && trueN== 0) histo->Fill(t10r10 + 0.5); + if(trueP == 1 && trueN== 1) histo->Fill(t11r10 + 0.5); + if(trueP == 1 && trueN > 1) histo->Fill(t1xr10 + 0.5); + if(trueP == 3) histo->Fill(t3r1 + 0.5); + } + if(recP == 1 && recN== 1){ + if(trueP == 1 && trueN== 0) histo->Fill(t10r11 + 0.5); + if(trueP == 1 && trueN== 1) histo->Fill(t11r11 + 0.5); + if(trueP == 1 && trueN > 1) histo->Fill(t1xr11 + 0.5); + if(trueP == 3 ) histo->Fill(t3r1 + 0.5); + } + if(recP == 1 && recN > 1){ + if(trueP == 1 && trueN== 0) histo->Fill(t10r1x + 0.5); + if(trueP == 1 && trueN== 1) histo->Fill(t11r1x + 0.5); + if(trueP == 1 && trueN > 1) histo->Fill(t1xr1x + 0.5); + if(trueP == 3 ) histo->Fill(t3r1 + 0.5); + } + if(recP == 3 && recN== 0){ + if(trueP == 1 ) histo->Fill(t1r3 + 0.5); + if(trueP == 3 && trueN== 0) histo->Fill(t30r30 + 0.5); + if(trueP == 3 && trueN>= 1) histo->Fill(t3xr30 + 0.5); + } + if(recP == 3 && recN>= 1){ + if(trueP == 1 ) histo->Fill(t1r3 + 0.5); + if(trueP == 3 && trueN== 0) histo->Fill(t30r3x + 0.5); + if(trueP == 3 && trueN>= 1) histo->Fill(t3xr3x + 0.5); + } + return; +} + } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx index 9cc2c23861e66c7012e0c7322370dae907b4c64d..2f99d3d22a00dbdca4d76e3961086d5110c89be6 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx @@ -79,7 +79,7 @@ void NewCorePlots::initializePlots(){ m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8); m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10); - m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0,300); + m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0); } void NewCorePlots::fill(const xAOD::TauJet& tau) { diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/ParamPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/ParamPlots.cxx index aa60d52e2618d11a1f09934810513b85e07f5597..5e7b3bc1e4e00c44c41552f0701f8262a5d94d60 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/ParamPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/ParamPlots.cxx @@ -6,34 +6,38 @@ namespace Tau{ -ParamPlots::ParamPlots(PlotBase* pParent, std::string sDir, std::string sParticleType):PlotBase(pParent, sDir),m_sParticleType(sParticleType) +ParamPlots::ParamPlots(PlotBase* pParent, std::string sDir, std::string sParticleType) + : PlotBase(pParent, sDir), + eta(nullptr), + phi(nullptr), + pt(nullptr), + eta_phi(nullptr), + eta_pt(nullptr), + m_sParticleType(sParticleType) { - eta=NULL; - phi=NULL; - pt=NULL; - - eta_phi=NULL; - eta_pt=NULL; } - -void ParamPlots::initializePlots() { - pt = Book1D("pt" , m_sParticleType+" pt;" +m_sParticleType+" Transverse Momentum [GeV];Entries / 1 GeV",200,0.,200); - eta = Book1D("eta", m_sParticleType+" eta;"+m_sParticleType+" Pseudo-Rapidity;Entries / 0.05", 32, -3.2, 3.2); - phi = Book1D("phi", m_sParticleType+" phi;"+m_sParticleType+" Azimuthal Angle;Entries / 0.05", 32, -3.2, 3.2); - - eta_pt = Book2D("eta_pt",m_sParticleType+" eta vs pt;"+m_sParticleType+" eta;"+m_sParticleType+" pt;Entries.0.05/1 GeV",32,-3.2,3.2,200,0.,200); - eta_phi = Book2D("eta_phi_test",m_sParticleType+" eta vs phi;"+m_sParticleType+" eta;"+m_sParticleType+" phi;Entries.0.05/0.5",32,-3.2,3.2,32,-3.2,3.2); +ParamPlots::~ParamPlots() +{ } +void ParamPlots::initializePlots() +{ + pt = Book1D("pt" , m_sParticleType+" pt;" +m_sParticleType+" Transverse Momentum [GeV];Entries / 1 GeV",200,0.,200); + eta = Book1D("eta", m_sParticleType+" eta;"+m_sParticleType+" Pseudo-Rapidity;Entries / 0.05", 32, -3.2, 3.2); + phi = Book1D("phi", m_sParticleType+" phi;"+m_sParticleType+" Azimuthal Angle;Entries / 0.05", 32, -3.2, 3.2); + eta_pt = Book2D("eta_pt",m_sParticleType+" eta vs pt;"+m_sParticleType+" eta;"+m_sParticleType+" pt;Entries.0.05/1 GeV",32,-3.2,3.2,200,0.,200); + eta_phi = Book2D("eta_phi_test",m_sParticleType+" eta vs phi;"+m_sParticleType+" eta;"+m_sParticleType+" phi;Entries.0.05/0.5",32,-3.2,3.2,32,-3.2,3.2); +} -void ParamPlots::fill(const xAOD::IParticle& tau){ - pt->Fill(tau.pt()*0.001); - eta->Fill(tau.eta()); - phi->Fill(tau.phi()); - - eta_pt->Fill(tau.eta(),tau.pt()*0.001); - eta_phi->Fill(tau.eta(),tau.phi()); + +void ParamPlots::fill(const xAOD::IParticle& tau) +{ + pt->Fill(tau.pt()*0.001); + eta->Fill(tau.eta()); + phi->Fill(tau.phi()); + eta_pt->Fill(tau.eta(),tau.pt()*0.001); + eta_phi->Fill(tau.eta(),tau.phi()); } } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx index da56580e04ebf2ce3bd2270b21143008ac029927..3c52bba569b197f1367a23471f9cd92cf40c49f6 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx @@ -9,15 +9,6 @@ namespace Tau{ RecoTauPlots::RecoTauPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): PlotBase(pParent, sDir), m_oParamPlots(this, "", sTauJetContainerName), - m_eflowRec_charPFO_Pt(nullptr), - m_eflowRec_charPFO_Eta(nullptr), - m_eflowRec_charPFO_Phi(nullptr), - m_eflowRec_charPFO_E(nullptr), - m_eflowRec_neuPFO_Pt(nullptr), - m_eflowRec_neuPFO_Eta(nullptr), - m_eflowRec_neuPFO_Phi(nullptr), - m_eflowRec_neuPFO_E(nullptr), - m_eflowRec_neuPFO_bdtPi0Score(nullptr), m_cellBased_charPFO_Pt(nullptr), m_cellBased_charPFO_Eta(nullptr), m_cellBased_charPFO_Phi(nullptr), @@ -42,20 +33,6 @@ RecoTauPlots::RecoTauPlots(PlotBase* pParent, std::string sDir, std::string sTau m_pantau_CellBasedInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts(nullptr), m_pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed(nullptr), m_pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged(nullptr), - m_pantau_eflowRecInput_isPanTauCandidate(nullptr), - m_pantau_eflowRecInput_DecayMode(nullptr), - m_pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n(nullptr), - m_pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn(nullptr), - m_pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn(nullptr), - m_pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts(nullptr), - m_pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts(nullptr), - m_pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts(nullptr), - m_pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM(nullptr), - m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1(nullptr), - m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2(nullptr), - m_pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts(nullptr), - m_pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts(nullptr), - m_pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged(nullptr), m_id_BDTJetScore(nullptr), m_id_BDTEleScore(nullptr), m_sTauJetContainerName(sTauJetContainerName) @@ -71,22 +48,6 @@ void RecoTauPlots::initializePlots(){ // m_oParamPlots.initialize(); - /*+++++++++++++++++++++++++++++++++++++++++++++++++ - +++++++++++++++++++EFLOW_REC+++++++++++++++++++++ - +++++++++++++++++++++++++++++++++++++++++++++++++*/ - - - // m_eflowRec_charPFO_Pt = Book1D("eflowRec_PFO_c_Pt",m_sTauJetContainerName + " Charged PFO pt; pt; # PFO",200,0.,200000.); - // m_eflowRec_charPFO_Eta = Book1D("eflowRec_PFO_c_Eta",m_sTauJetContainerName + " Charged PFO eta; eta; # PFO",128,-3.2,3.2); - // m_eflowRec_charPFO_Phi = Book1D("eflowRec_PFO_c_Phi",m_sTauJetContainerName + " Charged PFO phi; phi; # PFO",128,-3.2,3.2); - // m_eflowRec_charPFO_E = Book1D("eflowRec_PFO_c_E",m_sTauJetContainerName + " Charged PFO E; E; # PFO",200,0.,200000.); - // m_eflowRec_neuPFO_Pt = Book1D("eflowRec_PFO_n_Pt",m_sTauJetContainerName + " Neutral PFO pt; pt; # PFO",200,0.,200000.); - // m_eflowRec_neuPFO_Eta = Book1D("eflowRec_PFO_n_Eta",m_sTauJetContainerName + " Neutral PFO eta; eta; # PFO",128,-3.2,3.2); - // m_eflowRec_neuPFO_Phi = Book1D("eflowRec_PFO_n_Phi",m_sTauJetContainerName + " Neutral PFO phi; phi; # PFO",128,-3.2,3.2); - // m_eflowRec_neuPFO_E = Book1D("eflowRec_PFO_n_E",m_sTauJetContainerName + " Neutral PFO E; E; # PFO",200,0.,200000.); - // m_eflowRec_neuPFO_bdtPi0Score = Book1D("eflowRec_PFO_n_bdtPi0Score",m_sTauJetContainerName + " Neutral PFO BDT Pi0 Score; Score; # PFO",60,-.6,.6); - - /*+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++CellBased+++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -97,7 +58,7 @@ void RecoTauPlots::initializePlots(){ m_cellBased_charPFO_E = Book1D("cellBased_PFO_c_E",m_sTauJetContainerName + " Charged PFO E; E; # PFO",200,0.,200000.); m_cellBased_neuPFO_Pt = Book1D("cellBased_PFO_n_Pt",m_sTauJetContainerName + " Neutral PFO pt; pt; # PFO",200,0.,200000.); m_cellBased_neuPFO_Eta = Book1D("cellBased_PFO_n_Eta",m_sTauJetContainerName + " Neutral PFO eta; eta; # PFO",128,-3.2,3.2); - m_cellBased_neuPFO_Phi = Book1D("cellBased_PFO_n_Phi",m_sTauJetContainerName + " Neutral PFO phi; phi; # PFO",128,-3.2,3.2); + m_cellBased_neuPFO_Phi = Book1D("cellBased_PFO_n_Phi",m_sTauJetContainerName + " Neutral PFO phi; phi; # PFO",64,-3.2,3.2); m_cellBased_neuPFO_E = Book1D("cellBased_PFO_n_E",m_sTauJetContainerName + " Neutral PFO E; E; # PFO",200,0.,200000.); m_cellBased_neuPFO_bdtPi0Score = Book1D("cellBased_PFO_n_bdtPi0Score",m_sTauJetContainerName + " Neutral PFO BDT Pi0 Score; Score; # PFO",60,-1.0,1.0); @@ -121,57 +82,12 @@ void RecoTauPlots::initializePlots(){ m_pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed = Book1D("pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed",m_sTauJetContainerName + "pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed",10,-0.5,9.5); m_pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged = Book1D("pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged",m_sTauJetContainerName + "pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged",30,0.,0.6); - m_pantau_eflowRecInput_isPanTauCandidate = Book1D("pantau_eflowRecInput_isPanTauCandidate",m_sTauJetContainerName + "pantau_eflowRecInput_isPanTauCandidate",2,0,2); - m_pantau_eflowRecInput_DecayMode = Book1D("pantau_eflowRecInput_DecayMode",m_sTauJetContainerName + "pantau_eflowRecInput_DecayMode",6,-0.5,5.5); - m_pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n = Book1D("pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n",m_sTauJetContainerName + "pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n",30,-1.,1.); - m_pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn = Book1D("pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn",m_sTauJetContainerName + "pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn",30,-1.,1.); - m_pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn = Book1D("pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn",m_sTauJetContainerName + "pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn",30,-1.,1.); - m_pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts = Book1D("pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts",10.,-0.5,9.5); - m_pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts = Book1D("pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts",10.,-0.5,9.5); - m_pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts = Book1D("pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts",30,0.,1.); - m_pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM = Book1D("pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM",30,0.,6.); - m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1 = Book1D("pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1",30,-1.5,1.5); - m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2 = Book1D("pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2",30,-1.5,1.5); - m_pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts = Book1D("pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts",30,-0.5,1.2); - m_pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts = Book1D("pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts",30,-0.5,1.2); - m_pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged = Book1D("pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged",m_sTauJetContainerName + "pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged",30,0.,0.6); } void RecoTauPlots::fill(const xAOD::TauJet& thisTau) { //Access Particle Flow Object - /*+++++++++++++++++++++++++++++++++++++++++++++++++ - +++++++++++++++++++EFLOW_REC+++++++++++++++++++++ - +++++++++++++++++++++++++++++++++++++++++++++++++*/ - - //Charged Pions - // std::vector< ElementLink< xAOD::PFOContainer > > eflowRec_chargedPFO = thisTau.eflowRec_Charged_PFOLinks(); - // std::vector< ElementLink< xAOD::PFOContainer > >::iterator first_eflowRec_chargedPFO = eflowRec_chargedPFO.begin(); - // std::vector< ElementLink< xAOD::PFOContainer > >::iterator last_eflowRec_chargedPFO = eflowRec_chargedPFO.end(); - - // for (; first_eflowRec_chargedPFO != last_eflowRec_chargedPFO; ++first_eflowRec_chargedPFO){ - // ElementLink<xAOD::PFOContainer> thisLink = *first_eflowRec_chargedPFO; - // const xAOD::PFO* thisPFO = *thisLink; - // m_eflowRec_charPFO_Pt->Fill( thisPFO->pt()); - // m_eflowRec_charPFO_Eta->Fill( thisPFO->eta()); - // m_eflowRec_charPFO_Phi->Fill( thisPFO->phi()); - // m_eflowRec_charPFO_E->Fill( thisPFO->e()); - // } - - // //Neutral Pions - // std::vector< ElementLink< xAOD::PFOContainer > > eflowRec_neutralPFO = thisTau.eflowRec_Neutral_PFOLinks(); - // std::vector< ElementLink< xAOD::PFOContainer > >::iterator first_eflowRec_neutralPFO = eflowRec_neutralPFO.begin(); - // std::vector< ElementLink< xAOD::PFOContainer > >::iterator last_eflowRec_neutralPFO = eflowRec_neutralPFO.end(); - // for (; first_eflowRec_neutralPFO != last_eflowRec_neutralPFO; ++first_eflowRec_neutralPFO){ - // ElementLink<xAOD::PFOContainer> thisLink = *first_eflowRec_neutralPFO; - // const xAOD::PFO* thisPFO = *thisLink; - // m_eflowRec_neuPFO_Pt->Fill( thisPFO->pt()); - // m_eflowRec_neuPFO_Eta->Fill( thisPFO->eta()); - // m_eflowRec_neuPFO_Phi->Fill( thisPFO->phi()); - // m_eflowRec_neuPFO_E->Fill( thisPFO->e()); - // m_eflowRec_neuPFO_bdtPi0Score->Fill(thisPFO->bdtPi0Score()); - // } /*+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++CellBased+++++++++++++++++++++ @@ -245,35 +161,6 @@ void RecoTauPlots::initializePlots(){ m_pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed->Fill(panTauFloat); thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::PanTau_BDTVar_Combined_DeltaR1stNeutralTo1stCharged,panTauFloat); m_pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_isPanTauCandidate,panTauIntiger); - // m_pantau_eflowRecInput_isPanTauCandidate->Fill(panTauIntiger); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_DecayMode,panTauIntiger); - // m_pantau_eflowRecInput_DecayMode->Fill(panTauIntiger); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n,panTauFloat); - // m_pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn,panTauFloat); - // m_pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn,panTauFloat); - // m_pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts,panTauIntiger); - // m_pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts->Fill(panTauIntiger); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts,panTauIntiger); - // m_pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts->Fill(panTauIntiger); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts->Fill(panTauFloat); - // thisTau.panTauDetail( xAOD::TauJetParameters::PanTauDetails::pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged,panTauFloat); - // m_pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged->Fill(panTauFloat); - m_oParamPlots.fill(thisTau); }