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  print('LArRawCalibDataReadingCfg gain: ',gain,' doAccDigit: ',doAccDigit,' doAccCalibDigit: ',doAccCalibDigit,' doCalibDigit: ',doCalibDigit,' doDigit: ',doDigit)
14  accKey=""
15  accCalibKey=""
16  calibKey=""
17  digKey=""
18  if doAccDigit:
19  accKey=gain
20  elif doAccCalibDigit:
21  accCalibKey=gain
22  elif doCalibDigit:
23  calibKey=gain
24  elif doDigit:
25  digKey=gain
26  else:
27  from AthenaCommon.Logging import logging
28  mlog = logging.getLogger( 'LArRawCalibDataReadingCfg' )
29  mlog.error("No digits type choosen for LArRawCalibDataReadingAlg, no reading algo added !!!!")
30  return acc
31 
32  if configFlags.hasCategory("LArCalib"):
33  print('LArRawCalibDataReadingCfg accKey: ',accKey,' accCalibKey: ',accCalibKey,' calibKey: ',calibKey,' digKey: ',digKey)
34  acc.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArDigitKey=digKey, LArAccDigitKey=accKey,
35  LArAccCalibDigitKey=accCalibKey,
36  LArCalibDigitKey=calibKey, LArFebHeaderKey="LArFebHeader",
37  SubCaloPreselection=configFlags.LArCalib.Input.SubDet,
38  PosNegPreselection=configFlags.LArCalib.Preselection.Side,
39  BEPreselection=configFlags.LArCalib.Preselection.BEC,
40  FTNumPreselection=configFlags.LArCalib.Preselection.FT))
41  else:
42  acc.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArDigitKey=digKey, LArAccDigitKey=accKey,
43  LArAccCalibDigitKey=accCalibKey,
44  LArCalibDigitKey=calibKey, LArFebHeaderKey="LArFebHeader"))
45  return acc
46 
47 
48 if __name__=="__main__":
49 
50  from AthenaConfiguration.AllConfigFlags import initConfigFlags
52  from AthenaCommon.Logging import log
53  from AthenaCommon.Constants import DEBUG
54  log.setLevel(DEBUG)
55 
56  flags.LAr.doAlign=False
57  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"]
58 
59  flags.Exec.OutputLevel=DEBUG
60  flags.lock()
61 
62  acc = MainServicesCfg( flags )
63  acc.merge(LArRawCalibDataReadingCfg(flags,doAccCalibDigit=True))
64 
65  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
66  acc.merge(LArOnOffIdMappingCfg(flags))
67 
68  #f=open("LArRawCalibDataReading.pkl","wb")
69  #acc.store(f)
70  #f.close()
71  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:312
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:26
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19