ATLAS Offline Software
Loading...
Searching...
No Matches
CaloSwPhioff_v4data.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_v4_data.py
5# Created: Sep 2010, sss
6# Purpose: Phi position corrections, v4, data version.
7#
8# It turns out that the direction of the accordions is backwards in the MC
9# in the barrel.
10# So the correction required in the data is opposite that of the MC.
11# So this correction is identical to _v4, except that the sign is flipped
12# in the barrel.
13#
14
15from CaloClusterCorrection.constants import EME2, EMB2
16from CaloClusterCorrection.CaloSwPhioff_v4 import \
17 CaloSwPhioff_v4_b2_parms, CaloSwPhioff_v4_e2_parms
18
19
21 pass
22
23
24def _flip_phi2 (corr2):
25 return [[eta, -off] for (eta,off) in corr2]
26def _flip_phi1 (corr1):
27 return [_flip_phi2(c) for c in corr1]
28def _flip_phi (corr):
29 return dict([[k, _flip_phi1(v)] for k,v in corr.items()])
30
31
32def _copy_parms (src, dst):
33 for (k, v) in src.__dict__.items():
34 if k[0] == '_': continue
35 if k == 'correction':
36 v = _flip_phi (v)
37 setattr (dst, k, v)
38 return
39
40_copy_parms (CaloSwPhioff_v4_b2_parms, CaloSwPhioff_v4data_b2_parms)
41
42
43CaloSwPhioff_v4data_parms = { EMB2 : CaloSwPhioff_v4data_b2_parms,
44 EME2 : CaloSwPhioff_v4_e2_parms,
45 }
46
47