ATLAS Offline Software
LArRawDataReadingConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.Enums import ProductionStep
6 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
7 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
8 from LArConfiguration.LArConfigFlags import RawChannelSource
9 
10 
11 def LArRawDataReadingCfg(flags, **kwargs):
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 
32 if __name__=="__main__":
33 
34  from AthenaConfiguration.AllConfigFlags import 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 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.LArRawDataReadingConfig.LArRawDataReadingCfg
def LArRawDataReadingCfg(flags, **kwargs)
Definition: LArRawDataReadingConfig.py:11
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
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
DumpLArRawChannels
Definition: DumpLArRawChannels.h:22