Commit 34f7da23 authored by Philippe Calfayan's avatar Philippe Calfayan Committed by Peter Berta
Browse files

update TRT_ToT_dEdx to protect from crash

parent 7ed3bb35
......@@ -224,8 +224,11 @@ StatusCode TRT_ToT_dEdx::update(int& /*i*/ , std::list<std::string>& /*l*/)
current_array_values.push_back(first_channel->second["array_value"].data<float>());
}
result_dict[dict_names[current_channel]] = current_array_values;
// protection for longer vectors present in newer DB tags
if (current_channel < dict_names.size()) {
result_dict[dict_names[current_channel]] = current_array_values;
}
update_New(result_dict);
ATH_MSG_DEBUG ("update():: Reading new database is done!");
......@@ -350,10 +353,10 @@ void TRT_ToT_dEdx::update_New(std::map<std::string,std::vector<float> > &result_
for (unsigned int ind=0; ind < 180; ++ind) {
Dedxcorrection::para_short_mimicToXe_MC[0][ind]=result_dict["para_short_mimicToXeXe"][ind];
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_DATA[0][ind]=result_dict["para_long_mimicToXeXe"][ind];
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_MC[0][ind]=result_dict["para_long_mimicToXeXe"][ind];
}
......@@ -428,10 +431,10 @@ void TRT_ToT_dEdx::update_New(std::map<std::string,std::vector<float> > &result_
for (unsigned int ind=0; ind < 180; ++ind) {
Dedxcorrection::para_short_mimicToXe_MC[1][ind]=result_dict["para_short_mimicToXeAr"][ind];
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_DATA[1][ind]=result_dict["para_long_mimicToXeAr"][ind];
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_MC[1][ind]=result_dict["para_long_mimicToXeAr"][ind];
}
......@@ -506,10 +509,10 @@ void TRT_ToT_dEdx::update_New(std::map<std::string,std::vector<float> > &result_
for (unsigned int ind=0; ind < 180; ++ind) {
Dedxcorrection::para_short_mimicToXe_MC[2][ind]=result_dict["para_short_mimicToXeKr"][ind];
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_DATA[2][ind]=result_dict["para_long_mimicToXeKr"][ind];
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_MC[2][ind]=result_dict["para_long_mimicToXeKr"][ind];
}
}
......@@ -586,7 +589,7 @@ void TRT_ToT_dEdx::update_Old(std::map<std::string,std::vector<float> > &result_
Dedxcorrection::para_short_mimicToXe_DATA[gasType][ind] = 1.;
}
for (unsigned int ind=0; ind < 1800; ++ind) {
for (unsigned int ind=0; ind < 1080; ++ind) {
Dedxcorrection::para_long_mimicToXe_MC[gasType][ind] = 1.;
Dedxcorrection::para_long_mimicToXe_DATA[gasType][ind] = 1.;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment