ATLAS Offline Software
CaloSwClcon_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: CaloSwClcon_g3.cxx
8 PACKAGE: offline/Calorimeter/CaloClusterCorrection
9 
10 AUTHORS: S. Rajagopalan
11 CREATED: Dec. 15, 1999
12 
13 PURPOSE: correction for the finite containment for a given cluster size
14  (Tuned using 50 GeV Et photons)
15  Base class: CaloClusterCorrection
16  Correction tuned on G3 samples.
17 
18 Atrecon Orig: emrecon/qclcon.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: Feb 2003 (LC)
27  New corrections for DC1 geometry
28 
29 Updated: May 5, 2004 (Sven Menke)
30  base class changed from algo to tool
31 
32 Updated: June, 2004 (sss)
33  Use ToolWithConstants to get correction constants.
34 ********************************************************************/
35 
36 
37 #include "CaloSwClcon_g3.h"
39 #include "GaudiKernel/MsgStream.h"
40 #include <cmath>
41 
42 
43 using xAOD::CaloCluster;
44 
45 // apply correction to one cluster.
47  CaloCluster* cluster) const
48 {
49  const float etamin = m_etamin (myctx);
50  const float etamax = m_etamax (myctx);
51 
52  float eta = cluster->eta();
53  float aeta = fabs(eta);
54  if (aeta < etamin || aeta >= etamax) return;
55 
57  if (correction.size() == 0) return;
58 
59  // Determine the correction
60  double granularity = (etamax - etamin) / correction.size();
61  int i = static_cast<int> ((aeta - etamin)/granularity);
62  float qclcon = correction[i];
63 
64  // Do the Correction
65  setenergy(cluster, qclcon * cluster->e());
66 }
67 
68 
71 {
72  return 1;
73 }
CaloClusterCorrection::setenergy
virtual void setenergy(xAOD::CaloCluster *cluster, float energy) const
Definition: CaloClusterCorrection.cxx:94
CaloSwClcon_g3::version
virtual int version() const
Currently at version==1.
Definition: CaloSwClcon_g3.cxx:70
CaloSwClcon_g3.h
CaloSwClcon_g3::m_correction
Constant< CxxUtils::Array< 1 > > m_correction
Definition: CaloSwClcon_g3.h:91
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
CaloSwClcon_g3::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition: CaloSwClcon_g3.cxx:46
lumiFormat.i
int i
Definition: lumiFormat.py:85
CxxUtils::Array< 1 >
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CaloCluster::eta
virtual double eta() const
Retrieve eta independent of signal state.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:755
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
CaloSwClcon_g3::m_etamax
Constant< float > m_etamax
Definition: CaloSwClcon_g3.h:90
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
CaloSwClcon_g3::m_etamin
Constant< float > m_etamin
Definition: CaloSwClcon_g3.h:89