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 if 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
38 flags.LAr.doAlign=False
39 flags.Exec.OutputLevel=DEBUG
40 flags.Input.Files = defaultTestFiles.RAW_RUN2
41 flags.lock()
42
43 acc = MainServicesCfg( flags )
44 acc.merge(LArRawDataReadingCfg(flags))
45
46 DumpLArRawChannels=CompFactory.DumpLArRawChannels
47 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
48 acc.merge(LArOnOffIdMappingCfg(flags))
49 acc.addEventAlgo(DumpLArRawChannels(LArRawChannelContainerName="LArRawChannels",))
50
51 acc.run(2)
52
void print(char *figname, TCanvas *c1)