ATLAS Offline Software
Loading...
Searching...
No Matches
DecayModeMigration.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace Tau{
8
9 DecayModeMigration::DecayModeMigration(PlotBase* pParent, const std::string& sDir, std::string sTauJetContainerName):
10 PlotBase(pParent, sDir),
11 m_sTauJetContainerName(std::move(sTauJetContainerName))
12 {
13 }
14
16 {
17 m_migration_panTau = Book1D("panTau_migration",m_sTauJetContainerName + " panTau migration",DECAYSIZE,0,DECAYSIZE);
18 m_migration_panTauProto = Book1D("panTauProto_migration",m_sTauJetContainerName + " panTau proto migration",DECAYSIZE,0,DECAYSIZE);
19 m_migration_panTau->GetXaxis()->SetLabelSize(0.05);
20 m_migration_panTauProto->GetXaxis()->SetLabelSize(0.05);
21 for(int i=1; i<= DECAYSIZE;i++){
22 m_migration_panTauProto->GetXaxis()->SetBinLabel(i,m_lable[i-1]);
23 m_migration_panTau->GetXaxis()->SetBinLabel(i,m_lable[i-1]);
24 }
25 }
26
27
28 void DecayModeMigration::fill(const xAOD::TauJet& thisTau, xAOD::TauJetParameters::DecayMode trueMode, float weight)
29 {
30 int isPanTauCandidate = 0;
31 bool foundDetail = thisTau.panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate);
32 if ( !foundDetail || !isPanTauCandidate ) return;
33
34 // panTau
37 if ( foundDetail ) decayModeFill(trueMode, recMode, m_migration_panTau, weight);
38
39 // panTauProto
42 if ( foundDetail ) {
43 decayModeFill(trueMode, recMode, m_migration_panTauProto, weight);
44 }
45
46 }
47
48 void DecayModeMigration::decayModeFill(int trueMode, int recMode, TH1 *histo, float weight)
49 {
51
52 switch ( trueMode ) {
54 switch ( recMode ) {
56 histo->Fill(t10r10 + 0.5, weight);
57 break;
59 histo->Fill(t10r11 + 0.5, weight);
60 break;
62 histo->Fill(t10r1x + 0.5, weight);
63 break;
64 default:
65 histo->Fill(t1r3 + 0.5, weight);
66 break;
67 }
68 break;
70 switch ( recMode ) {
72 histo->Fill(t11r10 + 0.5, weight);
73 break;
75 histo->Fill(t11r11 + 0.5, weight);
76 break;
78 histo->Fill(t11r1x + 0.5, weight);
79 break;
80 default:
81 histo->Fill(t1r3 + 0.5, weight);
82 break;
83 }
84 break;
86 switch ( recMode ) {
88 histo->Fill(t1xr10 + 0.5, weight);
89 break;
91 histo->Fill(t1xr11 + 0.5, weight);
92 break;
94 histo->Fill(t1xr1x + 0.5, weight);
95 break;
96 default:
97 histo->Fill(t1r3 + 0.5, weight);
98 break;
99 }
100 break;
102 switch ( recMode ) {
104 histo->Fill(t30r30 + 0.5, weight);
105 break;
107 histo->Fill(t30r3x + 0.5, weight);
108 break;
109 default:
110 histo->Fill(t3r1 + 0.5, weight);
111 break;
112 }
113 break;
115 switch ( recMode ) {
117 histo->Fill(t3xr30 + 0.5, weight);
118 break;
120 histo->Fill(t3xr3x + 0.5, weight);
121 break;
122 default:
123 histo->Fill(t3r1 + 0.5, weight);
124 break;
125 }
126 break;
127 }
128 return;
129 }
130}
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
DecayModeMigration(PlotBase *pParent, const std::string &sDir, std::string sTauJetContainerName)
void decayModeFill(int trueMode, int recMode, TH1 *histo, float weight)
void fill(const xAOD::TauJet &tau, xAOD::TauJetParameters::DecayMode trueMode, float weight)
const char * m_lable[DECAYSIZE]
bool panTauDetail(TauJetParameters::PanTauDetails panTauDetail, int &value) const
Get and set values of pantau details variables via enum.
STL namespace.
TauJet_v3 TauJet
Definition of the current "tau version".