ATLAS Offline Software
Functions | Variables
python.algorithms.postprocessors.mu2e Namespace Reference

Functions

def mu2e (powheg_LHE_output)
 Post-process existing events from muons to electrons. More...
 

Variables

 logger = Logging.logging.getLogger("PowhegControl")
 Get handle to Athena logging. More...
 

Function Documentation

◆ mu2e()

def python.algorithms.postprocessors.mu2e.mu2e (   powheg_LHE_output)

Post-process existing events from muons to electrons.

Parameters
powheg_LHE_outputName of LHE file produced by PowhegBox.
Author
Jan Kretzschmar jan.k.nosp@m.retz.nosp@m.schma.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 13 of file mu2e.py.

13 def mu2e(powheg_LHE_output):
14  """! Post-process existing events from muons to electrons
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 muon to electron decays.")
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_e = "{}.e".format(powheg_LHE_output)
28  with open(powheg_LHE_e, "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.mu2e(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->e in {} events!".format(n_events))
36 
37  # Make a backup of the original events
38  shutil.move(powheg_LHE_output, "{}.mu2e_backup".format(powheg_LHE_output))
39  shutil.move(powheg_LHE_e, powheg_LHE_output)

Variable Documentation

◆ logger

python.algorithms.postprocessors.mu2e.logger = Logging.logging.getLogger("PowhegControl")

Get handle to Athena logging.

Definition at line 9 of file mu2e.py.

vtune_athena.format
format
Definition: vtune_athena.py:14
python.algorithms.postprocessors.mu2e.mu2e
def mu2e(powheg_LHE_output)
Post-process existing events from muons to electrons.
Definition: mu2e.py:13
Trk::open
@ open
Definition: BinningType.h:40