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 // DESTRUCTOR:
42 
44 = default;
45 
47 // EXECUTE method: Correct cells in input cell container
49 
51  const EventContext& ctx) const
52 {
53 
54  ATH_MSG_DEBUG("Executing CaloCellCorrection");
55 
56  if (!cellCollection) {
57  ATH_MSG_ERROR( "Cell Correction tool receives invalid cell Collection" );
58  return StatusCode::FAILURE;
59  }
60 
61  // Loop over all the CaloCell Objects and call Make Correction.
62  // Note that this is the base class of all the concrete correction
63  // classes which implement a Make Correction method.
64 
65  for (CaloCell* cell : *cellCollection) {
66  MakeCorrection ( cell, ctx );
67  }
68 
69  // Done, Return success
70 
71  return StatusCode::SUCCESS;
72 
73 }
74 
76 // Other methods:
77 // The following methods "correct" the CaloCell data members.
79 
80 
82 {
83  theCell->setEnergy( energy );
84 }
85 
87 {
88  theCell->addEnergy( energy );
89 }
90 
92 {
93  theCell->scaleEnergy( scale );
94 }
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloCellCorrection::execute
virtual StatusCode execute(CaloCellContainer *cellCollection, const EventContext &ctx) const
Definition: CaloCellCorrection.cxx:50
CaloCell.h
CaloCell::setEnergy
virtual void setEnergy(float energy)
set energy
Definition: CaloCell.h:466
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
CaloCell::scaleEnergy
virtual void scaleEnergy(float scale)
scale energy
Definition: CaloCell.h:472
CaloCellCorrection::addenergy
static void addenergy(CaloCell *lar_cell, float energy)
Definition: CaloCellCorrection.cxx:86
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:81
CaloCellCorrection::scaleenergy
static void scaleenergy(CaloCell *lar_cell, float scale)
Definition: CaloCellCorrection.cxx:91
CaloCell::addEnergy
void addEnergy(float energy)
add energy
Definition: CaloCell.h:443