Belle II Software
development
TauDecayMarkerModule.cc
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
9
#include <analysis/modules/TauDecayMarker/TauDecayMarkerModule.h>
10
11
#include <framework/logging/Logger.h>
12
#include <framework/gearbox/Const.h>
13
14
using namespace
std
;
15
using namespace
Belle2
;
16
17
//-----------------------------------------------------------------
18
// Register the Module
19
//-----------------------------------------------------------------
20
REG_MODULE
(TauDecayMarker);
21
22
//-----------------------------------------------------------------
23
// Implementation
24
//-----------------------------------------------------------------
25
26
TauDecayMarkerModule::TauDecayMarkerModule
() :
Module
(),
tauPair
(false),
numOfTauPlus
(0),
numOfTauMinus
(0),
idOfTauPlus
(-1),
27
idOfTauMinus
(-1),
m_pmode
(-2),
m_mmode
(-2),
m_pprong
(0),
m_mprong
(0)
28
{
29
// Set module properties
30
setDescription
(
"Module to identify generated tau pair decays, using MCParticle information. Each tau lepton decay channel "
31
"is numbered following the order in the default KKMC decay table. Using this module, "
32
"the channel number will be stored in the variables `tauPlusMCMode`, and `tauMinusMCMode`. "
33
"Further details and usage can be found at `TauDecayMCModes`. "
);
34
setPropertyFlags
(
c_ParallelProcessingCertified
);
35
//Parameter definition
36
addParam
(
"printDecayInfo"
,
m_printDecayInfo
,
"Print information of the tau pair decay from MC."
,
false
);
37
}
38
39
void
TauDecayMarkerModule::initialize
()
40
{
41
m_tauDecay
.registerInDataStore();
42
43
}
44
45
void
TauDecayMarkerModule::event
()
46
{
47
if
(!
m_tauDecay
)
m_tauDecay
.create();
48
49
IdentifyTauPair
();
50
if
(
tauPair
) {
51
m_pmode
=
getDecayChannelOfTau
(+1) % 100;
52
m_mmode
=
getDecayChannelOfTau
(-1) % 100;
53
54
m_pprong
=
getProngOfDecay
(*
m_MCParticles
[
idOfTauPlus
- 1]);
55
m_mprong
=
getProngOfDecay
(*
m_MCParticles
[
idOfTauMinus
- 1]);
56
57
if
(
m_printDecayInfo
) {
58
B2INFO(
"Decay ID: "
<<
m_pmode
<<
" (tau+), "
<<
m_mmode
<<
" (tau-)."
<<
59
" Topology: "
<<
m_pprong
<<
"-"
<<
m_mprong
<<
" prong"
);
60
}
61
62
}
else
{
63
m_pmode
= -1;
64
m_mmode
= -1;
65
}
66
67
m_tauDecay
->addTauPlusIdMode(
m_pmode
);
68
m_tauDecay
->addTauMinusIdMode(
m_mmode
);
69
70
m_tauDecay
->addTauPlusMcProng(
m_pprong
);
71
m_tauDecay
->addTauMinusMcProng(
m_mprong
);
72
73
}
74
75
void
TauDecayMarkerModule::IdentifyTauPair
()
76
{
77
numOfTauPlus
= 0;
78
numOfTauMinus
= 0;
79
idOfTauPlus
= 0;
80
idOfTauMinus
= 0;
81
for
(
int
i = 0; i <
m_MCParticles
.getEntries(); i++) {
82
const
MCParticle
& p = *
m_MCParticles
[i];
83
84
if
(p.getStatus() == 1 && p.getPDG() == 15) {
85
numOfTauMinus
++;
86
idOfTauMinus
= p.getIndex();
87
}
88
if
(p.getStatus() == 1 && p.getPDG() == -15) {
89
numOfTauPlus
++;
90
idOfTauPlus
= p.getIndex();
91
}
92
}
93
if
(
numOfTauPlus
== 1 &&
numOfTauMinus
== 1) {
94
tauPair
=
true
;
95
}
else
tauPair
=
false
;
96
}
97
98
int
TauDecayMarkerModule::getNumDaughterOfTau
(
int
s,
int
id
,
int
sign)
99
{
100
if
(s == 0 || !
tauPair
)
return
-1;
101
int
tauid =
idOfTauMinus
;
102
if
(s > 0) tauid =
idOfTauPlus
;
103
int
ret = 0;
104
const
MCParticle
& p = *
m_MCParticles
[tauid - 1];
105
106
if
(
id
== 0) {
107
for
(
int
i = p.getFirstDaughter(); i <= p.getLastDaughter(); ++i) {
108
const
MCParticle
& d = *
m_MCParticles
[i - 1];
109
if
(abs(d.getPDG()) == 24)
110
ret += d.getLastDaughter() - d.getFirstDaughter() + 1;
111
else
ret++;
112
}
113
}
else
{
114
for
(
int
i = p.getFirstDaughter(); i <= p.getLastDaughter(); ++i) {
115
const
MCParticle
& d = *
m_MCParticles
[i - 1];
116
int
pdg = d.getPDG();
117
if
(pdg ==
id
|| (sign == 0 && abs(pdg) == abs(
id
))) ret++;
118
if
(abs(pdg) == 24) {
119
for
(
int
j = d.getFirstDaughter(); j <= d.getLastDaughter(); ++j) {
120
const
MCParticle
& e = *
m_MCParticles
[j - 1];
121
int
pdg2 = e.getPDG();
122
if
(pdg2 ==
id
||
123
(sign == 0)) ret++;
124
}
125
}
126
}
127
}
128
return
ret;
129
}
130
131
int
TauDecayMarkerModule::getNumDaughterOfTauExceptGamma
(
int
s,
int
id
,
int
sign)
132
{
133
if
(s == 0 || !
tauPair
)
return
-1;
134
int
tauid =
idOfTauMinus
;
135
if
(s > 0) tauid =
idOfTauPlus
;
136
int
ret = 0;
137
const
MCParticle
& p = *
m_MCParticles
[tauid - 1];
138
139
if
(
id
== 0) {
140
for
(
int
i = p.getFirstDaughter(); i <= p.getLastDaughter(); ++i) {
141
const
MCParticle
& d = *
m_MCParticles
[i - 1];
142
if
(abs(d.getPDG()) == 24) {
143
for
(
int
j = d.getFirstDaughter(); j <= d.getLastDaughter(); ++j) {
144
const
MCParticle
& e = *
m_MCParticles
[j - 1];
145
if
(e.getPDG() !=
Const::photon
.getPDGCode()) ret++;
146
}
147
}
else
if
(d.getPDG() !=
Const::photon
.getPDGCode()) ret++;
148
}
149
}
else
{
150
for
(
int
i = p.getFirstDaughter(); i <= p.getLastDaughter(); ++i) {
151
const
MCParticle
& d = *
m_MCParticles
[i - 1];
152
int
pdg = d.getPDG();
153
if
(abs(pdg) == 24) {
154
for
(
int
j = d.getFirstDaughter(); j <= d.getLastDaughter(); ++j) {
155
const
MCParticle
& e = *
m_MCParticles
[j - 1];
156
int
pdg2 = e.getPDG();
157
if
(pdg2 ==
id
||
158
(sign == 0 && abs(pdg2) == abs(
id
))) ret++;
159
}
160
}
else
if
(pdg ==
id
|| (sign == 0 && abs(pdg) == abs(
id
))) ret++;
161
}
162
}
163
return
ret;
164
}
165
166
int
TauDecayMarkerModule::getDecayChannelOfTau
(
int
s)
167
{
168
if
(!
tauPair
|| s == 0)
return
0;
169
if
(
170
getNumDaughterOfTauExceptGamma
(s, -s * (-12), 1) == 1 &&
171
getNumDaughterOfTauExceptGamma
(s, -s * (11), 1) == 1 &&
172
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
173
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
174
)
return
1 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
175
if
(
176
getNumDaughterOfTauExceptGamma
(s, -s * (-14), 1) == 1 &&
177
getNumDaughterOfTauExceptGamma
(s, -s * (13), 1) == 1 &&
178
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
179
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
180
)
return
2 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
181
if
(
182
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
183
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
184
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 2
185
)
return
3 + (
getNumDaughterOfTau
(s, 0, 1) - 2) * 1000;
186
if
(
187
getNumDaughterOfTauExceptGamma
(s, -s * (-213), 1) == 1 &&
188
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
189
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 2
190
)
return
4 + (
getNumDaughterOfTau
(s, 0, 1) - 2) * 1000;
191
if
(
192
getNumDaughterOfTauExceptGamma
(s, -s * (-20213), 1) == 1 &&
193
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
194
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 2
195
)
return
5 + (
getNumDaughterOfTau
(s, 0, 1) - 2) * 1000;
196
if
(
197
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
198
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
199
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 2
200
)
return
6 + (
getNumDaughterOfTau
(s, 0, 1) - 2) * 1000;
201
if
(
202
getNumDaughterOfTauExceptGamma
(s, -s * (-323), 1) == 1 &&
203
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
204
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 2
205
)
return
7 + (
getNumDaughterOfTau
(s, 0, 1) - 2) * 1000;
206
if
(
207
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
208
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
209
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
210
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
211
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
212
)
return
8 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
213
if
(
214
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
215
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 3 &&
216
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
217
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
218
)
return
9 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
219
if
(
220
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
221
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
222
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
223
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
224
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 6
225
)
return
10 + (
getNumDaughterOfTau
(s, 0, 1) - 6) * 1000;
226
if
(
227
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 3 &&
228
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
229
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 2 &&
230
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 6
231
)
return
11 + (
getNumDaughterOfTau
(s, 0, 1) - 6) * 1000;
232
if
(
233
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 3 &&
234
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
235
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
236
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 2 &&
237
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 7
238
)
return
12 + (
getNumDaughterOfTau
(s, 0, 1) - 7) * 1000;
239
if
(
240
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
241
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 3 &&
242
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
243
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
244
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 7
245
)
return
13 + (
getNumDaughterOfTau
(s, 0, 1) - 7) * 1000;
246
if
(
247
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
248
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
249
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
250
getNumDaughterOfTauExceptGamma
(s, -s * (321), 1) == 1 &&
251
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
252
)
return
14 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
253
if
(
254
getNumDaughterOfTauExceptGamma
(s, -s * (-10313), 1) == 1 &&
255
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
256
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
257
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
258
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
259
)
return
15 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
260
if
(
261
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
262
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 2 ||
263
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 2) &&
264
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
265
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
266
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
267
)
return
15 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000
268
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
269
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
270
if
(
271
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
272
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
273
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
274
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
275
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
276
)
return
16 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
277
if
(
278
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
279
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
280
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
281
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
282
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
283
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
284
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
285
)
return
16 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000
286
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
287
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
288
if
(
289
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
290
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
291
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
292
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
293
)
return
17 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
294
if
(
295
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
296
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
297
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
298
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
299
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
300
)
return
18 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
301
if
(
302
getNumDaughterOfTauExceptGamma
(s, -s * (-10313), 1) == 1 &&
303
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
304
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
305
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
306
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
307
)
return
19 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
308
if
(
309
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
310
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
311
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
312
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
313
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
314
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
315
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
316
)
return
19 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000
317
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
318
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
319
if
(
320
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
321
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
322
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
323
getNumDaughterOfTauExceptGamma
(s, 221, 1) == 1 &&
324
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
325
)
return
20 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
326
if
(
327
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
328
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
329
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
330
getNumDaughterOfTau
(s, 22, 1) >= 1 &&
331
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
332
)
return
21 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
333
if
(
334
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
335
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
336
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
337
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
338
)
return
22 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
339
if
(
340
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
341
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
342
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
343
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
344
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
345
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
346
)
return
22 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000
347
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
348
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
349
if
(
350
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
351
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 4 &&
352
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
353
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 6
354
)
return
23 + (
getNumDaughterOfTau
(s, 0, 1) - 6) * 1000;
355
if
(
356
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
357
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
358
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
359
getNumDaughterOfTauExceptGamma
(s, 223, 1) == 1 &&
360
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 4
361
)
return
24 + (
getNumDaughterOfTau
(s, 0, 1) - 4) * 1000;
362
if
(
363
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
364
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
365
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
366
getNumDaughterOfTauExceptGamma
(s, 221, 1) == 1 &&
367
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
368
)
return
25 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
369
if
(
370
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
371
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
372
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
373
getNumDaughterOfTauExceptGamma
(s, 221, 1) == 1 &&
374
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
375
)
return
26 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
376
if
(
377
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
378
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
379
getNumDaughterOfTauExceptGamma
(s, 221, 1) == 1 &&
380
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
381
)
return
27 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
382
if
(
383
getNumDaughterOfTauExceptGamma
(s, -s * (-323), 1) == 1 &&
384
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
385
getNumDaughterOfTauExceptGamma
(s, 221, 1) == 1 &&
386
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
387
)
return
28 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
388
if
(
389
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
390
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
391
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
392
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
393
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
394
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
395
)
return
29 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
396
if
(
397
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
398
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 3 &&
399
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
400
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
401
)
return
30 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
402
if
(
403
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
404
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
405
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
406
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
407
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
408
)
return
31 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
409
if
(
410
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
411
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
412
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
413
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
414
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
415
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
416
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
417
)
return
31 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000
418
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
419
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
420
if
(
421
getNumDaughterOfTauExceptGamma
(s, -s * (-10313), 1) == 1 &&
422
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
423
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
424
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
425
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
426
)
return
32 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
427
if
(
428
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
429
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
430
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
431
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
432
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
433
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
434
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
435
)
return
32 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000
436
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
437
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
438
if
(
439
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
440
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
441
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
442
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
443
getNumDaughterOfTauExceptGamma
(s, -s * (321), 1) == 1 &&
444
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
445
)
return
33 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
446
if
(
447
getNumDaughterOfTauExceptGamma
(s, -s * (-10313), 1) == 1 &&
448
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
449
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
450
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
451
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
452
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
453
)
return
34 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
454
if
(
455
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
456
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 2 ||
457
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 2) &&
458
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
459
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 1 &&
460
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
461
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
462
)
return
34 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000
463
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
464
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
465
if
(
466
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
467
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
468
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
469
getNumDaughterOfTauExceptGamma
(s, 223, 1) == 1 &&
470
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
471
)
return
35 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
472
if
(
473
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
474
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
475
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
476
getNumDaughterOfTauExceptGamma
(s, 223, 1) == 1 &&
477
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
478
)
return
36 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
479
if
(
480
getNumDaughterOfTauExceptGamma
(s, -s * (-11), 1) == 1 &&
481
getNumDaughterOfTauExceptGamma
(s, -s * (-12), 1) == 1 &&
482
getNumDaughterOfTauExceptGamma
(s, -s * (11), 1) == 2 &&
483
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
484
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
485
)
return
37 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
486
if
(
487
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
488
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
489
getNumDaughterOfTauExceptGamma
(s, 20223, 1) == 1 &&
490
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
491
)
return
38 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
492
if
(
493
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
494
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
495
getNumDaughterOfTauExceptGamma
(s, 223, 1) == 1 &&
496
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 3
497
)
return
39 + (
getNumDaughterOfTau
(s, 0, 1) - 3) * 1000;
498
if
(
499
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
500
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
501
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
502
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
503
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
504
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
505
)
return
40 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
506
if
(
507
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
508
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
509
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
510
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 1 &&
511
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
512
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
513
getNumDaughterOfTauExceptGamma
(s, -s * (211), 1) == 1 &&
514
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
515
)
return
40 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000
516
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
517
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
518
if
(
519
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
520
getNumDaughterOfTauExceptGamma
(s, -s * (10313), 1) == 1 &&
521
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
522
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
523
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
524
)
return
41 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
525
if
(
526
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
527
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
528
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
529
getNumDaughterOfTauExceptGamma
(s, -s * (-321), 1) == 1 &&
530
getNumDaughterOfTauExceptGamma
(s, 111, 1) == 2 &&
531
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
532
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
533
)
return
41 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000
534
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
535
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
536
if
(
537
getNumDaughterOfTauExceptGamma
(s, -s * (-10313), 1) == 1 &&
538
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
539
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
540
getNumDaughterOfTauExceptGamma
(s, -s * (321), 1) == 1 &&
541
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
542
)
return
42 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000;
543
if
(
544
(
getNumDaughterOfTauExceptGamma
(s, 130, 0)
545
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) == 1 ||
546
getNumDaughterOfTauExceptGamma
(s, 311, 0) == 1) &&
547
getNumDaughterOfTauExceptGamma
(s, -s * (-211), 1) == 2 &&
548
getNumDaughterOfTauExceptGamma
(s, -s * (16), 1) == 1 &&
549
getNumDaughterOfTauExceptGamma
(s, -s * (321), 1) == 1 &&
550
getNumDaughterOfTauExceptGamma
(s, 0, 1) == 5
551
)
return
42 + (
getNumDaughterOfTau
(s, 0, 1) - 5) * 1000
552
+
getNumDaughterOfTauExceptGamma
(s, 310, 0) * 10000
553
+
getNumDaughterOfTauExceptGamma
(s, 130, 0) * 100000;
554
return
0;
555
}
556
557
558
int
TauDecayMarkerModule::getProngOfDecay
(
const
MCParticle
& p)
559
{
560
int
ret = 0;
561
const
vector<MCParticle*> daughters = p.getDaughters();
562
if
(daughters.empty())
return
ret;
563
for
(
const
MCParticle
* d : daughters) {
564
if
(!d->hasStatus(
MCParticle::c_PrimaryParticle
))
continue
;
565
// TODO: Improve how to identify a final state particle.
566
bool
isChargedFinalState = find(
finalStatePDGs
.begin(),
567
finalStatePDGs
.end(),
568
abs(d->getPDG())) !=
finalStatePDGs
.end();
569
if
(isChargedFinalState) ret++;
570
else
ret +=
getProngOfDecay
(*d);
571
}
572
return
ret;
573
}
574
Belle2::Const::photon
static const ParticleType photon
photon particle
Definition
Const.h:674
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition
MCParticle.h:32
Belle2::MCParticle::c_PrimaryParticle
@ c_PrimaryParticle
bit 0: Particle is primary particle.
Definition
MCParticle.h:47
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition
Module.cc:214
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition
Module.cc:208
Belle2::Module::Module
Module()
Constructor.
Definition
Module.cc:30
Belle2::Module::c_ParallelProcessingCertified
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition
Module.h:80
Belle2::TauDecayMarkerModule::m_mprong
Int_t m_mprong
Prong of the decay channel of negative tau.
Definition
TauDecayMarkerModule.h:69
Belle2::TauDecayMarkerModule::numOfTauPlus
int numOfTauPlus
Number of positive tau leptons in the event.
Definition
TauDecayMarkerModule.h:53
Belle2::TauDecayMarkerModule::m_pprong
Int_t m_pprong
Prong of the decay channel of positive tau.
Definition
TauDecayMarkerModule.h:67
Belle2::TauDecayMarkerModule::IdentifyTauPair
void IdentifyTauPair()
Identifies if the event is a generated tau pair.
Definition
TauDecayMarkerModule.cc:75
Belle2::TauDecayMarkerModule::initialize
virtual void initialize() override
Initializes the module.
Definition
TauDecayMarkerModule.cc:39
Belle2::TauDecayMarkerModule::event
virtual void event() override
Method is called for each event.
Definition
TauDecayMarkerModule.cc:45
Belle2::TauDecayMarkerModule::getNumDaughterOfTau
int getNumDaughterOfTau(int s=0, int id=0, int sign=0)
Count the number of daughers of the generated tau.
Definition
TauDecayMarkerModule.cc:98
Belle2::TauDecayMarkerModule::m_mmode
Int_t m_mmode
ID of the decay channel of negative tau.
Definition
TauDecayMarkerModule.h:65
Belle2::TauDecayMarkerModule::getNumDaughterOfTauExceptGamma
int getNumDaughterOfTauExceptGamma(int s=0, int id=0, int sign=0)
Count the number of daughers of the generated tau except gammas.
Definition
TauDecayMarkerModule.cc:131
Belle2::TauDecayMarkerModule::tauPair
bool tauPair
True if the generated event is a tau pair event.
Definition
TauDecayMarkerModule.h:51
Belle2::TauDecayMarkerModule::idOfTauMinus
int idOfTauMinus
Index of the generated negative tau.
Definition
TauDecayMarkerModule.h:59
Belle2::TauDecayMarkerModule::m_pmode
Int_t m_pmode
ID of the decay channel of positive tau.
Definition
TauDecayMarkerModule.h:63
Belle2::TauDecayMarkerModule::numOfTauMinus
int numOfTauMinus
Number of negative tau leptons in the event.
Definition
TauDecayMarkerModule.h:55
Belle2::TauDecayMarkerModule::getProngOfDecay
static int getProngOfDecay(const MCParticle &mc)
Get the prong of the generated tau decay.
Definition
TauDecayMarkerModule.cc:558
Belle2::TauDecayMarkerModule::idOfTauPlus
int idOfTauPlus
Index of the generated positive tau.
Definition
TauDecayMarkerModule.h:57
Belle2::TauDecayMarkerModule::m_tauDecay
StoreObjPtr< TauPairDecay > m_tauDecay
pointer to tau pair decay objects
Definition
TauDecayMarkerModule.h:47
Belle2::TauDecayMarkerModule::getDecayChannelOfTau
int getDecayChannelOfTau(int s=0)
Gets the id of the decay channel.
Definition
TauDecayMarkerModule.cc:166
Belle2::TauDecayMarkerModule::m_printDecayInfo
bool m_printDecayInfo
If true, prints ID and prong of each tau lepton in the event.
Definition
TauDecayMarkerModule.h:84
Belle2::TauDecayMarkerModule::m_MCParticles
StoreArray< MCParticle > m_MCParticles
StoreArray of MCParticles.
Definition
TauDecayMarkerModule.h:49
Belle2::TauDecayMarkerModule::TauDecayMarkerModule
TauDecayMarkerModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition
TauDecayMarkerModule.cc:26
Belle2::TauDecayMarkerModule::finalStatePDGs
static constexpr std::array< int, 5 > finalStatePDGs
PDG codes accepted as charged final state particles in generation: {e, mu, pi, K, p}...
Definition
TauDecayMarkerModule.h:61
Belle2::Module::addParam
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition
Module.h:560
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition
Module.h:650
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
std
STL namespace.
analysis
modules
TauDecayMarker
src
TauDecayMarkerModule.cc
Generated on Sun Nov 22 2026 03:09:17 for Belle II Software by
1.13.2