ATLAS Offline Software
Loading...
Searching...
No Matches
TauIDVariablesPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8namespace Tau{
9
10TauIDVariablesPlots::TauIDVariablesPlots(PlotBase* pParent, const std::string& sDir,
11 const std::string& sTauJetContainerName):
12 PlotBase(pParent, sDir),
13 m_oGeneralTauPlots(this, "", sTauJetContainerName),
14 m_sTauJetContainerName(sTauJetContainerName)
15{
16}
17
21
23
24 // m_oGeneralTauPlots.initialize();
25 m_tauCoreFrac = Book1D("CoreFrac",m_sTauJetContainerName + " Tau CoreFrac; CoreFrac; # Taus",40,0.,2.);
26 m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.);
27 m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8);
28 m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.);
29 m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5);
30 m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",50,-1.,10.);
31 m_SumPtTrkFrac = Book1D("SumPtTrkFrac",m_sTauJetContainerName + " Tau Sum PtTrk Frac ; SumPtTrkFrac; # Taus",100,-10.,20.);
32 m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8);
33 m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10);
34 m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0);
35 m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15);
36 m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20);
37 m_IsoFrac = Book1D("IsoFrac",m_sTauJetContainerName + " Iso Frac; Iso Frac; # Part",20,0,1.);
38 m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.);
39}
40
41void TauIDVariablesPlots::fill(const xAOD::TauJet& tau, float weight) {
42 m_oGeneralTauPlots.fill(tau, weight);
43
44 float avariable = 0.;
45
46 bool test = tau.detail(xAOD::TauJetParameters::centFrac, avariable);
47 if(test) m_tauCoreFrac->Fill(avariable, weight);
48
50 if(test) m_tauEoverPTrk->Fill(avariable, weight);
51
52 test = tau.detail(xAOD::TauJetParameters::trkAvgDist, avariable);
53 if(test) m_tauTrkAvgDist->Fill(avariable, weight);
54
55 static const SG::ConstAccessor<float> d0SigTJVAAcc("d0SigTJVA");
56 if(tau.nTracks()>0 && d0SigTJVAAcc.isAvailable(*tau.track(0))) {
57 m_tauIpSig->Fill(tau.track(0)->d0SigTJVA(), weight);
58 }
59
60 test = tau.detail(xAOD::TauJetParameters::dRmax, avariable);
61 if(test) m_tauDRMax->Fill(avariable, weight);
62
63 test = tau.detail(xAOD::TauJetParameters::massTrkSys, avariable);
64 if(test) m_tauMtrks->Fill(avariable/Athena::Units::GeV, weight);
65
66 test = tau.detail(xAOD::TauJetParameters::SumPtTrkFrac, avariable);
67 if(test) m_SumPtTrkFrac->Fill(avariable/Athena::Units::GeV, weight);
68
70 if(test) m_innerTrkAvgDist->Fill(avariable, weight);
71
73 if(test) m_ptRatioEflowApprox->Fill(avariable, weight);
74
75 test = tau.detail(xAOD::TauJetParameters::mEflowApprox, avariable);
76 if(test) m_mEflowApprox->Fill(avariable, weight);
77
79 if(test) m_ChPiEMEOverCaloEME->Fill(avariable, weight);
80
82 if(test) m_EMPOverTrkSysP->Fill(avariable, weight);
83
84 test = tau.detail(xAOD::TauJetParameters::isolFrac, avariable);
85 if (test) m_IsoFrac->Fill(avariable, weight);
86
88 if(test) m_tauSflight->Fill(avariable, weight);
89}
90}
Wrapper to avoid constant divisions when using units.
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
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Tau::GeneralTauPlots m_oGeneralTauPlots
void fill(const xAOD::TauJet &tau, float weight)
TauIDVariablesPlots(PlotBase *pParent, const std::string &sDir, const std::string &sTauJetContainerName)
bool detail(TauJetParameters::Detail detail, int &value) const
Get and set values of common details variables via enum.
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
float d0SigTJVA() const
@ isolFrac
Get isolation fraction.
Definition TauDefs.h:198
@ trkAvgDist
Get calibrated EM transverse energy (DEPRECATED since r19)
Definition TauDefs.h:214
@ centFrac
Get centrality fraction.
Definition TauDefs.h:200
@ dRmax
Get maximal dR of tracks associated to calo-seeded tau.
Definition TauDefs.h:226
TauJet_v3 TauJet
Definition of the current "tau version".