ATLAS Offline Software
LArRawDataReadingConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
6 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
7 from LArConfiguration.LArConfigFlags import RawChannelSource
8 
9 
10 def LArRawDataReadingCfg(configFlags, **kwargs):
12  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
13  acc.merge(LArGMCfg(configFlags))
14  acc.merge(ByteStreamReadCfg(configFlags))
15 
16  if configFlags.Overlay.DataOverlay:
17  kwargs.setdefault("LArDigitKey", configFlags.Overlay.BkgPrefix + "FREE")
18  kwargs.setdefault("LArFebHeaderKey", "LArFebHeader")
19  if configFlags.LAr.RawChannelSource is RawChannelSource.Calculated or configFlags.Overlay.DataOverlay:
20  kwargs.setdefault("LArRawChannelKey", "")
21 
22  print('LArRawDataReadingCfg configFlags.LAr.RawChannelSource ',configFlags.LAr.RawChannelSource)
23 
24  acc.addEventAlgo(CompFactory.LArRawDataReadingAlg(**kwargs))
25  return acc
26 
27 
28 if __name__=="__main__":
29 
30  from AthenaConfiguration.AllConfigFlags import initConfigFlags
32  from AthenaCommon.Logging import log
33  from AthenaCommon.Constants import DEBUG
34  log.setLevel(DEBUG)
35 
36  from AthenaConfiguration.TestDefaults import defaultTestFiles
37  flags.LAr.doAlign=False
38  flags.Exec.OutputLevel=DEBUG
39  flags.Input.Files = defaultTestFiles.RAW_RUN2
40  flags.lock()
41 
42  acc = MainServicesCfg( flags )
43  acc.merge(LArRawDataReadingCfg(flags))
44 
45  DumpLArRawChannels=CompFactory.DumpLArRawChannels
46  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
47  acc.merge(LArOnOffIdMappingCfg(flags))
48  acc.addEventAlgo(DumpLArRawChannels(LArRawChannelContainerName="LArRawChannels",))
49 
50  acc.run(2)
51 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.LArRawDataReadingConfig.LArRawDataReadingCfg
def LArRawDataReadingCfg(configFlags, **kwargs)
Definition: LArRawDataReadingConfig.py:10
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
DumpLArRawChannels
Definition: DumpLArRawChannels.h:22