7 #include "CoralBase/AttributeListSpecification.h"
11 "para_short_corrRZ_MC",
"para_end_corrRZ_MC",
"para_long_corrRZL_MC",
12 "para_short_corrRZL_MC",
"para_end_corrRZL_MC"};
14 "para_long_corrRZLXe",
"para_long_corrRZ_Xe",
"para_long_mimicToXeXe",
"para_short_corrRZLXe",
15 "para_short_corrRZ_Xe",
"para_short_mimicToXeXe",
"resolution_Xe",
"resolution_e_Xe",
"para_end_corrRZLAr",
16 "para_end_corrRZ_Ar",
"para_end_mimicToXeAr",
"para_long_corrRZLAr",
"para_long_corrRZ_Ar",
17 "para_long_mimicToXeAr",
"para_short_corrRZLAr",
"para_short_corrRZ_Ar",
"para_short_mimicToXeAr",
18 "resolution_Ar",
"resolution_e_Ar",
"para_end_corrRZLKr",
"para_end_corrRZ_Kr",
"para_end_mimicToXeKr",
19 "para_long_corrRZLKr",
"para_long_corrRZ_Kr",
"para_long_mimicToXeKr",
"para_short_corrRZLKr",
20 "para_short_corrRZ_Kr",
"para_short_mimicToXeKr",
"resolution_Kr",
"resolution_e_Kr",
21 "HitOccPar",
"TrackOccPar0",
"TrackOccPar0_noHT",
"TrackOccPar1",
"TrackOccPar1_noHT",
"TrackOccPar2",
"TrackOccPar2_noHT"};
24 , ISvcLocator* pSvcLocator )
38 return StatusCode::SUCCESS;
50 if(writeHandle.isValid()) {
51 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
52 <<
". In theory this should not be called, but may happen"
53 <<
" if multiple concurrent events are being processed out of order.");
55 return StatusCode::SUCCESS;
63 if(channel_values==
nullptr) {
64 ATH_MSG_ERROR(
" Problem reading TRT/Calib/ToT/ToTVectors cond object");
65 return StatusCode::FAILURE;
75 if(attrListColl==
nullptr) {
76 ATH_MSG_ERROR(
" Problem reading TRT/Calib/ToT/ToTValue cond object");
77 return StatusCode::FAILURE;
85 if(!readVecHandle.range(rangeW)) {
86 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << readVecHandle.key());
87 return StatusCode::FAILURE;
91 if(writeHandle.record(rangeW,std::move(
Dedxcorrection)).isFailure()) {
93 <<
" with EventRange " << rangeW
94 <<
" into Conditions Store");
95 return StatusCode::FAILURE;
99 return StatusCode::SUCCESS;
105 return StatusCode::SUCCESS;
111 int dataBaseType =
kNewDB;
112 if(channel_values->
size()<19695) {
114 }
else if (channel_values->
size()>19695) {
119 std::map<std::string,std::vector<float> > resultDict;
122 unsigned int channelIndex = 0;
123 std::vector<float> currentArrayValues = {};
125 if (channelIndex !=
channel->first){
126 if(!currentArrayValues.empty()) resultDict[dictNames[channelIndex]] = currentArrayValues;
128 currentArrayValues.clear();
130 currentArrayValues.push_back(
channel->second[
"array_value"].data<
float>());
132 resultDict[dictNames[channelIndex]] = currentArrayValues;
140 ATH_MSG_DEBUG (
"update():: Reading new database with occupancy correction is done!");
142 return StatusCode::SUCCESS;
143 }
else if(dataBaseType==
kOldDB) {
147 return StatusCode::SUCCESS;
149 return StatusCode::FAILURE;
170 for (
unsigned int ind=0;
ind < 4; ++
ind) {
174 for (
unsigned int ind=0;
ind < 4; ++
ind) {
178 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
182 for (
unsigned int ind=0;
ind < 216; ++
ind) {
186 for (
unsigned int ind=0;
ind < 630; ++
ind) {
190 for (
unsigned int ind=0;
ind < 63; ++
ind) {
191 Dedxcorrection.paraShortCorrRZDivideByLengthMC[0][
ind]=result_dict[
"para_short_corrRZLXe"][
ind];
194 for (
unsigned int ind=0;
ind < 252; ++
ind) {
198 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
202 for (
unsigned int ind=0;
ind < 216; ++
ind) {
206 for (
unsigned int ind=0;
ind < 630; ++
ind) {
207 Dedxcorrection.paraLongCorrRZDivideByLengthDATA[0][
ind]=result_dict[
"para_long_corrRZLXe"][
ind];
210 for (
unsigned int ind=0;
ind < 63; ++
ind) {
211 Dedxcorrection.paraShortCorrRZDivideByLengthDATA[0][
ind]=result_dict[
"para_short_corrRZLXe"][
ind];
214 for (
unsigned int ind=0;
ind < 252; ++
ind) {
218 for (
unsigned int ind=0;
ind < 336; ++
ind) {
222 for (
unsigned int ind=0;
ind < 336; ++
ind) {
228 for (
unsigned int ind=0;
ind < 560; ++
ind) {
231 for (
unsigned int ind=0;
ind < 560; ++
ind) {
234 for (
unsigned int ind=0;
ind < 180; ++
ind) {
237 for (
unsigned int ind=0;
ind < 180; ++
ind) {
240 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
243 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
248 for (
unsigned int ind=0;
ind < 4; ++
ind) {
252 for (
unsigned int ind=0;
ind < 4; ++
ind) {
256 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
260 for (
unsigned int ind=0;
ind < 216; ++
ind) {
264 for (
unsigned int ind=0;
ind < 630; ++
ind) {
268 for (
unsigned int ind=0;
ind < 63; ++
ind) {
269 Dedxcorrection.paraShortCorrRZDivideByLengthMC[1][
ind]=result_dict[
"para_short_corrRZLAr"][
ind];
272 for (
unsigned int ind=0;
ind < 252; ++
ind) {
276 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
280 for (
unsigned int ind=0;
ind < 216; ++
ind) {
284 for (
unsigned int ind=0;
ind < 630; ++
ind) {
285 Dedxcorrection.paraLongCorrRZDivideByLengthDATA[1][
ind]=result_dict[
"para_long_corrRZLAr"][
ind];
288 for (
unsigned int ind=0;
ind < 63; ++
ind) {
289 Dedxcorrection.paraShortCorrRZDivideByLengthDATA[1][
ind]=result_dict[
"para_short_corrRZLAr"][
ind];
292 for (
unsigned int ind=0;
ind < 252; ++
ind) {
296 for (
unsigned int ind=0;
ind < 336; ++
ind) {
300 for (
unsigned int ind=0;
ind < 336; ++
ind) {
306 for (
unsigned int ind=0;
ind < 560; ++
ind) {
309 for (
unsigned int ind=0;
ind < 560; ++
ind) {
312 for (
unsigned int ind=0;
ind < 180; ++
ind) {
315 for (
unsigned int ind=0;
ind < 180; ++
ind) {
318 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
321 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
326 for (
unsigned int ind=0;
ind < 4; ++
ind) {
330 for (
unsigned int ind=0;
ind < 4; ++
ind) {
334 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
338 for (
unsigned int ind=0;
ind < 216; ++
ind) {
342 for (
unsigned int ind=0;
ind < 630; ++
ind) {
346 for (
unsigned int ind=0;
ind < 63; ++
ind) {
347 Dedxcorrection.paraShortCorrRZDivideByLengthMC[2][
ind]=result_dict[
"para_short_corrRZLKr"][
ind];
350 for (
unsigned int ind=0;
ind < 252; ++
ind) {
354 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
358 for (
unsigned int ind=0;
ind < 216; ++
ind) {
362 for (
unsigned int ind=0;
ind < 630; ++
ind) {
363 Dedxcorrection.paraLongCorrRZDivideByLengthDATA[2][
ind]=result_dict[
"para_long_corrRZLKr"][
ind];
366 for (
unsigned int ind=0;
ind < 63; ++
ind) {
367 Dedxcorrection.paraShortCorrRZDivideByLengthDATA[2][
ind]=result_dict[
"para_short_corrRZLKr"][
ind];
370 for (
unsigned int ind=0;
ind < 252; ++
ind) {
374 for (
unsigned int ind=0;
ind < 336; ++
ind) {
378 for (
unsigned int ind=0;
ind < 336; ++
ind) {
384 for (
unsigned int ind=0;
ind < 560; ++
ind) {
387 for (
unsigned int ind=0;
ind < 560; ++
ind) {
390 for (
unsigned int ind=0;
ind < 180; ++
ind) {
393 for (
unsigned int ind=0;
ind < 180; ++
ind) {
396 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
399 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
407 for(
int gasType = 0; gasType<3; gasType++) {
408 for (
unsigned int ind=0;
ind < 4; ++
ind) {
412 for (
unsigned int ind=0;
ind < 4; ++
ind) {
416 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
420 for (
unsigned int ind=0;
ind < 216; ++
ind) {
424 for (
unsigned int ind=0;
ind < 630; ++
ind) {
425 Dedxcorrection.paraLongCorrRZDivideByLengthMC[gasType][
ind]=result_dict[
"para_long_corrRZL_MC"][
ind];
428 for (
unsigned int ind=0;
ind < 63; ++
ind) {
429 Dedxcorrection.paraShortCorrRZDivideByLengthMC[gasType][
ind]=result_dict[
"para_short_corrRZL_MC"][
ind];
432 for (
unsigned int ind=0;
ind < 252; ++
ind) {
433 Dedxcorrection.paraEndCorrRZDivideByLengthMC[gasType][
ind]=result_dict[
"para_end_corrRZL_MC"][
ind];
436 for (
unsigned int ind=0;
ind < 3240; ++
ind) {
440 for (
unsigned int ind=0;
ind < 216; ++
ind) {
444 for (
unsigned int ind=0;
ind < 630; ++
ind) {
445 Dedxcorrection.paraLongCorrRZDivideByLengthDATA[gasType][
ind]=result_dict[
"para_long_corrRZL_MC"][
ind];
448 for (
unsigned int ind=0;
ind < 63; ++
ind) {
449 Dedxcorrection.paraShortCorrRZDivideByLengthDATA[gasType][
ind]=result_dict[
"para_short_corrRZL_MC"][
ind];
452 for (
unsigned int ind=0;
ind < 252; ++
ind) {
453 Dedxcorrection.paraEndCorrRZDivideByLengthDATA[gasType][
ind]=result_dict[
"para_end_corrRZL_MC"][
ind];
456 for (
unsigned int ind=0;
ind < 336; ++
ind) {
460 for (
unsigned int ind=0;
ind < 336; ++
ind) {
465 for (
unsigned int ind=0;
ind < 560; ++
ind) {
470 for (
unsigned int ind=0;
ind < 180; ++
ind) {
475 for (
unsigned int ind=0;
ind < 1080; ++
ind) {
484 int dataBaseType =
kNewDB;
485 if(attrListColl->
size() < 2) dataBaseType =
kOldDB;
490 if(dataBaseType==
kNewDB) {
507 Dedxcorrection.normSlopeTotDivideByLength[
index] = attrList[
"norm_slope_totl"].data<
float>();
509 Dedxcorrection.normOffsetTotDivideByLength[
index] = attrList[
"norm_offset_totl"].data<
float>();
517 for(
int gasType=0; gasType<3; gasType++) {
518 Dedxcorrection.paraDivideByLengthDedxP1[gasType] = attrList[
"paraL_dEdx_p1"].data<
float>();
519 Dedxcorrection.paraDivideByLengthDedxP2[gasType] = attrList[
"paraL_dEdx_p2"].data<
float>();
520 Dedxcorrection.paraDivideByLengthDedxP3[gasType] = attrList[
"paraL_dEdx_p3"].data<
float>();
521 Dedxcorrection.paraDivideByLengthDedxP4[gasType] = attrList[
"paraL_dEdx_p4"].data<
float>();
522 Dedxcorrection.paraDivideByLengthDedxP5[gasType] = attrList[
"paraL_dEdx_p5"].data<
float>();
524 Dedxcorrection.paraDedxP1[gasType] = attrList[
"para_dEdx_p1"].data<
float>();
525 Dedxcorrection.paraDedxP2[gasType] = attrList[
"para_dEdx_p2"].data<
float>();
526 Dedxcorrection.paraDedxP3[gasType] = attrList[
"para_dEdx_p3"].data<
float>();
527 Dedxcorrection.paraDedxP4[gasType] = attrList[
"para_dEdx_p4"].data<
float>();
528 Dedxcorrection.paraDedxP5[gasType] = attrList[
"para_dEdx_p5"].data<
float>();
530 Dedxcorrection.normOffsetData[gasType] = attrList[
"norm_offset_data"].data<
float>();
531 Dedxcorrection.normSlopeTot[gasType] = attrList[
"norm_slope_tot"].data<
float>();
532 Dedxcorrection.normSlopeTotDivideByLength[gasType] = attrList[
"norm_slope_totl"].data<
float>();
533 Dedxcorrection.normOffsetTot[gasType] = attrList[
"norm_offset_tot"].data<
float>();
534 Dedxcorrection.normOffsetTotDivideByLength[gasType] = attrList[
"norm_offset_totl"].data<
float>();
535 Dedxcorrection.normNzero[gasType]=attrList[
"norm_nzero"].data<
int>();
540 return StatusCode::SUCCESS;