ATLAS Offline Software
LArBadChannelConfig.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 LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArOnOffIdMappingSCCfg
6 from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline
7 
8 def LArBadChannelCfg(configFlags, tag=None, isSC=False):
9 
10 
11 
12  result=ComponentAccumulator()
13  if not isSC:
14  result.merge(LArOnOffIdMappingCfg(configFlags))
15  rekey="/LAR/BadChannels/BadChannels"
16  algname="LArBadChannelCondAlg"
17  else:
18  result.merge(LArOnOffIdMappingSCCfg(configFlags))
19  rekey="/LAR/BadChannels/BadChannelsSC"
20  algname="LArBadChannelCondSCAlg"
21 
22  if configFlags.Overlay.DataOverlay:
23  # TODO: move this in a better location
24  result.merge(addFolders(configFlags, "/LAR/BadChannels/BadChannels", "LAR_OFL", className="CondAttrListCollection", tag="LARBadChannelsBadChannels-HECAQ3Missing", db="OFLP200"))
25  elif configFlags.Input.isMC:
26  result.merge(addFolders(configFlags,"/LAR/BadChannels/BadChannels","LAR_OFL",tag=tag,
27  className="CondAttrListCollection"))
28  else:
29  if not isSC:
30  result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/BadChannels",
31  f"/LAR/BadChannelsOfl/BadChannels<key>{rekey}</key>",tag=tag,
32  className="CondAttrListCollection"))
33  else :
34  result.merge(addFolders(configFlags,"/LAR/BadChannels/BadChannelsSC",
35  "LAR_ONL",tag=tag,
36  className="CondAttrListCollection"))
37  theLArBadChannelCondAlgo=CompFactory.LArBadChannelCondAlg(name=algname,ReadKey=rekey,isSC=isSC)
38  if isSC:
39  theLArBadChannelCondAlgo.WriteKey="LArBadChannelSC"
40  theLArBadChannelCondAlgo.CablingKey="LArOnOffIdMapSC"
41  result.addCondAlgo(theLArBadChannelCondAlgo)
42  return result
43 
44 
45 def LArBadFebCfg(configFlags, tag=None):
46  result=ComponentAccumulator()
47  rekey="/LAR/BadChannels/MissingFEBs"
48 
49  if configFlags.Input.isMC:
50  result.merge(addFolders(configFlags,"/LAR/BadChannels/MissingFEBs","LAR_OFL",tag=tag,
51  className="AthenaAttributeList"))
52  else:
53  result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/MissingFEBs",
54  f"/LAR/BadChannelsOfl/MissingFEBs<key>{rekey}</key>",tag=tag,
55  className="AthenaAttributeList"))
56  result.addCondAlgo(CompFactory.LArBadFebCondAlg(ReadKey=rekey))
57  return result
58 
59 def LArMaskedSCCfg(configFlags):
60  result=ComponentAccumulator()
61  result.merge(LArOnOffIdMappingSCCfg(configFlags))
62  from IOVDbSvc.IOVDbSvcConfig import addFolders
63  result.merge(addFolders(configFlags,"/LAR/BadChannels/MaskedSC","LAR_ONL",
64  tag="LARBadChannelsMaskedSC-RUN3-UPD1-00",
65  className="CondAttrListCollection",
66  extensible=configFlags.Common.isOnline )) # when run online, need folder to be extensible to force reload each event
67  condAlgo = CompFactory.LArBadChannelCondAlg(name="MaskedSCCondAlg",ReadKey="/LAR/BadChannels/MaskedSC",isSC=True,
68  CablingKey="LArOnOffIdMapSC",WriteKey="LArMaskedSC")
69  result.addCondAlgo(condAlgo)
70  return result
71 
72 
73 if __name__=="__main__":
74 
75  from AthenaConfiguration.AllConfigFlags import initConfigFlags
76  from AthenaCommon.Logging import log
77  from AthenaCommon.Constants import DEBUG
78  log.setLevel(DEBUG)
79 
81  flags.Input.isMC = False
82  flags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data"]
83  flags.lock()
84 
86 
87  cfg.merge(LArBadChannelCfg(flags))
88  cfg.merge(LArBadFebCfg(flags))
89  f=open("LArBCCondAlgos.pkl","wb")
90  cfg.store(f)
91  f.close()
92 
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None)
Definition: LArBadChannelConfig.py:45
Constants
some useful constants -------------------------------------------------—
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
python.LArBadChannelConfig.LArMaskedSCCfg
def LArMaskedSCCfg(configFlags)
Definition: LArBadChannelConfig.py:59
python.IOVDbSvcConfig.addFoldersSplitOnline
def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers='')
Definition: IOVDbSvcConfig.py:153
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19