3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
9 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg,chanSelStr
12 from LArCalibProcessing.utils
import FolderTagResolver
13 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
14 rs=FolderTagResolver()
15 DetCellParamsTag=rs.getFolderTag(flags.LArCalib.DetCellParams.Folder)
16 CaliPulseParamsTag=rs.getFolderTag(flags.LArCalib.CaliPulseParams.Folder)
17 CaliWaveTag=rs.getFolderTag(flags.LArCalib.CaliWave.Folder)
21 from IOVDbSvc.IOVDbSvcConfig
import addFolders
22 result.merge(
addFolders(flags,flags.LArCalib.CaliWave.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliWaveTag, modifiers=
chanSelStr(flags)))
24 if not flags.LArCalib.RTM.ExtractAll:
26 result.merge(
addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
27 result.merge(
addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
30 LArRTMParamExtractor = CompFactory.LArRTMParamExtractor()
32 LArRTMParamExtractor.KeyList = [
"LArCaliWave"]
33 LArRTMParamExtractor.TestMode =
False
34 LArRTMParamExtractor.GroupingType = flags.LArCalib.GroupingType
35 LArRTMParamExtractor.IgnoreDACSelection =
True
36 LArRTMParamExtractor.isSC = flags.LArCalib.isSC
38 LArRTMParamExtractor.ExtractTaur =
True
39 LArRTMParamExtractor.ExtractTcal = flags.LArCalib.RTM.ExtractAll
40 LArRTMParamExtractor.ExtractFstep = flags.LArCalib.RTM.ExtractAll
41 LArRTMParamExtractor.ExtractOmega0 = flags.LArCalib.RTM.ExtractAll
43 LArRTMParamExtractor.FT = flags.LArCalib.Preselection.FT
44 LArRTMParamExtractor.PosNeg = 0
if len(flags.LArCalib.Preselection.Side)==0
else flags.LArCalib.Preselection.Side[0]
45 LArRTMParamExtractor.Slot = flags.LArCalib.Preselection.Slot
47 LArRTMParamExtractor.DumpOmegaScan = flags.LArCalib.RTM.DumpOmegaScan
48 LArRTMParamExtractor.DumpResOscill = flags.LArCalib.RTM.DumpResOscill
51 theLArWFParamTool = CompFactory.LArWFParamTool()
52 theLArWFParamTool.isSC = flags.LArCalib.isSC
54 theLArWFParamTool.UseOmegaScanHelper =
True
55 theLArWFParamTool.CosRespScan = [
False ,
True ,
False ,
False ]
56 theLArWFParamTool.Omega0Min = [ 0.100 , 0.220 , 0.060 , 0.100 ]
57 theLArWFParamTool.Omega0Max = [ 0.600 , 0.310 , 0.215 , 0.700 ]
58 theLArWFParamTool.NpointScan = [ 800 , 900 , 310 , 120 ]
59 theLArWFParamTool.StoreResOscill = [
True * 4]
if flags.LArCalib.RTM.DumpResOscill
else [
False *4]
61 LArRTMParamExtractor.LArWFParamTool=theLArWFParamTool
63 result.addEventAlgo(LArRTMParamExtractor)
65 rootfile=flags.LArCalib.Output.ROOTFile
66 bcKey =
"LArBadChannelSC" if flags.LArCalib.isSC
else "LArBadChannel"
68 LArWFParams2Ntuple = CompFactory.LArWFParams2Ntuple(
"LArWFParams2Ntuple")
69 LArWFParams2Ntuple.DumpCaliPulseParams =
True
70 LArWFParams2Ntuple.DumpDetCellParams =
True
71 LArWFParams2Ntuple.CaliPulseParamsKey=
"LArCaliPulseParams_RTM"
72 LArWFParams2Ntuple.DetCellParamsKey=
"LArDetCellParams_RTM"
73 LArWFParams2Ntuple.BadChanKey = bcKey
74 LArWFParams2Ntuple.isSC = flags.LArCalib.isSC
75 LArWFParams2Ntuple.AddCalib =
True
76 result.addEventAlgo(LArWFParams2Ntuple)
78 if flags.LArCalib.RTM.DumpOmegaScan:
79 LArOmegaScans2Ntuple = CompFactory.LArCaliWaves2Ntuple(
"LArOmegaScans2Ntuple")
80 LArOmegaScans2Ntuple.NtupleName =
"OMEGASCAN"
81 LArOmegaScans2Ntuple.BadChanKey = bcKey
82 LArOmegaScans2Ntuple.isSC = flags.LArCalib.isSC
83 LArOmegaScans2Ntuple.KeyList = [
"OmegaScan"]
84 result.addEventAlgo(LArOmegaScans2Ntuple)
86 if ( flags.LArCalib.RTM.DumpResOscill ):
87 LArResOscillsBefore2Ntuple = CompFactory.LArCaliWaves2Ntuple(
"LArResOscillsBefore2Ntuple")
88 LArResOscillsBefore2Ntuple.NtupleName =
"RESOSCILLBEFORE"
89 LArResOscillsBefore2Ntuple.BadChanKey = bcKey
90 LArResOscillsBefore2Ntuple.isSC = flags.LArCalib.isSC
91 LArResOscillsBefore2Ntuple.KeyList = [
"ResOscillBefore"]
92 result.addEventAlgo(LArResOscillsBefore2Ntuple)
94 LArResOscillsAfter2Ntuple = CompFactory.LArCaliWaves2Ntuple(
"LArResOscillsAfter2Ntuple")
95 LArResOscillsAfter2Ntuple.NtupleName =
"RESOSCILLAFTER"
96 LArResOscillsAfter2Ntuple.BadChanKey = bcKey
97 LArResOscillsAfter2Ntuple.KeyList = [
"ResOscillAfter"]
98 result.addEventAlgo(LArResOscillsAfter2Ntuple)
101 if os.path.exists(rootfile):
103 result.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+rootfile+
"' OPT='NEW'" ]))
104 result.setAppProperty(
"HistogramPersistency",
"ROOT")
109 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
111 outputFile=flags.LArCalib.Output.POOLFile,
112 ObjectList=[
"LArCaliPulseParamsComplete#"+
"LArCaliPulseParams_RTM#"+flags.LArCalib.CaliPulseParams.Folder,
113 "LArDetCellParamsComplete#"+
"LArDetCellParams_RTM#"+flags.LArCalib.DetCellParams.Folder,],
114 IOVTagList=[CaliPulseParamsTag,DetCellParamsTag],
115 Run1=flags.LArCalib.IOVStart,
116 Run2=flags.LArCalib.IOVEnd
120 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
False))
121 result.getService(
"IOVDbSvc").DBInstance=
""
125 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
127 RunNumber = flags.LArCalib.Input.RunNumbers[0],
130 InitialTimeStamp = 0,
131 TimeStampInterval = 1))
133 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
138 if __name__ ==
"__main__":
141 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
143 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
146 ConfigFlags.Input.Files=[]
147 ConfigFlags.LArCalib.Input.RunNumbers=[401351,]
148 ConfigFlags.LArCalib.Input.Database=
"/home/wlampl/calibTest/00400939_00400943_00400945_Barrel-EMB-EMEC_HIGH_40_21.0.20_1/poolFiles/myDB200_00400939_00400943_00400945_EB-EMBA_one.db_Delay"
149 ConfigFlags.LArCalib.Input.SubDet=
"EM"
150 ConfigFlags.LArCalib.BadChannelDB=
"/home/wlampl/calibTest/00400939_00400943_00400945_Barrel-EMB-EMEC_HIGH_40_21.0.20_1/poolFiles/SnapshotBadChannel_00400939_00400943_00400945_EB-EMBA.db"
151 ConfigFlags.LArCalib.BadChannelTag=
"-RUN2-UPD3-00"
152 ConfigFlags.LArCalib.Output.ROOTFile=
"larparams.root"
153 ConfigFlags.IOVDb.DatabaseInstance=
"CONDBR2"
154 ConfigFlags.IOVDb.DBConnection=
"sqlite://;schema=output.sqlite;dbname=CONDBR2"
155 ConfigFlags.IOVDb.GlobalTag=
"LARCALIB-RUN2-02"
156 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
157 ConfigFlags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
158 ConfigFlags.IOVDb.DatabaseInstance=
"CONDBR2"
159 ConfigFlags.LAr.doAlign=
False
160 ConfigFlags.Input.RunNumbers=ConfigFlags.LArCalib.Input.RunNumbers
164 ConfigFlags.fillFromArgs()
168 print(
"Start running...")
170 sys.exit(cfg.run(1).isFailure())