ATLAS Offline Software
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 
21 from CaloClusterCorrection.CaloSwPhimod_v4 import CaloSwPhimod_v4_parms
22 
23 
24 def _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]
29 def _flip_phi2 (corr2):
30  return [_flip_phi3(eta,p0,p1,p2,p3) for (eta,p0,p1,p2,p3) in corr2]
31 def _flip_phi1 (corr1):
32  return [_flip_phi2(c) for c in corr1]
33 def _flip_phi (corr):
34  return dict([[k, _flip_phi1(v)] for k,v in corr.items()])
35 
36 
37 def _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 
CaloSwPhimod_v4data._flip_phi2
def _flip_phi2(corr2)
Definition: CaloSwPhimod_v4data.py:29
CaloSwPhimod_v4data._flip_phi
def _flip_phi(corr)
Definition: CaloSwPhimod_v4data.py:33
CaloSwPhimod_v4data._copy_parms
def _copy_parms(src, dst)
Definition: CaloSwPhimod_v4data.py:37
CaloSwPhimod_v4data._flip_phi1
def _flip_phi1(corr1)
Definition: CaloSwPhimod_v4data.py:31
CaloSwPhimod_v4data.CaloSwPhimod_v4data_parms
Definition: CaloSwPhimod_v4data.py:46
CaloSwPhimod_v4data._flip_phi3
def _flip_phi3(eta, p0, p1, p2, p3)
Definition: CaloSwPhimod_v4data.py:24