ATLAS Offline Software
CaloRecoConfig.py
Go to the documentation of this file.
1 #!/usr/bin/env athena.py
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from AthenaConfiguration.Enums import Format
7 
8 
9 def CaloRecoCfg(flags, clustersname=None):
10  result = ComponentAccumulator()
11  if flags.Input.Format is Format.BS:
12  #Data-case: Schedule ByteStream reading for LAr & Tile
13  from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
14  result.merge(LArRawDataReadingCfg(flags))
15 
16  from TileByteStream.TileByteStreamConfig import TileRawDataReadingCfg
17  result.merge( TileRawDataReadingCfg(flags) )
18 
19  if flags.Output.doWriteESD:
20  from TileRecAlgs.TileDigitsFilterConfig import TileDigitsFilterOutputCfg
21  result.merge(TileDigitsFilterOutputCfg(flags))
22  else: #Mostly for wrapping in RecExCommon
23  from TileRecAlgs.TileDigitsFilterConfig import TileDigitsFilterCfg
24  result.merge(TileDigitsFilterCfg(flags))
25 
26  from LArROD.LArRawChannelBuilderAlgConfig import LArRawChannelBuilderAlgCfg
27  result.merge(LArRawChannelBuilderAlgCfg(flags))
28 
29  from TileRecUtils.TileRawChannelMakerConfig import TileRawChannelMakerCfg
30  result.merge(TileRawChannelMakerCfg(flags))
31 
32  if not flags.Input.isMC and not flags.Common.isOnline:
33  from LArCellRec.LArTimeVetoAlgConfig import LArTimeVetoAlgCfg
34  result.merge(LArTimeVetoAlgCfg(flags))
35 
36  if not flags.Input.isMC and not flags.Overlay.DataOverlay:
37  from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
38  result.merge(LArFebErrorSummaryMakerCfg(flags))
39 
40 
41  #Configure cell-building
42  from CaloRec.CaloCellMakerConfig import CaloCellMakerCfg
43  result.merge(CaloCellMakerCfg(flags))
44 
45  #Configure topo-cluster builder
46  from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
47  result.merge(CaloTopoClusterCfg(flags, clustersname=clustersname))
48 
49  #Configure forward towers:
50  from CaloRec.CaloFwdTopoTowerConfig import CaloFwdTopoTowerCfg
51  result.merge(CaloFwdTopoTowerCfg(flags,CaloTopoClusterContainerKey="CaloCalTopoClusters"))
52 
53  #Configure NoisyROSummary
54  from LArCellRec.LArNoisyROSummaryConfig import LArNoisyROSummaryCfg
55  result.merge(LArNoisyROSummaryCfg(flags))
56 
57  #Configure TileLookForMuAlg
58  from TileMuId.TileMuIdConfig import TileLookForMuAlgCfg
59  result.merge(TileLookForMuAlgCfg(flags))
60 
61  if not flags.Input.isMC and not flags.Overlay.DataOverlay:
62  #Configure LArDigitsThinner:
63  from LArROD.LArDigitThinnerConfig import LArDigitThinnerCfg
64  result.merge(LArDigitThinnerCfg(flags))
65 
66  #Configure MBTSTimeDiff
67  #Clients are BackgroundWordFiller and (deprecated?) DQTBackgroundMonTool
68  #Consider moving to BackgroundWordFiller config
69  if flags.Detector.GeometryMBTS:
70  from TileRecAlgs.MBTSTimeDiffEventInfoAlgConfig import MBTSTimeDiffEventInfoAlgCfg
71  result.merge(MBTSTimeDiffEventInfoAlgCfg(flags))
72 
73 
74  #Configure AOD Cell-Thinning based on samplings:
75  from CaloRec.CaloThinCellsBySamplingAlgConfig import CaloThinCellsBySamplingAlgCfg
76  result.merge(CaloThinCellsBySamplingAlgCfg(flags,'StreamAOD', ['TileGap3']))
77 
78  # Optional: AOD Cell, rawCh, digits thinning, based on clusters, for XTalk studies
79  if flags.Calo.TopoCluster.xtalkInfoDumper and not flags.Overlay.DataOverlay:
80  from LArClusterCellDumper.CaloThinCellsInAODAlgConfig import CaloThinCellsInAODAlgCfg
81  result.merge(CaloThinCellsInAODAlgCfg(flags))
82 
83  return result
84 
85 
87  result = ComponentAccumulator()
88 
89  result.addEventAlgo(CompFactory.DumpLArRawChannels(LArRawChannelContainerName="LArRawChannels_FromDigits"))
90  result.addEventAlgo(CompFactory.CaloCellDumper())
91 
92  ClusterDumper = CompFactory.ClusterDumper
93  result.addEventAlgo(ClusterDumper("TopoDumper", ContainerName="CaloCalTopoClusters", FileName="TopoCluster.txt"))
94  result.addEventAlgo(ClusterDumper("FwdTopoDumper", ContainerName="CaloCalFwdTopoTowers", FileName="FwdTopoCluster.txt"))
95 
96  return result
97 
98 # Run with python -m CaloRec.CaloRecoConfig
99 def CaloRecoConfigTest(flags=None):
100 
101  if flags is None:
102  from AthenaConfiguration.AllConfigFlags import initConfigFlags
103  flags = initConfigFlags()
104 
105  from AthenaConfiguration.TestDefaults import defaultGeometryTags,defaultConditionsTags,defaultTestFiles
106  flags.Input.Files = defaultTestFiles.RAW_RUN3_DATA24
107  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA
108  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
109 
110  from AthenaCommon.Constants import DEBUG,INFO
111  from AthenaCommon.Logging import log
112  log.setLevel(DEBUG)
113  flags.Exec.OutputLevel=INFO
114 
115  flags.Exec.MaxEvents=10
116  flags.fillFromArgs()
117  flags.lock()
118 
119  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
120  acc = MainServicesCfg(flags)
121 
122  acc.merge(CaloRecoCfg(flags))
123 
124  CaloCellDumper = CompFactory.CaloCellDumper
125  acc.addEventAlgo(CaloCellDumper(),sequenceName="AthAlgSeq")
126 
127  ClusterDumper = CompFactory.ClusterDumper
128  acc.addEventAlgo(ClusterDumper("TopoDumper",ContainerName="CaloCalTopoClusters",FileName="TopoCluster.txt"),sequenceName="AthAlgSeq")
129 
130  f = open("CaloRec.pkl","wb")
131  acc.store(f)
132  f.close()
133 
134  acc.run()
135 
136 if __name__=="__main__":
137  from AthenaConfiguration.AllConfigFlags import initConfigFlags
138  from AthenaCommon.Logging import log
139  from AthenaCommon.Constants import DEBUG
140  from AthenaConfiguration.TestDefaults import defaultGeometryTags,defaultConditionsTags,defaultTestFiles
141  log.setLevel(DEBUG)
142  flags = initConfigFlags()
143  flags.Input.Files = (defaultTestFiles.RAW_RUN3)
144  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA
145  flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
146  CaloRecoConfigTest(flags)
python.CaloRecoConfig.CaloRecoDebuggingCfg
def CaloRecoDebuggingCfg(flags)
Definition: CaloRecoConfig.py:86
TileDigitsFilterConfig.TileDigitsFilterOutputCfg
def TileDigitsFilterOutputCfg(flags, streamName='ESD', **kwargs)
Definition: TileDigitsFilterConfig.py:31
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.CaloFwdTopoTowerConfig.CaloFwdTopoTowerCfg
def CaloFwdTopoTowerCfg(flags, **kwargs)
Definition: CaloFwdTopoTowerConfig.py:7
ClusterDumper
Definition: ClusterDumper.h:22
python.LArRawChannelBuilderAlgConfig.LArRawChannelBuilderAlgCfg
def LArRawChannelBuilderAlgCfg(flags, **kwargs)
Definition: LArRawChannelBuilderAlgConfig.py:9
python.CaloCellMakerConfig.CaloCellMakerCfg
def CaloCellMakerCfg(flags)
Definition: CaloCellMakerConfig.py:12
python.LArDigitThinnerConfig.LArDigitThinnerCfg
def LArDigitThinnerCfg(flags, **kwargs)
Definition: LArDigitThinnerConfig.py:12
TileDigitsFilterConfig.TileDigitsFilterCfg
def TileDigitsFilterCfg(flags, **kwargs)
Definition: TileDigitsFilterConfig.py:9
CaloThinCellsInAODAlgConfig.CaloThinCellsInAODAlgCfg
def CaloThinCellsInAODAlgCfg(flags, **kwargs)
Definition: CaloThinCellsInAODAlgConfig.py:12
python.LArFebErrorSummaryMakerConfig.LArFebErrorSummaryMakerCfg
def LArFebErrorSummaryMakerCfg(flags)
Definition: LArFebErrorSummaryMakerConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
LArTimeVetoAlgConfig.LArTimeVetoAlgCfg
def LArTimeVetoAlgCfg(flags)
Definition: LArTimeVetoAlgConfig.py:7
python.LArRawDataReadingConfig.LArRawDataReadingCfg
def LArRawDataReadingCfg(configFlags, **kwargs)
Definition: LArRawDataReadingConfig.py:10
python.CaloTopoClusterConfig.CaloTopoClusterCfg
def CaloTopoClusterCfg(flags, cellsname="AllCalo", clustersname=None, clustersnapname="CaloTopoClusters")
Definition: CaloTopoClusterConfig.py:318
CaloCellDumper
Definition: CaloCellDumper.h:15
Trk::open
@ open
Definition: BinningType.h:40
LArNoisyROSummaryConfig.LArNoisyROSummaryCfg
def LArNoisyROSummaryCfg(configFlags, **kwargs)
Definition: LArNoisyROSummaryConfig.py:8
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileByteStreamConfig.TileRawDataReadingCfg
def TileRawDataReadingCfg(flags, readDigits=True, readRawChannel=True, readMuRcv=None, readMuRcvDigits=False, readMuRcvRawCh=False, readBeamElem=None, readLaserObj=None, readDigitsFlx=False, readL2=False, stateless=False, **kwargs)
Definition: TileByteStreamConfig.py:87
TileRawChannelMakerConfig.TileRawChannelMakerCfg
def TileRawChannelMakerCfg(flags, **kwargs)
Definition: TileRawChannelMakerConfig.py:10
python.CaloThinCellsBySamplingAlgConfig.CaloThinCellsBySamplingAlgCfg
def CaloThinCellsBySamplingAlgCfg(flags, streamName, samplings=[], cells='AllCalo')
Definition: CaloThinCellsBySamplingAlgConfig.py:11
TileMuIdConfig.TileLookForMuAlgCfg
def TileLookForMuAlgCfg(flags, **kwargs)
Definition: TileMuIdConfig.py:12
MBTSTimeDiffEventInfoAlgConfig.MBTSTimeDiffEventInfoAlgCfg
def MBTSTimeDiffEventInfoAlgCfg(flags, **kwargs)
Definition: MBTSTimeDiffEventInfoAlgConfig.py:9
python.CaloRecoConfig.CaloRecoConfigTest
def CaloRecoConfigTest(flags=None)
Definition: CaloRecoConfig.py:99