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
18
20 {
21 m_migration_panTau = Book1D("panTau_migration",m_sTauJetContainerName + " panTau migration",DECAYSIZE,0,DECAYSIZE);
22 m_migration_panTauProto = Book1D("panTauProto_migration",m_sTauJetContainerName + " panTau proto migration",DECAYSIZE,0,DECAYSIZE);
23 m_migration_panTau->GetXaxis()->SetLabelSize(0.05);
24 m_migration_panTauProto->GetXaxis()->SetLabelSize(0.05);
25 for(int i=1; i<= DECAYSIZE;i++){
26 m_migration_panTauProto->GetXaxis()->SetBinLabel(i,m_lable[i-1]);
27 m_migration_panTau->GetXaxis()->SetBinLabel(i,m_lable[i-1]);
28 }
29 }
30
31
32 void DecayModeMigration::fill(const xAOD::TauJet& thisTau, xAOD::TauJetParameters::DecayMode trueMode, float weight)
33 {
34 int isPanTauCandidate = 0;
35 bool foundDetail = thisTau.panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate);
36 if ( !foundDetail || !isPanTauCandidate ) return;
37
38 // panTau
41 if ( foundDetail ) decayModeFill(trueMode, recMode, m_migration_panTau, weight);
42
43 // panTauProto
46 if ( foundDetail ) {
47 decayModeFill(trueMode, recMode, m_migration_panTauProto, weight);
48 }
49
50 }
51
52 void DecayModeMigration::decayModeFill(int trueMode, int recMode, TH1 *histo, float weight)
53 {
55
56 switch ( trueMode ) {
58 switch ( recMode ) {
60 histo->Fill(t10r10 + 0.5, weight);
61 break;
63 histo->Fill(t10r11 + 0.5, weight);
64 break;
66 histo->Fill(t10r1x + 0.5, weight);
67 break;
68 default:
69 histo->Fill(t1r3 + 0.5, weight);
70 break;
71 }
72 break;
74 switch ( recMode ) {
76 histo->Fill(t11r10 + 0.5, weight);
77 break;
79 histo->Fill(t11r11 + 0.5, weight);
80 break;
82 histo->Fill(t11r1x + 0.5, weight);
83 break;
84 default:
85 histo->Fill(t1r3 + 0.5, weight);
86 break;
87 }
88 break;
90 switch ( recMode ) {
92 histo->Fill(t1xr10 + 0.5, weight);
93 break;
95 histo->Fill(t1xr11 + 0.5, weight);
96 break;
98 histo->Fill(t1xr1x + 0.5, weight);
99 break;
100 default:
101 histo->Fill(t1r3 + 0.5, weight);
102 break;
103 }
104 break;
106 switch ( recMode ) {
108 histo->Fill(t30r30 + 0.5, weight);
109 break;
111 histo->Fill(t30r3x + 0.5, weight);
112 break;
113 default:
114 histo->Fill(t3r1 + 0.5, weight);
115 break;
116 }
117 break;
119 switch ( recMode ) {
121 histo->Fill(t3xr30 + 0.5, weight);
122 break;
124 histo->Fill(t3xr3x + 0.5, weight);
125 break;
126 default:
127 histo->Fill(t3r1 + 0.5, weight);
128 break;
129 }
130 break;
131 }
132 return;
133 }
134}
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".