ATLAS Offline Software
Migration.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 <utility>
6 
7 #include "Migration.h"
8 
9 namespace Tau{
10 
11  Migration::Migration(PlotBase* pParent, const std::string& sDir, std::string sTauJetContainerName):
12  PlotBase(pParent, sDir),
13  m_sTauJetContainerName(std::move(sTauJetContainerName))
14  {
15  }
16 
18  {
19  }
20 
22  {
23  m_migration_panTau = Book1D("panTau_migration",m_sTauJetContainerName + " panTau migration",DECAYSIZE,0,DECAYSIZE);
24  m_migration_panTauProto = Book1D("panTauProto_migration",m_sTauJetContainerName + " panTau proto migration",DECAYSIZE,0,DECAYSIZE);
25  m_migration_panTau->GetXaxis()->SetLabelSize(0.05);
26  m_migration_panTauProto->GetXaxis()->SetLabelSize(0.05);
27  for(int i=1; i<= DECAYSIZE;i++){
28  m_migration_panTauProto->GetXaxis()->SetBinLabel(i,m_lable[i-1]);
29  m_migration_panTau->GetXaxis()->SetBinLabel(i,m_lable[i-1]);
30  }
31  }
32 
33 
35  {
36  int isPanTauCandidate = 0;
37  bool foundDetail = thisTau.panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate);
38  if ( !foundDetail || !isPanTauCandidate ) return;
39 
40  // panTau
43  if ( foundDetail ) decayModeFill(trueMode, recMode, m_migration_panTau, weight);
44 
45  // panTauProto
48  if ( foundDetail ) {
49  decayModeFill(trueMode, recMode, m_migration_panTauProto, weight);
50  }
51 
52  }
53 
54  void Migration::decayModeFill(int trueMode, int recMode, TH1 *histo, float weight)
55  {
57 
58  switch ( trueMode ) {
60  switch ( recMode ) {
62  histo->Fill(t10r10 + 0.5, weight);
63  break;
65  histo->Fill(t10r11 + 0.5, weight);
66  break;
68  histo->Fill(t10r1x + 0.5, weight);
69  break;
70  default:
71  histo->Fill(t1r3 + 0.5, weight);
72  break;
73  }
74  break;
76  switch ( recMode ) {
78  histo->Fill(t11r10 + 0.5, weight);
79  break;
81  histo->Fill(t11r11 + 0.5, weight);
82  break;
84  histo->Fill(t11r1x + 0.5, weight);
85  break;
86  default:
87  histo->Fill(t1r3 + 0.5, weight);
88  break;
89  }
90  break;
92  switch ( recMode ) {
94  histo->Fill(t1xr10 + 0.5, weight);
95  break;
97  histo->Fill(t1xr11 + 0.5, weight);
98  break;
100  histo->Fill(t1xr1x + 0.5, weight);
101  break;
102  default:
103  histo->Fill(t1r3 + 0.5, weight);
104  break;
105  }
106  break;
108  switch ( recMode ) {
110  histo->Fill(t30r30 + 0.5, weight);
111  break;
113  histo->Fill(t30r3x + 0.5, weight);
114  break;
115  default:
116  histo->Fill(t3r1 + 0.5, weight);
117  break;
118  }
119  break;
121  switch ( recMode ) {
123  histo->Fill(t3xr30 + 0.5, weight);
124  break;
126  histo->Fill(t3xr3x + 0.5, weight);
127  break;
128  default:
129  histo->Fill(t3r1 + 0.5, weight);
130  break;
131  }
132  break;
133  }
134  return;
135  }
136 
137  void Migration::decayModeFill(int trueMode, int recP, int recN, TH1 *histo, float weight)
138  {
140  if ( recP == 1 && recN == 0 ) {
142  }
143  if ( recP == 1 && recN == 1 ) {
145  }
146  if ( recP == 1 && recN > 1 ) {
148  }
149  if ( recP == 3 && recN == 0 ) {
151  }
152  if ( recP == 3 && recN >= 1 ){
154  }
155  this->decayModeFill(trueMode, recMode, histo, weight);
156  }
157 
158 }
xAOD::TauJetParameters::Mode_1p0n
@ Mode_1p0n
Definition: TauDefs.h:386
xAOD::TauJetParameters::PanTau_DecayMode
@ PanTau_DecayMode
Definition: TauDefs.h:360
Tau::t11r1x
@ t11r1x
Definition: Migration.h:24
Tau::t10r10
@ t10r10
Definition: Migration.h:16
xAOD::TauJetParameters::Mode_1p1n
@ Mode_1p1n
Definition: TauDefs.h:387
PlotBase
Definition: PlotBase.h:34
Tau::Migration::~Migration
virtual ~Migration()
Definition: Migration.cxx:17
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:59
Tau::t1xr10
@ t1xr10
Definition: Migration.h:25
Tau::Migration::m_migration_panTau
TH1 * m_migration_panTau
Definition: Migration.h:59
Tau::Migration::m_lable
const char * m_lable[DECAYSIZE]
Definition: Migration.h:41
Tau::Migration::initializePlots
void initializePlots()
Definition: Migration.cxx:21
Tau::t3xr3x
@ t3xr3x
Definition: Migration.h:20
Tau
Definition: EfficiencyPtPlots.cxx:10
xAOD::TauJet_v3::panTauDetail
bool panTauDetail(TauJetParameters::PanTauDetails panTauDetail, int &value) const
Get and set values of pantau details variables via enum.
Definition: TauJet_v3.cxx:339
Tau::t30r30
@ t30r30
Definition: Migration.h:19
Tau::t11r11
@ t11r11
Definition: Migration.h:17
xAOD::TauJetParameters::Mode_1pXn
@ Mode_1pXn
Definition: TauDefs.h:388
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::DecayMode
DecayMode
Definition: TauDefs.h:385
Tau::t10r11
@ t10r11
Definition: Migration.h:21
Tau::t3r1
@ t3r1
Definition: Migration.h:30
Tau::DECAYSIZE
@ DECAYSIZE
Definition: Migration.h:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
Tau::t30r3x
@ t30r3x
Definition: Migration.h:27
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
Tau::Migration::fill
void fill(const xAOD::TauJet &tau, xAOD::TauJetParameters::DecayMode trueMode, float weight)
Definition: Migration.cxx:34
Tau::Migration::m_sTauJetContainerName
std::string m_sTauJetContainerName
Definition: Migration.h:63
Tau::t10r1x
@ t10r1x
Definition: Migration.h:22
xAOD::TauJetParameters::Mode_3p0n
@ Mode_3p0n
Definition: TauDefs.h:389
Tau::Migration::m_migration_panTauProto
TH1 * m_migration_panTauProto
Definition: Migration.h:60
Tau::t1xr11
@ t1xr11
Definition: Migration.h:26
Tau::Migration::Migration
Migration(PlotBase *pParent, const std::string &sDir, std::string sTauJetContainerName)
Definition: Migration.cxx:11
Tau::t1xr1x
@ t1xr1x
Definition: Migration.h:18
Tau::t1r3
@ t1r3
Definition: Migration.h:29
Migration.h
xAOD::TauJetParameters::PanTau_DecayModeProto
@ PanTau_DecayModeProto
Definition: TauDefs.h:359
Tau::t3xr30
@ t3xr30
Definition: Migration.h:28
Tau::Migration::decayModeFill
void decayModeFill(int trueMode, int recMode, TH1 *histo, float weight)
Definition: Migration.cxx:54
xAOD::TauJetParameters::Mode_3pXn
@ Mode_3pXn
Definition: TauDefs.h:390
xAOD::TauJetParameters::PanTau_isPanTauCandidate
@ PanTau_isPanTauCandidate
Definition: TauDefs.h:357
xAOD::TauJetParameters::Mode_Error
@ Mode_Error
Definition: TauDefs.h:393
Tau::t11r10
@ t11r10
Definition: Migration.h:23
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:414
xAOD::TauJetParameters::Mode_Other
@ Mode_Other
Definition: TauDefs.h:391