3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
7 return (tool_name, prefix)
9 def ComparedToolsToPlot(tool_ref, tool_test, prefix, match_in_energy = False, match_without_shared = False, match_perfectly = False):
10 return (tool_ref, tool_test, prefix, match_in_energy, match_without_shared, match_perfectly)
12 def MatchingOptions(min_similarity = 0.50, terminal_weight = 250., grow_weight = 500., seed_weight = 1000.):
13 return (min_similarity, terminal_weight, grow_weight, seed_weight)
18 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
19 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
21 ConstantDataExporter = CompFactory.BasicConstantGPUDataExporter(name, **kwargs)
23 result.setPrivateTools(ConstantDataExporter)
29 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
30 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
32 kwargs.setdefault(
"CellsName", cellsname)
34 if flags.CaloRecGPU.ActiveConfig.FillMissingCells:
35 kwargs.setdefault(
"MissingCellsToFill", flags.CaloRecGPU.ActiveConfig.MissingCellsToFill)
37 EventDataExporter = CompFactory.BasicEventDataGPUExporter(name, **kwargs)
39 result.setPrivateTools(EventDataExporter)
44 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
45 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
46 kwargs.setdefault(
"CellsName", cellsname)
47 kwargs.setdefault(
"ClusterSize", flags.CaloRecGPU.ActiveConfig.ClusterSize)
48 if flags.CaloRecGPU.ActiveConfig.FillMissingCells:
49 kwargs.setdefault(
"MissingCellsToFill", flags.CaloRecGPU.ActiveConfig.MissingCellsToFill)
51 AthenaClusterImporter = CompFactory.BasicGPUToAthenaImporter(name, **kwargs)
52 result.setPrivateTools(AthenaClusterImporter)
57 kwargs.setdefault(
"CellsName", cellsname)
58 kwargs.setdefault(
"SavePath",
"output")
60 CPUOutput = CompFactory.CaloCPUOutput(name, **kwargs)
61 result.setPrivateTools(CPUOutput)
66 kwargs.setdefault(
"UseSortedAndCutClusters",
True)
67 kwargs.setdefault(
"SavePath",
"output")
69 GPUOutput = CompFactory.CaloGPUOutput(name, **kwargs)
70 result.setPrivateTools(GPUOutput)
75 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
76 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
78 kwargs.setdefault(
"ClusterCutsInAbsEt", flags.CaloRecGPU.ActiveConfig.PostGrowingClusterCutClustersInAbsEt)
79 kwargs.setdefault(
"ClusterEtorAbsEtCut", flags.CaloRecGPU.ActiveConfig.PostGrowingClusterEnergyCut)
81 kwargs.setdefault(
"ClusterCutsInAbsEt",
True)
82 kwargs.setdefault(
"ClusterEtorAbsEtCut", -1)
85 CalcTool = CompFactory.BasicGPUClusterInfoCalculator(name, **kwargs)
86 result.setPrivateTools(CalcTool)
92 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
93 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
95 kwargs.setdefault(
"CalorimeterNames", flags.CaloRecGPU.ActiveConfig.GrowingCalorimeterNames)
97 kwargs.setdefault(
"SeedSamplingNames", flags.CaloRecGPU.ActiveConfig.GrowingSeedSamplingNames)
99 kwargs.setdefault(
"SeedThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.SeedThreshold)
100 kwargs.setdefault(
"NeighborThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.GrowThreshold)
101 kwargs.setdefault(
"CellThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.TermThreshold)
103 kwargs.setdefault(
"SeedCutsInAbsE", flags.CaloRecGPU.ActiveConfig.UseAbsSeedThreshold)
104 kwargs.setdefault(
"NeighborCutsInAbsE", flags.CaloRecGPU.ActiveConfig.UseAbsGrowThreshold)
105 kwargs.setdefault(
"CellCutsInAbsE", flags.CaloRecGPU.ActiveConfig.UseAbsTermThreshold)
107 kwargs.setdefault(
"TwoGaussianNoise", flags.CaloRecGPU.ActiveConfig.doTwoGaussianNoise)
109 kwargs.setdefault(
"SeedCutsInT", flags.CaloRecGPU.ActiveConfig.doTimeCut)
110 kwargs.setdefault(
"CutOOTseed", flags.CaloRecGPU.ActiveConfig.doTimeCut
and flags.CaloRecGPU.ActiveConfig.extendTimeCut)
111 kwargs.setdefault(
"UseTimeCutUpperLimit", flags.CaloRecGPU.ActiveConfig.useUpperLimitForTimeCut)
112 kwargs.setdefault(
"TimeCutUpperLimit", flags.CaloRecGPU.ActiveConfig.timeCutUpperLimit)
114 kwargs.setdefault(
"SeedThresholdOnTAbs", flags.CaloRecGPU.ActiveConfig.GrowingTimeCutSeedThreshold)
116 kwargs.setdefault(
"TreatL1PredictedCellsAsGood", flags.CaloRecGPU.ActiveConfig.GrowingTreatL1PredictedCellsAsGood)
118 kwargs.setdefault(
"XTalkEM2", flags.CaloRecGPU.ActiveConfig.xtalkEM2)
119 kwargs.setdefault(
"XTalkDeltaT", flags.CaloRecGPU.ActiveConfig.xtalkDeltaT)
123 kwargs.setdefault(
"NeighborOption", flags.CaloRecGPU.ActiveConfig.GrowingNeighborOption)
125 kwargs.setdefault(
"RestrictHECIWandFCalNeighbors", flags.CaloRecGPU.ActiveConfig.GrowingRestrictHECIWandFCalNeighbors)
127 kwargs.setdefault(
"RestrictPSNeighbors", flags.CaloRecGPU.ActiveConfig.GrowingRestrictPSNeighbors)
129 TAClusterMaker = CompFactory.TopoAutomatonClustering(name, **kwargs)
130 result.setPrivateTools(TAClusterMaker)
136 kwargs.setdefault(
"CellsName", cellsname)
138 kwargs.setdefault(
"CalorimeterNames", flags.CaloRecGPU.ActiveConfig.GrowingCalorimeterNames)
139 kwargs.setdefault(
"SeedSamplingNames", flags.CaloRecGPU.ActiveConfig.GrowingSeedSamplingNames)
141 kwargs.setdefault(
"NeighborOption", flags.CaloRecGPU.ActiveConfig.GrowingNeighborOption)
142 kwargs.setdefault(
"RestrictHECIWandFCalNeighbors", flags.CaloRecGPU.ActiveConfig.GrowingRestrictHECIWandFCalNeighbors)
143 kwargs.setdefault(
"RestrictPSNeighbors", flags.CaloRecGPU.ActiveConfig.GrowingRestrictPSNeighbors)
145 kwargs.setdefault(
"SeedThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.SeedThreshold)
146 kwargs.setdefault(
"NeighborThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.GrowThreshold)
147 kwargs.setdefault(
"CellThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.TermThreshold)
149 kwargs.setdefault(
"SeedCutsInAbsE", flags.CaloRecGPU.ActiveConfig.UseAbsSeedThreshold)
150 kwargs.setdefault(
"NeighborCutsInAbsE", flags.CaloRecGPU.ActiveConfig.UseAbsGrowThreshold)
151 kwargs.setdefault(
"CellCutsInAbsE", flags.CaloRecGPU.ActiveConfig.UseAbsTermThreshold)
153 kwargs.setdefault(
"SeedCutsInT", flags.CaloRecGPU.ActiveConfig.doTimeCut)
154 kwargs.setdefault(
"CutOOTseed", flags.CaloRecGPU.ActiveConfig.doTimeCut
and flags.CaloRecGPU.ActiveConfig.extendTimeCut)
155 kwargs.setdefault(
"UseTimeCutUpperLimit", flags.CaloRecGPU.ActiveConfig.useUpperLimitForTimeCut)
156 kwargs.setdefault(
"TimeCutUpperLimit", flags.CaloRecGPU.ActiveConfig.timeCutUpperLimit)
157 kwargs.setdefault(
"XTalkEM2", flags.CaloRecGPU.ActiveConfig.xtalkEM2)
158 kwargs.setdefault(
"XTalkEM2D", flags.CaloRecGPU.ActiveConfig.xtalkEM2D)
159 kwargs.setdefault(
"XTalkEM2n", flags.CaloRecGPU.ActiveConfig.xtalkEM2n)
160 kwargs.setdefault(
"XTalkEM3", flags.CaloRecGPU.ActiveConfig.xtalkEM3)
161 kwargs.setdefault(
"XTalkEMEta", flags.CaloRecGPU.ActiveConfig.xtalkEMEta)
162 kwargs.setdefault(
"XTalkDeltaT", flags.CaloRecGPU.ActiveConfig.xtalkDeltaT)
163 kwargs.setdefault(
"XTalk2Eratio1", flags.CaloRecGPU.ActiveConfig.xtalk2Eratio1)
164 kwargs.setdefault(
"XTalk2Eratio2", flags.CaloRecGPU.ActiveConfig.xtalk2Eratio2)
165 kwargs.setdefault(
"XTalk3Eratio", flags.CaloRecGPU.ActiveConfig.xtalk3Eratio)
166 kwargs.setdefault(
"XTalkEtaEratio", flags.CaloRecGPU.ActiveConfig.xtalkEtaEratio)
167 kwargs.setdefault(
"XTalk2DEratio", flags.CaloRecGPU.ActiveConfig.xtalk2DEratio)
169 kwargs.setdefault(
"ClusterCutsInAbsEt", flags.CaloRecGPU.ActiveConfig.PostGrowingClusterCutClustersInAbsEt)
170 kwargs.setdefault(
"ClusterEtorAbsEtCut", flags.CaloRecGPU.ActiveConfig.PostGrowingClusterEnergyCut)
172 kwargs.setdefault(
"TwoGaussianNoise", flags.CaloRecGPU.ActiveConfig.doTwoGaussianNoise)
174 kwargs.setdefault(
"SeedThresholdOnTAbs", flags.CaloRecGPU.ActiveConfig.GrowingTimeCutSeedThreshold)
176 kwargs.setdefault(
"TreatL1PredictedCellsAsGood", flags.CaloRecGPU.ActiveConfig.GrowingTreatL1PredictedCellsAsGood)
178 kwargs.setdefault(
"UseGPUCriteria",
not flags.CaloRecGPU.ActiveConfig.UseOriginalCriteria)
180 TopoMaker = CompFactory.CaloTopoClusterMaker(name, **kwargs)
181 result.setPrivateTools(TopoMaker)
187 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
188 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
190 kwargs.setdefault(
"NumberOfCellsCut", flags.CaloRecGPU.ActiveConfig.SplittingNumberOfCellsCut)
191 kwargs.setdefault(
"EnergyCut", flags.CaloRecGPU.ActiveConfig.SplittingEnergyCut)
192 kwargs.setdefault(
"SamplingNames", flags.CaloRecGPU.ActiveConfig.SplittingSamplingNames)
193 kwargs.setdefault(
"SecondarySamplingNames", flags.CaloRecGPU.ActiveConfig.SplittingSecondarySamplingNames)
194 kwargs.setdefault(
"ShareBorderCells", flags.CaloRecGPU.ActiveConfig.SplittingShareBorderCells)
195 kwargs.setdefault(
"EMShowerScale", flags.CaloRecGPU.ActiveConfig.SplittingEMShowerScale)
196 kwargs.setdefault(
"WeightingOfNegClusters", flags.CaloRecGPU.ActiveConfig.SplittingUseNegativeClusters)
198 kwargs.setdefault(
"TreatL1PredictedCellsAsGood", flags.CaloRecGPU.ActiveConfig.SplittingTreatL1PredictedCellsAsGood)
200 kwargs.setdefault(
"NeighborOption", flags.CaloRecGPU.ActiveConfig.SplittingNeighborOption)
201 kwargs.setdefault(
"RestrictHECIWandFCalNeighbors", flags.CaloRecGPU.ActiveConfig.SplittingRestrictHECIWandFCalNeighbors)
202 kwargs.setdefault(
"RestrictPSNeighbors", flags.CaloRecGPU.ActiveConfig.GPUSplittingRestrictPSNeighbors)
205 Splitter = CompFactory.TopoAutomatonSplitting(name, **kwargs)
206 result.setPrivateTools(Splitter)
212 kwargs.setdefault(
"NeighborOption", flags.CaloRecGPU.ActiveConfig.SplittingNeighborOption)
213 kwargs.setdefault(
"RestrictHECIWandFCalNeighbors", flags.CaloRecGPU.ActiveConfig.SplittingRestrictHECIWandFCalNeighbors)
215 kwargs.setdefault(
"NumberOfCellsCut", flags.CaloRecGPU.ActiveConfig.SplittingNumberOfCellsCut)
216 kwargs.setdefault(
"EnergyCut", flags.CaloRecGPU.ActiveConfig.SplittingEnergyCut)
218 kwargs.setdefault(
"SamplingNames", flags.CaloRecGPU.ActiveConfig.SplittingSamplingNames)
219 kwargs.setdefault(
"SecondarySamplingNames", flags.CaloRecGPU.ActiveConfig.SplittingSecondarySamplingNames)
221 kwargs.setdefault(
"ShareBorderCells", flags.CaloRecGPU.ActiveConfig.SplittingShareBorderCells)
222 kwargs.setdefault(
"EMShowerScale", flags.CaloRecGPU.ActiveConfig.SplittingEMShowerScale)
224 kwargs.setdefault(
"TreatL1PredictedCellsAsGood", flags.CaloRecGPU.ActiveConfig.SplittingTreatL1PredictedCellsAsGood)
226 kwargs.setdefault(
"WeightingOfNegClusters", flags.CaloRecGPU.ActiveConfig.SplittingUseNegativeClusters)
228 kwargs.setdefault(
"UseGPUCriteria",
not flags.CaloRecGPU.ActiveConfig.UseOriginalCriteria)
230 TopoSplitter = CompFactory.CaloTopoClusterSplitter(name, **kwargs)
231 result.setPrivateTools(TopoSplitter)
237 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
239 kwargs.setdefault(
"WeightingOfNegClusters", flags.CaloRecGPU.ActiveConfig.MomentsUseAbsEnergy)
241 kwargs.setdefault(
"MaxAxisAngle", flags.CaloRecGPU.ActiveConfig.MomentsMaxAxisAngle)
243 kwargs.setdefault(
"TwoGaussianNoise", flags.CaloRecGPU.ActiveConfig.doTwoGaussianNoise)
245 kwargs.setdefault(
"MinBadLArQuality", flags.CaloRecGPU.ActiveConfig.MomentsMinBadLArQuality)
247 kwargs.setdefault(
"MinRLateral", flags.CaloRecGPU.ActiveConfig.MomentsMinRLateral)
248 kwargs.setdefault(
"MinLLongitudinal", flags.CaloRecGPU.ActiveConfig.MomentsMinLLongitudinal)
250 GPUTopoMoments = CompFactory.GPUClusterInfoAndMomentsCalculator(name, **kwargs)
251 result.setPrivateTools(GPUTopoMoments)
257 kwargs.setdefault(
"WeightingOfNegClusters", flags.CaloRecGPU.ActiveConfig.MomentsUseAbsEnergy)
259 kwargs.setdefault(
"MaxAxisAngle", flags.CaloRecGPU.ActiveConfig.MomentsMaxAxisAngle)
261 kwargs.setdefault(
"TwoGaussianNoise", flags.CaloRecGPU.ActiveConfig.doTwoGaussianNoise)
263 kwargs.setdefault(
"MinBadLArQuality", flags.CaloRecGPU.ActiveConfig.MomentsMinBadLArQuality)
265 kwargs.setdefault(
"MomentsNames", flags.CaloRecGPU.ActiveConfig.MomentsToCalculate)
267 kwargs.setdefault(
"MinRLateral", flags.CaloRecGPU.ActiveConfig.MomentsMinRLateral)
268 kwargs.setdefault(
"MinLLongitudinal", flags.CaloRecGPU.ActiveConfig.MomentsMinLLongitudinal)
270 kwargs.setdefault(
"UseGPUCriteria",
not flags.CaloRecGPU.ActiveConfig.UseOriginalCriteria)
272 TopoMoments = CompFactory.CaloClusterMomentsMaker(name, **kwargs)
274 if not flags.Common.isOnline
and not instantiateForTrigger
and "LArHVFraction" not in kwargs:
277 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
280 TopoMoments.LArHVFraction=CompFactory.LArHVFraction(HVScaleCorrKey=
"LArHVScaleCorr")
282 TopoMoments.LArHVFraction=CompFactory.LArHVFraction(HVScaleCorrKey=
"LArHVScaleCorrRecomputed")
284 result.setPrivateTools(TopoMoments)
289 kwargs.setdefault(
"CellsName", cellsname)
291 kwargs.setdefault(
"ClusterSize", flags.CaloRecGPU.ActiveConfig.ClusterSize)
293 kwargs.setdefault(
"MeasureTimes", flags.CaloRecGPU.ActiveConfig.MeasureTimes)
294 kwargs.setdefault(
"TimeFileOutput", name +
"Times.txt")
296 if not flags.Common.isOnline
and not instantiateForTrigger:
297 kwargs.setdefault(
"FillHVMoments",
True)
299 kwargs.setdefault(
"HVScaleCorrKey",
"LArHVScaleCorr")
301 kwargs.setdefault(
"HVScaleCorrKey",
"LArHVScaleCorrRecomputed")
303 kwargs.setdefault(
"FillHVMoments",
False)
305 kwargs.setdefault(
"MomentsNames", flags.CaloRecGPU.ActiveConfig.MomentsToCalculate)
307 if flags.CaloRecGPU.ActiveConfig.FillMissingCells:
308 kwargs.setdefault(
"MissingCellsToFill", flags.CaloRecGPU.ActiveConfig.MissingCellsToFill)
310 AthenaClusterImporter = CompFactory.GPUToAthenaImporterWithMoments(name, **kwargs)
311 result.setPrivateTools(AthenaClusterImporter)
316 kwargs.setdefault(
"SavePath",
"counts")
317 kwargs.setdefault(
"FilePrefix",
"CPU")
318 kwargs.setdefault(
"CellsName", cellsname)
320 kwargs.setdefault(
"SeedThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.SeedThreshold)
321 kwargs.setdefault(
"NeighborThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.GrowThreshold)
322 kwargs.setdefault(
"CellThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.TermThreshold)
324 CPUCount = CompFactory.CaloCellsCounterCPU(name, **kwargs)
325 result.setPrivateTools(CPUCount)
330 kwargs.setdefault(
"SavePath",
"counts")
331 kwargs.setdefault(
"FilePrefix",
"GPU")
333 kwargs.setdefault(
"SeedThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.SeedThreshold)
334 kwargs.setdefault(
"NeighborThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.GrowThreshold)
335 kwargs.setdefault(
"CellThresholdOnEorAbsEinSigma", flags.CaloRecGPU.ActiveConfig.TermThreshold)
337 GPUCount = CompFactory.CaloCellsCounterGPU(name, **kwargs)
338 result.setPrivateTools(GPUCount)
343 kwargs.setdefault(
"SavePath",
"moments")
345 MomentsDumper = CompFactory.CaloMomentsDumper(name, **kwargs)
346 result.setPrivateTools(MomentsDumper)
352 kwargs.setdefault(
"SeedThreshold", flags.CaloRecGPU.ActiveConfig.SeedThreshold)
353 kwargs.setdefault(
"NeighborThreshold", flags.CaloRecGPU.ActiveConfig.GrowThreshold)
354 kwargs.setdefault(
"CellThreshold", flags.CaloRecGPU.ActiveConfig.TermThreshold)
356 kwargs.setdefault(
"CellsName", cellsname)
363 PloTool = CompFactory.CaloGPUClusterAndCellDataMonitor(name, **kwargs)
365 if "MonitoringTool" not in kwargs:
366 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
369 result.setPrivateTools(PloTool)
375 kwargs.setdefault(
"MomentsNames", [
"ENG_CALIB_TOT"
381 ,
"ENG_CALIB_DEAD_TOT"
382 ,
"ENG_CALIB_DEAD_EMB0"
383 ,
"ENG_CALIB_DEAD_TILE0"
384 ,
"ENG_CALIB_DEAD_TILEG3"
385 ,
"ENG_CALIB_DEAD_EME0"
386 ,
"ENG_CALIB_DEAD_HEC0"
387 ,
"ENG_CALIB_DEAD_FCAL"
388 ,
"ENG_CALIB_DEAD_LEAKAGE"
389 ,
"ENG_CALIB_DEAD_UNCLASS"
391 ,
"ENG_CALIB_FRAC_HAD"
392 ,
"ENG_CALIB_FRAC_REST"])
394 kwargs.setdefault(
"CalibrationHitContainerNames", [
"LArCalibrationHitInactive"
395 ,
"LArCalibrationHitActive"
396 ,
"TileCalibHitActiveCell"
397 ,
"TileCalibHitInactiveCell"])
399 kwargs.setdefault(
"DMCalibrationHitContainerNames", [
"LArCalibrationHitDeadMaterial"
400 ,
"TileCalibHitDeadMaterial"])
402 TopoCalibMoments = CompFactory.CaloCalibClusterMomentsMaker2(name, **kwargs)
403 result.setPrivateTools(TopoCalibMoments)
409 CaloClusterLocalCalib=CompFactory.CaloClusterLocalCalib
412 LCClassify = CompFactory.CaloLCClassificationTool(prefix +
"LCClassify")
413 LCClassify.ClassificationKey =
"EMFracClassify"
414 LCClassify.UseSpread =
False
415 LCClassify.MaxProbability = 0.85
if flags.GeoModel.AtlasVersion.startswith(
"Rome")
and instantiateForTrigger
else 0.5
416 LCClassify.StoreClassificationProbabilityInAOD =
True
417 if instantiateForTrigger:
418 LCClassify.UseNormalizedEnergyDensity =
not flags.GeoModel.AtlasVersion.startswith(
"Rome")
419 if not instantiateForTrigger:
420 LCClassify.WeightingOfNegClusters = flags.CaloRecGPU.ActiveConfig.CalibrationUseAbsEnergy
422 LCWeight = CompFactory.CaloLCWeightTool(prefix +
"LCWeight")
423 LCWeight.CorrectionKey =
"H1ClusterCellWeights"
424 LCWeight.SignalOverNoiseCut = 2.0
425 LCWeight.UseHadProbability =
True
427 LocalCalib = CaloClusterLocalCalib (prefix +
"LocalCalib")
428 LocalCalib.ClusterClassificationTool = [LCClassify]
429 LocalCalib.ClusterRecoStatus = [1,2]
430 LocalCalib.LocalCalibTools = [LCWeight]
431 if not instantiateForTrigger:
432 LocalCalib.WeightingOfNegClusters = flags.CaloRecGPU.ActiveConfig.CalibrationUseAbsEnergy
435 LCOut = CompFactory.CaloLCOutOfClusterTool(prefix +
"LCOut")
436 LCOut.CorrectionKey =
"OOCCorrection"
437 LCOut.UseEmProbability =
False
438 LCOut.UseHadProbability =
True
440 OOCCalib = CaloClusterLocalCalib (prefix +
"OOCCalib")
441 OOCCalib.ClusterRecoStatus = [1,2]
442 OOCCalib.LocalCalibTools = [LCOut]
443 if not instantiateForTrigger:
444 OOCCalib.WeightingOfNegClusters = flags.CaloRecGPU.ActiveConfig.CalibrationUseAbsEnergy
446 LCOutPi0 = CompFactory.CaloLCOutOfClusterTool(prefix +
"LCOutPi0")
447 LCOutPi0.CorrectionKey =
"OOCPi0Correction"
448 LCOutPi0.UseEmProbability =
True
449 LCOutPi0.UseHadProbability =
False
451 OOCPi0Calib = CaloClusterLocalCalib (prefix +
"OOCPi0Calib")
452 OOCPi0Calib.ClusterRecoStatus = [1,2]
453 OOCPi0Calib.LocalCalibTools = [LCOutPi0]
454 if not instantiateForTrigger:
455 OOCPi0Calib.WeightingOfNegClusters = flags.CaloRecGPU.ActiveConfig.CalibrationUseAbsEnergy
458 LCDeadMaterial = CompFactory.CaloLCDeadMaterialTool(prefix +
"LCDeadMaterial")
459 LCDeadMaterial.HadDMCoeffKey =
"HadDMCoeff2"
460 LCDeadMaterial.ClusterRecoStatus = 0
461 LCDeadMaterial.WeightModeDM = 2
462 LCDeadMaterial.UseHadProbability =
True
463 if not instantiateForTrigger:
464 LCDeadMaterial.WeightingOfNegClusters = flags.CaloRecGPU.ActiveConfig.CalibrationUseAbsEnergy
466 DMCalib = CaloClusterLocalCalib (prefix +
"DMCalib")
467 DMCalib.ClusterRecoStatus = [1,2]
468 DMCalib.LocalCalibTools = [LCDeadMaterial]
469 if not instantiateForTrigger:
470 DMCalib.WeightingOfNegClusters = flags.CaloRecGPU.ActiveConfig.CalibrationUseAbsEnergy
478 result.setPrivateTools(lccalibtools)
485 clustersname = None, clustersnapname="CaloTopoClusters", name="HybridClusterProcessor",
486 MonitorTool = None, MonitorCells = False, PlotterTool = None,
487 addAsPrimary = True, ReallyUseGPUTools = True):
489 doLCCalib = flags.CaloRecGPU.ActiveConfig.doTopoClusterLocalCalib
491 if clustersname
is None:
492 clustersname =
"CaloCalTopoClusters" if doLCCalib
else "CaloTopoClusters"
494 if clustersname ==
"CaloTopoClusters" and doLCCalib:
495 raise RuntimeError(
"Inconsistent arguments: clustersname must not be 'CaloTopoClusters' if doTopoClusterLocalCalib is True")
499 if not instantiateForTrigger:
501 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
502 from TileGeoModel.TileGMConfig
import TileGMCfg
503 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
512 HybridClusterProcessor = CompFactory.CaloGPUHybridClusterProcessor(name)
513 HybridClusterProcessor.ClustersOutputName = clustersname
515 HybridClusterProcessor.WriteTriggerSpecificInfo = instantiateForTrigger
517 HybridClusterProcessor.MeasureTimes = flags.CaloRecGPU.ActiveConfig.MeasureTimes
519 HybridClusterProcessor.TimeFileOutput =
"GlobalTimes.txt"
521 HybridClusterProcessor.DeferConstantDataPreparationToFirstEvent =
True
522 HybridClusterProcessor.DoPlots = PlotterTool
is not None
523 HybridClusterProcessor.PlotterTool = PlotterTool
524 HybridClusterProcessor.DoMonitoring = MonitorTool
is not None
525 HybridClusterProcessor.MonitoringTool = MonitorTool
526 HybridClusterProcessor.MonitorCells = MonitorCells
527 HybridClusterProcessor.CellsName = cellsname
529 HybridClusterProcessor.NumPreAllocatedDataHolders = flags.CaloRecGPU.ActiveConfig.NumPreAllocatedDataHolders
531 if ReallyUseGPUTools:
538 HybridClusterProcessor.BeforeGPUTools = []
540 HybridClusterProcessor.GPUTools = []
544 HybridClusterProcessor.GPUTools += [result.popToolsAndMerge(
ClusterInfoCalcToolCfg(flags,
"PostGPUGrowingClusterPropertiesCalculator",
True))]
552 HybridClusterProcessor.ConstantDataToGPUTool =
None
553 HybridClusterProcessor.EventDataToGPUTool =
None
554 HybridClusterProcessor.GPUToEventDataTool =
None
555 HybridClusterProcessor.SkipConversions =
True
557 HybridClusterProcessor.GPUTools = []
559 HybridClusterProcessor.BeforeGPUTools = []
567 HybridClusterProcessor.BeforeGPUTools += [ CompFactory.CaloClusterStoreRawProperties(
"RawPropertiesStorer") ]
571 HybridClusterProcessor.AfterGPUTools = []
573 if not instantiateForTrigger:
574 from CaloBadChannelTool.CaloBadChanToolConfig
import CaloBadChanToolCfg
576 HybridClusterProcessor.AfterGPUTools += [CompFactory.CaloClusterBadChannelList(badChannelTool = caloBadChanTool)]
578 if not instantiateForTrigger
and flags.CaloRecGPU.ActiveConfig.doCalibHitMoments:
581 HybridClusterProcessor.AfterGPUTools += [calibHitsMomentsMaker]
584 if not instantiateForTrigger:
585 HybridClusterProcessor.AfterGPUTools += [CompFactory.CaloClusterSnapshot(OutputName=clustersnapname,
587 FinalClusterContainerName=clustersname)]
589 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
590 from CaloRec.CaloTopoClusterConfig
import caloTopoCoolFolderCfg
596 HybridClusterProcessor.AfterGPUTools += calibTools
599 if not instantiateForTrigger:
600 from CaloRec.CaloTopoClusterConfig
import caloTopoCoolFolderCfg
603 if instantiateForTrigger:
604 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
607 result.addEventAlgo(HybridClusterProcessor, primary=addAsPrimary)
609 if instantiateForTrigger
or clustersname
in flags.CaloRecGPU.ActiveConfig.skipWriteList:
614 AODMoments=[
"SECOND_R"
633 if flags.CaloRecGPU.ActiveConfig.writeExtendedClusterMoments:
634 AODMoments += [
"LATERAL"
640 if flags.Reco.EnableHI:
641 AODMoments += [
"CELL_SIG_SAMPLING"]
643 if flags.CaloRecGPU.ActiveConfig.writeCalibHitClusterMoments:
644 AODMoments += [
"ENG_CALIB_TOT"
650 ,
"ENG_CALIB_DEAD_TOT"
651 ,
"ENG_CALIB_DEAD_EMB0"
652 ,
"ENG_CALIB_DEAD_TILE0"
653 ,
"ENG_CALIB_DEAD_TILEG3"
654 ,
"ENG_CALIB_DEAD_EME0"
655 ,
"ENG_CALIB_DEAD_HEC0"
656 ,
"ENG_CALIB_DEAD_FCAL"
657 ,
"ENG_CALIB_DEAD_LEAKAGE"
658 ,
"ENG_CALIB_DEAD_UNCLASS"
660 ,
"ENG_CALIB_FRAC_HAD"
661 ,
"ENG_CALIB_FRAC_REST"]
664 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD, addToESD
665 toESD = [f
"xAOD::CaloClusterContainer#{clustersname}",
666 f
"xAOD::CaloClusterAuxContainer#{clustersname}Aux.",
667 f
"CaloClusterCellLinkContainer#{clustersname}_links"]
668 toAOD = [f
"xAOD::CaloClusterContainer#{clustersname}",
669 f
"CaloClusterCellLinkContainer#{clustersname}_links"]
671 AODMoments.append(
"CellLink")
672 if flags.CaloRecGPU.ActiveConfig.addCalibrationHitDecoration:
673 AODMoments.append(flags.CaloRecGPU.ActiveConfig.CalibrationHitDecorationName)
675 if flags.CaloRecGPU.ActiveConfig.addCPData:
676 AODMoments += [
"ClusterWidthEta",
"ClusterWidthPhi"]
678 auxItems = f
"xAOD::CaloClusterAuxContainer#{clustersname}Aux."
679 auxItems+=
".".
join(AODMoments)
681 toAOD.append(auxItems)
683 result.merge(
addToESD(flags, toESD))
684 result.merge(
addToAOD(flags, toAOD))