11 #include "GaudiKernel/SystemOfUnits.h"
39 return StatusCode::SUCCESS;
44 m_etaBins = {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.7, 2.9, 3.1};
45 TProfile *noiseProfileEM =
dynamic_cast<TProfile *
>(noiseFile->Get(
"jTowerNoise/pr_eta_EM"));
46 TProfile *noiseProfileHAD =
dynamic_cast<TProfile *
>(noiseFile->Get(
"jTowerNoise/pr_eta_HAD"));
47 TProfile *noiseProfileFCAL =
dynamic_cast<TProfile *
>(noiseFile->Get(
"jTowerNoise/pr_eta_FCAL"));
48 if (!noiseProfileEM || !noiseProfileHAD || !noiseProfileFCAL)
50 ATH_MSG_ERROR(
"Failed to load noise values from input file!");
51 return StatusCode::FAILURE;
53 if (
m_etaBins.size() !=
static_cast<std::size_t
>(noiseProfileEM->GetNbinsX()) + 1)
55 ATH_MSG_ERROR(
"Number of EM profile eta bins '" << noiseProfileEM->GetNbinsX() <<
"' does not match expected value '" <<
m_etaBins.size() - 1 <<
"'!");
56 return StatusCode::FAILURE;
58 if (
m_etaBins.size() !=
static_cast<std::size_t
>(noiseProfileHAD->GetNbinsX()) + 1)
60 ATH_MSG_ERROR(
"Number of HAD profile eta bins '" << noiseProfileHAD->GetNbinsX() <<
"' does not match expected value '" <<
m_etaBins.size() - 1 <<
"'!");
61 return StatusCode::FAILURE;
73 for (std::size_t
idx = 1; idx < static_cast<std::size_t>(noiseProfileFCAL->GetNbinsX() + 1); ++
idx)
75 std::string
label = noiseProfileFCAL->GetXaxis()->GetBinLabel(
idx);
79 if (
label.substr(0, 4) !=
"ieta")
82 return StatusCode::FAILURE;
84 std::size_t towerIdx =
static_cast<std::size_t
>(
std::atoi(
label.substr(4).c_str()));
90 m_etaBins = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.5, 2.7, 2.9, 3.1, 3.5, 4.0, 4.45, 4.9};
91 TProfile *noiseProfile =
dynamic_cast<TProfile *
>(noiseFile->Get(
"gTowerNoise/pr_eta"));
94 ATH_MSG_ERROR(
"Failed to load noise values from input file!");
95 return StatusCode::FAILURE;
97 if (
m_etaBins.size() !=
static_cast<std::size_t
>(noiseProfile->GetNbinsX()) + 1)
99 ATH_MSG_ERROR(
"Number of profile eta bins '" << noiseProfile->GetNbinsX() <<
"' does not match expected value '" <<
m_etaBins.size() - 1 <<
"'!");
100 return StatusCode::FAILURE;
107 return StatusCode::SUCCESS;
113 if (!inputTowers.isValid())
116 return StatusCode::FAILURE;
120 float absEta = std::abs(iTower->eta());
138 if (iTower->sampling() == 0)
156 return StatusCode::SUCCESS;