ATLAS Offline Software
Loading...
Searching...
No Matches
CaloLCWConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4
5def GetLCWCfg(flags):
6
7 cfg=ComponentAccumulator()
8
9 if flags.LCW.doClassification:
10 from CaloLocalHadCalib.LCClassificationConfig import GetLCCCfg
11 cfg.merge(GetLCCCfg(flags))
12
13 if flags.LCW.doWeighting:
14 from CaloLocalHadCalib.LCWeightingConfig import GetLCWCfg
15 cfg.merge(GetLCWCfg(flags))
16
17 if flags.LCW.doOutOfCluster:
18 from CaloLocalHadCalib.LCOOCConfig import GetLCOOCCfg
19 cfg.merge(GetLCOOCCfg(flags))
20
21 if flags.LCW.doDeadMaterial:
22 from CaloLocalHadCalib.LCDMConfig import GetLCDMCfg
23 cfg.merge(GetLCDMCfg(flags))
24
25 return cfg
26
27
28if __name__=="__main__":
29 from AthenaConfiguration.AllConfigFlags import initConfigFlags
30 flags = initConfigFlags()
31 from CaloLocalHadCalib.LCWConfigFlags import addLCWFlags
32 addLCWFlags(flags)
33
34 #flags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc20e_13TeV/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.ESD.e4993_s3227_r12689/myESD.pool.root"]
35 #flags.Input.Files = ["/home/pavol/mc10_7TeV/ESD.371532._001990.pool.root.1"]
36 flags.Input.Files = ["/home/pavol/mc16_13TeV/ESD.29275544._000648.pool.root.1"]
37 flags.Output.ESDFileName="esdOut.pool.root"
38 from AthenaConfiguration.Enums import LHCPeriod
39 flags.GeoModel.Run = LHCPeriod.Run1
40 from AthenaConfiguration.TestDefaults import defaultGeometryTags
41 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN1_2010
42
43
44 flags.fillFromArgs()
45
46 # for debugging
47 from AthenaCommon.Constants import DEBUG
48 flags.Exec.OutputLevel=DEBUG
49
50 # redo topo clusters on EM scale
51 flags.Calo.TopoCluster.doTopoClusterLocalCalib = False
52 flags.Calo.TopoCluster.doCellWeightCalib = False
53 flags.Calo.TopoCluster.doCalibHitMoments = True
54
55 # choose which part to do
56 flags.LCW.doClassification = True
57 flags.LCW.doWeighting = True
58 flags.LCW.doOutOfCluster = True
59 flags.LCW.doDeadMaterial = True
60 flags.lock()
61
62 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
63 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
64
65 cfg = MainServicesCfg(flags)
66 cfg.merge(PoolReadCfg(flags))
67
68 theKey="CopyCaloTopoCluster"
69
70 from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
71
72 topoAcc=CaloTopoClusterCfg(flags,clustersnapname=theKey)
73 topoAlg = topoAcc.getPrimary()
74 topoAlg.ClusterCorrectionTools.__getitem__("TopoCalibMoments").MatchDmType = 1 # 1=loose, 2=medium (default), 3=tight
75 topoAlg.ClusterCorrectionTools.__getitem__("TopoCalibMoments").CalibrationHitContainerNames = ["LArCalibrationHitInactive","LArCalibrationHitActive","TileCalibHitActiveCell","TileCalibHitInactiveCell"]
76 topoAlg.ClusterCorrectionTools.__getitem__("TopoCalibMoments").DMCalibrationHitContainerNames = ["LArCalibrationHitDeadMaterial_DEAD","LArCalibrationHitInactive_DEAD","LArCalibrationHitActive_DEAD","TileCalibHitDeadMaterial"]
77
78 cfg.merge(topoAcc)
79
80 cfg.merge(GetLCWCfg(flags))
81
82
83 # for debugging purposes:
84 cfg.getService("StoreGateSvc").Dump=True
85 cfg.getService("MessageSvc").defaultLimit=999999
86
87 cfg.run(10)