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