ATLAS Offline Software
CaloCellCorrection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /********************************************************************
6 
7 NAME: CaloCellCorrection.h used to be LArCellCorrection.h
8 PACKAGE: offline/Calorimeter/CaloUtils
9 
10 AUTHORS: H. Ma, S. Rajagopalan
11 CREATED: Dec. 15, 1999
12 
13 PURPOSE: Performs cell corrections for CaloCell objects
14  This is the base class for individual cell correction classes.
15 
16 
17 Updated: May 10, 2000 (SR, HM)
18  Migrated to Athena Framework from PASO
19 
20 Updated: Jan. 2, 2001 (SR)
21  Adhere to QC standards (based on comments from S. Albrand)
22 
23 Updated: Jan 2003
24  Made to an AlgTool,
25  Moved to LArCalorimeter/LArRecUtils
26 
27 Update : June 2004 David Rousseau
28  Change name
29  Work off CaloCell, not LArCell anymore, without friend mechanism
30 
31 ********************************************************************/
32 
33 // Calo Header files:
34 
37 #include "CaloEvent/CaloCell.h"
38 
40 
41 // CONSTRUCTOR:
42 
44  const std::string& name,
45  const IInterface* parent)
47 { }
48 
49 // DESTRUCTOR:
50 
52 = default;
53 
55 // EXECUTE method: Correct cells in input cell container
57 
59  const EventContext& ctx) const
60 {
61 
62  ATH_MSG_DEBUG("Executing CaloCellCorrection");
63 
64  if (!cellCollection) {
65  ATH_MSG_ERROR( "Cell Correction tool receives invalid cell Collection" );
66  return StatusCode::FAILURE;
67  }
68 
69  // Loop over all the CaloCell Objects and call Make Correction.
70  // Note that this is the base class of all the concrete correction
71  // classes which implement a Make Correction method.
72 
73  for (CaloCell* cell : *cellCollection) {
74  MakeCorrection ( cell, ctx );
75  }
76 
77  // Done, Return success
78 
79  return StatusCode::SUCCESS;
80 
81 }
82 
84 // Other methods:
85 // The following methods "correct" the CaloCell data members.
87 
88 
90 {
91  theCell->setEnergy( energy );
92 }
93 
95 {
96  theCell->addEnergy( energy );
97 }
98 
100 {
101  theCell->scaleEnergy( scale );
102 }
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloCellCorrection::execute
virtual StatusCode execute(CaloCellContainer *cellCollection, const EventContext &ctx) const
Definition: CaloCellCorrection.cxx:58
CaloCell.h
CaloCell::setEnergy
virtual void setEnergy(float energy)
set energy
Definition: CaloCell.cxx:136
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
CaloCellCorrection.h
CaloCellCorrection::MakeCorrection
virtual void MakeCorrection(CaloCell *cellCollection, const EventContext &ctx) const =0
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCellCorrection::CaloCellCorrection
CaloCellCorrection(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloCellCorrection.cxx:43
CaloCell::scaleEnergy
virtual void scaleEnergy(float scale)
scale energy
Definition: CaloCell.cxx:146
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CaloCellCorrection::addenergy
static void addenergy(CaloCell *lar_cell, float energy)
Definition: CaloCellCorrection.cxx:94
CaloCellCorrection::~CaloCellCorrection
virtual ~CaloCellCorrection()
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellCorrection::setenergy
static void setenergy(CaloCell *lar_cell, float energy)
Definition: CaloCellCorrection.cxx:89
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCellCorrection::scaleenergy
static void scaleenergy(CaloCell *lar_cell, float scale)
Definition: CaloCellCorrection.cxx:99
AthAlgTool
Definition: AthAlgTool.h:26
CaloCell::addEnergy
virtual void addEnergy(float energy)
add energy
Definition: CaloCell.cxx:141