ATLAS Offline Software
CaloSwRfac.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/CaloSwRfac.py
5 # Created: Nov 2006, sss
6 # Purpose: Steering module for R-factor correction.
7 #
8 # Some corrections, such as the position correction, are energy-dependent,
9 # but they need to run before the energy correction is done. This causes
10 # a problem: the energy-dependence of these corrections is handled
11 # by finding the correction at several different true cluster energies,
12 # and then interpolating. The value that we'd want to use for the
13 # interpolation is the true cluster energy. However, all we have
14 # is the uncorrected reconstructed energy, which is systematically off
15 # from the true energy by a significant amount.
16 #
17 # To deal with this circularity, we first (before the position corrections)
18 # apply a crude energy correction to get the scale approximately correct.
19 # This corrected energy is then used for the interpolation in the
20 # position corrections. When the layer update pass is run, the correction
21 # we make here gets undone.
22 #
23 # This `R-factor' correction simply scales the total cluster energy
24 # by an eta-dependent constant. This is typically derived from
25 # 100 GeV electrons/photons.
26 #
27 
28 
29 from AthenaConfiguration.ComponentFactory import CompFactory
30 from CaloClusterCorrection.constants import \
31  CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW
32 from CaloClusterCorrection.common import makecorr
33 
34 #
35 # This table lists all available versions of this correction.
36 # See common.py for a description of the contents.
37 #
38 from CaloClusterCorrection.constants import sw_valid_keys as keys
39 cls = CompFactory.CaloScaleCluster # CaloClusterCorrection
40 CaloSwRfac_versions = [
41  # From 11.0.41 simulation and 12.0.0 reconstruction.
42  # In CaloClusterCorrection-00-02-38, 12.0.0.
43  # This was used for the `DC3-02' corrections.
44  ['v3', cls, ['CaloSwRfac_v3.CaloSwRfac_v3_parms',
45  'caloswcorr_pool', CALOCORR_COOL], keys],
46 
47  # From 12.0.3 simulation and reconstruction,
48  # with ideal (calib0) geometry.
49  # In CaloClusterCorrection-00-02-61, 12.0.4.
50  ['v4', cls, ['CaloSwRfac_v4.CaloSwRfac_v4_parms',
51  'caloswcorr_pool', CALOCORR_COOL], keys],
52  # Ewan edit
53  # Not sure what version of athena this will be for (v20?). November 2013 edits
54  # Corrections made using mc11_7TeV
55  # The differences come from an updated understanding of the upstream material (first update since data taking),
56  # and a fix on the endcap, which were shifted.
57  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
58  # Updated version of CaloClusterCorrectionAnalysis corrects outliers removal
59  ['v5', cls, ['CaloSwRfac_v5.CaloSwRfac_v5_parms',
60  'caloswcorr_pool', CALOCORR_COOL], keys],
61 
62  ]
63 
64 
65 #
66 # Create a new tool instance.
67 # FLAGS is the configuration flags instance.
68 # NAME is the base name for this tool. If defaulted, a name will
69 # be constructed from the name of the correction, the version, and the key.
70 # If SUFFIX is not None, it will be added onto the end of the tool name.
71 # VERSION is a string specifying which of several versions of the correction
72 # to choose. If defaulted, the latest version of the correction is chosen.
73 # KEY is a string to specify the type of cluster to which the correction
74 # applies. The convention is to use `ele55' for 5x5 electron clusters,
75 # `gam35' for 3x5 photon clusters, and so on.
76 # SOURCE tells from where we should read the calibration constants.
77 # See common.py for a description of the possibilities.
78 # None means to use the default.
79 # CONFCLASS gives the Configurable class to use to create the tool.
80 # It may (and usually should) be defaulted.
81 #
82 # Additional keyword arguments may be passed to override any tool
83 # parameters/constants.
84 #
85 def make_CaloSwRfac (flags,
86  name = None,
87  suffix = None,
88  version = None,
89  key = CALOCORR_DEFAULT_KEY,
90  source = None,
91  confclass = None,
92  **kw):
93  # Make the tool.
94  return makecorr (flags,
95  versions = CaloSwRfac_versions,
96  name = name,
97  basename = 'rfac',
98  suffix = suffix,
99  version = version,
100  key = key,
101  sampling = None,
102  source = source,
103  confclass = confclass,
104  corrclass = CALOCORR_SW,
105  **kw)