ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTopoEMphioff.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/CaloTopoEMphioff.py
5# Created: Mar 2007, sss, from earlier job options.
6# Purpose: Steering module + corrections for phi offset corrections
7# for TopoEM clusters.
8#
9
10from AthenaConfiguration.ComponentFactory import CompFactory
11from CaloClusterCorrection.constants import \
12 CALOCORR_COOL, CALOCORR_DEFAULT_KEY, CALOCORR_EMTOPO, CALOCORR_COMBINED2
13from CaloClusterCorrection.common import makecorr
14import math
15
16#
17# This table lists all available versions of this correction.
18# See common.py for a description of the contents.
19#
20from CaloClusterCorrection.constants import topoem_valid_keys as keys
21cls = CompFactory.CaloTopoEMphioff # CaloClusterCorrection
22CaloTopoEMphioff_versions = [
23
24 # v1 --- from the original job options file.
25 ['v1', cls, ['CaloTopoEMphioff.CaloTopoEMphioff_v1_parms',
26 'calotopoemcorr_pool', CALOCORR_COOL], keys],
27
28 # v2 --- same, but with endcap shift removed.
29 ['v2', cls, ['CaloTopoEMphioff.CaloTopoEMphioff_v2_parms',
30 'calotopoemcorr_pool', CALOCORR_COOL
31 ], keys],
32
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 # Make the tool.
65 return makecorr (flags,
66 versions = CaloTopoEMphioff_versions,
67 name = name,
68 basename = 'topophioff',
69 suffix = suffix,
70 version = version,
71 key = key,
72 sampling = None,
73 source = source,
74 confclass = confclass,
75 corrclass = CALOCORR_EMTOPO,
76 **kw)
77
78
79
80# ... phi offset : barrel + endcap
81# I think this was derived for 6-3-3 clusters.
82# Currently applied for all emtopo clusters.
84 region = CALOCORR_COMBINED2
85 EdepA = [
86 0.003568, 0.003794, 0.003693, 0.004167, 0.003905,
87 0.003608, 0.003133, 0.003018, 0.009932, 0.014734,
88 0.022201, 0.029784, 0.035050, 0.034313, 0.025003,
89 0.036740, 0.036417, 0.030943, 0.031863, 0.029199,
90 0.029680, 0.030302, 0.027069, -0.000001, -0.000001
91 ]
92 EdepB = [
93 0.000151, 0.000151, 0.000183, 0.000246, 0.000384,
94 0.000463, 0.000543, 0.000654, 0.000260, 0.000338,
95 0.000426, 0.000592, 0.000861, 0.000965, 0.001584,
96 0.000329, 0.000303, 0.000321, 0.000347, 0.000351,
97 0.000370, 0.000431, 0.000513, 0.000517, 0.000790
98 ]
99 Granularity = 0.1
100 EtaFrontier = [ 0.8, 1.5, 2.3, 2.5 ]
101 FlipPhi = 1
102 EndcapOffset = 2*math.pi/256/6
103
104
105#
106# The same as v1, but with the endcap shift removed.
107#
110for (k,v) in CaloTopoEMphioff_v1_parms.__dict__.items():
111 if k[0] != '_':
112 setattr (CaloTopoEMphioff_v2_parms, k, v)
113CaloTopoEMphioff_v2_parms.EndcapOffset = 0
make_CaloTopoEMphioff(flags, name=None, suffix=None, version=None, key=CALOCORR_DEFAULT_KEY, source=None, confclass=None, **kw)