ATLAS Offline Software
Loading...
Searching...
No Matches
LArRawDataReadingConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 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.Overlay.ByteStream:
21 kwargs.setdefault("LArDigitKey", f"{flags.Overlay.BkgPrefix}FREE")
22 kwargs.setdefault("LArFebHeaderKey", "LArFebHeader")
23 if flags.LAr.RawChannelSource is RawChannelSource.Calculated or flags.Overlay.DataOverlay:
24 kwargs.setdefault("LArRawChannelKey", "")
25
26 print('LArRawDataReadingCfg flags.LAr.RawChannelSource ',flags.LAr.RawChannelSource)
27
28 acc.addEventAlgo(CompFactory.LArRawDataReadingAlg(**kwargs))
29 return acc
30
31
32if __name__=="__main__":
33
34 from AthenaConfiguration.AllConfigFlags import initConfigFlags
35 flags=initConfigFlags()
36 from AthenaCommon.Logging import log
37 from AthenaCommon.Constants import DEBUG
38 log.setLevel(DEBUG)
39
40 from AthenaConfiguration.TestDefaults import defaultTestFiles
41 flags.LAr.doAlign=False
42 flags.Exec.OutputLevel=DEBUG
43 flags.Input.Files = defaultTestFiles.RAW_RUN2
44 flags.lock()
45
46 acc = MainServicesCfg( flags )
47 acc.merge(LArRawDataReadingCfg(flags))
48
49 DumpLArRawChannels=CompFactory.DumpLArRawChannels
50 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
51 acc.merge(LArOnOffIdMappingCfg(flags))
52 acc.addEventAlgo(DumpLArRawChannels(LArRawChannelContainerName="LArRawChannels",))
53
54 acc.run(2)
55
void print(char *figname, TCanvas *c1)