ATLAS Offline Software
EvgenProdToolsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from GeneratorConfig.Sequences import EvgenSequence, EvgenSequenceFactory
6 
7 
8 def TestHepMCCfg(flags, name="TestHepMC", streamName="TestHepMCname", fileName="TestHepMC.root", **kwargs):
9  kwargs.setdefault("CmEnergy", flags.Beam.Energy * 2)
10 
11  acc = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Test))
12  acc.addService(CompFactory.THistSvc(name="THistSvc",
13  Output=[f"{streamName} DATAFILE='{fileName}' OPT='RECREATE'"]))
14 
15  acc.addEventAlgo(CompFactory.TestHepMC(name, **kwargs))
16  return acc
17 
18 
19 def FixHepMCCfg(flags, name="FixHepMC", **kwargs):
20  acc = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Fix))
21  acc.addEventAlgo(CompFactory.FixHepMC(name, **kwargs))
22  return acc
23 
24 
25 def CountHepMCCfg(flags, name="CountHepMC", **kwargs):
26  kwargs.setdefault("InputEventInfo", "TMPEvtInfo")
27  kwargs.setdefault("OutputEventInfo", "EventInfo")
28  kwargs.setdefault("mcEventWeightsKey", "TMPEvtInfo.mcEventWeights")
29  kwargs.setdefault("FirstEvent", flags.Exec.FirstEvent)
30  kwargs.setdefault("CorrectHepMC", True)
31  kwargs.setdefault("CorrectEventID", True)
32 
33  acc = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Post))
34  acc.addEventAlgo(CompFactory.CountHepMC(name, **kwargs))
35  return acc
36 
37 
38 def CopyEventWeightCfg(flags, name="CopyEventWeight", **kwargs):
39  kwargs.setdefault("mcEventWeightsKey", "TMPEvtInfo.mcEventWeights")
40 
41  acc = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Post))
42  acc.addEventAlgo(CompFactory.CopyEventWeight(name, **kwargs))
43  return acc
44 
45 
46 def FillFilterValuesCfg(flags, name="FillFilterValues", **kwargs):
47  kwargs.setdefault("mcFilterHTKey", "TMPEvtInfo.mcFilterHT")
48 
49  acc = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Post))
50  acc.addEventAlgo(CompFactory.FillFilterValues(name, **kwargs))
51  return acc
52 
53 
54 def SimTimeEstimateCfg(flags, name="SimTimeEstimate", **kwargs):
55  acc = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Post))
56  acc.addEventAlgo(CompFactory.SimTimeEstimate(name, **kwargs))
57  return acc
python.Sequences.EvgenSequenceFactory
def EvgenSequenceFactory(sequence)
Definition: Sequences.py:17
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
EvgenProdToolsConfig.SimTimeEstimateCfg
def SimTimeEstimateCfg(flags, name="SimTimeEstimate", **kwargs)
Definition: EvgenProdToolsConfig.py:54
EvgenProdToolsConfig.CopyEventWeightCfg
def CopyEventWeightCfg(flags, name="CopyEventWeight", **kwargs)
Definition: EvgenProdToolsConfig.py:38
EvgenProdToolsConfig.TestHepMCCfg
def TestHepMCCfg(flags, name="TestHepMC", streamName="TestHepMCname", fileName="TestHepMC.root", **kwargs)
Definition: EvgenProdToolsConfig.py:8
EvgenProdToolsConfig.FixHepMCCfg
def FixHepMCCfg(flags, name="FixHepMC", **kwargs)
Definition: EvgenProdToolsConfig.py:19
EvgenProdToolsConfig.CountHepMCCfg
def CountHepMCCfg(flags, name="CountHepMC", **kwargs)
Definition: EvgenProdToolsConfig.py:25
EvgenProdToolsConfig.FillFilterValuesCfg
def FillFilterValuesCfg(flags, name="FillFilterValues", **kwargs)
Definition: EvgenProdToolsConfig.py:46