ATLAS Offline Software
TileTopoClusterConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 '''
5 @file TileTopoClusterMakerConfig.py
6 @brief Python configuration of Tile topo cluster maker algorithm for the Run III
7 '''
8 from AthenaCommon.SystemOfUnits import MeV, deg
9 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10 
11 def TileTopoClusterCfg(flags, **kwargs):
12 
13  acc = ComponentAccumulator()
14 
15  kwargs.setdefault('name', 'TileTopoClusterAlg')
16  kwargs.setdefault('ClustersOutputName', 'TileTopoCluster')
17 
18  from TileGeoModel.TileGMConfig import TileGMCfg
19  acc.merge(TileGMCfg(flags))
20 
21  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
22  acc.merge(LArGMCfg(flags))
23 
24  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
25  # Schedule total noise cond alg
26  acc.merge(CaloNoiseCondAlgCfg(flags, 'totalNoise'))
27 
28  # Configure Tile topo cluster maker
29  from AthenaConfiguration.ComponentFactory import CompFactory
30  topoClusterMaker = CompFactory.CaloTopoClusterMaker()
31  topoClusterMaker.CellsName = 'AllCalo'
32  topoClusterMaker.CalorimeterNames = ['TILE']
33  # Cells from the following samplings will be able to form seeds.
34  # By default no sampling is excluded
35  topoClusterMaker.SeedSamplingNames = ['TileBar0', 'TileBar1', 'TileBar2',
36  'TileExt0', 'TileExt1', 'TileExt2',
37  'TileGap1', 'TileGap2', 'TileGap3']
38 
39  topoClusterMaker.NeighborOption = 'super3D'
40  topoClusterMaker.RestrictHECIWandFCalNeighbors = False
41  topoClusterMaker.CellThresholdOnEorAbsEinSigma = 0.0
42  topoClusterMaker.NeighborThresholdOnEorAbsEinSigma = 2.0
43  topoClusterMaker.SeedThresholdOnEorAbsEinSigma = 4.0
44 
45  topoClusterMaker.SeedCutsInAbsE = True
46  topoClusterMaker.ClusterCutsInAbsEt = True
47  topoClusterMaker.ClusterEtorAbsEtCut = 0.0 * MeV
48  topoClusterMaker.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
49 
50  kwargs['ClusterMakerTools'] = [topoClusterMaker]
51 
52  # Configure Tile topo cluster splitter
53  topoClusterSpliter = CompFactory.CaloTopoClusterSplitter()
54  topoClusterSpliter.SamplingNames = ['TileBar0', 'TileBar1', 'TileBar2',
55  'TileExt0', 'TileExt1', 'TileExt2' ,
56  'TileGap1', 'TileGap2', 'TileGap3']
57 
58  topoClusterSpliter.ShareBorderCells = True
59  topoClusterSpliter.RestrictHECIWandFCalNeighbors = False
60 
61  kwargs['ClusterMakerTools'] += [topoClusterSpliter]
62 
63  # Configure Tile topo cluster moments maker
64  clsuterMomentsMaker = CompFactory.CaloClusterMomentsMaker()
65  clsuterMomentsMaker.MaxAxisAngle = 30 * deg
66  clsuterMomentsMaker.MomentsNames = ['FIRST_PHI'
67  , 'FIRST_ETA'
68  , 'SECOND_R'
69  , 'SECOND_LAMBDA'
70  , 'DELTA_PHI'
71  , 'DELTA_THETA'
72  , 'DELTA_ALPHA'
73  , 'CENTER_X'
74  , 'CENTER_Y'
75  , 'CENTER_Z'
76  , 'CENTER_MAG'
77  , 'CENTER_LAMBDA'
78  , 'LATERAL'
79  , 'LONGITUDINAL'
80  , 'FIRST_ENG_DENS'
81  , 'ENG_FRAC_EM'
82  , 'ENG_FRAC_MAX'
83  , 'ENG_FRAC_CORE'
84  , 'FIRST_ENG_DENS'
85  , 'SECOND_ENG_DENS'
86  , 'ISOLATION'
87  , 'ENG_BAD_CELLS'
88  , 'N_BAD_CELLS'
89  , 'N_BAD_CELLS_CORR'
90  , 'BAD_CELLS_CORR_E'
91  , 'BADLARQ_FRAC'
92  , 'ENG_POS'
93  , 'SIGNIFICANCE'
94  , 'CELL_SIGNIFICANCE'
95  , 'CELL_SIG_SAMPLING'
96  , 'AVG_LAR_Q'
97  , 'AVG_TILE_Q'
98  , 'PTD'
99  , 'MASS']
100 
101 
102  kwargs['ClusterCorrectionTools'] = [clsuterMomentsMaker]
103 
104  acc.addEventAlgo(CompFactory.CaloClusterMaker(**kwargs), primary = True)
105 
106  return acc
107 
108 
109 
110 if __name__=='__main__':
111 
112  # Setup logs
113  from AthenaCommon.Logging import log
114  from AthenaCommon.Constants import INFO
115  log.setLevel(INFO)
116 
117  # Set the Athena configuration flags
118  from AthenaConfiguration.AllConfigFlags import initConfigFlags
119  from AthenaConfiguration.TestDefaults import defaultTestFiles
120  flags = initConfigFlags()
121  flags.Input.Files = defaultTestFiles.ESD
122  flags.Exec.MaxEvents = 3
123  flags.fillFromArgs()
124  flags.lock()
125 
126  # Initialize configuration object, add accumulator, merge, and run.
127  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
128  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
129  cfg = MainServicesCfg(flags)
130  cfg.merge(PoolReadCfg(flags))
131 
132  cfg.merge( TileTopoClusterCfg(flags) )
133 
134  cfg.printConfig(withDetails = True, summariseProps = True)
135  flags.dump()
136 
137  cfg.store( open('TileTopoClusterMaker.pkl','wb') )
138 
139  sc = cfg.run()
140 
141  import sys
142  # Success should be 0
143  sys.exit(not sc.isSuccess())
SystemOfUnits
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
Constants
some useful constants -------------------------------------------------—
TileTopoClusterConfig.TileTopoClusterCfg
def TileTopoClusterCfg(flags, **kwargs)
Definition: TileTopoClusterConfig.py:11
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7