ATLAS Offline Software
LArBadFebsConfig.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 AthenaConfiguration.Enums import LHCPeriod
6 from IOVDbSvc.IOVDbSvcConfig import addFolders,addFoldersSplitOnline
7 
8 LArBadFebCondAlg = CompFactory.LArBadFebCondAlg
9 
10 
11 def LArKnownBadFebCfg(configFlags, tag=None, dbname=None):
12  result=ComponentAccumulator()
13 
14  if configFlags.GeoModel.Run is LHCPeriod.Run1:
15  rekey=""
16  else:
17  rekey="/LAR/BadChannels/KnownBADFEBs"
18  if dbname is None:
19  result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/KnownBADFEBs",
20  f"/LAR/BadChannelsOfl/KnownBADFEBs<key>{rekey}</key>",tag=tag,
21  className="AthenaAttributeList"))
22  else:
23  result.merge(addFolders(configFlags,"/LAR/BadChannelsOfl/KnownBADFEBs","LAR_OFL",
24  modifiers=f"<key>{rekey}</key>",tag=tag,
25  className="AthenaAttributeList"))
26 
27  result.addCondAlgo(LArBadFebCondAlg("LArKnownBadFebAlg",ReadKey=rekey,WriteKey="LArKnownBadFEBs"))
28  return result
29 
30 def LArKnownMNBFebCfg(configFlags, tag=None, dbname=None):
31  result=ComponentAccumulator()
32 
33  if configFlags.GeoModel.Run is LHCPeriod.Run1:
34  rekey=""
35  else:
36  rekey="/LAR/BadChannels/KnownMNBFEBs"
37  if dbname is None:
38  result.merge(addFoldersSplitOnline(configFlags,"LAR","/LAR/BadChannels/KnownMNBFEBs",
39  f"/LAR/BadChannelsOfl/KnownMNBFEBs<key>{rekey}</key>",tag=tag,
40  className="AthenaAttributeList"))
41  else:
42  result.merge(addFolders(configFlags,"/LAR/BadChannelsOfl/KnownMNBFEBs","LAR_OFL",
43  modifiers=f"<key>{rekey}</key>",tag=tag,
44  className="AthenaAttributeList"))
45  pass
46 
47  result.addCondAlgo(LArBadFebCondAlg("LArKnownMNBFebAlg",ReadKey=rekey,WriteKey="LArKnownMNBFEBs"))
48  return result
49 
50 
51 
52 if __name__=="__main__":
53 
54  from AthenaConfiguration.AllConfigFlags import initConfigFlags
55  from AthenaCommon.Logging import log
56  from AthenaCommon.Constants import DEBUG
57  log.setLevel(DEBUG)
58 
60  flags.Input.isMC = False
61  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"]
62  flags.lock()
63 
65 
66  cfg.merge(LArKnownBadFebCfg(flags))
67  cfg.merge(LArKnownMNBFebCfg(flags))
68  f=open("LArBadFebCondAlgos.pkl","wb")
69  cfg.store(f)
70  f.close()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.LArBadFebsConfig.LArKnownBadFebCfg
def LArKnownBadFebCfg(configFlags, tag=None, dbname=None)
Definition: LArBadFebsConfig.py:11
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:86
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:167
python.LArBadFebsConfig.LArKnownMNBFebCfg
def LArKnownMNBFebCfg(configFlags, tag=None, dbname=None)
Definition: LArBadFebsConfig.py:30
Trk::open
@ open
Definition: BinningType.h:40
LArBadFebCondAlg
Definition: LArBadFebCondAlg.h:16
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19