ATLAS Offline Software
LArFebErrorSummaryMakerConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from LArBadChannelTool.LArBadChannelConfig import LArBadFebCfg
4 from AthenaCommon.Logging import logging
5 from OutputStreamAthenaPool.OutputStreamConfig import addToESD
6 
8 
9  log = logging.getLogger('LArFebErrorSummaryMakerConfig')
10  projectName=flags.Input.ProjectName
11 
12  bCheckAllFEB=True
13  streamName=flags.Input.ProcessingTags
14  if len(streamName) > 0 and len(streamName[0])>4 and streamName[0].endswith("PEB"):
15  log.info("StreamName %s suggests partial event building. Do not check for FEB completeness",str(streamName))
16  bCheckAllFEB=False
17 
18 
19  if projectName == "data_test":
20  from datetime import date
21  yearNumber=date.today().year-2000
22  log.info("Found project name data_test, assume year number to be %d",yearNumber)
23  else:
24  try:
25  yearNumber=int(projectName[4:6])
26  except ValueError:
27  from datetime import date
28  yearNumber=date.today().year-2000
29  log.warning("Failed to extract year from project tag "+ projectName+". Guessing %d",yearNumber)
30 
31  if yearNumber > 20:
32  lMaskFebScacStatus = [0x38680000,0x38720000]
33  lMaskFebEvtId = [0x38680000]
34  else:
35  lMaskFebScacStatus = [0x38080000]
36  lMaskFebEvtId = [0x38080000]
37  # needed only if it is not in DB.
38  #lMaskFebZeroSample = [0x39618000,0x39930000,0x3b1b0000,0x38db0000,0x38f60000,0x39ae8000,0x3bb90000]
39 
40  acc = LArBadFebCfg(flags)
41 
42  minErrFeb=1
43  # In online or express processing, EventInfo::LArError is triggered if >=4 FEB with data corrupted
44  if flags.Common.isOnline or flags.Common.doExpressProcessing:
45  minErrFeb=4
46 
47  acc.addEventAlgo(CompFactory.LArFebErrorSummaryMaker("LArFebErrorSummaryMaker",CheckAllFEB=bCheckAllFEB,
48  WriteKey="StoreGateSvc+LArFebErrorSummary",
49  MaskFebScacStatus = lMaskFebScacStatus, MaskFebEvtId = lMaskFebEvtId,
50  minFebInError=minErrFeb
51  #MaskFebZeroSample = lMaskFebZeroSample,
52  )
53  )
54 
55  acc.merge(addToESD(flags,["LArFebErrorSummary#LArFebErrorSummary",]))
56 
57  return acc
58 
59 
60 if __name__=="__main__":
61 
62  from AthenaConfiguration.AllConfigFlags import initConfigFlags
63  from AthenaCommon.Logging import log
64  from AthenaCommon.Constants import DEBUG
65  log.setLevel(DEBUG)
66 
67  from AthenaConfiguration.TestDefaults import defaultTestFiles
68  flags = initConfigFlags()
69  flags.Input.Files = defaultTestFiles.RAW_RUN2
70  flags.lock()
71 
72 
73  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
74  from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
75 
76  acc=MainServicesCfg(flags)
77  acc.merge(LArRawDataReadingCfg(flags))
78  acc.merge(LArFebErrorSummaryMakerCfg(flags))
79 
80  acc.run(3)
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.LArRawDataReadingConfig.LArRawDataReadingCfg
def LArRawDataReadingCfg(flags, **kwargs)
Definition: LArRawDataReadingConfig.py:11
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None)
Definition: LArBadChannelConfig.py:45
python.LArFebErrorSummaryMakerConfig.LArFebErrorSummaryMakerCfg
def LArFebErrorSummaryMakerCfg(flags)
Definition: LArFebErrorSummaryMakerConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:127
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
str
Definition: BTagTrackIpAccessor.cxx:11