ATLAS Offline Software
LArRawCalibDataReadingConfig.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 
8 def LArRawCalibDataReadingCfg(configFlags,gain="HIGH",doAccDigit=False,doAccCalibDigit=False,doCalibDigit=False,doDigit=False):
10  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
11  acc.merge(LArGMCfg(configFlags))
12  acc.merge(ByteStreamReadCfg(configFlags))
13  accKey=""
14  accCalibKey=""
15  calibKey=""
16  digKey=""
17  if doAccDigit:
18  accKey=gain
19  elif doAccCalibDigit:
20  accCalibKey=gain
21  elif doCalibDigit:
22  calibKey=gain
23  elif doDigit:
24  digKey=gain
25  else:
26  from AthenaCommon.Logging import logging
27  mlog = logging.getLogger( 'LArRawCalibDataReadingCfg' )
28  mlog.error("No digits type choosen for LArRawCalibDataReadingAlg, no reading algo added !!!!")
29  return acc
30 
31  if configFlags.hasCategory("LArCalib"):
32  acc.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArDigitKey=digKey, LArAccDigitKey=accKey,
33  LArAccCalibDigitKey=accCalibKey,
34  LArCalibDigitKey=calibKey, LArFebHeaderKey="LArFebHeader",
35  SubCaloPreselection=configFlags.LArCalib.Input.SubDet,
36  PosNegPreselection=configFlags.LArCalib.Preselection.Side,
37  BEPreselection=configFlags.LArCalib.Preselection.BEC,
38  FTNumPreselection=configFlags.LArCalib.Preselection.FT))
39  else:
40  acc.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArDigitKey=digKey, LArAccDigitKey=accKey,
41  LArAccCalibDigitKey=accCalibKey,
42  LArCalibDigitKey=calibKey, LArFebHeaderKey="LArFebHeader"))
43  return acc
44 
45 
46 if __name__=="__main__":
47 
48  from AthenaConfiguration.AllConfigFlags import initConfigFlags
50  from AthenaCommon.Logging import log
51  from AthenaCommon.Constants import DEBUG
52  log.setLevel(DEBUG)
53 
54  flags.LAr.doAlign=False
55  flags.Input.Files = ["/eos/atlas/atlastier0/rucio/data22_calib/calibration_LArElec-Pedestal-32s-High-All/00420537/data22_calib.00420537.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data22_calib.00420537.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-4._0001.data"]
56 
57  flags.Exec.OutputLevel=DEBUG
58  flags.lock()
59 
60  acc = MainServicesCfg( flags )
61  acc.merge(LArRawCalibDataReadingCfg(flags,doAccCalibDigit=True))
62 
63  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
64  acc.merge(LArOnOffIdMappingCfg(flags))
65 
66  #f=open("LArRawCalibDataReading.pkl","wb")
67  #acc.store(f)
68  #f.close()
69  acc.run(-1)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.LArRawCalibDataReadingConfig.LArRawCalibDataReadingCfg
def LArRawCalibDataReadingCfg(configFlags, gain="HIGH", doAccDigit=False, doAccCalibDigit=False, doCalibDigit=False, doDigit=False)
Definition: LArRawCalibDataReadingConfig.py:8
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.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19