3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory
import CompFactory
8 acc = ComponentAccumulator()
10 from CaloRec.CaloRecoConfig
import CaloRecoCfg
11 acc.merge(CaloRecoCfg(flags))
12 from CaloRec.CaloTowerMakerConfig
import CaloTowerMakerCfg
13 towerMaker = acc.getPrimaryAndMerge(CaloTowerMakerCfg(flags))
14 inputTowers = towerMaker.TowerContainerName
16 kwargs.setdefault(
"InputTowerKey", inputTowers)
17 kwargs.setdefault(
"CaloCellContainerKey",
"AllCalo")
18 kwargs.setdefault(
"HistStream",
"CALOGEOEXTRACTSTREAM")
19 extractCGC = CompFactory.ExtractCaloGeoConstants(
"ExtractCaloGeoConstants", **kwargs)
20 acc.addEventAlgo(extractCGC)
22 acc.addService(CompFactory.THistSvc(Output=[
"CALOGEOEXTRACTSTREAM DATAFILE='cluster.geo.W_ETA_PHI_R.root' OPT='RECREATE'"]))
27if __name__ ==
"__main__":
29 This macro will generate a new root weight file with histograms "h3_w", "h3_eta", "h3_phi", and "h3_R"
30 that are stored in "/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/HIJetCorrection/cluster.geo....root" files.
31 It's based on the code from https://gitlab.cern.ch/atlas-physics/hi/jets/HICaloGeo/
32 To have correct weights, one needs to assure:
33 1) have consistent input file, conditions, and geometry
34 2) have only 1 event processed
37 $ asetup Athena,main,latest,here
39 $ python -m HIClusterGeoWeights.HICaloGeoExtract
40 3) the new file is "cluster.geo.W_ETA_PHI_R.root"
42 In the root weight file, there are also histograms "h3_eta_phi_response", "h3_eta_phi_offset",
43 and "h1_run_index". These are produced by "HIClusterGeoFiller" and "makeHIResponse".
46 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
47 from AthenaConfiguration.TestDefaults
import defaultTestFiles, defaultGeometryTags
48 flags = initConfigFlags()
56 flags.Input.Files = [defaultTestFiles.d +
"/RecJobTransformTests/data22_hi/RAWFiles/data22_hi.00440101.physics_MinBias.daq.RAW/data22_hi.00440101.physics_MinBias.daq.RAW._lb0214._SFO-11._0001.data"]
57 flags.IOVDb.GlobalTag =
"CONDBR2-BLKPA-2022-09"
58 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
62 flags.Exec.MaxEvents=1
63 flags.Concurrency.NumThreads=1
64 flags.Trigger.triggerConfig =
"DB"
65 flags.Reco.EnableHI =
True
68 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
69 acc = MainServicesCfg(flags)
73 acc.printConfig(withDetails=
True, summariseProps=
True)
77 sys.exit(acc.run().isFailure())