ATLAS Offline Software
runTauOnly_EMTopo.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 # Simple script to run a
4 # Tau job
5 #
6 # Usefull for quick testing using EMTopo jets for tau seeding
7 # run with
8 #
9 # athena --CA runTauOnly_EMTopo.py
10 # or
11 # python runTauOnly_EMTopo.py
12 
13 import sys
14 
15 def tauSpecialContent(flags,cfg):
16  from OutputStreamAthenaPool.OutputStreamConfig import outputStreamName
17  StreamAOD = cfg.getEventAlgo(outputStreamName("AOD"))
18  newList = [x for x in StreamAOD.ItemList if "Tau" in x]
19  StreamAOD.ItemList = newList
20 
21  StreamESD = cfg.getEventAlgo(outputStreamName("ESD"))
22  newList = [x for x in StreamESD.ItemList if "Tau" in x]
23  StreamESD.ItemList = newList
24 
25 def _run():
26  from AthenaConfiguration.AllConfigFlags import initConfigFlags
27  flags = initConfigFlags()
28  # input
29  from AthenaConfiguration.TestDefaults import defaultTestFiles
30  flags.Exec.MaxEvents = 20
31  flags.Input.Files = defaultTestFiles.RDO_RUN2
32  from AthenaConfiguration.Enums import ProductionStep
33  flags.Common.ProductionStep = ProductionStep.Reconstruction
34 
35  # output
36  flags.Output.ESDFileName = "myESD.pool.root"
37  flags.Output.AODFileName = "myAOD.pool.root"
38 
39  # uncomment given something like export ATHENA_CORE_NUMBER=2
40  # flags.Concurrency.NumThreads = 2
41 
42  # Setup detector flags
43  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
44  setupDetectorFlags(flags, None, use_metadata=True,
45  toggle_geometry=True, keep_beampipe=True)
46 
47  # Schedule Tau Reco
48  from tauRec.ConfigurationHelpers import StandaloneTauRecoFlags
50  flags.Tau.TauRec.SeedJetCollection = "AntiKt4EMTopoJets"
51  flags.lock()
52 
53  from RecJobTransforms.RecoSteering import RecoSteering
54  acc = RecoSteering(flags)
55 
56  # keep only tau containers
57  tauSpecialContent(flags,acc)
58 
59  # Special message service configuration
60  from DigitizationConfig.DigitizationSteering import DigitizationMessageSvcCfg
61  acc.merge(DigitizationMessageSvcCfg(flags))
62 
63  from AthenaConfiguration.Utils import setupLoggingLevels
64  setupLoggingLevels(flags, acc)
65 
66  # Print reco domain status
67  from RecJobTransforms.RecoConfigFlags import printRecoFlags
68  printRecoFlags(flags)
69 
70  # running
71  statusCode = acc.run()
72 
73  return statusCode
74 
75 
76 if __name__ == "__main__":
77  statusCode = None
78  statusCode = _run()
79  assert statusCode is not None, "Issue while running"
80  sys.exit(not statusCode.isSuccess())
81 
82 
AthenaPoolExample_WriteCond.outputStreamName
string outputStreamName
Definition: AthenaPoolExample_WriteCond.py:21
runTauOnly_EMTopo.tauSpecialContent
def tauSpecialContent(flags, cfg)
Definition: runTauOnly_EMTopo.py:15
python.RecoSteering.RecoSteering
def RecoSteering(flags)
Definition: RecoSteering.py:6
runTauOnly_EMTopo._run
def _run()
Definition: runTauOnly_EMTopo.py:25
ConfigurationHelpers.StandaloneTauRecoFlags
def StandaloneTauRecoFlags(flags)
Definition: Reconstruction/tauRec/python/ConfigurationHelpers.py:6
python.RecoConfigFlags.printRecoFlags
def printRecoFlags(flags)
Definition: RecoConfigFlags.py:153
python.DigitizationSteering.DigitizationMessageSvcCfg
def DigitizationMessageSvcCfg(flags)
Definition: DigitizationSteering.py:217
python.Utils.setupLoggingLevels
def setupLoggingLevels(flags, ca)
Definition: Control/AthenaConfiguration/python/Utils.py:46
python.DetectorConfigFlags.setupDetectorFlags
def setupDetectorFlags(flags, custom_list=None, use_metadata=False, toggle_geometry=False, validate_only=False, keep_beampipe=False)
Definition: DetectorConfigFlags.py:289
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19