ATLAS Offline Software
LArCellContHVCorrTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "LArCellContHVCorrTool.h"
6 #include "CaloEvent/CaloCell.h"
8 
9 
10 
11 
13 
15 
16  return StatusCode::SUCCESS;
17 }
18 
19 StatusCode LArCellContHVCorrTool::process(CaloCellContainer* cellCollection, const EventContext& ctx) const {
20 
21  // get offline HVScaleCorr
23  const LArHVCorr *oflHVCorr = *oflHVCorrHdl;
24  if(!oflHVCorr) {
25  ATH_MSG_ERROR("Do not have ofline HV corr. conditions object !!!!");
26  return StatusCode::FAILURE;
27  }
28 
29  if (!cellCollection) {
30  ATH_MSG_ERROR( "Cell Correction tool receives invalid cell Collection" );
31  return StatusCode::FAILURE;
32  }
33 
34 
35  for (CaloCell* theCell : *cellCollection) {
36  const float hvcorr = oflHVCorr->HVScaleCorr(theCell->ID());
37  theCell->setEnergy(theCell->energy()*hvcorr);
38  }// End loop over cell-container
39  return StatusCode::SUCCESS;
40 }
LArCellContHVCorrTool::initialize
virtual StatusCode initialize() override final
Definition: LArCellContHVCorrTool.cxx:12
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
LArCellContHVCorrTool::process
virtual StatusCode process(CaloCellContainer *cellCollection, const EventContext &ctx) const override final
Definition: LArCellContHVCorrTool.cxx:19
CaloCell.h
LArCellContHVCorrTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArHVCorr
Definition: LArHVCorr.h:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
LArCellContHVCorrTool::m_offlineHVScaleCorrKey
SG::ReadCondHandleKey< LArHVCorr > m_offlineHVScaleCorrKey
Definition: LArCellContHVCorrTool.h:31
LArHVCorr::HVScaleCorr
virtual const float & HVScaleCorr(const HWIdentifier &chid) const override final
Definition: LArHVCorr.cxx:19