ATLAS Offline Software
HadProngPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "HadProngPlots.h"
7 #include "AthenaKernel/Units.h"
8 
9 namespace Tau{
10 
11 HadProngPlots::HadProngPlots(PlotBase* pParent, const std::string& sDir,
12  const std::string& sTauJetContainerName):
13  PlotBase(pParent, sDir),
14  m_oGeneralTauPlots(this, "", sTauJetContainerName),
15  m_sTauJetContainerName(sTauJetContainerName)
16 {
17 }
18 
20 {
21 }
22 
24 
25  // m_oGeneralTauPlots.initialize();
26  m_tauCoreFrac = Book1D("CoreFrac",m_sTauJetContainerName + " Tau CoreFrac; CoreFrac; # Taus",40,0.,2.);
27  m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.);
28  m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8);
29  m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.);
30  m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5);
31  m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",50,-1.,10.);
32  m_SumPtTrkFrac = Book1D("SumPtTrkFrac",m_sTauJetContainerName + " Tau Sum PtTrk Frac ; SumPtTrkFrac; # Taus",100,-10.,20.);
33  m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8);
34  m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10);
35  m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0);
36  m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15);
37  m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20);
38  m_IsoFrac = Book1D("IsoFrac",m_sTauJetContainerName + " Iso Frac; Iso Frac; # Part",20,0,1.);
39  m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.);
40 }
41 
42 void HadProngPlots::fill(const xAOD::TauJet& tau, float weight) {
44 
45  float avariable = 0.;
46 
47  bool test = tau.detail(xAOD::TauJetParameters::centFrac, avariable);
48  if(test) m_tauCoreFrac->Fill(avariable, weight);
49 
51  if(test) m_tauEoverPTrk->Fill(avariable, weight);
52 
54  if(test) m_tauTrkAvgDist->Fill(avariable, weight);
55 
56  static const SG::ConstAccessor<float> d0SigTJVAAcc("d0SigTJVA");
57  if(tau.nTracks()>0 && d0SigTJVAAcc.isAvailable(*tau.track(0))) {
58  m_tauIpSig->Fill(tau.track(0)->d0SigTJVA(), weight);
59  }
60 
61  test = tau.detail(xAOD::TauJetParameters::dRmax, avariable);
62  if(test) m_tauDRMax->Fill(avariable, weight);
63 
65  if(test) m_tauMtrks->Fill(avariable/Athena::Units::GeV, weight);
66 
68  if(test) m_SumPtTrkFrac->Fill(avariable/Athena::Units::GeV, weight);
69 
71  if(test) m_innerTrkAvgDist->Fill(avariable, weight);
72 
74  if(test) m_ptRatioEflowApprox->Fill(avariable, weight);
75 
77  if(test) m_mEflowApprox->Fill(avariable, weight);
78 
80  if(test) m_ChPiEMEOverCaloEME->Fill(avariable, weight);
81 
83  if(test) m_EMPOverTrkSysP->Fill(avariable, weight);
84 
86  if (test) m_IsoFrac->Fill(avariable, weight);
87 
89  if(test) m_tauSflight->Fill(avariable, weight);
90 }
91 }
Tau::HadProngPlots::fill
void fill(const xAOD::TauJet &tau, float weight)
Definition: HadProngPlots.cxx:42
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:18
Tau::HadProngPlots::m_tauEoverPTrk
TH1 * m_tauEoverPTrk
Definition: HadProngPlots.h:23
Tau::HadProngPlots::m_tauIpSig
TH1 * m_tauIpSig
Definition: HadProngPlots.h:25
Tau::HadProngPlots::m_tauSflight
TH1 * m_tauSflight
Definition: HadProngPlots.h:39
PlotBase
Definition: PlotBase.h:34
xAOD::TauJetParameters::trFlightPathSig
@ trFlightPathSig
Definition: TauDefs.h:163
xAOD::TauTrack_v1::d0SigTJVA
float d0SigTJVA() const
Definition: TauTrack_v1.cxx:120
Tau::HadProngPlots::m_tauTrkAvgDist
TH1 * m_tauTrkAvgDist
Definition: HadProngPlots.h:24
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:59
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:488
Tau::HadProngPlots::m_EMPOverTrkSysP
TH1 * m_EMPOverTrkSysP
Definition: HadProngPlots.h:35
Tau::HadProngPlots::m_tauCoreFrac
TH1 * m_tauCoreFrac
Definition: HadProngPlots.h:22
xAOD::TauJetParameters::mEflowApprox
@ mEflowApprox
Definition: TauDefs.h:292
Tau
Definition: EfficiencyPtPlots.cxx:10
Tau::HadProngPlots::~HadProngPlots
virtual ~HadProngPlots()
Definition: HadProngPlots.cxx:19
SG::ConstAccessor< float >
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:142
Tau::HadProngPlots::m_SumPtTrkFrac
TH1 * m_SumPtTrkFrac
Definition: HadProngPlots.h:28
xAOD::TauJetParameters::ptRatioEflowApprox
@ ptRatioEflowApprox
Definition: TauDefs.h:293
Tau::HadProngPlots::initializePlots
void initializePlots()
Definition: HadProngPlots.cxx:23
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
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
xAOD::TauJetParameters::centFrac
@ centFrac
Get centrality fraction.
Definition: TauDefs.h:200
Tau::HadProngPlots::m_IsoFrac
TH1 * m_IsoFrac
Definition: HadProngPlots.h:37
xAOD::TauJetParameters::dRmax
@ dRmax
Get maximal dR of tracks associated to calo-seeded tau.
Definition: TauDefs.h:226
Tau::HadProngPlots::m_innerTrkAvgDist
TH1 * m_innerTrkAvgDist
Definition: HadProngPlots.h:30
Tau::HadProngPlots::m_tauMtrks
TH1 * m_tauMtrks
Definition: HadProngPlots.h:27
Tau::HadProngPlots::HadProngPlots
HadProngPlots(PlotBase *pParent, const std::string &sDir, const std::string &sTauJetContainerName)
Definition: HadProngPlots.cxx:11
xAOD::TauJetParameters::trkAvgDist
@ trkAvgDist
Get calibrated EM transverse energy (DEPRECATED since r19)
Definition: TauDefs.h:214
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
xAOD::TauJet_v3::track
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...
Definition: TauJet_v3.cxx:422
xAOD::TauJetParameters::etOverPtLeadTrk
@ etOverPtLeadTrk
Definition: TauDefs.h:158
Tau::HadProngPlots::m_ChPiEMEOverCaloEME
TH1 * m_ChPiEMEOverCaloEME
Definition: HadProngPlots.h:34
xAOD::TauJetParameters::massTrkSys
@ massTrkSys
Definition: TauDefs.h:161
xAOD::TauJet_v3::detail
bool detail(TauJetParameters::Detail detail, int &value) const
Get and set values of common details variables via enum.
Definition: TauJet_v3.cxx:264
Units.h
Wrapper to avoid constant divisions when using units.
Tau::HadProngPlots::m_tauDRMax
TH1 * m_tauDRMax
Definition: HadProngPlots.h:26
Tau::HadProngPlots::m_ptRatioEflowApprox
TH1 * m_ptRatioEflowApprox
Definition: HadProngPlots.h:31
xAOD::TauJetParameters::innerTrkAvgDist
@ innerTrkAvgDist
Definition: TauDefs.h:287
xAOD::TauJetParameters::ChPiEMEOverCaloEME
@ ChPiEMEOverCaloEME
Definition: TauDefs.h:278
Tau::HadProngPlots::m_sTauJetContainerName
std::string m_sTauJetContainerName
Definition: HadProngPlots.h:43
Tau::HadProngPlots::m_oGeneralTauPlots
Tau::GeneralTauPlots m_oGeneralTauPlots
Definition: HadProngPlots.h:20
xAOD::TauJetParameters::isolFrac
@ isolFrac
Get isolation fraction.
Definition: TauDefs.h:198
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Tau::GeneralTauPlots::fill
void fill(const xAOD::TauJet &tau, float weight)
Definition: GeneralTauPlots.cxx:54
xAOD::TauJetParameters::SumPtTrkFrac
@ SumPtTrkFrac
Definition: TauDefs.h:289
Tau::HadProngPlots::m_mEflowApprox
TH1 * m_mEflowApprox
Definition: HadProngPlots.h:32
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
xAOD::TauJetParameters::EMPOverTrkSysP
@ EMPOverTrkSysP
Definition: TauDefs.h:279
HadProngPlots.h