ATLAS Offline Software
LArIdCablingTest.py
Go to the documentation of this file.
1 
2 #Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def LArIdCablingTestCfg(flags,isSC=False):
6  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
7  result=LArGMCfg(flags)
8 
9  if isSC:
10  #Setup SuperCell cabling
11  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
12  result.merge(LArOnOffIdMappingSCCfg(flags))
13  else:
14  #Setup regular cabling
15  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
16  result.merge(LArOnOffIdMappingCfg(flags))
17 
18  result.addEventAlgo(CompFactory.LArIdCablingTest("LArIdCablingTest",isSC=isSC,
19  CablingKey= "LArOnOffIdMapSC" if isSC else "LArOnOffIdMap",
20  ))
21  return result
22 
23 
24 if __name__=="__main__":
25  import sys,argparse
26  parser= argparse.ArgumentParser()
27  parser.add_argument("--loglevel", default=None, help="logging level (ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, or FATAL")
28  parser.add_argument("-r","--runnumber",default=0x7fffffff, type=int, help="run number to query the DB")
29  parser.add_argument("-d","--database",default="LAR_ONL", help="Database name or sqlite file name")
30  parser.add_argument("--SC", action='store_true', help="Work on SuperCells")
31 
32  (args,leftover)=parser.parse_known_args(sys.argv[1:])
33 
34  if len(leftover)>0:
35  print("ERROR, unhandled argument(s):",leftover)
36  sys.exit(-1)
37 
38  from AthenaConfiguration.AllConfigFlags import initConfigFlags
40 
41  flags.Input.isMC = False
42  flags.IOVDb.DatabaseInstance="CONDBR2"
43  flags.LAr.doAlign=False
44  flags.Input.RunNumbers=[args.runnumber]
45  flags.IOVDb.GlobalTag="CONDBR2-ES1PA-2023-02"
46  from AthenaConfiguration.TestDefaults import defaultGeometryTags
47  flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
48  flags.lock()
49 
50  isSC=args.SC
51 
52  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
53  cfg=MainServicesCfg(flags)
54  #MC Event selector since we have no input data file
55  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
56  cfg.merge(McEventSelectorCfg(flags,
57  EventsPerRun = 1,
58  FirstEvent = 1,
59  InitialTimeStamp = 0,
60  TimeStampInterval = 1))
61 
62 
63 
64 
65  cfg.merge(LArIdCablingTestCfg(flags,isSC))
66  cfg.getService("MessageSvc").errorLimit=5000000
67  cfg.run(1)
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
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:25
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
LArIdCablingTest.LArIdCablingTestCfg
def LArIdCablingTestCfg(flags, isSC=False)
Definition: LArIdCablingTest.py:5