9 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg,chanSelStr
12 from LArCalibProcessing.utils
import FolderTagResolver
13 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
14 if flags.LArCalib.isSC:
15 FolderTagResolver._defaultSuffix=
"-RUN2-UPD3-00"
16 rs=FolderTagResolver()
17 CaliWaveTag=rs.getFolderTag(flags.LArCalib.CaliWave.Folder)
18 DetCellParamsTag=rs.getFolderTag(flags.LArCalib.DetCellParams.Folder)
19 CaliPulseParamsTag=rs.getFolderTag(flags.LArCalib.CaliPulseParams.Folder)
20 MphysOverMcalTag=rs.getFolderTag(flags.LArCalib.MphysOverMcal.Folder)
21 PhysWaveTag=rs.getFolderTag(flags.LArCalib.PhysWave.Folder)
24 bcKey =
"LArBadChannelSC" if flags.LArCalib.isSC
else "LArBadChannel"
27 isHEC= (flags.LArCalib.Input.SubDet ==
"HEC")
34 TdriftVector = [ 420 , 469 , 469 , 469 ]
35 TdriftVector2 = [ 420 , 921 , 921 , 921 ]
36 TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ]
38 TdriftVector = [ 451.92 , 504.644 , 504.644 , 504.644 ]
39 TdriftVector2 = [ 451.92 , 990.996 , 990.996 , 990.996 ]
40 TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ]
44 from IOVDbSvc.IOVDbSvcConfig
import addFolders
45 result.merge(
addFolders(flags,flags.LArCalib.CaliWave.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliWaveTag, modifiers=
chanSelStr(flags)))
46 if flags.LArCalib.isSC:
47 result.merge(
addFolders(flags,
"/LAR/ElecCalibOflSC/Tdrift/Computed",detDb=
"LAR_OFL",tag=
"LARElecCalibOflSCTdriftComputed-000"))
48 result.merge(
addFolders(flags,
"/LAR/ElecCalibOflSC/PhysWaves/HECIdeal",detDb=
"LAR_OFL",tag=
"LARElecCalibOflSCPhysWavesHECIdeal-calib-02"))
52 result.merge(
addFolders(flags,
"/LAR/ElecCalibOflSC/PhysWaves/FCALmeasured",detDb=
"LAR_OFL",tag=
"LARElecCalibOflSCPhysWavesFCALmeasured-data-00",modifiers=
"<key>FCALFromData</key>"))
54 result.merge(
addFolders(flags,
"/LAR/ElecCalibOfl/Tdrift/Computed",detDb=
"LAR_OFL",tag=
"LARElecCalibOflTdriftComputed-calib-03"))
58 result.merge(
addFolders(flags,
"/LAR/ElecCalibOfl/PhysWaves/HECIdeal",detDb=
"LAR_OFL",tag=
"LARElecCalibOflPhysWavesHECIdeal-calib-02"))
59 if flags.LArCalib.isSC:
60 result.merge(
addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
61 result.merge(
addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
63 result.merge(
addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=
"LAR_OFL", tag=CaliPulseParamsTag))
65 result.merge(
addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
66 result.merge(
addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
68 LArPhysWavePredictor = CompFactory.LArPhysWavePredictor(
"LArPhysWavePredictor" )
69 LArPhysWavePredictor.ProblemsToMask= [
"deadCalib",
"deadReadout",
"deadPhys",
"almostDead",
"short"]
70 LArPhysWavePredictor.TestMode =
False
71 LArPhysWavePredictor.isSC = flags.LArCalib.isSC
72 LArPhysWavePredictor.KeyCaliList = [
"LArCaliWave" ]
73 LArPhysWavePredictor.UseCaliPulseParamsFromJO = isHEC
74 LArPhysWavePredictor.UseDetCellParamsFromJO = isHEC
75 LArPhysWavePredictor.UseTdriftFromJO = isHEC
76 LArPhysWavePredictor.Tdrift = TdriftVector
77 LArPhysWavePredictor.UseDoubleTriangle =
False
78 LArPhysWavePredictor.Tdrift2 = TdriftVector2
79 LArPhysWavePredictor.WeightTriangle2 = TdriftWeight2
80 LArPhysWavePredictor.UseTimeShiftFromJO =
True
81 LArPhysWavePredictor.GroupingType = flags.LArCalib.GroupingType
82 LArPhysWavePredictor.NormalizeCali =
not isHEC
83 LArPhysWavePredictor.KeyMphysMcali =
"LArMphysOverMcal"
84 LArPhysWavePredictor.DumpMphysMcali =
False
85 LArPhysWavePredictor.KeyPhys =
"LArPhysWave"
86 LArPhysWavePredictor.isHEC = isHEC
87 LArPhysWavePredictor.BadChanKey = bcKey
89 if flags.LArCalib.isSC:
90 LArPhysWavePredictor.KeyFcal =
"FCALFromData"
92 result.addEventAlgo(LArPhysWavePredictor)
94 if (flags.LArCalib.isSC
or flags.LArCalib.Input.SubDet ==
"HEC"):
95 LArPhysWaveHECTool=CompFactory.LArPhysWaveHECTool(
"LArPhysWaveHECTool")
96 LArPhysWaveHECTool.NormalizeCali =
False
97 LArPhysWaveHECTool.TimeOriginShift =
False
98 LArPhysWaveHECTool.SubtractBaseline =
False
99 LArPhysWaveHECTool.isSC = flags.LArCalib.isSC
100 result.addPublicTool(LArPhysWaveHECTool)
103 if flags.LArCalib.isSC
or flags.LArCalib.Input.SubDet !=
"HEC":
104 LArPhysWaveTool=CompFactory.LArPhysWaveTool(
"LArPhysWaveTool")
105 LArPhysWaveTool.NormalizeCali =
False
106 LArPhysWaveTool.TimeOriginShift =
False
107 LArPhysWaveTool.SubtractBaseline =
False
108 LArPhysWaveTool.InjPointCorrLayer = [ 1, 1, 1, 1 ]
109 LArPhysWaveTool.InjPointUseTauR = [ 1, 1, 1, 1 ]
110 result.addPublicTool(LArPhysWaveTool)
113 rootfile=flags.LArCalib.Output.ROOTFile
115 LArPhysWaves2Ntuple = CompFactory.LArPhysWaves2Ntuple(
"LArPhysWaves2Ntuple")
116 LArPhysWaves2Ntuple.NtupleName =
"PHYSWAVE"
117 LArPhysWaves2Ntuple.AddFEBTempInfo =
False
118 LArPhysWaves2Ntuple.KeyList = [
"LArPhysWave" ]
119 LArPhysWaves2Ntuple.isSC = flags.LArCalib.isSC
120 LArPhysWaves2Ntuple.AddCalib =
True
121 LArPhysWaves2Ntuple.BadChanKey = bcKey
122 result.addEventAlgo(LArPhysWaves2Ntuple)
124 LArMphysOverMcal2Ntuple = CompFactory.LArMphysOverMcal2Ntuple(
"LArMphysOverMcal2Ntuple" )
125 LArMphysOverMcal2Ntuple.ContainerKey =
"LArMphysOverMcal"
126 LArMphysOverMcal2Ntuple.AddFEBTempInfo =
False
127 LArMphysOverMcal2Ntuple.isSC = flags.LArCalib.isSC
128 LArMphysOverMcal2Ntuple.BadChanKey = bcKey
129 result.addEventAlgo(LArMphysOverMcal2Ntuple)
132 if os.path.exists(rootfile):
134 result.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+rootfile+
"' OPT='NEW'" ]))
135 result.setAppProperty(
"HistogramPersistency",
"ROOT")
139 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
141 outputFile=flags.LArCalib.Output.POOLFile,
142 ObjectList=[
"LArPhysWaveContainer#LArPhysWave#"+flags.LArCalib.PhysWave.Folder,
143 "LArMphysOverMcalComplete#LArMphysOverMcal#"+flags.LArCalib.MphysOverMcal.Folder,],
144 IOVTagList=[PhysWaveTag,MphysOverMcalTag],
145 Run1=flags.LArCalib.IOVStart,
146 Run2=flags.LArCalib.IOVEnd
150 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
False))
151 result.getService(
"IOVDbSvc").DBInstance=
""
154 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
156 RunNumber = flags.LArCalib.Input.RunNumbers[0],
159 InitialTimeStamp = 0,
160 TimeStampInterval = 1))
162 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg