26 m_writeAux(false), m_eventReady(false),
27 m_runNumber(0), m_lumiBlock(0),
28 m_zdcTriggerEfficiency(0)
31 #ifndef XAOD_STANDALONE
32 declareInterface<IZdcAnalysisTool>(
this);
102 std::unique_ptr<TFile>
file (TFile::Open(
filename.c_str(),
"READ"));
103 if (
file ==
nullptr ||
file->IsZombie())
113 std::stringstream Aalpha_name;
115 TSpline3* par_A_alpha = (TSpline3*)
file->GetObjectChecked(Aalpha_name.str().c_str(),
"TSpline3");
123 std::stringstream Abeta_name;
125 TSpline3* par_A_beta = (TSpline3*)
file->GetObjectChecked(Abeta_name.str().c_str(),
"TSpline3");
126 std::stringstream Atheta_name;
128 TSpline3* par_A_theta = (TSpline3*)
file->GetObjectChecked(Atheta_name.str().c_str(),
"TSpline3");
130 std::stringstream Calpha_name;
132 TSpline3* par_C_alpha = (TSpline3*)
file->GetObjectChecked(Calpha_name.str().c_str(),
"TSpline3");
133 std::stringstream Cbeta_name;
135 TSpline3* par_C_beta = (TSpline3*)
file->GetObjectChecked(Cbeta_name.str().c_str(),
"TSpline3");
136 std::stringstream Ctheta_name;
138 TSpline3* par_C_theta = (TSpline3*)
file->GetObjectChecked(Ctheta_name.str().c_str(),
"TSpline3");
140 std::stringstream Err_Aalpha_name;
141 Err_Aalpha_name <<
"A_alpha_error_" <<
runNumber;
142 TSpline3* parErr_A_alpha = (TSpline3*)
file->GetObjectChecked(Err_Aalpha_name.str().c_str(),
"TSpline3");
143 std::stringstream Err_Abeta_name;
144 Err_Abeta_name <<
"A_beta_error_" <<
runNumber;
145 TSpline3* parErr_A_beta = (TSpline3*)
file->GetObjectChecked(Err_Abeta_name.str().c_str(),
"TSpline3");
146 std::stringstream Err_Atheta_name;
147 Err_Atheta_name <<
"A_theta_error_" <<
runNumber;
148 TSpline3* parErr_A_theta = (TSpline3*)
file->GetObjectChecked(Err_Atheta_name.str().c_str(),
"TSpline3");
150 std::stringstream Err_Calpha_name;
151 Err_Calpha_name <<
"C_alpha_error_" <<
runNumber;
152 TSpline3* parErr_C_alpha = (TSpline3*)
file->GetObjectChecked(Err_Calpha_name.str().c_str(),
"TSpline3");
153 std::stringstream Err_Cbeta_name;
154 Err_Cbeta_name <<
"C_beta_error_" <<
runNumber;
155 TSpline3* parErr_C_beta = (TSpline3*)
file->GetObjectChecked(Err_Cbeta_name.str().c_str(),
"TSpline3");
156 std::stringstream Err_Ctheta_name;
157 Err_Ctheta_name <<
"C_theta_error_" <<
runNumber;
158 TSpline3* parErr_C_theta = (TSpline3*)
file->GetObjectChecked(Err_Ctheta_name.str().c_str(),
"TSpline3");
161 std::stringstream Cov_A_alpha_beta_name;
162 Cov_A_alpha_beta_name <<
"cov_A_alpha_beta_" <<
runNumber;
163 TSpline3* cov_A_alpha_beta = (TSpline3*)
file->GetObjectChecked(Cov_A_alpha_beta_name.str().c_str(),
"TSpline3");
164 std::stringstream Cov_A_alpha_theta_name;
165 Cov_A_alpha_theta_name <<
"cov_A_alpha_theta_" <<
runNumber;
166 TSpline3* cov_A_alpha_theta = (TSpline3*)
file->GetObjectChecked(Cov_A_alpha_theta_name.str().c_str(),
"TSpline3");
167 std::stringstream Cov_A_beta_theta_name;
168 Cov_A_beta_theta_name <<
"cov_A_beta_theta_" <<
runNumber;
169 TSpline3* cov_A_beta_theta = (TSpline3*)
file->GetObjectChecked(Cov_A_beta_theta_name.str().c_str(),
"TSpline3");
171 std::stringstream Cov_C_alpha_beta_name;
172 Cov_C_alpha_beta_name <<
"cov_C_alpha_beta_" <<
runNumber;
173 TSpline3* cov_C_alpha_beta = (TSpline3*)
file->GetObjectChecked(Cov_C_alpha_beta_name.str().c_str(),
"TSpline3");
174 std::stringstream Cov_C_alpha_theta_name;
175 Cov_C_alpha_theta_name <<
"cov_C_alpha_theta_" <<
runNumber;
176 TSpline3* cov_C_alpha_theta = (TSpline3*)
file->GetObjectChecked(Cov_C_alpha_theta_name.str().c_str(),
"TSpline3");
177 std::stringstream Cov_C_beta_theta_name;
178 Cov_C_beta_theta_name <<
"cov_C_beta_theta_" <<
runNumber;
179 TSpline3* cov_C_beta_theta = (TSpline3*)
file->GetObjectChecked(Cov_C_beta_theta_name.str().c_str(),
"TSpline3");
181 std::array<std::vector<TSpline3*>, 2> effparams;
182 std::array<std::vector<TSpline3*>, 2> effparamErrors;
183 std::array<std::vector<TSpline3*>, 2> effparamsCorrCoeffs;
185 effparams[0] = {par_C_alpha, par_C_beta, par_C_theta};
186 effparams[1] = {par_A_alpha, par_A_beta, par_A_theta};
187 effparamErrors[0] = {parErr_C_alpha, parErr_C_beta, parErr_C_theta};
188 effparamErrors[1] = {parErr_A_alpha, parErr_A_beta, parErr_A_theta};
189 effparamsCorrCoeffs[0] = {cov_C_alpha_beta, cov_C_alpha_theta, cov_C_beta_theta};
190 effparamsCorrCoeffs[1] = {cov_A_alpha_beta, cov_A_alpha_theta, cov_A_beta_theta};
214 {0, 1.1, 1.1, 1.1}}};
222 for (
size_t side : {0, 1}) {
223 for (
size_t module : {0, 1, 2, 3}) {
227 peak2ndDerivMinThresholdsHG[
side][
module] = -35;
228 peak2ndDerivMinThresholdsLG[
side][
module] = -16;
236 ATH_MSG_DEBUG(
"LHCF2022: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
251 peak2ndDerivMinSamples,
252 peak2ndDerivMinThresholdsHG,
253 peak2ndDerivMinThresholdsLG,
258 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
259 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
271 {-12, -12, -12, -12}}};
276 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
286 return zdcDataAnalyzer;
304 {1.1, 1.1, 1.1, 1.1}}};
312 const int deriv2ndThreshDSHG = -35;
313 const int deriv2ndThreshDSLG = -10;
315 const float deltaTcutLow = -10;
316 const float deltaTcutHigh = 10;
317 const float chisqDivAmpCutVal = 10;
319 for (
size_t side : {0, 1}) {
320 for (
size_t module : {0, 1, 2, 3}) {
324 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
325 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
329 chisqDivAmpCut[
side][
module] = chisqDivAmpCutVal;
333 ATH_MSG_DEBUG(
"pp2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
344 peak2ndDerivMinSamples,
345 peak2ndDerivMinThresholdsHG,
346 peak2ndDerivMinThresholdsLG,
351 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
352 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
364 {-12, -12, -12, -12}}};
369 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
375 return zdcDataAnalyzer;
393 {1.1, 1.1, 1.1, 1.1}}};
401 const int deriv2ndThreshDSHG = -35;
402 const int deriv2ndThreshDSLG = -10;
404 const float deltaTcutLow = -10;
405 const float deltaTcutHigh = 10;
406 const float chisqDivAmpCutVal = 100;
408 for (
size_t side : {0, 1}) {
409 for (
size_t module : {0, 1, 2, 3}) {
413 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
414 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
418 chisqDivAmpCut[
side][
module] = chisqDivAmpCutVal;
422 ATH_MSG_DEBUG(
"pp2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
433 peak2ndDerivMinSamples,
434 peak2ndDerivMinThresholdsHG,
435 peak2ndDerivMinThresholdsLG,
440 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
441 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
453 {-12, -12, -12, -12}}};
458 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
464 return zdcDataAnalyzer;
475 const int deriv2ndThreshDSHG = -25;
476 const int deriv2ndThreshDSLG = -10;
477 const unsigned int peakSample = 10;
479 const float deltaTcutLow = -10;
480 const float deltaTcutHigh = 10;
481 const float chisqDivAmpCutHGVal = 30;
482 const float chisqDivAmpCutLGVal = 50;
492 {1.35, 1.4, 1.3, 1.1}}};
499 for (
size_t side : {0, 1}) {
500 for (
size_t module : {0, 1, 2, 3}) {
504 peak2ndDerivMinSamples[
side][
module] = peakSample;
505 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
506 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
510 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
511 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
515 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
522 peak2ndDerivMinSamples,
523 peak2ndDerivMinThresholdsHG,
524 peak2ndDerivMinThresholdsLG,
549 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
550 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
555 {-20, -20, -20, -20},}};
560 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
569 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
571 nonLinearCorrCoefficHG[0][0] = {-0.0225871, 0.00702802, 0.00201155, -0.00675293, 0.00186212} ;
572 nonLinearCorrCoefficHG[0][1] = {-0.0155562, 0.00594092, 0.00382112, -0.00665466, 0.00143384} ;
573 nonLinearCorrCoefficHG[0][2] = {-0.0313621, 0.0134528, 0.00529013, -0.0111751, 0.0029913} ;
574 nonLinearCorrCoefficHG[0][3] = {-0.025108, 0.00301898, 0.022472, -0.0204288, 0.00453215} ;
575 nonLinearCorrCoefficHG[1][0] = {-0.0266648, 0.0106792, -0.00939959, 0.000833011, 0.000199051} ;
576 nonLinearCorrCoefficHG[1][1] = {-0.0246541, 0.000327376, 0.00754946, -0.00710273, 0.00136899} ;
577 nonLinearCorrCoefficHG[1][2] = {-0.0175283, 0.0127954, 0.000235749, -0.00769698, 0.00221995} ;;
578 nonLinearCorrCoefficHG[1][3] = {-0.0279931, 0.0188122, 0.0126234, -0.0169907, 0.00398826} ;
582 nonLinearCorrCoefficLG = {{ {{{0},
595 zdcDataAnalyzer->
SetNonlinCorrParams(1000, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
597 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
598 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
599 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
600 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
601 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
603 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
604 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
605 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
606 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
614 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
615 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
616 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
617 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
619 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
620 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
621 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
622 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
630 return zdcDataAnalyzer;
640 const int deriv2ndThreshDSHG = -45;
641 const int deriv2ndThreshDSLG = -10;
642 const unsigned int peakSample = 10;
644 const float deltaTcutLow = -10;
645 const float deltaTcutHigh = 10;
646 const float chisqDivAmpCutHGVal = 30;
647 const float chisqDivAmpCutLGVal = 50;
657 {1.35, 1.4, 1.3, 1.1}}};
664 for (
size_t side : {0, 1}) {
665 for (
size_t module : {0, 1, 2, 3}) {
669 peak2ndDerivMinSamples[
side][
module] = peakSample;
670 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
671 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
675 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
676 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
680 ATH_MSG_DEBUG(
"PbPb2024: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
687 peak2ndDerivMinSamples,
688 peak2ndDerivMinThresholdsHG,
689 peak2ndDerivMinThresholdsLG,
714 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
715 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
720 {-30, -30, -30, -30},}};
725 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
734 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
736 nonLinearCorrCoefficHG[0][0] = {-0.0225871, 0.00702802, 0.00201155, -0.00675293, 0.00186212} ;
737 nonLinearCorrCoefficHG[0][1] = {-0.0155562, 0.00594092, 0.00382112, -0.00665466, 0.00143384} ;
738 nonLinearCorrCoefficHG[0][2] = {-0.0313621, 0.0134528, 0.00529013, -0.0111751, 0.0029913} ;
739 nonLinearCorrCoefficHG[0][3] = {-0.025108, 0.00301898, 0.022472, -0.0204288, 0.00453215} ;
740 nonLinearCorrCoefficHG[1][0] = {-0.0266648, 0.0106792, -0.00939959, 0.000833011, 0.000199051} ;
741 nonLinearCorrCoefficHG[1][1] = {-0.0246541, 0.000327376, 0.00754946, -0.00710273, 0.00136899} ;
742 nonLinearCorrCoefficHG[1][2] = {-0.0175283, 0.0127954, 0.000235749, -0.00769698, 0.00221995} ;;
743 nonLinearCorrCoefficHG[1][3] = {-0.0279931, 0.0188122, 0.0126234, -0.0169907, 0.00398826} ;
747 nonLinearCorrCoefficHG = {{ {{{0},
759 zdcDataAnalyzer->
SetNonlinCorrParams(1000, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
761 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
762 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
763 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
764 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
765 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
767 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
768 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
769 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
770 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
778 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
779 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
780 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
781 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
783 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
784 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
785 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
786 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
791 std::array< std::array< std::array<float,6>, 3>, 2> nlCalib = {{
792 {{ {{0.3, 1, -0.00753349, 0.882218, 0.019739, 1.0803}},{{0.3, 1, 0.0181165, 0.620646, -0.171213, 2.2143}},{{0.25, 1, -0.108547, 0.106, -1.3594, 4.1509}} }},
793 {{ {{0.3, 1, -0.00753349, 0.882218, 0.019739, 1.0803}},{{0.3, 1, 0.0181165, 0.620646, -0.171213, 2.2143}},{{0.25, 1, -0.108547, 0.106, -1.3594, 4.1509}} }}
801 return zdcDataAnalyzer;
811 const int deriv2ndThreshDSHG = -45;
812 const int deriv2ndThreshDSLG = -10;
813 const unsigned int peakSample = 10;
815 const float deltaTcutLow = -10;
816 const float deltaTcutHigh = 10;
817 const float chisqDivAmpCutHGVal = 30;
818 const float chisqDivAmpCutLGVal = 50;
828 {1.35, 1.4, 1.3, 1.1}}};
835 for (
size_t side : {0, 1}) {
836 for (
size_t module : {0, 1, 2, 3}) {
840 peak2ndDerivMinSamples[
side][
module] = peakSample;
841 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
842 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
846 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
847 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
851 ATH_MSG_DEBUG(
"PbPb2024: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
858 peak2ndDerivMinSamples,
859 peak2ndDerivMinThresholdsHG,
860 peak2ndDerivMinThresholdsLG,
885 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
886 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
891 {-30, -30, -30, -30},}};
896 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
905 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
907 nonLinearCorrCoefficHG[0][0] = {-0.0225871, 0.00702802, 0.00201155, -0.00675293, 0.00186212} ;
908 nonLinearCorrCoefficHG[0][1] = {-0.0155562, 0.00594092, 0.00382112, -0.00665466, 0.00143384} ;
909 nonLinearCorrCoefficHG[0][2] = {-0.0313621, 0.0134528, 0.00529013, -0.0111751, 0.0029913} ;
910 nonLinearCorrCoefficHG[0][3] = {-0.025108, 0.00301898, 0.022472, -0.0204288, 0.00453215} ;
911 nonLinearCorrCoefficHG[1][0] = {-0.0266648, 0.0106792, -0.00939959, 0.000833011, 0.000199051} ;
912 nonLinearCorrCoefficHG[1][1] = {-0.0246541, 0.000327376, 0.00754946, -0.00710273, 0.00136899} ;
913 nonLinearCorrCoefficHG[1][2] = {-0.0175283, 0.0127954, 0.000235749, -0.00769698, 0.00221995} ;;
914 nonLinearCorrCoefficHG[1][3] = {-0.0279931, 0.0188122, 0.0126234, -0.0169907, 0.00398826} ;
918 nonLinearCorrCoefficHG = {{ {{{0},
930 zdcDataAnalyzer->
SetNonlinCorrParams(1000, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
932 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
933 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
934 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
935 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
936 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
938 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
939 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
940 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
941 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
949 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
950 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
951 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
952 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
954 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
955 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
956 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
957 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
974 std::array< std::array< std::array<float,6>, 3>, 2> nlCalib = {{
975 {{ {{0.3, 1, -0.00753349, 0.882218, 0.019739, 1.0803}},{{0.3, 1, 0.0181165, 0.620646, -0.171213, 2.2143}},{{0.25, 1, -0.108547, 0.106, -1.3594, 4.1509}} }},
976 {{ {{0.3, 1, -0.00753349, 0.882218, 0.019739, 1.0803}},{{0.3, 1, 0.0181165, 0.620646, -0.171213, 2.2143}},{{0.25, 1, -0.108547, 0.106, -1.3594, 4.1509}} }}
981 return zdcDataAnalyzer;
991 const int deriv2ndThreshDSHG = -45;
992 const int deriv2ndThreshDSLG = -10;
993 const unsigned int peakSample = 10;
995 const float deltaTcutLow = -10;
996 const float deltaTcutHigh = 10;
997 const float chisqDivAmpCutHGVal = 30;
998 const float chisqDivAmpCutLGVal = 50;
1008 {1.35, 1.4, 1.3, 1.1}}};
1015 for (
size_t side : {0, 1}) {
1016 for (
size_t module : {0, 1, 2, 3}) {
1020 peak2ndDerivMinSamples[
side][
module] = peakSample;
1021 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1022 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1025 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1026 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1027 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1031 ATH_MSG_DEBUG(
"PbPb2024: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1038 peak2ndDerivMinSamples,
1039 peak2ndDerivMinThresholdsHG,
1040 peak2ndDerivMinThresholdsLG,
1065 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1066 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1071 {-30, -30, -30, -30},}};
1076 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
1085 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
1087 nonLinearCorrCoefficHG[0][0] = {-0.0225871, 0.00702802, 0.00201155, -0.00675293, 0.00186212} ;
1088 nonLinearCorrCoefficHG[0][1] = {-0.0155562, 0.00594092, 0.00382112, -0.00665466, 0.00143384} ;
1089 nonLinearCorrCoefficHG[0][2] = {-0.0313621, 0.0134528, 0.00529013, -0.0111751, 0.0029913} ;
1090 nonLinearCorrCoefficHG[0][3] = {-0.025108, 0.00301898, 0.022472, -0.0204288, 0.00453215} ;
1091 nonLinearCorrCoefficHG[1][0] = {-0.0266648, 0.0106792, -0.00939959, 0.000833011, 0.000199051} ;
1092 nonLinearCorrCoefficHG[1][1] = {-0.0246541, 0.000327376, 0.00754946, -0.00710273, 0.00136899} ;
1093 nonLinearCorrCoefficHG[1][2] = {-0.0175283, 0.0127954, 0.000235749, -0.00769698, 0.00221995} ;;
1094 nonLinearCorrCoefficHG[1][3] = {-0.0279931, 0.0188122, 0.0126234, -0.0169907, 0.00398826} ;
1098 nonLinearCorrCoefficHG = {{ {{{0},
1110 zdcDataAnalyzer->
SetNonlinCorrParams(1000, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
1112 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
1113 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
1114 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
1115 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
1116 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
1118 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
1119 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
1120 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
1121 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
1129 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
1130 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
1131 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
1132 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
1134 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
1135 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
1136 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
1137 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
1148 return zdcDataAnalyzer;
1158 const int deriv2ndThreshDSHG = -45;
1159 const int deriv2ndThreshDSLG = -10;
1160 const unsigned int peakSample = 10;
1162 const float deltaTcutLow = -10;
1163 const float deltaTcutHigh = 10;
1164 const float chisqDivAmpCutHGVal = 30;
1165 const float chisqDivAmpCutLGVal = 50;
1175 {1.35, 1.4, 1.3, 1.1}}};
1182 for (
size_t side : {0, 1}) {
1183 for (
size_t module : {0, 1, 2, 3}) {
1187 peak2ndDerivMinSamples[
side][
module] = peakSample;
1188 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1189 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1192 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1193 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1194 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1198 ATH_MSG_DEBUG(
"PbPb2024: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1205 peak2ndDerivMinSamples,
1206 peak2ndDerivMinThresholdsHG,
1207 peak2ndDerivMinThresholdsLG,
1232 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1233 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1238 {-30, -30, -30, -30},}};
1243 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
1252 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
1254 nonLinearCorrCoefficHG[0][0] = {-0.0225871, 0.00702802, 0.00201155, -0.00675293, 0.00186212} ;
1255 nonLinearCorrCoefficHG[0][1] = {-0.0155562, 0.00594092, 0.00382112, -0.00665466, 0.00143384} ;
1256 nonLinearCorrCoefficHG[0][2] = {-0.0313621, 0.0134528, 0.00529013, -0.0111751, 0.0029913} ;
1257 nonLinearCorrCoefficHG[0][3] = {-0.025108, 0.00301898, 0.022472, -0.0204288, 0.00453215} ;
1258 nonLinearCorrCoefficHG[1][0] = {-0.0266648, 0.0106792, -0.00939959, 0.000833011, 0.000199051} ;
1259 nonLinearCorrCoefficHG[1][1] = {-0.0246541, 0.000327376, 0.00754946, -0.00710273, 0.00136899} ;
1260 nonLinearCorrCoefficHG[1][2] = {-0.0175283, 0.0127954, 0.000235749, -0.00769698, 0.00221995} ;;
1261 nonLinearCorrCoefficHG[1][3] = {-0.0279931, 0.0188122, 0.0126234, -0.0169907, 0.00398826} ;
1265 nonLinearCorrCoefficHG = {{ {{{0},
1277 zdcDataAnalyzer->
SetNonlinCorrParams(1000, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
1279 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
1280 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
1281 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
1282 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
1283 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
1285 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
1286 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
1287 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
1288 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
1296 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
1297 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
1298 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
1299 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
1301 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
1302 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
1303 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
1304 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
1315 return zdcDataAnalyzer;
1325 const int deriv2ndThreshDSHG = -10;
1326 const int deriv2ndThreshDSLG = -10;
1327 const unsigned int peakSample = 10;
1329 const float deltaTcutLow = -50;
1330 const float deltaTcutHigh = 50;
1331 const float chisqDivAmpCutHGVal = 30;
1332 const float chisqDivAmpCutLGVal = 50;
1342 {1.35, 1.4, 1.3, 1.1}}};
1349 for (
size_t side : {0, 1}) {
1350 for (
size_t module : {0, 1, 2, 3}) {
1354 peak2ndDerivMinSamples[
side][
module] = peakSample;
1355 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1356 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1359 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1360 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1361 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1365 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1372 peak2ndDerivMinSamples,
1373 peak2ndDerivMinThresholdsHG,
1374 peak2ndDerivMinThresholdsLG,
1399 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1400 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1408 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
1409 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
1410 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
1411 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
1412 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
1414 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
1415 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
1416 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
1417 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
1425 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
1426 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
1427 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
1428 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
1430 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
1431 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
1432 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
1433 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
1441 return zdcDataAnalyzer;
1451 const int deriv2ndThreshDSHG = -25;
1452 const int deriv2ndThreshDSLG = -10;
1453 const unsigned int peakSample = 10;
1455 const float deltaTcutLow = -10;
1456 const float deltaTcutHigh = 10;
1457 const float chisqDivAmpCutHGVal = 30;
1458 const float chisqDivAmpCutLGVal = 50;
1474 for (
size_t side : {0, 1}) {
1475 for (
size_t module : {0, 1, 2, 3}) {
1479 peak2ndDerivMinSamples[
side][
module] = peakSample;
1480 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1481 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1484 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1485 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1486 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1490 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1497 peak2ndDerivMinSamples,
1498 peak2ndDerivMinThresholdsHG,
1499 peak2ndDerivMinThresholdsLG,
1525 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1526 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1532 return zdcDataAnalyzer;
1542 const int deriv2ndThreshDSHG = -25;
1543 const int deriv2ndThreshDSLG = -10;
1544 const unsigned int peakSample = 10;
1546 const float deltaTcutLow = -10;
1547 const float deltaTcutHigh = 10;
1548 const float chisqDivAmpCutHGVal = 30;
1549 const float chisqDivAmpCutLGVal = 50;
1565 for (
size_t side : {0, 1}) {
1566 for (
size_t module : {0, 1, 2, 3}) {
1570 peak2ndDerivMinSamples[
side][
module] = peakSample;
1571 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1572 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1575 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1576 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1577 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1581 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1588 peak2ndDerivMinSamples,
1589 peak2ndDerivMinThresholdsHG,
1590 peak2ndDerivMinThresholdsLG,
1616 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1617 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1623 return zdcDataAnalyzer;
1633 const int deriv2ndThreshDSHG = -25;
1634 const int deriv2ndThreshDSLG = -10;
1635 const unsigned int peakSample = 10;
1637 const float deltaTcutLow = -10;
1638 const float deltaTcutHigh = 10;
1639 const float chisqDivAmpCutHGVal = 30;
1640 const float chisqDivAmpCutLGVal = 50;
1650 {1.1, 1.1, 1.1, 1.1}}};
1657 for (
size_t side : {0, 1}) {
1658 for (
size_t module : {0, 1, 2, 3}) {
1662 peak2ndDerivMinSamples[
side][
module] = peakSample;
1663 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1664 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1667 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1668 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1669 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1673 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1680 peak2ndDerivMinSamples,
1681 peak2ndDerivMinThresholdsHG,
1682 peak2ndDerivMinThresholdsLG,
1707 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1708 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1713 {-10, -10, -10, -10}}};
1718 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
1727 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
1729 nonLinearCorrCoefficHG = {{ {{{0},
1740 nonLinearCorrCoefficLG = {{ {{{0},
1750 zdcDataAnalyzer->
SetNonlinCorrParams(0, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
1752 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
1753 timeCorrCoefficHG[0][0] = {};
1754 timeCorrCoefficHG[0][1] = {};
1755 timeCorrCoefficHG[0][2] = {};
1756 timeCorrCoefficHG[0][3] = {};
1758 timeCorrCoefficHG[1][0] = {};
1759 timeCorrCoefficHG[1][1] = {};
1760 timeCorrCoefficHG[1][2] = {};
1761 timeCorrCoefficHG[1][3] = {};
1763 timeCorrCoefficLG[0][0] = {};
1764 timeCorrCoefficLG[0][1] = {};
1765 timeCorrCoefficLG[0][2] = {};
1766 timeCorrCoefficLG[0][3] = {};
1768 timeCorrCoefficLG[1][0] = {};
1769 timeCorrCoefficLG[1][1] = {};
1770 timeCorrCoefficLG[1][2] = {};
1771 timeCorrCoefficLG[1][3] = {};
1779 return zdcDataAnalyzer;
1803 for (
size_t side : {0, 1}) {
1804 for (
size_t module : {0, 1, 2, 3}) {
1821 ATH_MSG_DEBUG(
"Default: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1830 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
1833 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0, t0);
1834 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1842 return zdcDataAnalyzer;
1853 const int peakSample = 4;
1854 const float peak2ndDerivThreshHG = -12;
1855 const float peak2ndDerivThreshLG = -10;
1857 {4.000, 4.000, 4.000, 4.000}}};
1859 {25.11, 25.08, 25.18, 25.48}}};
1862 {57.28, 57.29, 57.31, 57.33}}};
1864 {57.28, 57.29, 57.31, 57.33}}};
1872 for (
size_t side : {0, 1}) {
1873 for (
size_t module : {0, 1, 2, 3}) {
1877 peak2ndDerivMinSamples[
side][
module] = peakSample;
1878 peak2ndDerivMinThresholdsHG[
side][
module] = peak2ndDerivThreshHG;
1879 peak2ndDerivMinThresholdsLG[
side][
module] = peak2ndDerivThreshLG;
1892 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
1899 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1Arr, tau2Arr, t0HG, t0LG);
1900 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
1905 return zdcDataAnalyzer;
1921 const int peakSample = 5;
1922 const float peak2ndDerivThreshHG = -12;
1923 const float peak2ndDerivThreshLG = -10;
1925 {4.472, 4.656, 3.871, 4.061}
1929 {24.17, 24.22, 25.46, 24.45}
1933 {75.11, 74.94, 73.93, 74.45}
1936 {76.28, 76.07, 74.98, 76.54}
1946 for (
size_t side : {0, 1}) {
1947 for (
size_t module : {0, 1, 2, 3}) {
1951 peak2ndDerivMinSamples[
side][
module] = peakSample;
1952 peak2ndDerivMinThresholdsHG[
side][
module] = peak2ndDerivThreshHG;
1953 peak2ndDerivMinThresholdsLG[
side][
module] = peak2ndDerivThreshLG;
1963 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
1965 slewingParamsHG[0][0] = {0, 0, 0, 0};
1966 slewingParamsHG[0][1] = { -4.780244e-01, -7.150874e-02, 4.614585e-02, 8.015731e-04};
1967 slewingParamsHG[0][2] = { -5.253412e-01, -5.718167e-02, 5.243121e-02, 2.128398e-03};
1968 slewingParamsHG[0][3] = { -5.773952e-01, -5.687478e-02, 4.564267e-02, 1.462294e-03};
1970 slewingParamsHG[1][0] = { 7.105115e-01, -3.686143e-02, 7.727447e-02, 5.924152e-03};
1971 slewingParamsHG[1][1] = { 4.052120e-02, 4.450686e-03, 8.031615e-02, 4.038097e-03};
1972 slewingParamsHG[1][2] = { 3.389476e-02, -2.056782e-02, 4.805321e-02, -2.627999e-03};
1973 slewingParamsHG[1][3] = { 2.069765e-01, -2.890419e-02, 6.084375e-02, 3.742011e-03};
1975 slewingParamsLG[0][0] = {0, 0, 0, 0};
1976 slewingParamsLG[0][1] = { -1.632547e+00, -4.827813e-01, -1.379131e-01, -2.522607e-02};
1977 slewingParamsLG[0][2] = { -7.254288e+00, -5.454064e+00, -1.619126e+00, -1.739665e-01};
1978 slewingParamsLG[0][3] = { -1.548400e+01, -1.277708e+01, -3.729333e+00, -3.700458e-01};
1980 slewingParamsLG[1][0] = { 1.142767e-01, -3.608906e-02, 9.642735e-02, -3.097043e-03};
1981 slewingParamsLG[1][1] = { -5.615388e-01, -1.655047e-02, 8.327350e-02, -4.231348e-03};
1982 slewingParamsLG[1][2] = { -7.370728e-01, -2.887482e-02, 8.293875e-02, -4.482743e-03};
1983 slewingParamsLG[1][3] = { -1.270636e+00, -2.791777e-01, -5.807295e-02, -2.332612e-02};
1990 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
2001 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1Arr, tau2Arr, t0HG, t0LG);
2002 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
2010 zdcDataAnalyzer->
enableDelayed(-12.5, defaultPedestalShifts);
2014 slewingParamsHG, slewingParamsLG);
2017 return zdcDataAnalyzer;
2027 static constexpr
int peakSample = 5;
2028 static constexpr
float peak2ndDerivThreshHG = -35;
2029 static constexpr
float peak2ndDerivThreshLG = -20;
2030 static constexpr
float peak2ndDerivRepassHG = -10;
2031 static constexpr
float peak2ndDerivRepassLG = -6;
2034 {4.296, 4.064, 3.497, 3.642}
2038 {24.42, 24.99, 25.72, 25.29}
2042 {74.18, 72.79, 71.77, 72.62}
2045 {75.16, 73.71, 72.25, 73.61}
2049 {0.3216, 0.2593, 0.2511, 0.1680}
2058 for (
size_t side : {0, 1}) {
2059 for (
size_t module : {0, 1, 2, 3}) {
2063 peak2ndDerivMinSamples[
side][
module] = peakSample;
2064 peak2ndDerivMinThresholdsHG[
side][
module] = peak2ndDerivThreshHG;
2065 peak2ndDerivMinThresholdsLG[
side][
module] = peak2ndDerivThreshLG;
2066 peak2ndDerivMinRepassHG [
side][
module] = peak2ndDerivRepassHG;
2067 peak2ndDerivMinRepassLG [
side][
module] = peak2ndDerivRepassLG;
2081 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
2083 slewingParamsHG[0][0] = { -1.335560e-01, -6.071869e-03, 5.858193e-02, 2.473300e-03};
2084 slewingParamsHG[0][1] = { -1.223062e-01, -4.379469e-02, 4.452285e-02, 2.130210e-03};
2085 slewingParamsHG[0][2] = { -1.021415e-01, -4.254239e-02, 4.939866e-02, 3.849738e-03};
2086 slewingParamsHG[0][3] = { -8.234056e-02, -3.938803e-02, 4.689029e-02, 2.784816e-03};
2088 slewingParamsHG[1][0] = { -1.640979e-01, -2.780350e-02, 5.755065e-02, -4.244651e-04};
2089 slewingParamsHG[1][1] = { -1.422324e-01, 2.663803e-02, 7.295366e-02, 3.740496e-03};
2090 slewingParamsHG[1][2] = { -9.858124e-02, -2.426132e-02, 4.895967e-02, 2.291393e-03};
2091 slewingParamsHG[1][3] = { -1.070401e-01, -2.256383e-03, 5.833770e-02, 2.255208e-03};
2093 slewingParamsLG[0][0] = { -2.588446e-01, -3.241086e-02, 7.828661e-02, 1.945547e-03};
2094 slewingParamsLG[0][1] = { -3.112495e-01, -7.419508e-02, 6.825776e-02, 2.148860e-03};
2095 slewingParamsLG[0][2] = { -3.470650e-01, -5.836748e-02, 6.204396e-02, 1.550421e-03};
2096 slewingParamsLG[0][3] = { -4.485435e-01, -4.603790e-02, 5.944799e-02, -1.174585e-03};
2098 slewingParamsLG[1][0] = { -3.291676e-01, -4.023732e-02, 8.608755e-02, -3.958167e-03};
2099 slewingParamsLG[1][1] = { -2.608969e-01, -2.129786e-03, 6.930791e-02, -4.141910e-03};
2100 slewingParamsLG[1][2] = { -2.505712e-01, -2.195804e-02, 5.137261e-02, -4.058378e-03};
2101 slewingParamsLG[1][3] = { -5.083206e-01, 3.776601e-02, 1.284275e-01, 1.014067e-02};
2107 std::unique_ptr<ZDCDataAnalyzer> zdcDataAnalyzer = std::make_unique<ZDCDataAnalyzer>(
MakeMessageFunction(), 7, 25, 0,
"FermiExpLinear", peak2ndDerivMinSamples,
2108 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode);
2118 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1Arr, tau2Arr, t0HG, t0LG);
2120 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
2130 {{ -12.5, -12.5, -12.5, -12.5}}
2134 zdcDataAnalyzer->
enableDelayed(delayDeltaTs, defaultPedestalShifts);
2137 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
2139 slewingParamsHG, slewingParamsLG);
2144 return zdcDataAnalyzer;
2153 {{5.0, 3.7, 3.5, 3.5}}
2159 {{19.1, 21.9, 22.6, 23.4}}
2185 bool fixTau1 =
true;
2186 bool fixTau2 =
true;
2188 for (
size_t side : {0, 1}) {
2189 for (
size_t module : {0, 1, 2, 3}) {
2196 {{46.314, 42.267, 50.327, 41.605}}
2200 {{44.295, 41.755, 48.081, 40.175}}
2212 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
2214 slewingParamsHG[0][0] = {0, -7.904e-02, 4.686e-02, 1.530e-03 };
2215 slewingParamsHG[0][1] = {0, 2.250e-02, 4.732e-02, 6.050e-03 };
2216 slewingParamsHG[0][2] = {0, 4.388e-02, 6.707e-02, -5.526e-05 };
2217 slewingParamsHG[0][3] = {0, 1.205e-01, 2.726e-02, 2.610e-03 };
2219 slewingParamsHG[1][0] = {0, 6.861e-02, 5.175e-03, -9.018e-04 };
2220 slewingParamsHG[1][1] = {0, 3.855e-01, -4.442e-02, -2.022e-02 };
2221 slewingParamsHG[1][2] = {0, -4.337e-03, 3.841e-02, 4.661e-03 };
2222 slewingParamsHG[1][3] = {0, 3.623e-01, -3.882e-02, -1.805e-02 };
2224 slewingParamsLG[0][0] = {0, 1.708e-02, 7.929e-02, 5.079e-03 };
2225 slewingParamsLG[0][1] = {0, 1.406e-01, 1.209e-01, -1.922e-04 };
2226 slewingParamsLG[0][2] = {0, 1.762e-01, 1.118e-01, 1.679e-04 };
2227 slewingParamsLG[0][3] = {0, 1.361e-02, -2.685e-02, -4.168e-02 };
2229 slewingParamsLG[1][0] = {0, 1.962e-01, -5.025e-03, -2.001e-02 };
2230 slewingParamsLG[1][1] = {0, 3.258e-01, 1.229e-02, -2.925e-02 };
2231 slewingParamsLG[1][2] = {0, 1.393e-01, 8.113e-02, -2.594e-03 };
2232 slewingParamsLG[1][3] = {0, 1.939e-01, 2.188e-02, -5.579e-02 };
2235 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
2239 m_zdcDataAnalyzer_40MHz->SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
2241 slewingParamsHG, slewingParamsLG);
2243 std::array<std::array<std::vector<float>, 4>, 2> moduleHGNonLinCorr, moduleLGNonLinCorr;
2244 moduleHGNonLinCorr[0][0] = { -3.76800e-02, 4.63597e-02};
2245 moduleHGNonLinCorr[0][1] = { -1.02185e-01, -1.17548e-01};
2246 moduleHGNonLinCorr[0][2] = { -8.78451e-02, -1.52174e-01};
2247 moduleHGNonLinCorr[0][3] = { -1.04835e-01, -1.96514e-01};
2248 moduleHGNonLinCorr[1][0] = { -6.83115e-02, 3.57802e-02};
2249 moduleHGNonLinCorr[1][1] = { -1.08162e-01, -1.91413e-01};
2250 moduleHGNonLinCorr[1][2] = { -7.82514e-02, -1.21218e-01};
2251 moduleHGNonLinCorr[1][3] = { -2.34354e-02, -2.52033e-01};
2253 moduleLGNonLinCorr = {{ {{{0},
2294 bool fixTau1 =
true;
2295 bool fixTau2 =
true;
2297 for (
size_t side : {0, 1}) {
2298 for (
size_t module : {0, 1, 2, 3}) {
2305 {{4.2, 3.6, 3.3, 3.4}}
2310 {{19.1, 21.9, 22.6, 23.4}}
2315 {{36.0, 31.1, 40.75, 30.5}}
2320 {{33.7, 29.9, 39.0, 29.3}}
2331 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
2333 slewingParamsHG[0][0] = {0, -6.5e-2, 2.85e-2, -2.83e-3};
2334 slewingParamsHG[0][1] = {0, -5.5e-2, 5.13e-2, 5.6e-3};
2335 slewingParamsHG[0][2] = {0, -1.45e-3, 9.3e-2, 3.9e-3};
2336 slewingParamsHG[0][3] = {0, -2.36e-2, 8.3e-2, 1.1e-3};
2338 slewingParamsHG[1][0] = {0, -6.5e-2, 4.84e-2, -3.7e-3};
2339 slewingParamsHG[1][1] = {0, 1.34e-2, 6.57e-2, 5.37e-3};
2340 slewingParamsHG[1][2] = {0, -5.37e-2, 3.49e-2, 3.8e-3};
2341 slewingParamsHG[1][3] = {0, -3.3e-2, 3.9e-2, 2.2e-3};
2343 slewingParamsLG[0][0] = {0, -9.6e-2, 4.39e-2, 2.93e-3 };
2344 slewingParamsLG[0][1] = {0, -5.0e-2, 14.9e-2, 20.6e-3 };
2345 slewingParamsLG[0][2] = {0, -4.4e-2, 5.3e-2, 0, };
2346 slewingParamsLG[0][3] = {0, -9.90e-2, 4.08e-2, 0, };
2348 slewingParamsLG[1][0] = {0, -8.7e-2, 4.2e-2, -3.2e-3 };
2349 slewingParamsLG[1][1] = {0, -3.26e-2, 3.84e-2, -2.32e-3};
2350 slewingParamsLG[1][2] = {0, -26.8e-2, -2.64e-2, -5.3e-3 };
2351 slewingParamsLG[1][3] = {0, -13.2e-2, 0.45e-2, -2.4e-3 };
2359 m_zdcDataAnalyzer_80MHz->SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
2361 slewingParamsHG, slewingParamsLG);
2363 std::array<std::array<std::vector<float>, 4>, 2> moduleHGNonLinCorr, moduleLGNonLinCorr;
2364 moduleHGNonLinCorr[0][0] = { -3.76800e-02, 4.63597e-02};
2365 moduleHGNonLinCorr[0][1] = { -1.02185e-01, -1.17548e-01};
2366 moduleHGNonLinCorr[0][2] = { -8.78451e-02, -1.52174e-01};
2367 moduleHGNonLinCorr[0][3] = { -1.04835e-01, -1.96514e-01};
2368 moduleHGNonLinCorr[1][0] = { -6.83115e-02, 3.57802e-02};
2369 moduleHGNonLinCorr[1][1] = { -1.08162e-01, -1.91413e-01};
2370 moduleHGNonLinCorr[1][2] = { -7.82514e-02, -1.21218e-01};
2371 moduleHGNonLinCorr[1][3] = { -2.34354e-02, -2.52033e-01};
2373 moduleLGNonLinCorr = {{ {{{0},
2408 ATH_MSG_ERROR(
"Invalid settings: Forced run > 0 but lumi block < 0");
2409 return StatusCode::FAILURE;
2471 return StatusCode::FAILURE;
2588 return StatusCode::SUCCESS;
2612 return StatusCode::SUCCESS;
2619 if (moduleContainer.
size()==0)
return StatusCode::SUCCESS;
2622 if (!eventInfo.
isValid())
return StatusCode::FAILURE;
2629 return StatusCode::SUCCESS;
2634 unsigned int thisRunNumber = eventInfo->
runNumber();
2636 ATH_MSG_DEBUG(
"ZDC analysis tool will be configured for run " << thisRunNumber);
2644 unsigned int calibRunNumber = thisRunNumber;
2650 catch(std::runtime_error&)
2660 unsigned int calibRunNumber = thisRunNumber;
2666 catch(std::runtime_error&)
2693 const std::vector<unsigned short>* adcUndelayLG = 0;
2694 const std::vector<unsigned short>* adcUndelayHG = 0;
2696 const std::vector<unsigned short>* adcDelayLG = 0;
2697 const std::vector<unsigned short>* adcDelayHG = 0;
2700 for (
const auto zdcModule : moduleContainer)
2703 if (zdcModule->zdcSide() == -1)
side = 0;
2704 else if (zdcModule->zdcSide() == 1)
side = 1;
2708 ATH_MSG_WARNING(
"Invalid side value found for module number: " << zdcModule->zdcModule() <<
", side value = " <<
side);
2712 if(zdcModule->zdcModule() > 4)
continue;
2714 if (zdcModule->zdcType() == 0) {
2720 adcUndelayLG = &g0dataAcc(*zdcModule);
2721 adcUndelayHG = &g1dataAcc(*zdcModule);
2734 adcUndelayLG = &g0d1dataAcc(*zdcModule);
2735 adcUndelayHG = &g1d1dataAcc(*zdcModule);
2736 adcDelayLG = &g0d0dataAcc(*zdcModule);
2737 adcDelayHG = &g1d0dataAcc(*zdcModule);
2741 adcUndelayLG = &g0d0dataAcc(*zdcModule);
2742 adcUndelayHG = &g1d0dataAcc(*zdcModule);
2743 adcDelayLG = &g0d1dataAcc(*zdcModule);
2744 adcDelayHG = &g1d1dataAcc(*zdcModule);
2750 return StatusCode::FAILURE;
2754 std::vector<float> HGUndelADCSamples(
m_numSample);
2755 std::vector<float> LGUndelADCSamples(
m_numSample);
2757 if (LGUndelADCSamples.size() < adcUndelayLG->size()) {
2758 LGUndelADCSamples.resize(adcUndelayLG->size());
2761 if (HGUndelADCSamples.size() < adcUndelayHG->size()) {
2762 HGUndelADCSamples.resize(adcUndelayHG->size());
2765 std::copy(adcUndelayLG->begin(), adcUndelayLG->end(), LGUndelADCSamples.begin());
2766 std::copy(adcUndelayHG->begin(), adcUndelayHG->end(), HGUndelADCSamples.begin());
2768 int side = (zdcModule->zdcSide() == -1) ? 0 : 1 ;
2771 m_zdcDataAnalyzer->LoadAndAnalyzeData(
side, zdcModule->zdcModule(), HGUndelADCSamples, LGUndelADCSamples);
2774 std::vector<float> HGDelayADCSamples(
m_numSample);
2775 std::vector<float> LGDelayADCSamples(
m_numSample);
2776 if (adcDelayLG and adcDelayHG){
2777 std::copy(adcDelayLG->begin(), adcDelayLG->end(), LGDelayADCSamples.begin());
2778 std::copy(adcDelayHG->begin(), adcDelayHG->end(), HGDelayADCSamples.begin());
2780 ATH_MSG_ERROR(
"adcDelayLG or adcDelayHG pointers are null");
2781 return StatusCode::FAILURE;
2788 HGUndelADCSamples, LGUndelADCSamples,
2789 HGDelayADCSamples, LGDelayADCSamples);
2839 for (
const auto zdcModule : moduleContainer)
2841 int side = (zdcModule->zdcSide() == -1) ? 0 : 1 ;
2842 int mod = zdcModule->zdcModule();
2844 if(
mod > 4)
continue;
2846 if (zdcModule->zdcType() == 0) {
2850 zdcModuleCalibEnergy(*zdcModule) = calibEnergy;
2858 zdcModuleChisq(*zdcModule) = pulseAna_p->
GetChisq();
2861 zdcModuleFitAmpError(*zdcModule) = pulseAna_p->
GetAmpError();
2862 zdcModuleFitT0(*zdcModule) = pulseAna_p->
GetFitT0();
2865 zdcModulePresample(*zdcModule) = pulseAna_p->
getPresample();
2867 zdcModuleMaxADC(*zdcModule) = pulseAna_p->
getMaxADCSub();
2868 zdcModuleMaxADCHG(*zdcModule) = pulseAna_p->
getMaxADCHG();
2869 zdcModuleMaxADCLG(*zdcModule) = pulseAna_p->
getMaxADCLG();
2871 zdcModuleAmpLGRefit(*zdcModule) = pulseAna_p->
getRefitLGAmp();
2898 for (
const auto zdc_sum: moduleSumContainer)
2900 ATH_MSG_DEBUG(
"Extracting ZDC side " << zdc_sum->zdcSide());
2902 if (zdc_sum->zdcSide()==0)
continue;
2904 int iside = (zdc_sum->zdcSide()==-1) ? 0 : 1;
2907 zdcSumUncalibSum(*zdc_sum) = uncalibSum;
2909 zdcSumUncalibSumErr(*zdc_sum) = uncalibSumErr;
2912 zdcSumCalibEnergy(*zdc_sum) = calibEnergy;
2914 zdcSumCalibEnergyErr(*zdc_sum) = calibEnergyErr;
2917 zdcSumNLCalibEnergy(*zdc_sum) = nlcalibEnergy;
2919 zdcSumNLCalibEnergyErr(*zdc_sum) = nlcalibEnergyErr;
2921 float finalEnergy = calibEnergy;
2922 zdcSumFinalEnergy(*zdc_sum) = finalEnergy;
2925 zdcSumModuleMask(*zdc_sum) = (
getModuleMask() >> (4 * iside)) & 0xF;
2928 return StatusCode::SUCCESS;
2952 std::unique_ptr<TFile> fCalib (TFile::Open(
filename.c_str(),
"READ"));
2954 if (fCalib ==
nullptr || fCalib->IsZombie())
2957 throw std::runtime_error (
"failed to open file " +
filename);
2960 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> splines;
2963 TString calibVersion;
2966 for (
int iside = 0; iside < 2; iside++)
2968 for (
int imod = 0; imod < 4; imod++)
2970 sprintf(
name,
"ZDC_Ecalib_run%u_s%d_m%d",
runNumber, iside, imod);
2972 TSpline3*
s = (TSpline3*) fCalib->GetObjectChecked(calibVersion+TString(
name),
"TSpline3");
2981 splines[iside][imod].reset (
s);
3010 ATH_MSG_WARNING(
"No LHC Run defined, so no time calibration allowed");
3014 char name[128] = {0};
3016 std::unique_ptr<TFile> fCalib (TFile::Open(
filename.c_str(),
"READ"));
3019 TString calibVersion =
"";
3022 if (fCalib && !fCalib->IsZombie())
3024 bool success =
true;
3025 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> T0HGOffsetSplines;
3026 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> T0LGOffsetSplines;
3027 std::unique_ptr<TSpline3> spline;
3028 for (
int iside = 0; iside < 2; iside++)
3030 for (
int imod = 0; imod < 4; imod++)
3032 sprintf(
name,
"ZDC_T0calib_run%u_HG_s%d_m%d",
runNumber, iside, imod);
3033 spline.reset (
static_cast<TSpline3*
>(fCalib->GetObjectChecked(calibVersion+TString(
name),
"TSpline3")));
3036 T0HGOffsetSplines[iside][imod] = std::move (spline);
3044 sprintf(
name,
"ZDC_T0calib_run%u_LG_s%d_m%d",
runNumber, iside, imod);
3045 spline.reset (
static_cast<TSpline3*
>(fCalib->GetObjectChecked(calibVersion+TString(
name),
"TSpline3")));
3048 T0LGOffsetSplines[iside][imod] = std::move (spline);
3076 std::string runString;
3079 else runString = (
"ZdcFADCCorr_Run"+TString::Itoa(
runNumber,10)+
".root").Data();
3084 ATH_MSG_WARNING(
"setFADCCorrections: FADC corrections not implemented for Run 2");
3090 ATH_MSG_INFO(
"FADC correction requested but no calibration file found");
3096 std::unique_ptr<TFile> fFADCCorr(TFile::Open(
filename.c_str(),
"READ"));
3098 if (!fFADCCorr->IsOpen()) {
3100 throw std::runtime_error (
"ZdcAnalysisTool failed to open FADCCorrections file " +
filename);
3105 bool readSuccess =
true;
3106 std::array<std::array<std::unique_ptr<const TH1>, 4>, 2> histogramsHG;
3107 std::array<std::array<std::unique_ptr<const TH1>, 4>, 2> histogramsLG;
3109 for (
size_t side : {0, 1}) {
3110 for (
int module : {0, 1, 2, 3}) {
3114 ATH_MSG_DEBUG(
"setFADCCorrections: Searching for histograms HG and LG: " << histNameHG <<
", " << histNameLG);
3116 TH1* histHG_ptr =
static_cast<TH1*
>(fFADCCorr->GetObjectChecked(histNameHG.c_str(),
"TH1"));
3117 TH1* histLG_ptr =
static_cast<TH1*
>(fFADCCorr->GetObjectChecked(histNameLG.c_str(),
"TH1"));
3119 if (!histHG_ptr || !histLG_ptr) {
3120 std::string errMsg =
"setFADCCorrections: unable to read FADC correction histogram(s) ";
3121 if (!histHG_ptr) errMsg += histNameHG +
" ";
3122 if (!histLG_ptr) errMsg += histNameLG;
3125 readSuccess =
false;
3133 if ( std::abs(histHG_ptr->GetXaxis()->GetXmin()+0.5) > 1
e-3 || std::abs(histHG_ptr->GetXaxis()->GetXmax() - 4095.5) > 1
e-3) {
3134 ATH_MSG_ERROR(
"setFADCCorrections: invalid axis range for HG FADC corrections in histogram with name " << histNameHG);
3135 readSuccess =
false;
3138 if (std::abs(histLG_ptr->GetXaxis()->GetXmin()+0.5) > 1
e-3 || std::abs(histLG_ptr->GetXaxis()->GetXmax() - 4095.5) > 1
e-3) {
3139 ATH_MSG_ERROR(
"setFADCCorrections: invalid axis range for HG FADC corrections in histogram with name " << histNameLG);
3140 readSuccess =
false;
3144 histogramsHG[
side][
module].reset(histHG_ptr);
3145 histogramsLG[
side][
module].reset(histLG_ptr);
3156 ATH_MSG_ERROR(
"setFADCCorrections: due to at least one error, FADC corrections are not implemented");
3169 return StatusCode::FAILURE;
3184 return StatusCode::SUCCESS;
3189 size_t nsamp =
adc.size();
3190 float presamp =
adc.at(0);
3191 unsigned short max_adc = 0;
3193 for (
size_t i = 0;
i < nsamp;
i++)
3195 if (
adc[
i] > max_adc)
3201 amp = max_adc - presamp;
3202 time = max_index * deltaT;
3205 if (max_index == -1)
3216 size_t nsamp =
adc.size();
3217 float presamp =
adc.at(0);
3219 for (
size_t i = 0;
i < nsamp;
i++)
3306 return eff_pair.second;