ATLAS Offline Software
Loading...
Searching...
No Matches
CaloSwLongWeights.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/CaloSwLongWeights.py
5# Created: Nov 2006, sss
6# Purpose: Steering module for longitudinal weights corrections.
7#
8# This module is used to set up the longitudinal weight correction.
9# This correction scales the energies of layers 0 and 3 by constants,
10# then applies a linear transformation (scale plus offset) to the resulting
11# energy. All four of these constants are eta-dependent
12# (but not energy-dependent).
13#
14# Note that for any given eta, we should apply either the gap or the LW
15# correction, but not both. For some versions of the corrections, that
16# wasn't true. See the comments in the individual versions for more
17# about hacks that were used to deal with this.
18#
19# The entry point for this module is make_CaloSwLongWeights, which
20# returns a new correction tool. The available versions are given
21# in the table below.
22#
23
24
25from AthenaConfiguration.ComponentFactory import CompFactory
26from CaloClusterCorrection.constants import \
27 CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_SW
28from CaloClusterCorrection.common import makecorr
29
30#
31# This table lists all available versions of this correction.
32# See common.py for a description of the contents.
33#
34from CaloClusterCorrection.constants import sw_valid_keys as keys
35cls = CompFactory.CaloSwLongWeights # CaloClusterCorrection
36CaloSwLongWeights_versions = [
37
38 # From SP and KL. The original version.
39 # Only one correction, derived from 5X5 DC2 electrons.
40 # In LArClusterRec-02-05-10 in 8.5.0;
41 # revised in LArClusterRec-02-05-25 in 9.0.3.
42 # This was used for the `DC2' corrections.
43 ['old', cls, ['CaloSwLongWeights_old.CaloSwLongWeights_old_parms',
44 'caloswcorr_pool', CALOCORR_COOL], keys],
45
46 # From SP. Derived from 9.0.4 MC for 3X5, 3X7, and 5X5 clusters
47 # (electrons only). This version is not applied in the gap region.
48 # This was used for the `DC2new' corrections.
49 ['904', cls, ['CaloSwLongWeights_904.CaloSwLongWeights_904_parms',
50 'caloswcorr_pool', CALOCORR_COOL], keys],
51
52 # From SP. Derived from 9.0.4 MC for 3X5, 3X7, and 5X5 clusters
53 # (electrons only). This version is applied in the gap region.
54 # This was used for the `Rome' corrections.
55 ['904gap', cls, ['CaloSwLongWeights_904.CaloSwLongWeights_904gap_parms',
56 'caloswcorr_pool', CALOCORR_COOL], keys],
57
58 # From SP. 11.0.41 simulation, 12.0.0 reconstruction.
59 # No separate photon correction.
60 # In CaloClusterCorrection-00-02-38, 12.0.0.
61 # This was used for the `DC3-02' corrections.
62 ['v3', cls, ['CaloSwLongWeights_v3.CaloSwLongWeights_v3_parms',
63 'caloswcorr_pool', CALOCORR_COOL], keys],
64
65 # From SP. 11.0.42 simulation, 12.0.2 reconstruction.
66 # Separate electron and photon corrections.
67 # In CaloClusterCorrection-00-02-59, 12.0.3.
68 ['v3_1', cls, ['CaloSwLongWeights_v3.CaloSwLongWeights_v3_1_parms',
69 'caloswcorr_pool', CALOCORR_COOL], keys],
70
71 # From SP. 12.0.3 simulation and reconstruction,
72 # with ideal (calib0) geometry.
73 # In CaloClusterCorrection-00-02-61, 12.0.4.
74 ['v4', cls, ['CaloSwLongWeights_v4.CaloSwLongWeights_v4_parms',
75 'caloswcorr_pool', CALOCORR_COOL], keys],
76
77 # From Stathes and Nicolas.
78 # For ATLAS-CSC-05-00-00 geometry (14.0.0).
79 ['v5', cls, ['CaloSwLongWeights_v5.CaloSwLongWeights_v5_parms',
80 'caloswcorr_pool', CALOCORR_COOL], keys],
81
82 ['pi0_v1',cls,
83 ['CaloSwLongWeights_pi0_v1.CaloSwLongWeights_pi0_v1_parms'],keys],
84
85 # From Stathes and Nicolas.
86 # For ATLAS-CSC-05-00-00 geometry.
87 ['v6', cls, ['CaloSwLongWeights_v6.CaloSwLongWeights_v6_parms',
88 'caloswcorr_pool', CALOCORR_COOL],
89 keys + ['gam55_conv', 'gam35_conv', 'gam37_conv']],
90
91 # From Stathes and Nicolas.
92 # For Atlfast2 simulation with ATLAS-CSC-05-00-00 geometry (14.0.0).
93 ['atlfast_v1', cls,
94 ['CaloSwLongWeights_atlfast_v1.CaloSwLongWeights_atlfast_v1_parms',
95 'caloswcorr_pool', CALOCORR_COOL], keys],
96
97
98 ]
99
100
101#
102# Create a new tool instance.
103# FLAGS is the configuration flags instance.
104# NAME is the base name for this tool. If defaulted, a name will
105# be constructed from the name of the correction, the version, and the key.
106# If SUFFIX is not None, it will be added onto the end of the tool name.
107# VERSION is a string specifying which of several versions of the correction
108# to choose. If defaulted, the latest version of the correction is chosen.
109# KEY is a string to specify the type of cluster to which the correction
110# applies. The convention is to use `ele55' for 5x5 electron clusters,
111# `gam35' for 3x5 photon clusters, and so on.
112# SOURCE tells from where we should read the calibration constants.
113# See common.py for a description of the possibilities.
114# None means to use the default.
115# CONFCLASS gives the Configurable class to use to create the tool.
116# It may (and usually should) be defaulted.
117#
118# Additional keyword arguments may be passed to override any tool
119# parameters/constants.
120#
122 name = None,
123 suffix = None,
124 version = None,
125 key = CALOCORR_DEFAULT_KEY,
126 source = None,
127 confclass = None,
128 **kw):
129 # Make the tool.
130 return makecorr (flags,
131 versions = CaloSwLongWeights_versions,
132 name = name,
133 basename = 'lwc',
134 suffix = suffix,
135 version = version,
136 key = key,
137 sampling = None,
138 source = source,
139 confclass = confclass,
140 corrclass = CALOCORR_SW,
141 **kw)
make_CaloSwLongWeights(flags, name=None, suffix=None, version=None, key=CALOCORR_DEFAULT_KEY, source=None, confclass=None, **kw)