ATLAS Offline Software
CaloSwPhioff.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/CaloSwPhioff.py
5 # Created: Nov 2006, sss
6 # Purpose: Steering module for phi position corrections.
7 #
8 # Due to the accordion structure of the calorimeter, the reconstructed
9 # phi position may be slightly offset from the true position. This bias
10 # depends on the average shower depth, and thus on the shower eta.
11 #
12 # The correction consists of a simple eta-dependent offset that is
13 # added to the phi position. There's also a small energy dependence,
14 # so we also interpolate in energy.
15 #
16 
17 
18 from AthenaConfiguration.ComponentFactory import CompFactory
19 from CaloClusterCorrection.constants import \
20  CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW
21 from CaloClusterCorrection.common import makecorr
22 
23 #
24 # This table lists all available versions of this correction.
25 # See common.py for a description of the contents.
26 #
27 from CaloClusterCorrection.constants import sw_valid_keys as keys
28 cls = CompFactory.CaloSwPhioff_v2 # CaloClusterCorrection
29 CaloSwPhioff_versions = [
30 
31  # The original G3-based correction, translated from the
32  # original fortran version.
33  ['g3', cls, ['CaloSwPhioff_g3.CaloSwPhioff_g3_parms',
34  'caloswcorr_pool', CALOCORR_COOL], keys],
35 
36  # DC2 simulation and 8.x.0 reconstruction.
37  # Electrons at 50, 100, and 200 GeV were used.
38  # Derived for 5x5 clusters only.
39  # Added in LArClusterRec-02-05-12, in 8.6.0.
40  ['v2', cls, ['CaloSwPhioff_v2.CaloSwPhioff_v2_parms',
41  'caloswcorr_pool', CALOCORR_COOL], keys],
42 
43  # 11.0.41 simulation and 12.0 reconstruction.
44  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
45  # In CaloClusterCorrection-00-02-58, in 12.0.3.
46  ['v3', cls, ['CaloSwPhioff_v3.CaloSwPhioff_v3_parms',
47  'caloswcorr_pool', CALOCORR_COOL], keys],
48 
49  # 12.0.3 simulation and reconstruction.
50  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
51  # In CaloClusterCorrection-xxx, in 12.0.4.
52  ['v4', cls, ['CaloSwPhioff_v4.CaloSwPhioff_v4_parms',
53  'caloswcorr_pool', CALOCORR_COOL], keys],
54 
55  # Same as v4, but with the sign of the correction flipped in the barrel.
56  # This because the orientation of the accordions is backwards in the MC.
57  ['v4data', cls, ['CaloSwPhioff_v4data.CaloSwPhioff_v4data_parms',
58  'caloswcorr_pool', CALOCORR_COOL], keys],
59 
60  # mc12 simulation and reconstruction.
61  # Both electrons and photons, 5x5, 3x5, 3x7 clusters.
62  # In CaloClusterCorrection-xxx, in ??????.
63  ['v5', cls, ['CaloSwPhioff_v5.CaloSwPhioff_v5_parms',
64  'caloswcorr_pool', CALOCORR_COOL], keys],
65 
66  # Same as v5, but with the sign of the correction flipped in the barrel.
67  # This because the orientation of the accordions is backwards in the MC.
68  ['v5data', cls, ['CaloSwPhioff_v5data.CaloSwPhioff_v5data_parms',
69  'caloswcorr_pool', CALOCORR_COOL], keys],
70 ]
71 
72 
73 #
74 # Create a new tool instance.
75 # FLAGS is the configuration flags instance.
76 # SAMPLING is the calorimeter sampling (EMB1, EMB2, EME1, EME2) to which
77 # this correction will be applied.
78 # NAME is the base name for this tool. If defaulted, a name will
79 # be constructed from the name of the correction, the version, and the key.
80 # If SUFFIX is not None, it will be added onto the end of the tool name.
81 # VERSION is a string specifying which of several versions of the correction
82 # to choose. If defaulted, the latest version of the correction is chosen.
83 # KEY is a string to specify the type of cluster to which the correction
84 # applies. The convention is to use `ele55' for 5x5 electron clusters,
85 # `gam35' for 3x5 photon clusters, and so on.
86 # SOURCE tells from where we should read the calibration constants.
87 # See common.py for a description of the possibilities.
88 # None means to use the default.
89 # CONFCLASS gives the Configurable class to use to create the tool.
90 # It may (and usually should) be defaulted.
91 #
92 # Additional keyword arguments may be passed to override any tool
93 # parameters/constants.
94 #
95 def make_CaloSwPhioff (flags,
96  sampling,
97  name = None,
98  suffix = None,
99  version = None,
100  key = CALOCORR_DEFAULT_KEY,
101  source = None,
102  confclass = None,
103  **kw):
104  # Make the tool.
105  return makecorr (flags,
106  versions = CaloSwPhioff_versions,
107  name = name,
108  basename = 'phioff',
109  suffix = suffix,
110  version = version,
111  key = key,
112  sampling = sampling,
113  source = source,
114  confclass = confclass,
115  corrclass = CALOCORR_SW,
116  **kw)
117 
CaloSwPhioff.make_CaloSwPhioff
def make_CaloSwPhioff(flags, sampling, name=None, suffix=None, version=None, key=CALOCORR_DEFAULT_KEY, source=None, confclass=None, **kw)
Definition: CaloSwPhioff.py:95