35 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg
39 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
45 gainStrMap={0:
"HIGH",1:
"MEDIUM",2:
"LOW"}
47 if not flags.LArCalib.isSC:
48 digKey=gainStrMap[flags.LArCalib.Gain]
49 if flags.LArCalib.Input.isRawData:
54 from LArROD.LArFebErrorSummaryMakerConfig
import LArFebErrorSummaryMakerCfg
56 result.getEventAlgo(
"LArFebErrorSummaryMaker").CheckAllFEB=
False
57 result.addEventAlgo(CompFactory.LArBadEventCatcher(CheckAccCalibDigitCont=
True,
64 theLArLATOMEDecoder = CompFactory.LArLATOMEDecoder(
"LArLATOMEDecoder",
65 IgnoreBarrelChannels = flags.LArCalib.SCIgnoreBarrelChannels,
66 IgnoreEndcapChannels = flags.LArCalib.SCIgnoreEndcapChannels)
68 if flags.LArCalib.Input.isRawData:
69 result.addEventAlgo(CompFactory.LArRawSCDataReadingAlg(adcCollKey = digKey, adcBasCollKey =
"", etCollKey =
"",
70 etIdCollKey =
"", LATOMEDecoder = theLArLATOMEDecoder))
71 result.addEventAlgo(CompFactory.LArDigitsAccumulator(
"LArDigitsAccumulator", KeyList = [digKey],
72 LArAccuDigitContainerName =
"", NTriggersPerStep = 100,
73 isSC = flags.LArCalib.isSC, DropPercentTrig = 0))
76 from LArCabling.LArCablingConfig
import LArCalibIdMappingCfg,LArOnOffIdMappingCfg,LArCalibIdMappingSCCfg,LArOnOffIdMappingSCCfg
82 result.addEventAlgo(CompFactory.LArRawSCCalibDataReadingAlg(LArSCAccDigitKey = digKey, LATOMEDecoder = theLArLATOMEDecoder))
84 LArPedACBuilder=CompFactory.LArPedestalAutoCorrBuilder()
85 LArPedACBuilder.KeyList = [digKey,]
86 LArPedACBuilder.PedestalKey =
"Pedestal"
87 LArPedACBuilder.AutoCorrKey =
"LArAutoCorr"
88 LArPedACBuilder.GroupingType = flags.LArCalib.GroupingType
90 result.addEventAlgo(LArPedACBuilder)
93 rootfile=flags.LArCalib.Output.ROOTFile
94 if flags.LArCalib.isSC:
95 bcKey =
"LArBadChannelSC"
97 bcKey =
"LArBadChannel"
100 result.addEventAlgo(CompFactory.LArPedestals2Ntuple(ContainerKey =
"Pedestal",
101 AddFEBTempInfo =
False,
105 isSC = flags.LArCalib.isSC,
110 result.addEventAlgo(CompFactory.LArAutoCorr2Ntuple(ContainerKey =
"LArAutoCorr",
111 AddFEBTempInfo =
False, isSC = flags.LArCalib.isSC,
119 if os.path.exists(rootfile):
121 result.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+rootfile+
"' OPT='NEW'" ]))
122 result.setAppProperty(
"HistogramPersistency",
"ROOT")
128 from LArCalibProcessing.utils
import FolderTagResolver
129 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
130 tagResolver=FolderTagResolver()
131 pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
132 autocorrTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder)
137 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
139 outputFile=flags.LArCalib.Output.POOLFile,
140 ObjectList=[
"LArPedestalComplete#Pedestal#"+flags.LArCalib.Pedestal.Folder,
141 "LArAutoCorrComplete#LArAutoCorr#"+flags.LArCalib.AutoCorr.Folder],
142 IOVTagList=[pedestalTag,autocorrTag],
143 Run1=flags.LArCalib.IOVStart,
144 Run2=flags.LArCalib.IOVEnd
148 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
False))
152 if flags.LArCalib.doValidation:
153 from IOVDbSvc.IOVDbSvcConfig
import addFolders
156 result.merge(
addFolders(flags,
"/LAR/ElecCalibFlat/Pedestal<key>PedestalRefIn</key>",
"LAR_ONL",
"CondAttrListCollection"))
157 LArPedestalCondAlg = CompFactory.getComp(
"LArFlatConditionsAlg<LArPedestalFlat>")
158 result.addCondAlgo(
LArPedestalCondAlg(
"LArFlatPedCondAlg",ReadKey=
"PedestalRefIn", WriteKey=
"PedestalRef"))
159 from LArCalibDataQuality.Thresholds
import pedThr,rmsThr, pedThrFEB,rmsThrFEB
162 thePedestalValidationAlg=CompFactory.LArPedestalValidationAlg(
"PedestalVal")
164 thePedestalValidationAlg.UseBadChannelInfo=
False
165 thePedestalValidationAlg.ValidationKey=
"Pedestal"
166 thePedestalValidationAlg.ReferenceKey=
"PedestalRef"
167 thePedestalValidationAlg.PedestalTolerance=pedThr
168 thePedestalValidationAlg.PedestalRMSTolerance=rmsThr
169 thePedestalValidationAlg.PedestalToleranceFEB=pedThrFEB
170 thePedestalValidationAlg.PedestalRMSToleranceFEB=rmsThrFEB
171 thePedestalValidationAlg.MsgLevelForDeviations=WARNING
172 thePedestalValidationAlg.ListOfDevFEBs=
"pedFebs.txt"
173 thePedestalValidationAlg.CheckCompletness=
True
174 thePedestalValidationAlg.PatchMissingFEBs=
True
175 thePedestalValidationAlg.UseCorrChannels=
False
176 if flags.LArCalib.isSC:
177 thePedestalValidationAlg.CablingKey =
"LArOnOffIdMapSC"
178 thePedestalValidationAlg.CalibLineKey =
"LArCalibIdMapSC"
179 thePedestalValidationAlg.BadChanKey = bcKey
180 result.addEventAlgo(thePedestalValidationAlg)
183 theBadPedestal=CompFactory.LArPedestalValidationAlg(
"PedestalFail")
185 theBadPedestal.UseBadChannelInfo=
False
186 theBadPedestal.ValidationKey=
"Pedestal"
187 theBadPedestal.ReferenceKey=
"PedestalRef"
188 theBadPedestal.PedestalTolerance = [
"10,10,10"]
189 theBadPedestal.PedestalRMSTolerance = [
"0.5, 0.5, 0.5"]
190 theBadPedestal.PedestalToleranceFEB = [
"8, 8, 8"]
191 theBadPedestal.PedestalRMSToleranceFEB = [
"1.2, 1.2, 1.2"]
193 theBadPedestal.MsgLevelForDeviations=ERROR
194 theBadPedestal.CheckCompletness=
False
195 theBadPedestal.ListOfDevFEBs=
"Bad_pedFebs.txt"
196 if flags.LArCalib.isSC:
197 theBadPedestal.CablingKey =
"LArOnOffIdMapSC"
198 theBadPedestal.CalibLineKey =
"LArCalibIdMapSC"
199 theBadPedestal.BadChanKey = bcKey
200 result.addEventAlgo(theBadPedestal)
203 result.merge(
addFolders(flags,
"/LAR/ElecCalibOfl/AutoCorrs/AutoCorr<key>LArAutoCorrRef</key>",
"LAR_OFL"))
204 from LArCalibDataQuality.Thresholds
import acThr, acThrFEB
205 theAutoCorrValidationAlg=CompFactory.LArAutoCorrValidationAlg(
"AutoCorrVal")
206 theAutoCorrValidationAlg.UseBadChannelInfo=
False
207 theAutoCorrValidationAlg.ValidationKey=
"LArAutoCorr"
208 theAutoCorrValidationAlg.ReferenceKey=
"LArAutoCorrRef"
209 theAutoCorrValidationAlg.AutoCorrTolerance=acThr
210 theAutoCorrValidationAlg.AutoCorrToleranceFEB=acThrFEB
211 theAutoCorrValidationAlg.MsgLevelForDeviations=WARNING
212 theAutoCorrValidationAlg.ListOfDevFEBs=
"ACFebs.txt"
213 theAutoCorrValidationAlg.CheckCompletness=
True
214 theAutoCorrValidationAlg.PatchMissingFEBs=
True
215 theAutoCorrValidationAlg.UseCorrChannels=
False
216 if flags.LArCalib.isSC:
217 theAutoCorrValidationAlg.CablingKey =
"LArOnOffIdMapSC"
218 theAutoCorrValidationAlg.CalibLineKey =
"LArCalibIdMapSC"
219 theAutoCorrValidationAlg.BadChanKey = bcKey
220 result.addEventAlgo(theAutoCorrValidationAlg)
223 theBadAutoCorr=CompFactory.LArAutoCorrValidationAlg(
"AutoCorrFail")
224 theBadAutoCorr.UseBadChannelInfo=
False
225 theBadAutoCorr.ValidationKey=
"LArAutoCorr"
226 theBadAutoCorr.ReferenceKey=
"LArAutoCorrRef"
227 theBadAutoCorr.AutoCorrTolerance = [
"0.15, 0.15, 0.15"]
228 theBadAutoCorr.AutoCorrToleranceFEB = [
"0.15, 0.15, 0.15"]
229 theBadAutoCorr.MsgLevelForDeviations=ERROR
230 theBadAutoCorr.CheckFifthSample=
True
231 theBadAutoCorr.ListOfDevFEBs=
"Bad_ACFebs.txt"
232 theBadAutoCorr.CheckCompletness=
False
233 if flags.LArCalib.isSC:
234 theBadAutoCorr.CablingKey =
"LArOnOffIdMapSC"
235 theBadAutoCorr.CalibLineKey =
"LArCalibIdMapSC"
236 theBadAutoCorr.BadChanKey = bcKey
237 result.addEventAlgo(theBadAutoCorr)
239 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg