9#include "Identifier/Identifier.h"
45 m_tree =
new TTree(
"mytree",
"Calo Noise ntuple");
59 ATH_MSG_INFO (
" end of CaloRescaleNoise::initialize " );
60 return StatusCode::SUCCESS;
66 return StatusCode::SUCCESS;
72 const EventContext& ctx = Gaudi::Hive::currentContext();
77 return StatusCode::FAILURE;
80 FILE* fp = std::fopen(
"calonoise.txt",
"w");
82 ATH_MSG_ERROR(
"Cannot open file calonoise.txt: " << strerror(errno));
83 return StatusCode::FAILURE;
89 scaleCorr = *scaleCorrHdl;
98 if( not caloSCMgrHandle.
isValid()){
100 ATH_MSG_ERROR(
"CaloRescaleNoise::stop: caloSCMgrHandle invalid.");
101 return StatusCode::FAILURE;
107 if( not caloMgrHandle.
isValid()){
109 ATH_MSG_ERROR(
"CaloRescaleNoise::stop: caloMgrHandle invalid.");
110 return StatusCode::FAILURE;
115 int ncell=
m_calo_id->calo_cell_hash_max();
116 ATH_MSG_INFO (
" start loop over Calo cells " << ncell );
117 for (
int i=0;i<ncell;i++) {
150 int ii = (int) (idSubHash);
155 m_OffId = (int)(
id.get_identifier32().get_compact());
163 else if (subCalo<3) ngain=3;
171 hvonline = onlineScaleCorr->HVScaleCorr(hwid);
174 for (
int igain=0;igain<ngain;igain++) {
196 if (iCool<48 && m_elecNoise>0. && hvonline > 1.) {
198 " layer/ieta/iphi " <<
m_calo_id->sampling(
id) <<
" " <<
m_calo_id->eta(
id) <<
" " <<
m_calo_id->phi(
id) <<
" OldNoise,NewNoise " <<
205 " layer/eta/phi " <<
m_layer <<
" " <<
m_eta <<
" " <<
m_phi <<
" OldNoise,NewNoise " <<
223 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helper base class for offline cell identifiers.
Helper class for offline supercell identifiers.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
Helper base class for offline cell identifiers.
This class groups all DetDescr information related to a CaloCell.
float eta_raw() const
cell eta_raw
float phi_raw() const
cell phi_raw
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class initializes the Calo (LAr and Tile) offline identifiers.
const CaloCell_Base_ID * m_calo_id
virtual StatusCode stop() override
standard Athena-Algorithm method
virtual ~CaloRescaleNoise()
Default Destructor.
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
virtual StatusCode initialize() override
standard Athena-Algorithm method
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSCMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadCondHandleKey< ILArHVScaleCorr > m_scaleCorrKey
BooleanProperty m_absScaling
SG::ReadCondHandleKey< CaloNoise > m_pileupNoiseKey
ServiceHandle< ITHistSvc > m_thistSvc
virtual StatusCode execute() override
standard Athena-Algorithm method
CaloRescaleNoise(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
float m_elecNoiseRescaled
SG::ReadCondHandleKey< ILArHVScaleCorr > m_onlineScaleCorrKey
virtual const float & HVScaleCorr(const HWIdentifier &id) const =0
This is a "hash" representation of an Identifier.