3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD, addToESD
8 """Configures HITowerWeightTool"""
11 if "InputFile" not in kwargs:
12 from HIJetRec.HIJetRecUtilsCA
import getHIClusterGeoWeightFile
14 kwargs.setdefault(
"ApplyCorrection", flags.HeavyIon.Jet.ApplyTowerEtaPhiCorrection)
15 kwargs.setdefault(
"ConfigDir",
'HIJetCorrection/')
17 acc.setPrivateTools(CompFactory.HITowerWeightTool(name, **kwargs))
21 """Configures HIEventShapeMapTool"""
23 acc.setPrivateTools(CompFactory.HIEventShapeMapTool(name, **kwargs))
27 """Configures HIEventShapeFillerTool"""
29 if "EventShapeMapTool" not in kwargs:
31 kwargs.setdefault(
"EventShapeMapTool", eventShapeMapTool)
32 kwargs.setdefault(
"UseClusters",
False)
33 if kwargs[
"UseClusters"]:
36 kwargs.setdefault(
"TowerWeightTool", TWTool)
38 acc.setPrivateTools(CompFactory.HIEventShapeFillerTool(name, **kwargs))
42 """Configures HIEventShapeMaker, either with weights (for HIJets) or without weight (for HIGlobal)"""
46 from CaloRec.CaloRecoConfig
import CaloRecoCfg
48 from CaloRec.CaloTowerMakerConfig
import CaloTowerMakerCfg
51 kwargs.setdefault(
"NaviTowerKey", towerMaker.TowerContainerName)
52 kwargs.setdefault(
"InputTowerKey",
"")
53 kwargs.setdefault(
"OutputContainerKey",
"HIEventShape")
54 if "HIEventShapeFillerTool" not in kwargs:
55 name_esft=
"HIEventShapeFillerTool_Weighted" if doWeighted
else "HIEventShapeFillerTool"
58 UseClusters=doWeighted))
59 kwargs.setdefault(
"HIEventShapeFillerTool",eventShapeTool)
61 acc.addEventAlgo(CompFactory.HIEventShapeMaker(name, **kwargs))
65 """Configures HIEventShapeSummaryTool"""
69 kwargs.setdefault(
"SubCalos", [
'FCal',
'EMCal',
'HCal',
'ALL'])
70 kwargs.setdefault(
"Samplings", [
'FCAL0',
'FCAL1',
'FCAL2'])
71 kwargs.setdefault(
"DoPositiveNegativeSides",
False)
73 acc.setPrivateTools(CompFactory.HIEventShapeSummaryTool(name, **kwargs))
77 """Configures Heavy Ion Global quantities """
80 shapeKey=flags.HeavyIon.Global.EventShape
81 output = [ f
"xAOD::HIEventShapeContainer#{shapeKey}", f
"xAOD::HIEventShapeAuxContainer#{shapeKey}Aux."]
84 if flags.HeavyIon.Global.doEventShapeSummary:
85 summaryKey =
"CaloSums"
87 kwargs_hies[
"SummaryTool"] = summaryTool
88 kwargs_hies[
"SummaryContainerKey"] = summaryKey
89 output.extend([ f
"xAOD::HIEventShapeContainer#{summaryKey}", f
"xAOD::HIEventShapeAuxContainer#{summaryKey}Aux."])
99 if __name__ ==
"__main__":
100 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
101 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
103 flags.Input.Files = [defaultTestFiles.d +
"/RecJobTransformTests/data18_hi.00367384.physics_HardProbes.daq.RAW._lb0145._SFO-8._0001.data"]
104 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
105 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
106 flags.Exec.MaxEvents=5
107 flags.Concurrency.NumThreads=1
112 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
114 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
119 acc.getEventAlgo(
"HIEventShapeMaker").OutputLevel=DEBUG
121 acc.printConfig(withDetails=
True, summariseProps=
True)
125 sys.exit(acc.run().isFailure())