ATLAS Offline Software
CaloSwEtaoff.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/CaloSwEtaoff.py
5 # Created: Nov 2006, sss
6 # Purpose: Steering module for eta position (s-shape) corrections.
7 #
8 # Due to the cell structure of the calorimeter, measurements in eta
9 # are biased towards the cell center. There will also be other biases
10 # near edges and cracks. This is sometimes called the S-shape correction,
11 # after how the bias looks when plotted. This correction attempts
12 # to remove these biases.
13 #
14 # In general, this is done by fitting an empirical function that evolves
15 # as a function of eta. The details of how this is done has changed
16 # significantly with time. For more details, see the C++ header files
17 # for the individual versions.
18 #
19 
20 
21 from AthenaConfiguration.ComponentFactory import CompFactory
22 from CaloClusterCorrection.constants import \
23  CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW, \
24  EMB1, EME1, EMB2, EME2
25 from CaloClusterCorrection.common import makecorr
26 
27 #
28 # This table lists all available versions of this correction.
29 # See common.py for a description of the contents.
30 #
31 from CaloClusterCorrection.constants import sw_valid_keys as keys
32 cls_g3 = {EMB1 : CompFactory.CaloSwEta1b_g3, # CaloClusterCorrection
33  EMB2 : CompFactory.CaloSwEta2b_g3, # CaloClusterCorrection
34  EME1 : CompFactory.CaloSwEta1e_g3, # CaloClusterCorrection
35  EME2 : CompFactory.CaloSwEta2e_g3} # CaloClusterCorrection
36 cls_v2 = CompFactory.CaloSwEtaoff_v2 # CaloClusterCorrection
37 cls_v3 = CompFactory.CaloSwEtaoff_v3 # CaloClusterCorrection
38 CaloSwEtaoff_versions = [
39 
40  # The original G3-based correction, translated from the
41  # original fortran version.
42  ['g3', cls_g3, ['CaloSwEtaoff_g3.CaloSwEtaoff_g3_parms',
43  'caloswcorr_pool', CALOCORR_COOL], keys],
44 
45  # DC2 simulation and 8.x.0 reconstruction.
46  # Electrons at 50, 100, and 200 GeV were used.
47  # Derived for 5x5 clusters only.
48  # Added in LArClusterRec-02-05-12, in 8.6.0.
49  ['v2', cls_v2, ['CaloSwEtaoff_v2.CaloSwEtaoff_v2_parms',
50  'caloswcorr_pool', CALOCORR_COOL], keys],
51 
52  # 11.0.41 simulation and 12.0 reconstruction.
53  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
54  # In CaloClusterCorrection-00-02-58, in 12.0.3.
55  ['v3', cls_v3, ['CaloSwEtaoff_v3.CaloSwEtaoff_v3_parms',
56  'caloswcorr_pool', CALOCORR_COOL], keys],
57 
58  # 12.0.3 simulation and reconstruction.
59  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
60  # In CaloClusterCorrection-00-02-61, in 12.0.4.
61  ['v4', cls_v3, ['CaloSwEtaoff_v4.CaloSwEtaoff_v4_parms',
62  'caloswcorr_pool', CALOCORR_COOL], keys],
63 
64  # 12.0.3 simulation and reconstruction.
65  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
66  # In CaloClusterCorrection-00-02-74, in 12.X.0.
67  # The difference from v4 is that this is derived with a different
68  # depth function, which was derived by requiring that the eta position
69  # resolution be optimal, and the use of large-statistics samples
70  # for the 50 and 100 GeV energy points.
71  ['v4_1', cls_v3, ['CaloSwEtaoff_v4_1.CaloSwEtaoff_v4_1_parms',
72  'caloswcorr_pool', CALOCORR_COOL], keys],
73 
74  # Ewan edit
75  # Not sure what version of athena this will be for (v20?). November 2013 edits
76  # Corrections made using mc11_7TeV
77  # The differences come from an updated understanding of the upstream material (first update since data taking),
78  # and a fix on the endcap, which were shifted.
79  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
80  # Updated version of CaloClusterCorrectionAnalysis corrects outliers removal
81  ['v5', cls_v3, ['CaloSwEtaoff_v5.CaloSwEtaoff_v5_parms',
82  'caloswcorr_pool', CALOCORR_COOL], keys],
83  ]
84 
85 
86 #
87 # Create a new tool instance.
88 # FLAGS is the configuration flags instance.
89 # SAMPLING is the calorimeter sampling (EMB1, EMB2, EME1, EME2) to which
90 # this correction will be applied.
91 # NAME is the base name for this tool. If defaulted, a name will
92 # be constructed from the name of the correction, the version, and the key.
93 # If SUFFIX is not None, it will be added onto the end of the tool name.
94 # VERSION is a string specifying which of several versions of the correction
95 # to choose. If defaulted, the latest version of the correction is chosen.
96 # KEY is a string to specify the type of cluster to which the correction
97 # applies. The convention is to use `ele55' for 5x5 electron clusters,
98 # `gam35' for 3x5 photon clusters, and so on.
99 # SOURCE tells from where we should read the calibration constants.
100 # See common.py for a description of the possibilities.
101 # None means to use the default.
102 # CONFCLASS gives the Configurable class to use to create the tool.
103 # It may (and usually should) be defaulted.
104 #
105 # Additional keyword arguments may be passed to override any tool
106 # parameters/constants.
107 #
108 def make_CaloSwEtaoff (flags,
109  sampling,
110  name = None,
111  suffix = None,
112  version = None,
113  key = CALOCORR_DEFAULT_KEY,
114  source = None,
115  confclass = None,
116  **kw):
117  # Make the tool.
118  return makecorr (flags,
119  versions = CaloSwEtaoff_versions,
120  name = name,
121  basename = 'etaoff',
122  suffix = suffix,
123  version = version,
124  key = key,
125  sampling = sampling,
126  source = source,
127  confclass = confclass,
128  corrclass = CALOCORR_SW,
129  **kw)
130 
CaloSwEtaoff.make_CaloSwEtaoff
def make_CaloSwEtaoff(flags, sampling, name=None, suffix=None, version=None, key=CALOCORR_DEFAULT_KEY, source=None, confclass=None, **kw)
Definition: CaloSwEtaoff.py:108