ATLAS Offline Software
CaloComputeSWcellWeights.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/CaloComputeSWcellWeights.py
5 # Created: Nov 2006, sss
6 # Purpose: Reweight cluster cells to eliminate double-counting between
7 # clusters.
8 #
9 # With the default cluster finding, a given cell may be included
10 # in more than one cluster, leading to double-counting of the cell's
11 # energy. This correction pass assigns weights to such duplicated
12 # cells such that the sum of the weights over all clusters is one,
13 # thus removing the double-counting.
14 #
15 # Following this, the layer variables need to be recalculated.
16 #
17 
18 from AthenaConfiguration.ComponentFactory import CompFactory
19 from CaloClusterCorrection.constants import \
20  CALOCORR_NOPOOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW
21 from CaloClusterCorrection.common import makecorr
22 
23 
24 #
25 # This table lists all available versions of this correction.
26 # See common.py for a description of the contents.
27 #
28 cls = CompFactory.CaloComputeSWcellWeights # CaloClusterCorrection
29 CaloComputeSWcellWeights_versions = [
30  ['', cls,
31  ['CaloComputeSWcellWeights.CaloComputeSWcellWeights_parms',
32  CALOCORR_NOPOOL]],
33  ]
34 
35 
36 #
37 # Create a new tool instance.
38 # FLAGS is the configuration flags instance.
39 # NAME is the base name for this tool. If defaulted, a name will
40 # be constructed from the name of the correction, the version, and the key.
41 # If SUFFIX is not None, it will be added onto the end of the tool name.
42 # VERSION is a string specifying which of several versions of the correction
43 # to choose. If defaulted, the latest version of the correction is chosen.
44 # KEY is a string to specify the type of cluster to which the correction
45 # applies. The convention is to use `ele55' for 5x5 electron clusters,
46 # `gam35' for 3x5 photon clusters, and so on.
47 # SOURCE tells from where we should read the calibration constants.
48 # See common.py for a description of the possibilities.
49 # None means to use the default.
50 # CONFCLASS gives the Configurable class to use to create the tool.
51 # It may (and usually should) be defaulted.
52 #
53 # Additional keyword arguments may be passed to override any tool
54 # parameters/constants.
55 #
57  name = None,
58  suffix = None,
59  version = None,
60  key = CALOCORR_DEFAULT_KEY,
61  source = None,
62  confclass = None,
63  **kw):
64  return makecorr (flags,
65  versions = CaloComputeSWcellWeights_versions,
66  name = name,
67  basename = 'weightsEM',
68  suffix = suffix,
69  version = version,
70  key = key,
71  sampling = None,
72  source = source,
73  confclass = confclass,
74  corrclass = CALOCORR_SW,
75  **kw)
76 
77 
79  pass
CaloComputeSWcellWeights.make_CaloComputeSWcellWeights
def make_CaloComputeSWcellWeights(flags, name=None, suffix=None, version=None, key=CALOCORR_DEFAULT_KEY, source=None, confclass=None, **kw)
Definition: CaloComputeSWcellWeights.py:56
CaloComputeSWcellWeights.CaloComputeSWcellWeights_parms
Definition: CaloComputeSWcellWeights.py:78