ATLAS Offline Software
JiveXMLConfig.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 AthenaConfiguration.Enums import Format
6 
7 
9  import os
10 
11  if "AtlasVersion" in os.environ:
12  return os.environ["AtlasVersion"]
13  if "AtlasBaseVersion" in os.environ:
14  return os.environ["AtlasBaseVersion"]
15  return "Unknown"
16 
17 
18 def AlgoJiveXMLCfg(flags, name="AlgoJiveXML", **kwargs):
19  # This is based on a few old-style configuation files:
20  # JiveXML_RecEx_config.py
21  # JiveXML_jobOptionBase.py
22  result = ComponentAccumulator()
23 
24  kwargs.setdefault("AtlasRelease", getATLASVersion())
25  kwargs.setdefault("WriteToFile", True)
26 
27  kwargs.setdefault("WriteGeometry", False)
28  kwargs.setdefault("StreamToServerTool", None)
29 
30  # This next bit sets the data types, then we set the associated public tools
31  readAOD = False # FIXME - set this properly
32  readESD = False # FIXME - set this properly
33  haveRDO = (
34  flags.Input.Format is Format.BS or "StreamRDO" in flags.Input.ProcessingTags
35  )
36 
37  tools = []
38 
39  if not readAOD:
40  from JiveXML.TruthTrackRetrieverConfig import TruthTrackRetrieverCfg
41  tools += [result.getPrimaryAndMerge(TruthTrackRetrieverCfg(flags))]
42 
43  if haveRDO or readESD:
44  if flags.Detector.EnableID and flags.Detector.GeometryID:
45  from JiveXML.InDetRetrieversConfig import InDetRetrieversCfg
46  cfg_ID, tools_ID = InDetRetrieversCfg(flags)
47  result.merge(cfg_ID)
48  tools += tools_ID
49 
50  if flags.Detector.EnableCalo and flags.Detector.GeometryCalo:
51  from JiveXML.CaloRetrieversConfig import CaloRetrieversCfg
52  cfg_Calo, tools_Calo = CaloRetrieversCfg(flags)
53  result.merge(cfg_Calo)
54  tools += tools_Calo
55 
56  if flags.Detector.EnableMuon and flags.Detector.GeometryMuon:
57  from JiveXML.MuonRetrieversConfig import MuonRetrieversCfg
58  cfg_Muon, tools_Muon = MuonRetrieversCfg(flags)
59  result.merge(cfg_Muon)
60  tools += tools_Muon
61 
62  from JiveXML.xAODRetrieversConfig import xAODRetrieversCfg
63  cfg_xAOD, tools_xAOD = xAODRetrieversCfg(flags)
64  result.merge(cfg_xAOD)
65  tools += tools_xAOD
66 
67  from JiveXML.TriggerRetrieversConfig import TriggerRetrieversCfg
68  cfg_Trigger, tools_Trigger = TriggerRetrieversCfg(flags)
69  result.merge(cfg_Trigger)
70  tools += tools_Trigger
71 
72  kwargs.setdefault("DataRetrieverTools", tools)
73  the_alg = CompFactory.JiveXML.AlgoJiveXML(name="AlgoJiveXML", **kwargs)
74  result.addEventAlgo(the_alg, primary=True)
75 
76 
77  return result
InDetRetrieversConfig.InDetRetrieversCfg
def InDetRetrieversCfg(flags)
Definition: InDetRetrieversConfig.py:105
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
JiveXMLConfig.AlgoJiveXMLCfg
def AlgoJiveXMLCfg(flags, name="AlgoJiveXML", **kwargs)
Definition: JiveXMLConfig.py:18
TruthTrackRetrieverConfig.TruthTrackRetrieverCfg
def TruthTrackRetrieverCfg(flags, name="TruthTrackRetriever", **kwargs)
Definition: TruthTrackRetrieverConfig.py:6
MuonRetrieversConfig.MuonRetrieversCfg
def MuonRetrieversCfg(flags, **kwargs)
Definition: MuonRetrieversConfig.py:50
JiveXMLConfig.getATLASVersion
def getATLASVersion()
Definition: JiveXMLConfig.py:8
xAODRetrieversConfig.xAODRetrieversCfg
def xAODRetrieversCfg(flags)
Definition: xAODRetrieversConfig.py:124
TriggerRetrieversConfig.TriggerRetrieversCfg
def TriggerRetrieversCfg(flags)
Definition: TriggerRetrieversConfig.py:51
CaloRetrieversConfig.CaloRetrieversCfg
def CaloRetrieversCfg(flags, **kwargs)
Definition: CaloRetrieversConfig.py:148