ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTopoEMphimod.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6
7NAME: CaloTopoEMphimod.cxx
8PACKAGE: offline/Calorimeter/CaloClusterCorrection
9
10AUTHORS: M.Boonekamp & N.Kerschen
11CREATED: March 2005
12
13PURPOSE: correction for the phi offset due to accordion structure
14 base class: CaloClusterCorrection (Algorithm)
15
16Updated: March 12, 2005 (MB)
17 corrections for the TopoCluster
18********************************************************************/
19
20#include "CaloTopoEMphimod.h"
21#include "CLHEP/Units/PhysicalConstants.h"
24#include <cmath>
25
26using CLHEP::pi;
27
28
29// make correction to one cluster
31 xAOD::CaloCluster* cluster,
32 const CaloDetDescrElement* elt,
33 float /*eta*/,
34 float adj_eta,
35 float phi,
36 float /*adj_phi*/,
37 CaloSampling::CaloSample /*samp*/) const
38{
39 float qphimod = 0.;
40 float aeta = fabs(adj_eta);
41 int iEtaBin;
42 // u is the normalized coordinate along phi (within a cell)
43 // 0 < u < 1
44 float u = (phi - elt->phi()) / elt->dphi() + 0.5;
45
46 ATH_MSG_DEBUG( " ... phi-mod BEGIN" << endmsg);
47 ATH_MSG_DEBUG( " ... e, eta, phi " << cluster->e() << " " << cluster->eta() << " " << cluster->phi() << " " << endmsg);
48
49 const CxxUtils::Array<1> EtaFrontier = m_EtaFrontier (myctx);
50
51 // Compute the correction
52 if (aeta < EtaFrontier[0])
53 {
54 iEtaBin = (int)(aeta / m_BarrelGranularity(myctx));
55 qphimod = 1 - m_P1b(myctx)[iEtaBin]*std::cos(8*pi*u)
56 - m_P2b(myctx)[iEtaBin]*std::cos(16*pi*u)
57 - m_P3b(myctx)[iEtaBin]*std::sin(8*pi*u)
58 - m_P4b(myctx)[iEtaBin]*std::sin(16*pi*u);
59 }
60 else if (aeta > EtaFrontier[1] && aeta < EtaFrontier[2])
61 {
62 iEtaBin = (int)((aeta - EtaFrontier[1]) / m_EndcapGranularity(myctx));
63 qphimod = 1 - m_P1e(myctx)[iEtaBin]*std::cos(6*pi*u)
64 - m_P2e(myctx)[iEtaBin]*std::cos(12*pi*u)
65 - m_P3e(myctx)[iEtaBin]*std::sin(6*pi*u)
66 - m_P4e(myctx)[iEtaBin]*std::sin(12*pi*u);
67 }
68 else // wrong eta value
69 {
70 return;
71 }
72
73 // Print out the function for debugging
74 ATH_MSG_DEBUG( " ... Phi mod " << qphimod << " " << u << " " << phi << " " << elt->phi()
75 << " " << adj_eta << " " << aeta << " " << iEtaBin << endmsg);
76
77 // Apply the correction
78 setenergy (cluster, cluster->e() * qphimod);
79
80 ATH_MSG_DEBUG( " ... phi-mod END" << endmsg);
81 ATH_MSG_DEBUG( " ... e, eta, phi " << cluster->e() << " " << cluster->eta() << " " << cluster->phi() << " " << endmsg);
82}
Scalar phi() const
phi method
#define endmsg
#define ATH_MSG_DEBUG(x)
Definition of CaloDetDescrManager.
CaloPhiRange class declaration.
#define pi
virtual void setenergy(xAOD::CaloCluster *cluster, float energy) const
This class groups all DetDescr information related to a CaloCell.
Constant< CxxUtils::Array< 1 > > m_P3b
Constant< CxxUtils::Array< 1 > > m_P2e
Constant< CxxUtils::Array< 1 > > m_P1e
Constant< CxxUtils::Array< 1 > > m_P2b
Constant< CxxUtils::Array< 1 > > m_P4b
Constant< float > m_EndcapGranularity
virtual void makeTheCorrection(const Context &myctx, xAOD::CaloCluster *cluster, const CaloDetDescrElement *elt, float eta, float adj_eta, float phi, float adj_phi, CaloSampling::CaloSample samp) const
Constant< CxxUtils::Array< 1 > > m_P4e
Constant< CxxUtils::Array< 1 > > m_P3e
Constant< float > m_BarrelGranularity
Constant< CxxUtils::Array< 1 > > m_P1b
Constant< CxxUtils::Array< 1 > > m_EtaFrontier
Read-only multidimensional array.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.