Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LArFillMinBiasConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def LArFillMinBiasCfg(flags):
6 
7  #Get basic services and cond-algos
8  from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
9  result=LArCalibBaseCfg(flags)
10 
11  if flags.LArCalib.isSC:
12  ckey="LArOnOffIdMapSC"
13  result.addCondAlgo(CompFactory.LArMCSymCondAlg("LArMCSymCondAlgSC",SuperCell=flags.LArCalib.isSC,ReadKey=ckey))
14  result.addEventAlgo(CompFactory.FixLArElecSCCalib(FixFlag=3,
15  SCCablingKey=ckey,
16  InputFile=flags.LArCalib.Input.Files[0],
17  ))
18  obj="CondAttrListCollection#/LAR/ElecCalibMCSC/MinBias"
19  else:
20  ckey="LArOnOffIdMap"
21  obj="CondAttrListCollection#/LAR/ElecCalibMC/MinBias"
22  result.addEventAlgo(CompFactory.FixLArElecCalib(FixFlag=14,
23  CablingKey=ckey,
24  InputFile=flags.LArCalib.Input.Files[0],
25  ))
26 
27  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
28  result.merge(OutputConditionsAlgCfg(flags,
29  outputFile="dummy.root",
30  ObjectList=[obj, ],
31  IOVTagList=[flags.LArCalib.Input.Type],
32  Run1=flags.LArCalib.IOVStart,
33  Run2=flags.LArCalib.IOVEnd
34  ))
35 
36  #RegistrationSvc
37  result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = True, SVFolder=False,
38  OverrideNames = [flags.LArCalib.Input.SubDet], OverrideTypes = ["Blob16M"]))
39  result.getService("IOVDbSvc").DBInstance=""
40 
41  #MC Event selector since we have no input data file
42  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
43  result.merge(McEventSelectorCfg(flags,
44  RunNumber = flags.LArCalib.Input.RunNumbers[0],
45  EventsPerRun = 1,
46  FirstEvent = 1,
47  InitialTimeStamp = 0,
48  TimeStampInterval = 1))
49 
50  return result
51 
52 if __name__=="__main__":
53 
54  import sys
55  import argparse
56 
57  # now process the CL options and assign defaults
58  parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
59  parser.add_argument('-i','--infile', dest='infile', default="ntuple.root", help='Input file with constants`', type=str)
60  parser.add_argument('-t','--tag', dest='tag', default="LARElecCalibMCSCMinBias-mc16-Epos-A3-s3687", help='Folder tag for constants`', type=str)
61  parser.add_argument('-o','--outfile', dest='outfile', default="MinBias.db", help='Output sqlite file', type=str)
62  parser.add_argument('-s','--isSC', dest='supercell', default=False, action='store_true', help='Running for SC')
63 
64  args = parser.parse_args()
65  if help in args and args.help is not None and args.help:
66  parser.print_help()
67  sys.exit(0)
68 
69  for _, value in args._get_kwargs():
70  if value is not None:
71  print(value)
72 
73  from AthenaConfiguration.AllConfigFlags import initConfigFlags
75  from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
76  addLArCalibFlags(flags, args.supercell)
77 
78  flags.Input.Files=[]
79  flags.LArCalib.Input.RunNumbers = [404400,]
80  flags.Input.RunNumbers=flags.LArCalib.Input.RunNumbers
81 
82  flags.IOVDb.DatabaseInstance="CONDBR2"
83  flags.IOVDb.DBConnection="sqlite://;schema=" + args.outfile +";dbname=CONDBR2"
84 
85  flags.LAr.doAlign=False
86  from AthenaConfiguration.TestDefaults import defaultGeometryTags
87  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
88 
89  #The global tag we are working with
90  flags.IOVDb.GlobalTag = "LARCALIB-RUN2-00"
91 
92  # misusing these flags, but do not want to introduce new ones
93  flags.LArCalib.Input.Files=[args.infile]
94  flags.LArCalib.Input.Type=args.tag
95  flags.LArCalib.Input.SubDet="MinBias"
96 
97  #Define the global output Level:
98  from AthenaCommon.Constants import INFO
99  flags.Exec.OutputLevel = INFO
100 
101  flags.Detector.GeometryID = False
102  flags.Detector.GeometryITk = False
103  flags.Detector.GeometryHGTD = False
104  flags.Detector.GeometryCalo = False
105  flags.Detector.GeometryMuon = False
106  flags.Detector.GeometryForward = False
107 
108  flags.lock()
109  flags.dump()
110 
111  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
112 
113  cfg=MainServicesCfg(flags)
114  cfg.merge(LArFillMinBiasCfg(flags))
115 
116 
117  cfg.run(1)
118 
OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
LArFillMinBiasConfig.LArFillMinBiasCfg
def LArFillMinBiasCfg(flags)
Definition: LArFillMinBiasConfig.py:5
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.LArCalibBaseConfig.LArCalibBaseCfg
def LArCalibBaseCfg(flags)
Definition: LArCalibBaseConfig.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.LArCalibConfigFlags.addLArCalibFlags
def addLArCalibFlags(flags, isSC=False)
Definition: LArCalibConfigFlags.py:3