ATLAS Offline Software
Had1ProngPlots.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 #include "Had1ProngPlots.h"
7 
8 namespace Tau{
9 
10 Had1ProngPlots::Had1ProngPlots(PlotBase* pParent, const std::string& sDir,
11  const std::string& sTauJetContainerName):
12  PlotBase(pParent, sDir),
13  m_oGeneralTauPlots(this, "", sTauJetContainerName),
14  m_tauNWideTracks(nullptr),
15  m_tauCoreFrac(nullptr),
16  m_tauEoverPTrk(nullptr),
17  m_tauTrkAvgDist(nullptr),
18  m_tauIpSig(nullptr),
19  m_tauDRMax(nullptr),
20  m_tauMtrks(nullptr),
21  m_SumPtTrkFrac(nullptr),
22  m_innerTrkAvgDist(nullptr),
23  m_ptRatioEflowApprox(nullptr),
24  m_mEflowApprox(nullptr),
25  m_ChPiEMEOverCaloEME(nullptr),
26  m_EMPOverTrkSysP(nullptr),
27  m_HadRadius(nullptr),
28  m_EMRadius(nullptr),
29  m_IsoFrac(nullptr),
30  m_sTauJetContainerName(sTauJetContainerName)
31 {
32 }
33 
35 {
36 }
37 
39 
40  // m_oGeneralTauPlots.initialize();
41  m_tauCoreFrac = Book1D("CoreFrac",m_sTauJetContainerName + " Tau CoreFrac; CoreFrac; # Taus",40,0.,2.);
42  m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.);
43  m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8);
44  m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.);
45  m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5);
46  m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",50,-1.,10.);
47  m_SumPtTrkFrac = Book1D("SumPtTrkFrac",m_sTauJetContainerName + " Tau Sum PtTrk Frac ; SumPtTrkFrac; # Taus",100,-10.,20.);
48  m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus",10,-0.2,.8);
49  m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10);
50  m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0.0,3000.0);
51  m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15);
52  m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 21, -1, 20);
53  m_HadRadius = Book1D("HadRadius",m_sTauJetContainerName + " Had Radius; HadRadius; # Part",20,0,2.);
54  m_EMRadius = Book1D("EMRadius",m_sTauJetContainerName + " EM Radius; EMRadius; # Part",20,0,2.);
55  m_IsoFrac = Book1D("IsoFrac",m_sTauJetContainerName + " Iso Frac; Iso Frac; # Part",20,0,1.);
56 }
57 
58 void Had1ProngPlots::fill(const xAOD::TauJet& tau, float weight) {
60 
61  float avariable = 0.;
62 
63  bool test = tau.detail(xAOD::TauJetParameters::centFrac, avariable);
64  if(test) m_tauCoreFrac->Fill(avariable, weight);
65 
67  if(test) m_tauEoverPTrk->Fill(avariable, weight);
68 
70  if(test) m_tauTrkAvgDist->Fill(avariable, weight);
71 
72  static const SG::ConstAccessor<float> d0SigTJVAAcc("d0SigTJVA");
73  if(tau.nTracks()>0 && d0SigTJVAAcc.isAvailable(*tau.track(0))) {
74  m_tauIpSig->Fill(tau.track(0)->d0SigTJVA(), weight);
75  }
76 
77  test = tau.detail(xAOD::TauJetParameters::dRmax, avariable);
78  if(test) m_tauDRMax->Fill(avariable, weight);
79 
81  if(test) m_tauMtrks->Fill(avariable/1000., weight);
82 
84  if(test) m_SumPtTrkFrac->Fill(avariable/1000., weight);
85 
87  if(test) m_innerTrkAvgDist->Fill(avariable, weight);
88 
90  if(test) m_ptRatioEflowApprox->Fill(avariable, weight);
91 
93  if(test) m_mEflowApprox->Fill(avariable, weight);
94 
96  if(test) m_ChPiEMEOverCaloEME->Fill(avariable, weight);
97 
99  if(test) m_EMPOverTrkSysP->Fill(avariable, weight);
100 
102  if(test) m_HadRadius->Fill(avariable, weight);
103 
104  test = tau.detail(xAOD::TauJetParameters::EMRadius, avariable);
105  if(test) m_EMRadius->Fill(avariable, weight);
106 
107  test = tau.detail(xAOD::TauJetParameters::isolFrac, avariable);
108  if (test) m_IsoFrac->Fill(avariable, weight);
109 }
110 }
Tau::Had1ProngPlots::m_ChPiEMEOverCaloEME
TH1 * m_ChPiEMEOverCaloEME
Definition: Had1ProngPlots.h:34
Tau::Had1ProngPlots::m_sTauJetContainerName
std::string m_sTauJetContainerName
Definition: Had1ProngPlots.h:44
PlotBase
Definition: PlotBase.h:34
xAOD::TauTrack_v1::d0SigTJVA
float d0SigTJVA() const
Definition: TauTrack_v1.cxx:129
Tau::Had1ProngPlots::Had1ProngPlots
Had1ProngPlots(PlotBase *pParent, const std::string &sDir, const std::string &sTauJetContainerName)
Definition: Had1ProngPlots.cxx:10
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::Had1ProngPlots::fill
void fill(const xAOD::TauJet &tau, float weight)
Definition: Had1ProngPlots.cxx:58
xAOD::TauJetParameters::mEflowApprox
@ mEflowApprox
Definition: TauDefs.h:292
Tau
Definition: EfficiencyPtPlots.cxx:9
SG::ConstAccessor< float >
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
xAOD::TauJetParameters::ptRatioEflowApprox
@ ptRatioEflowApprox
Definition: TauDefs.h:293
xAOD::TauJetParameters::hadRadius
@ hadRadius
Get hadron calorimeter radius.
Definition: TauDefs.h:192
Tau::Had1ProngPlots::m_mEflowApprox
TH1 * m_mEflowApprox
Definition: Had1ProngPlots.h:32
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
xAOD::TauJetParameters::centFrac
@ centFrac
Get centrality fraction.
Definition: TauDefs.h:200
Tau::Had1ProngPlots::m_tauIpSig
TH1 * m_tauIpSig
Definition: Had1ProngPlots.h:25
xAOD::TauJetParameters::dRmax
@ dRmax
Get maximal dR of tracks associated to calo-seeded tau.
Definition: TauDefs.h:226
Tau::Had1ProngPlots::m_innerTrkAvgDist
TH1 * m_innerTrkAvgDist
Definition: Had1ProngPlots.h:30
Tau::Had1ProngPlots::m_tauDRMax
TH1 * m_tauDRMax
Definition: Had1ProngPlots.h:26
Tau::Had1ProngPlots::m_EMPOverTrkSysP
TH1 * m_EMPOverTrkSysP
Definition: Had1ProngPlots.h:35
Tau::Had1ProngPlots::m_oGeneralTauPlots
Tau::GeneralTauPlots m_oGeneralTauPlots
Definition: Had1ProngPlots.h:20
Tau::Had1ProngPlots::m_EMRadius
TH1 * m_EMRadius
Definition: Had1ProngPlots.h:38
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:450
Tau::Had1ProngPlots::m_tauTrkAvgDist
TH1 * m_tauTrkAvgDist
Definition: Had1ProngPlots.h:24
xAOD::TauJetParameters::etOverPtLeadTrk
@ etOverPtLeadTrk
Definition: TauDefs.h:158
Tau::Had1ProngPlots::m_HadRadius
TH1 * m_HadRadius
Definition: Had1ProngPlots.h:37
xAOD::TauJetParameters::massTrkSys
@ massTrkSys
Definition: TauDefs.h:161
Tau::Had1ProngPlots::m_ptRatioEflowApprox
TH1 * m_ptRatioEflowApprox
Definition: Had1ProngPlots.h:31
xAOD::TauJet_v3::detail
bool detail(TauJetParameters::Detail detail, int &value) const
Set veto flag.
Definition: TauJet_v3.cxx:292
Tau::Had1ProngPlots::~Had1ProngPlots
virtual ~Had1ProngPlots()
Definition: Had1ProngPlots.cxx:34
Had1ProngPlots.h
Tau::Had1ProngPlots::initializePlots
void initializePlots()
Definition: Had1ProngPlots.cxx:38
xAOD::TauJetParameters::innerTrkAvgDist
@ innerTrkAvgDist
Definition: TauDefs.h:287
Tau::Had1ProngPlots::m_SumPtTrkFrac
TH1 * m_SumPtTrkFrac
Definition: Had1ProngPlots.h:28
xAOD::TauJetParameters::ChPiEMEOverCaloEME
@ ChPiEMEOverCaloEME
Definition: TauDefs.h:278
Tau::Had1ProngPlots::m_tauMtrks
TH1 * m_tauMtrks
Definition: Had1ProngPlots.h:27
xAOD::TauJetParameters::isolFrac
@ isolFrac
Get isolation fraction.
Definition: TauDefs.h:198
Tau::Had1ProngPlots::m_tauCoreFrac
TH1 * m_tauCoreFrac
Definition: Had1ProngPlots.h:22
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Tau::Had1ProngPlots::m_IsoFrac
TH1 * m_IsoFrac
Definition: Had1ProngPlots.h:39
Tau::GeneralTauPlots::fill
void fill(const xAOD::TauJet &tau, float weight)
Definition: GeneralTauPlots.cxx:57
xAOD::TauJetParameters::SumPtTrkFrac
@ SumPtTrkFrac
Definition: TauDefs.h:289
Tau::Had1ProngPlots::m_tauEoverPTrk
TH1 * m_tauEoverPTrk
Definition: Had1ProngPlots.h:23
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
xAOD::TauJetParameters::EMRadius
@ EMRadius
Get E_T radius.
Definition: TauDefs.h:190
xAOD::TauJetParameters::EMPOverTrkSysP
@ EMPOverTrkSysP
Definition: TauDefs.h:279