ATLAS Offline Software
CaloSwEtamod_g3.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 
7 NAME: CaloSwEtamod_g3.cxx
8 PACKAGE: offline/Calorimeter/CaloClusterCorrection
9 
10 AUTHORS: H. Ma, S. Rajagopalan
11 CREATED: Dec. 15, 1999
12 
13 PURPOSE: correction for the modulations with the position in eta
14  (Tuned using 50 GeV Et photons)
15  base class: CaloClusterCorrection
16  Correction tuned on G3 samples.
17 
18 Atrecon Orig: emreco/qetamod.F
19 
20 Updated: May 10, 2000 (SR, HM)
21  Migrated to Athena Framework from PASO
22 
23 Updated: Jan 5, 2001 (HM)
24  QA.
25 
26 Updated: May 5, 2004 (Sven Menke)
27  base class changed from algo to tool
28 
29 Updated: June, 2004 (sss)
30  Use ToolWithConstants to get correction constants.
31 
32 ********************************************************************/
33 // include header files
34 #include "CaloSwEtamod_g3.h"
35 
36 
37 using xAOD::CaloCluster;
38 
39 
40 // make correction to one cluster
42  CaloCluster* cluster) const
43 {
44  float aeta = fabs (cluster->etaBE(2));
45  if (aeta > 2.5) return;
46 
47  int ieta = m_neta(myctx)/2;
48  if (ieta > 3) return; // something went wrong
49 
50  CaloRec::Array<1> coef = m_correction(myctx)[aeta < 1.5 ? 0 : 1][ieta-1];
51 
52  float u = fmod (aeta, 0.025);
53  float qetamod = coef[0] + coef[1]*u + coef[2]*u*u;
54 
55  setenergy (cluster, qetamod * cluster->e());
56 }
57 
CaloSwEtamod_g3::m_neta
Constant< int > m_neta
Definition: CaloSwEtamod_g3.h:80
CaloClusterCorrection::setenergy
virtual void setenergy(xAOD::CaloCluster *cluster, float energy) const
Definition: CaloClusterCorrection.cxx:94
CaloSwEtamod_g3.h
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
CaloSwEtamod_g3::m_correction
Constant< CxxUtils::Array< 3 > > m_correction
Definition: CaloSwEtamod_g3.h:81
CxxUtils::Array
Read-only multidimensional array.
Definition: Control/CxxUtils/CxxUtils/Array.h:138
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloCluster::etaBE
double etaBE(int sampling) const
EMB/EMEC combined barycenter .
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:1199
CaloSwEtamod_g3::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition: CaloSwEtamod_g3.cxx:41
CaloCluster::e
virtual double e() const
Retrieve energy independent of signal state.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:753
CaloUtils::ToolConstantsContext
Context object for retrieving ToolConstant values.
Definition: ToolWithConstants.h:61
WriteCalibToCool.coef
coef
Definition: WriteCalibToCool.py:582