6 #include <TParameter.h>
12 TParameter<T>*
p =
dynamic_cast<TParameter<T>*
>(
f.Get(
name.c_str()));
21 :
asg::AsgMessaging(
"LArTemperatureCorrectionTool"),
24 throw std::runtime_error(
"LArTemperatureCorrectionTool: Cannot open file");
27 m_tree =
dynamic_cast<TTree*
>(
m_file->Get(
"temperature"));
29 throw std::runtime_error(
"LArTemperatureCorrectionTool: Cannot find tree");
33 m_tree->SetBranchAddress(
"run", &t_run);
40 get_value_parameter<double>(*
m_file,
"base_temperature_barrel");
42 get_value_parameter<double>(*
m_file,
"base_temperature_endcapA");
44 get_value_parameter<double>(*
m_file,
"base_temperature_endcapC");
47 get_value_parameter<double>(*
m_file,
"sensitivity_temperature_barrel");
49 get_value_parameter<double>(*
m_file,
"sensitivity_temperature_endcapA");
51 get_value_parameter<double>(*
m_file,
"sensitivity_temperature_endcapC");
53 ATH_MSG_INFO(
"LArTemperatureCorrectionTool initialized for runs "
55 ATH_MSG_INFO(
"base temperatures (barrel/endcapA/endcapC) = "
58 ATH_MSG_INFO(
"sensitivity relE/K (barrel/endcapA/endcapC) = "
82 m_tree->SetBranchAddress(
"run", &t_run);
83 m_tree->SetBranchAddress(
"average_temperature_barrel", &t_barrel);
84 m_tree->SetBranchAddress(
"average_temperature_endcapA", &t_endcapA);
85 m_tree->SetBranchAddress(
"average_temperature_endcapC", &t_endcapC);
89 int high =
m_tree->GetEntries() - 1;
93 if (high - low < 50) {
94 for (
int i = low;
i <= high; ++
i) {
97 return AllValues{t_barrel, t_endcapA, t_endcapC};
103 mid = low + (high - low) / 2;
106 return AllValues{t_barrel, t_endcapA, t_endcapC};
107 }
else if (
run < t_run) {
127 "run " <<
run <<
" is before the first run - using the first run");
131 <<
" is after the last run - using the last run");