12def CaloCellMakerCfg(flags, addToOutputStream=True, doDigiHSTruth=False):
13 result=ComponentAccumulator()
14
15 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
16 from TileGeoModel.TileGMConfig import TileGMCfg
17
18 result.merge(LArGMCfg(flags))
19 result.merge(TileGMCfg(flags))
20
21 larCellBuilder = result.popToolsAndMerge(LArCellBuilderCfg(flags,doDigiHSTruth=doDigiHSTruth))
22 larCellCorrectors = result.popToolsAndMerge(LArCellCorrectorCfg(flags))
23 tileCellBuilder = result.popToolsAndMerge(TileCellBuilderCfg(flags,doDigiHSTruth=doDigiHSTruth))
24 cellFinalizer = CompFactory.CaloCellContainerFinalizerTool()
25
26 cellMakerTools=[larCellBuilder,tileCellBuilder,cellFinalizer]+larCellCorrectors
27
28
29 if flags.Calo.Cell.doPileupOffsetBCIDCorr or flags.Calo.Cell.doPedestalCorr:
30 theCaloCellPedestalCorr=CaloCellPedestalCorrCfg(flags)
31 cellMakerTools.append(result.popToolsAndMerge(theCaloCellPedestalCorr))
32
33
34 if flags.LAr.doHVCorr:
35 from LArCellRec.LArCellBuilderConfig import LArHVCellContCorrCfg
36 theLArHVCellContCorr=LArHVCellContCorrCfg(flags)
37 cellMakerTools.append(result.popToolsAndMerge(theLArHVCellContCorr))
38
39
40 if flags.Calo.Cell.doDeadCellCorr:
41 theCaloCellNeighborAvg=CaloCellNeighborsAverageCorrCfg(flags)
42 cellMakerTools.append(result.popToolsAndMerge(theCaloCellNeighborAvg))
43
44 if flags.Calo.Cell.doEnergyCorr:
45 theCaloCellEnergyRescaler=CaloEnergyRescalerCfg(flags)
46 cellMakerTools.append(result.popToolsAndMerge(theCaloCellEnergyRescaler))
47 if flags.Calo.Cell.doTimeCorr:
48 theCaloTimeCorr=CaloCellTimeCorrCfg(flags)
49 cellMakerTools.append(result.popToolsAndMerge(theCaloTimeCorr))
50
51 if flags.LAr.doDeadOTxCorr:
52 from LArCellRec.LArCellBuilderConfig import LArDeadOTXCorrCfg
53 theLArDeadOTXCorr=LArDeadOTXCorrCfg(flags)
54 cellMakerTools.append(result.popToolsAndMerge(theLArDeadOTXCorr))
55
56 cellOutputName = "AllCalo"
57 toolName = "CaloCellMaker"
58
59 if doDigiHSTruth:
60 cellOutputName = "AllCalo_DigiHSTruth"
61 toolName = "CaloCellMaker_DigiHSTruth"
62
63 cellAlgo = CompFactory.CaloCellMaker(toolName,
64 CaloCellMakerToolNames=cellMakerTools,
65 CaloCellsOutputName=cellOutputName,
66 EnableChronoStat=(flags.Concurrency.NumThreads == 0))
67
68 result.addEventAlgo(cellAlgo, primary=True)
69
70 outputContainers = [f'CaloCellContainer#{flags.Egamma.Keys.Input.CaloCells}']
71 if flags.GeoModel.Run in [LHCPeriod.Run1, LHCPeriod.Run2, LHCPeriod.Run3]:
72 outputContainers += ["TileCellContainer#MBTSContainer"]
73 if flags.GeoModel.Run is LHCPeriod.Run2:
74 outputContainers += ["TileCellContainer#E4prContainer"]
75 if addToOutputStream:
76 from OutputStreamAthenaPool.OutputStreamConfig import addToESD, addToAOD
77 result.merge(addToESD(flags, outputContainers))
78 result.merge(addToAOD(flags, outputContainers))
79
80
81 if flags.LAr.DT.storeET_ID or flags.LAr.DT.storeET_additional:
82 from LArConfiguration.LArSuperCellConfig import LArSuperCellCfg
83 result.merge(LArSuperCellCfg(flags))
84
85 return result
86
87
88