ATLAS Offline Software
TrkClusterAnalysisConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 
7 def TrkClusterAnalisysBaseCfg(flags, name, **kwargs):
8  result = ComponentAccumulator()
9  histsvc = CompFactory.THistSvc(name="THistSvc",
10  Output=[ f"{name} DATAFILE='{name}.root' OPT='RECREATE'" ])
11  result.addService(histsvc)
12  return result
13 
14 
15 def ITkPixelClusterAnalysisCfg(flags, name="ITkPixelClusterAnalysis", **kwargs):
16  result = TrkClusterAnalisysBaseCfg(flags, name, **kwargs)
17 
18  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelReadoutGeometryCfg
19  result.merge(ITkPixelReadoutGeometryCfg(flags))
20 
21  kwargs.setdefault("NtupleFileName", f"/{name}/")
22  kwargs.setdefault("HistPath", f"/{name}/")
23  kwargs.setdefault("InputKey", "ITkPixelClusters")
24 
25  result.addEventAlgo(CompFactory.PixelClusterAnalysis(name, **kwargs))
26  return result
27 
28 
29 def ITkStripClusterAnalysisCfg(flags, name="ITkStripClusterAnalysis", **kwargs):
30  result = TrkClusterAnalisysBaseCfg(flags, name, **kwargs)
31 
32  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
33  result.merge(ITkStripReadoutGeometryCfg(flags))
34 
35  kwargs.setdefault("NtupleFileName", f"/{name}/")
36  kwargs.setdefault("HistPath", f"/{name}/")
37  kwargs.setdefault("InputKey", "ITkStripClusters")
38 
39  result.addEventAlgo(CompFactory.SCT_ClusterAnalysis(name, **kwargs))
40  return result
41 
42 
43 def ClusterAnalysisCfg(flags):
44  acc = ComponentAccumulator()
45 
46  if flags.Detector.EnableITkPixel:
47  acc.merge(ITkPixelClusterAnalysisCfg(flags))
48 
49  if flags.Detector.EnableITkStrip:
50  acc.merge(ITkStripClusterAnalysisCfg(flags))
51 
52  return acc
python.TrkClusterAnalysisConfig.TrkClusterAnalisysBaseCfg
def TrkClusterAnalisysBaseCfg(flags, name, **kwargs)
Definition: TrkClusterAnalysisConfig.py:7
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:39
ITkPixelGeoModelConfig.ITkPixelReadoutGeometryCfg
def ITkPixelReadoutGeometryCfg(flags)
Definition: ITkPixelGeoModelConfig.py:39
python.TrkClusterAnalysisConfig.ClusterAnalysisCfg
def ClusterAnalysisCfg(flags)
Definition: TrkClusterAnalysisConfig.py:43
python.TrkClusterAnalysisConfig.ITkStripClusterAnalysisCfg
def ITkStripClusterAnalysisCfg(flags, name="ITkStripClusterAnalysis", **kwargs)
Definition: TrkClusterAnalysisConfig.py:29
python.TrkClusterAnalysisConfig.ITkPixelClusterAnalysisCfg
def ITkPixelClusterAnalysisCfg(flags, name="ITkPixelClusterAnalysis", **kwargs)
Definition: TrkClusterAnalysisConfig.py:15