Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Generators
PowhegControl
python
algorithms
postprocessors
e2tau.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaCommon
import
Logging
4
from
...decorators
import
timed
5
from
...utility
import
LHE
6
import
shutil
7
8
9
logger = Logging.logging.getLogger(
"PowhegControl"
)
10
11
12
@
timed
(
"e2tau"
)
13
def
e2tau
(powheg_LHE_output):
14
"""! Post-process existing events from electrons to taus
15
16
@param powheg_LHE_output Name of LHE file produced by PowhegBox.
17
18
@author Jan Kretzschmar <jan.kretzschmar@cern.ch>
19
"""
20
logger.warning(
"Converting LHE events from electron to tau decays. Tau mass must be restored by showering program, ensure to validate physics."
)
21
22
# Get opening and closing strings
23
preamble = LHE.preamble(powheg_LHE_output)
24
postamble = LHE.postamble(powheg_LHE_output)
25
26
n_events = 0
27
powheg_LHE_tau =
"{}.tau"
.
format
(powheg_LHE_output)
28
with
open
(powheg_LHE_tau,
"w"
)
as
f_output:
29
f_output.write(
"{}\n"
.
format
(preamble))
30
for
input_event
in
LHE.event_iterator(powheg_LHE_output):
31
is_event_changed, output_event = LHE.e2tau(input_event)
32
f_output.write(output_event)
33
n_events += [0, 1][is_event_changed]
34
f_output.write(postamble)
35
logger.info(
"Changed mu->tau in {} events!"
.
format
(n_events))
36
37
# Make a backup of the original events
38
shutil.move(powheg_LHE_output,
"{}.e2tau_backup"
.
format
(powheg_LHE_output))
39
shutil.move(powheg_LHE_tau, powheg_LHE_output)
python.decorators.timed.timed
def timed(name)
Decorator to output function execution time.
Definition:
timed.py:12
vtune_athena.format
format
Definition:
vtune_athena.py:14
Trk::open
@ open
Definition:
BinningType.h:40
python.algorithms.postprocessors.e2tau.e2tau
def e2tau(powheg_LHE_output)
Post-process existing events from electrons to taus.
Definition:
e2tau.py:13
Generated on Thu May 1 2025 21:08:52 for ATLAS Offline Software by
1.8.18