ATLAS Offline Software
Loading...
Searching...
No Matches
CaloSwPhimod_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/CaloSwPhimod_v4_data.py
5# Created: Sep 2010, sss
6# Purpose: Phi modulation corrections, v4, data version.
7#
8# It turns out that the direction of the accordions is backwards in the MC
9# for the barrel.
10# So for the data, we flip the sign of the phase arguments in this region.
11# Recall that the correction has the form
12#
13# p0 * (a*cos(N*phi + p1) + (1-a)*cos(2*N*phi + p3))
14#
15# where a = atan(p2)/pi + 0.5
16#
17# So here we flip the signs of p1 and p3; that corresponds to making
18# this correction identical under a phi -> -phi transformation.
19#
20
21from CaloClusterCorrection.CaloSwPhimod_v4 import CaloSwPhimod_v4_parms
22
23
24def _flip_phi3 (eta, p0, p1, p2, p3):
25 if abs(eta) < 1.5:
26 p1 = -p1
27 p3 = -p3
28 return [eta, p0, p1, p2, p3]
29def _flip_phi2 (corr2):
30 return [_flip_phi3(eta,p0,p1,p2,p3) for (eta,p0,p1,p2,p3) in corr2]
31def _flip_phi1 (corr1):
32 return [_flip_phi2(c) for c in corr1]
33def _flip_phi (corr):
34 return dict([[k, _flip_phi1(v)] for k,v in corr.items()])
35
36
37def _copy_parms (src, dst):
38 for (k, v) in src.__dict__.items():
39 if k[0] == '_': continue
40 if k == 'correction':
41 v = _flip_phi (v)
42 setattr (dst, k, v)
43 return
44
45
47 pass
48
49_copy_parms (CaloSwPhimod_v4_parms, CaloSwPhimod_v4data_parms)
50
51
_flip_phi3(eta, p0, p1, p2, p3)