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
19
20 // m_oGeneralTauPlots.initialize();
21 m_tauCoreFrac = Book1D("CoreFrac",m_sTauJetContainerName + " Tau CoreFrac; CoreFrac; # Taus",40,0.,2.);
22 m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.);
23 m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8);
24 m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.);
25 m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5);
26 m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",50,-1.,10.);
27 m_SumPtTrkFrac = Book1D("SumPtTrkFrac",m_sTauJetContainerName + " Tau Sum PtTrk Frac ; SumPtTrkFrac; # Taus",100,-10.,20.);
28 m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8);
29 m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10);
30 m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0);
31 m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15);
32 m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20);
33 m_IsoFrac = Book1D("IsoFrac",m_sTauJetContainerName + " Iso Frac; Iso Frac; # Part",20,0,1.);
34 m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.);
35}
36
37void TauIDVariablesPlots::fill(const xAOD::TauJet& tau, float weight) {
38 m_oGeneralTauPlots.fill(tau, weight);
39
40 float avariable = 0.;
41
42 bool test = tau.detail(xAOD::TauJetParameters::centFrac, avariable);
43 if(test) m_tauCoreFrac->Fill(avariable, weight);
44
46 if(test) m_tauEoverPTrk->Fill(avariable, weight);
47
48 test = tau.detail(xAOD::TauJetParameters::trkAvgDist, avariable);
49 if(test) m_tauTrkAvgDist->Fill(avariable, weight);
50
51 static const SG::ConstAccessor<float> d0SigTJVAAcc("d0SigTJVA");
52 if(tau.nTracks()>0 && d0SigTJVAAcc.isAvailable(*tau.track(0))) {
53 m_tauIpSig->Fill(tau.track(0)->d0SigTJVA(), weight);
54 }
55
56 test = tau.detail(xAOD::TauJetParameters::dRmax, avariable);
57 if(test) m_tauDRMax->Fill(avariable, weight);
58
59 test = tau.detail(xAOD::TauJetParameters::massTrkSys, avariable);
60 if(test) m_tauMtrks->Fill(avariable/Athena::Units::GeV, weight);
61
62 test = tau.detail(xAOD::TauJetParameters::SumPtTrkFrac, avariable);
63 if(test) m_SumPtTrkFrac->Fill(avariable/Athena::Units::GeV, weight);
64
66 if(test) m_innerTrkAvgDist->Fill(avariable, weight);
67
69 if(test) m_ptRatioEflowApprox->Fill(avariable, weight);
70
71 test = tau.detail(xAOD::TauJetParameters::mEflowApprox, avariable);
72 if(test) m_mEflowApprox->Fill(avariable, weight);
73
75 if(test) m_ChPiEMEOverCaloEME->Fill(avariable, weight);
76
78 if(test) m_EMPOverTrkSysP->Fill(avariable, weight);
79
80 test = tau.detail(xAOD::TauJetParameters::isolFrac, avariable);
81 if (test) m_IsoFrac->Fill(avariable, weight);
82
84 if(test) m_tauSflight->Fill(avariable, weight);
85}
86}
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".