ATLAS Offline Software
CaloTopoEMClusterUpdate.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 #
4 # File: CaloClusterCorrection/python/CaloTopoEMClusterUpdate.py
5 # Created: Nov 2006, sss
6 # Purpose: Recalculate global cluster variable from layer variables.
7 #
8 # This `correction' recalculates the global cluster variables from the
9 # individual layer variables. This is mainly the eta and phi positions.
10 # The energy may also be reset to the sum of all layer energies.
11 # There are two variants: the default version, with an empty version
12 # string, recalculates the energy. The version named `dont_update_e'
13 # leaves the total cluster energy unchanged.
14 #
15 
16 from AthenaConfiguration.ComponentFactory import CompFactory
17 from CaloClusterCorrection.constants import \
18  CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO
19 from CaloClusterCorrection.common import makecorr
20 
21 
22 #
23 # This table lists all available versions of this correction.
24 # See common.py for a description of the contents.
25 #
26 cls = CompFactory.CaloClusterUpdate # CaloClusterCorrection
27 CaloTopoEMClusterUpdate_versions = [
28  # This version doesn't recalculate the total cluster energy.
29  ['dont_update_e', cls,
30  ['CaloTopoEMClusterUpdate.CaloTopoEMClusterUpdate_dont_update_e_parms',
31  'calotopoemcorr_pool', CALOCORR_COOL]],
32 
33  # This version does recalculate the total cluster energy.
34  ['', cls,
35  ['CaloTopoEMClusterUpdate.CaloTopoEMClusterUpdate_parms',
36  'calotopoemcorr_pool', CALOCORR_COOL]],
37  ]
38 
39 
40 #
41 # Create a new tool instance.
42 # FLAGS is the configuration flags instance.
43 # NAME is the base name for this tool. If defaulted, a name will
44 # be constructed from the name of the correction, the version, and the key.
45 # If SUFFIX is not None, it will be added onto the end of the tool name.
46 # VERSION is a string specifying which of several versions of the correction
47 # to choose. If defaulted, the latest version of the correction is chosen.
48 # KEY is a string to specify the type of cluster to which the correction
49 # applies. The convention is to use `ele55' for 5x5 electron clusters,
50 # `gam35' for 3x5 photon clusters, and so on.
51 # SOURCE tells from where we should read the calibration constants.
52 # See common.py for a description of the possibilities.
53 # None means to use the default.
54 # CONFCLASS gives the Configurable class to use to create the tool.
55 # It may (and usually should) be defaulted.
56 #
57 # Additional keyword arguments may be passed to override any tool
58 # parameters/constants.
59 #
60 def make_CaloTopoEMClusterUpdate (flags,
61  name = None,
62  suffix = None,
63  version = None,
64  key = CALOCORR_DEFAULT_KEY,
65  source = None,
66  confclass = None,
67  **kw):
68  return makecorr (flags,
69  versions = CaloTopoEMClusterUpdate_versions,
70  name = name,
71  basename = 'larupdate',
72  suffix = suffix,
73  version = version,
74  key = key,
75  sampling = None,
76  source = source,
77  confclass = confclass,
78  corrclass = CALOCORR_EMTOPO,
79  **kw)
80 
81 
82 class CaloTopoEMClusterUpdate_parms:
83  update_energy = True
84 
85 
86 class CaloTopoEMClusterUpdate_dont_update_e_parms:
87  update_energy = False
88 
89