ATLAS Offline Software
GeneralTauPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #include "GeneralTauPlots.h"
8 
9 namespace Tau{
10 
11 GeneralTauPlots::GeneralTauPlots(PlotBase* pParent, const std::string& sDir, const std::string& sTauJetContainerName):
12  PlotBase(pParent, sDir),
13  m_oParamPlots(this, "", sTauJetContainerName),
14  m_tauCharge(nullptr),
15  m_tauNCoreTracks(nullptr),
16  m_tauNWideTracks(nullptr),
17  m_ptHighPt(nullptr),
18  m_RNNEleScore(nullptr),
19  m_RNNEleScoreSigTrans(nullptr),
20  m_RNNJetScore(nullptr),
21  m_RNNJetScoreSigTrans(nullptr),
22  m_ptRNNVeryLoose(nullptr),
23  m_ptRNNLoose(nullptr),
24  m_ptRNNMedium(nullptr),
25  m_ptRNNTight(nullptr),
26  m_ptRNNVeryLooseHighPt(nullptr),
27  m_ptRNNLooseHighPt(nullptr),
28  m_ptRNNMediumHighPt(nullptr),
29  m_ptRNNTightHighPt(nullptr),
30  m_sTauJetContainerName(sTauJetContainerName)
31 {
32 }
33 
35 {
36 }
37 
39 
40  m_tauCharge = Book1D("Charge",m_sTauJetContainerName + " Tau charge; charge; # Taus",7,-3.,4.);
41  m_tauNCoreTracks = Book1D("NCoreTracks",m_sTauJetContainerName + " Tau n core tracks; nCore; # Taus",10,0.,10.);
42  m_tauNWideTracks = Book1D("NWideTracks",m_sTauJetContainerName + " Tau n wide tracks; nWide; # Taus",10,0.,10.);
43  m_ptHighPt = Book1D("ptHighPt", m_sTauJetContainerName+" HighPt"+"; pt; # Taus",20, 0.0, 1500.0);
44  m_RNNEleScore = Book1D("RNNEleScore", m_sTauJetContainerName+" RNNEleScore;RNNEleScore;# Tau", 50,0.,1.);
45  m_RNNEleScoreSigTrans = Book1D("RNNEleScoreSigTrans", m_sTauJetContainerName+" RNNEleScoreSigTrans;RNNEleScoreSigTrans;"+"# Tau", 50,0.,1.);
46  m_RNNJetScore = Book1D("RNNJetScore", m_sTauJetContainerName+" RNNJetScore;RNNJetScore;# Tau", 50,0.,1.);
47  m_RNNJetScoreSigTrans = Book1D("RNNJetScoreSigTrans", m_sTauJetContainerName+" RNNJetScoreSigTrans;RNNJetScoreSigTrans;"+"# Tau", 50,0.,1.);
48  m_ptRNNVeryLoose = Book1D("ptRNNSigVeryLoose", m_sTauJetContainerName+" RNNSigVeryLoose; pt; # Taus",20, 0.0, 150.0);
49  m_ptRNNVeryLooseHighPt = Book1D("ptRNNSigVeryLooseHighPt", m_sTauJetContainerName+" RNNSigVeryLooseHighPt"+"; pt; # Taus",20, 0.0, 1500.0);
50  m_ptRNNLoose = Book1D("ptRNNSigLoose",m_sTauJetContainerName+" RNNSigLoose; pt; # Taus", 20, 0.0, 150.0);
51  m_ptRNNLooseHighPt = Book1D("ptRNNSigLooseHighPt", m_sTauJetContainerName+" RNNSigLooseHighPt; pt"+"; # Taus",20, 0.0, 1500.0);
52  m_ptRNNMedium = Book1D("ptRNNSigMedium",m_sTauJetContainerName+" RNNSigMedium; pt; # Taus", 20, 0.0, 150.0);
53  m_ptRNNMediumHighPt = Book1D("ptRNNSigMediumHighPt", m_sTauJetContainerName+" RNNSigMediumHighPt; pt"+"; # Taus",20, 0.0, 1500.0);
54  m_ptRNNTight = Book1D("ptRNNSigTight",m_sTauJetContainerName+" RNNSigTight; pt; # Taus", 20, 0.0, 150.0);
55  m_ptRNNTightHighPt = Book1D("ptRNNSigTightHighPt", m_sTauJetContainerName+" RNNSigTightHighPt; pt"+"; # Taus",20, 0.0, 1500.0);
56 }
57 
58 void GeneralTauPlots::fill(const xAOD::TauJet& tau, float weight) {
60  m_tauCharge->Fill(tau.charge(), weight);
61  m_tauNCoreTracks->Fill(tau.nTracks(), weight);
63  m_ptHighPt->Fill(tau.pt()/1000, weight);
64 
65  static const SG::ConstAccessor<float> acc_RNNEleScore("RNNEleScore");
66  if ( acc_RNNEleScore.isAvailable(tau) ) {
68  if ( rnnScore > -2.0 ) m_RNNEleScore->Fill(rnnScore, weight);
69  }
70  static const SG::ConstAccessor<float> acc_RNNEleScoreSigTrans("RNNEleScoreSigTrans_v1");
71  if ( acc_RNNEleScoreSigTrans.isAvailable(tau) ) {
72  float rnnScore = acc_RNNEleScoreSigTrans(tau);
73  m_RNNEleScoreSigTrans->Fill(rnnScore, weight);
74  }
75  static const SG::AuxElement::ConstAccessor<float> acc_RNNJetScore("RNNJetScore");
76  if ( acc_RNNJetScore.isAvailable(tau) ) {
78  if ( rnnScore > -2.0 ) m_RNNJetScore->Fill(rnnScore, weight);
79  }
80  static const SG::AuxElement::ConstAccessor<float> acc_RNNJetScoreSigTrans("RNNJetScoreSigTrans");
81  if ( acc_RNNJetScoreSigTrans.isAvailable(tau) ) {
83  m_RNNJetScoreSigTrans->Fill(rnnScore, weight);
84  }
86  m_ptRNNVeryLoose ->Fill(tau.pt()/1000, weight);
87  m_ptRNNVeryLooseHighPt->Fill(tau.pt()/1000, weight);
88  }
90  m_ptRNNLoose ->Fill(tau.pt()/1000, weight);
91  m_ptRNNLooseHighPt->Fill(tau.pt()/1000, weight);
92  }
94  m_ptRNNMedium ->Fill(tau.pt()/1000, weight);
95  m_ptRNNMediumHighPt->Fill(tau.pt()/1000, weight);
96  }
98  m_ptRNNTight ->Fill(tau.pt()/1000, weight);
99  m_ptRNNTightHighPt->Fill(tau.pt()/1000, weight);
100  }
101 
102 }
103 
104 
105 }
Tau::GeneralTauPlots::m_RNNEleScore
TH1 * m_RNNEleScore
Definition: GeneralTauPlots.h:28
Tau::GeneralTauPlots::m_oParamPlots
Tau::ParamPlots m_oParamPlots
Definition: GeneralTauPlots.h:21
xAOD::TauJetParameters::RNNJetScoreSigTrans
@ RNNJetScoreSigTrans
RNN score which is signal transformed/flattened.
Definition: TauDefs.h:92
Tau::GeneralTauPlots::m_ptRNNMediumHighPt
TH1 * m_ptRNNMediumHighPt
Definition: GeneralTauPlots.h:38
Tau::ParamPlots::fill
void fill(const xAOD::IParticle &prt, float weight)
Definition: PhysicsAnalysis/TauID/TauDQA/src/ParamPlots.cxx:36
PlotBase
Definition: PlotBase.h:34
xAOD::TauJet_v3::discriminant
double discriminant(TauJetParameters::TauID discID) const
Get value of discriminant.
Definition: TauJet_v3.cxx:253
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:526
Tau::GeneralTauPlots::m_tauCharge
TH1 * m_tauCharge
Definition: GeneralTauPlots.h:22
Tau
Definition: EfficiencyPtPlots.cxx:9
SG::ConstAccessor< float >
Tau::GeneralTauPlots::m_RNNEleScoreSigTrans
TH1 * m_RNNEleScoreSigTrans
Definition: GeneralTauPlots.h:29
Tau::GeneralTauPlots::m_ptRNNVeryLooseHighPt
TH1 * m_ptRNNVeryLooseHighPt
Definition: GeneralTauPlots.h:36
Tau::GeneralTauPlots::m_ptRNNMedium
TH1 * m_ptRNNMedium
Definition: GeneralTauPlots.h:34
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
PlotBase::Book1D
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition: PlotBase.cxx:94
Tau::GeneralTauPlots::m_RNNJetScore
TH1 * m_RNNJetScore
Definition: GeneralTauPlots.h:30
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Tau::GeneralTauPlots::m_tauNWideTracks
TH1 * m_tauNWideTracks
Definition: GeneralTauPlots.h:24
Tau::GeneralTauPlots::~GeneralTauPlots
virtual ~GeneralTauPlots()
Definition: GeneralTauPlots.cxx:34
Tau::GeneralTauPlots::m_ptRNNVeryLoose
TH1 * m_ptRNNVeryLoose
Definition: GeneralTauPlots.h:32
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
Tau::GeneralTauPlots::m_tauNCoreTracks
TH1 * m_tauNCoreTracks
Definition: GeneralTauPlots.h:23
Tau::GeneralTauPlots::initializePlots
void initializePlots()
Definition: GeneralTauPlots.cxx:38
xAOD::TauJetParameters::JetRNNSigVeryLoose
@ JetRNNSigVeryLoose
Definition: TauDefs.h:145
Tau::GeneralTauPlots::m_ptRNNLoose
TH1 * m_ptRNNLoose
Definition: GeneralTauPlots.h:33
Tau::GeneralTauPlots::GeneralTauPlots
GeneralTauPlots(PlotBase *pParent, const std::string &sDir, const std::string &sTauJetContainerName)
Definition: GeneralTauPlots.cxx:11
Tau::GeneralTauPlots::m_ptRNNTightHighPt
TH1 * m_ptRNNTightHighPt
Definition: GeneralTauPlots.h:39
xAOD::TauJetParameters::classifiedIsolation
@ classifiedIsolation
Definition: TauDefs.h:407
Tau::GeneralTauPlots::m_ptRNNLooseHighPt
TH1 * m_ptRNNLooseHighPt
Definition: GeneralTauPlots.h:37
xAOD::TauJetParameters::JetRNNSigTight
@ JetRNNSigTight
Definition: TauDefs.h:148
Tau::GeneralTauPlots::m_ptRNNTight
TH1 * m_ptRNNTight
Definition: GeneralTauPlots.h:35
Tau::GeneralTauPlots::m_ptHighPt
TH1 * m_ptHighPt
Definition: GeneralTauPlots.h:25
xAOD::TauJetParameters::RNNJetScore
@ RNNJetScore
RNN score for Jet rejection (not transformed)
Definition: TauDefs.h:90
xAOD::TauJetParameters::JetRNNSigMedium
@ JetRNNSigMedium
Definition: TauDefs.h:147
xAOD::TauJet_v3::isTau
bool isTau(TauJetParameters::IsTauFlag flag) const
Get Flag for tau acceptance based on predefined arbitrary criteria.
Definition: TauJet_v3.cxx:273
xAOD::TauJet_v3::charge
float charge() const
Tau::GeneralTauPlots::m_sTauJetContainerName
std::string m_sTauJetContainerName
Definition: GeneralTauPlots.h:43
xAOD::TauJetParameters::RNNEleScore
@ RNNEleScore
RNN score for Ele rejection (not transformed)
Definition: TauDefs.h:94
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
GeneralTauPlots.h
Tau::GeneralTauPlots::fill
void fill(const xAOD::TauJet &tau, float weight)
Definition: GeneralTauPlots.cxx:58
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
Tau::GeneralTauPlots::m_RNNJetScoreSigTrans
TH1 * m_RNNJetScoreSigTrans
Definition: GeneralTauPlots.h:31
xAOD::TauJetParameters::JetRNNSigLoose
@ JetRNNSigLoose
Definition: TauDefs.h:146