ATLAS Offline Software
TRTPreProcessing.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 # ------------------------------------------------------------
3 #
4 # ----------- TRT Data-Preparation stage
5 #
6 # ------------------------------------------------------------
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.Enums import Format, BeamType
9 
10 
12  acc = ComponentAccumulator()
13  if not flags.Detector.EnableTRT:
14  return acc
15 
16  if flags.Input.Format is Format.BS or 'TRT_RDOs' in flags.Input.Collections:
17 
18  #
19  # --- TRT_RIO_Maker Algorithm
20  #
21  if flags.Beam.Type is BeamType.Cosmics:
22  from InDetConfig.InDetPrepRawDataFormationConfig import (
23  InDetTRT_NoTime_RIO_MakerCfg)
24  acc.merge(InDetTRT_NoTime_RIO_MakerCfg(flags))
25  else:
26  from InDetConfig.InDetPrepRawDataFormationConfig import (
27  InDetTRT_RIO_MakerCfg)
28  acc.merge(InDetTRT_RIO_MakerCfg(flags))
29 
30  if flags.InDet.doSplitReco:
31  from InDetConfig.InDetPrepRawDataFormationConfig import (
32  InDetTRT_RIO_MakerPUCfg)
33  acc.merge(InDetTRT_RIO_MakerPUCfg(flags))
34 
35  #
36  # Include alg to save the local occupancy inside xAOD::EventInfo
37  #
38  if flags.InDet.doTRTGlobalOccupancy:
39  from InDetConfig.TRT_ElectronPidToolsConfig import (
40  TRTOccupancyIncludeCfg)
41  acc.merge(TRTOccupancyIncludeCfg(flags))
42 
43  #
44  # --- we need to do truth association if requested (not for uncalibrated hits in cosmics)
45  #
46  if flags.InDet.doTruth and (
47  flags.Beam.Type is not BeamType.Cosmics and
48  'PRD_MultiTruthTRT' not in flags.Input.Collections):
49  from InDetConfig.InDetTruthAlgsConfig import (
50  InDetPRD_MultiTruthMakerTRTCfg)
51  acc.merge(InDetPRD_MultiTruthMakerTRTCfg(flags))
52  if flags.InDet.doSplitReco:
53  from InDetConfig.InDetTruthAlgsConfig import (
54  InDetPRD_MultiTruthMakerTRTPUCfg)
55  acc.merge(InDetPRD_MultiTruthMakerTRTPUCfg(flags))
56  return acc
57 
58 
59 if __name__ == "__main__":
60  from AthenaConfiguration.AllConfigFlags import initConfigFlags
61  flags = initConfigFlags()
62 
63  from AthenaConfiguration.TestDefaults import defaultTestFiles
64  flags.Input.Files = defaultTestFiles.RDO_RUN2
65 
66  # TODO: TRT only?
67 
68  numThreads = 1
69  flags.Concurrency.NumThreads = numThreads
70  # Might change this later, but good enough for the moment.
71  flags.Concurrency.NumConcurrentEvents = numThreads
72 
73  flags.lock()
74  flags.dump()
75 
76  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
77  top_acc = MainServicesCfg(flags)
78 
79  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
80  top_acc.merge(PoolReadCfg(flags))
81 
82  from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
83  top_acc.merge(TRT_ReadoutGeometryCfg(flags))
84 
85  from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
86  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
87  top_acc.merge(PixelReadoutGeometryCfg(flags))
88  top_acc.merge(SCT_ReadoutGeometryCfg(flags))
89 
90  top_acc.merge(TRTPreProcessingCfg(flags))
91 
92  iovsvc = top_acc.getService('IOVDbSvc')
93  iovsvc.OutputLevel = 5
94  top_acc.run(25)
95  top_acc.store(open("test_TRTPrepocessing.pkl", "wb"))
python.TRTPreProcessing.TRTPreProcessingCfg
def TRTPreProcessingCfg(flags)
Definition: TRTPreProcessing.py:11
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TRT_ElectronPidToolsConfig.TRTOccupancyIncludeCfg
def TRTOccupancyIncludeCfg(flags, name="TRTOccupancyInclude", **kwargs)
Definition: TRT_ElectronPidToolsConfig.py:45
TRT_GeoModelConfig.TRT_ReadoutGeometryCfg
def TRT_ReadoutGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:55
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:42
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
python.InDetPrepRawDataFormationConfig.InDetTRT_NoTime_RIO_MakerCfg
def InDetTRT_NoTime_RIO_MakerCfg(flags, name="InDetTRT_NoTime_RIO_Maker", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:251
PixelGeoModelConfig.PixelReadoutGeometryCfg
def PixelReadoutGeometryCfg(flags)
Definition: PixelGeoModelConfig.py:42
python.InDetTruthAlgsConfig.InDetPRD_MultiTruthMakerTRTCfg
def InDetPRD_MultiTruthMakerTRTCfg(flags, name="InDetTRT_PRD_MultiTruthMaker", **kwargs)
Definition: InDetTruthAlgsConfig.py:64
python.InDetPrepRawDataFormationConfig.InDetTRT_RIO_MakerPUCfg
def InDetTRT_RIO_MakerPUCfg(flags, name="InDetTRT_RIO_MakerPU", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:275
python.InDetTruthAlgsConfig.InDetPRD_MultiTruthMakerTRTPUCfg
def InDetPRD_MultiTruthMakerTRTPUCfg(flags, name="InDetTRT_PRD_MultiTruthMakerPU", **kwargs)
Definition: InDetTruthAlgsConfig.py:87
python.InDetPrepRawDataFormationConfig.InDetTRT_RIO_MakerCfg
def InDetTRT_RIO_MakerCfg(flags, name="InDetTRT_RIO_Maker", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:234
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69