ATLAS Offline Software
Loading...
Searching...
No Matches
LArRawDataReadingConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaConfiguration.Enums import ProductionStep
6from AthenaConfiguration.MainServicesConfig import MainServicesCfg
7from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
8from LArConfiguration.LArConfigFlags import RawChannelSource
9
10
11def LArRawDataReadingCfg(flags, **kwargs):
12 acc=ComponentAccumulator()
13 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
14 acc.merge(LArGMCfg(flags))
15 acc.merge(ByteStreamReadCfg(flags))
16
17 if flags.Common.ProductionStep is ProductionStep.MinbiasPreprocessing:
18 kwargs.setdefault("LArDigitKey", f"{flags.Overlay.BkgPrefix}LArDigitContainer_data")
19 kwargs.setdefault("LArFebHeaderKey", "LArFebHeader")
20 elif flags.LAr.RawChannelSource is RawChannelSource.Calculated or flags.Overlay.DataOverlay:
21 kwargs.setdefault("LArRawChannelKey", "")
22
23 print('LArRawDataReadingCfg flags.LAr.RawChannelSource ',flags.LAr.RawChannelSource)
24
25 acc.addEventAlgo(CompFactory.LArRawDataReadingAlg(**kwargs))
26 return acc
27
28
29if __name__=="__main__":
30
31 from AthenaConfiguration.AllConfigFlags import initConfigFlags
32 flags=initConfigFlags()
33 from AthenaCommon.Logging import log
34 from AthenaCommon.Constants import DEBUG
35 log.setLevel(DEBUG)
36
37 from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags, defaultConditionsTags
38 flags.LAr.doAlign=False
39 flags.Exec.OutputLevel=DEBUG
40 flags.Input.Files = defaultTestFiles.RAW_RUN2
41 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
42 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
43 flags.lock()
44
45 acc = MainServicesCfg( flags )
46 acc.merge(LArRawDataReadingCfg(flags))
47
48 DumpLArRawChannels=CompFactory.DumpLArRawChannels
49 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
50 acc.merge(LArOnOffIdMappingCfg(flags))
51 acc.addEventAlgo(DumpLArRawChannels(LArRawChannelContainerName="LArRawChannels",))
52
53 acc.run(10)
54
void print(char *figname, TCanvas *c1)