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.035+3.25, -0.126189, 0.022724, 0.039116, -0.098255};
615 timeCorrCoefficLG[0][1] = {0.022+3.25, -0.165988, -0.014125, 0.057323, -0.205109};
616 timeCorrCoefficLG[0][2] = {0.01+3.25, -0.136087, -0.007248, -0.014452, -0.060469};
617 timeCorrCoefficLG[0][3] = {0.0+3.25, -0.131067, 0.025579, 0.059994, -0.065595};
619 timeCorrCoefficLG[1][0] = {0.076+3.25, -0.300587, -0.041827, 0.641108, -0.594157};
620 timeCorrCoefficLG[1][1] = {0.057+3.25, -0.223443, -0.125013, -0.176900, 0.348081};
621 timeCorrCoefficLG[1][2] = {0.015+3.25, -0.141721, 0.023936, 0.099657, -0.188526};
622 timeCorrCoefficLG[1][3] = {0.01+3.25, -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.035+3.25, -0.126189, 0.022724, 0.039116, -0.098255};
779 timeCorrCoefficLG[0][1] = {0.022+3.25, -0.165988, -0.014125, 0.057323, -0.205109};
780 timeCorrCoefficLG[0][2] = {0.01+3.25, -0.136087, -0.007248, -0.014452, -0.060469};
781 timeCorrCoefficLG[0][3] = {0.0+3.25, -0.131067, 0.025579, 0.059994, -0.065595};
783 timeCorrCoefficLG[1][0] = {0.076+3.25, -0.300587, -0.041827, 0.641108, -0.594157};
784 timeCorrCoefficLG[1][1] = {0.057+3.25, -0.223443, -0.125013, -0.176900, 0.348081};
785 timeCorrCoefficLG[1][2] = {0.015+3.25, -0.141721, 0.023936, 0.099657, -0.188526};
786 timeCorrCoefficLG[1][3] = {0.01+3.25, -0.152589, 0.016122, -0.086580, 0.563625};
795 return zdcDataAnalyzer;
805 const int deriv2ndThreshDSHG = -10;
806 const int deriv2ndThreshDSLG = -10;
807 const unsigned int peakSample = 10;
809 const float deltaTcutLow = -50;
810 const float deltaTcutHigh = 50;
811 const float chisqDivAmpCutHGVal = 30;
812 const float chisqDivAmpCutLGVal = 50;
822 {1.35, 1.4, 1.3, 1.1}}};
829 for (
size_t side : {0, 1}) {
830 for (
size_t module : {0, 1, 2, 3}) {
834 peak2ndDerivMinSamples[
side][
module] = peakSample;
835 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
836 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
840 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
841 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
845 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
852 peak2ndDerivMinSamples,
853 peak2ndDerivMinThresholdsHG,
854 peak2ndDerivMinThresholdsLG,
879 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
880 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
888 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
889 timeCorrCoefficHG[0][0] = {0.07, -0.020672, 0.070206, 0.004961, -0.010821, -0.001835};
890 timeCorrCoefficHG[0][1] = {0.04, -0.012961, 0.008204, 0.010771, 0.011593, 0.002045};
891 timeCorrCoefficHG[0][2] = {0.04, 0.017393, 0.017597, 0.003736, -0.001696, -0.000465};
892 timeCorrCoefficHG[0][3] = {0.04, 0.018463, 0.009862, -0.000277, -0.000268, 0.000192};
894 timeCorrCoefficHG[1][0] = {0.13, -0.106068, 0.078153, 0.034479, -0.004964, -0.001688};
895 timeCorrCoefficHG[1][1] = {0.03, -0.007518, 0.008937, 0.015319, 0.012290, 0.001889};
896 timeCorrCoefficHG[1][2] = {-0.01, 0.006711, -0.001652, -0.004223, -0.000573, 0.000161};
897 timeCorrCoefficHG[1][3] = {0.015, 0.017993, 0.006339, 0.003122, 0.002980, 0.000735};
905 timeCorrCoefficLG[0][0] = {0.035f+3.25f, -0.126189, 0.022724, 0.039116, -0.098255};
906 timeCorrCoefficLG[0][1] = {0.022f+3.25f, -0.165988, -0.014125, 0.057323, -0.205109};
907 timeCorrCoefficLG[0][2] = {0.01f+3.25f, -0.136087, -0.007248, -0.014452, -0.060469};
908 timeCorrCoefficLG[0][3] = {0.0f+3.25f, -0.131067, 0.025579, 0.059994, -0.065595};
910 timeCorrCoefficLG[1][0] = {0.076f+3.25f, -0.300587, -0.041827, 0.641108, -0.594157};
911 timeCorrCoefficLG[1][1] = {0.057f+3.25f, -0.223443, -0.125013, -0.176900, 0.348081};
912 timeCorrCoefficLG[1][2] = {0.015f+3.25f, -0.141721, 0.023936, 0.099657, -0.188526};
913 timeCorrCoefficLG[1][3] = {0.01f+3.25f, -0.152589, 0.016122, -0.086580, 0.563625};
921 return zdcDataAnalyzer;
931 const int deriv2ndThreshDSHG = -25;
932 const int deriv2ndThreshDSLG = -10;
933 const unsigned int peakSample = 10;
935 const float deltaTcutLow = -10;
936 const float deltaTcutHigh = 10;
937 const float chisqDivAmpCutHGVal = 30;
938 const float chisqDivAmpCutLGVal = 50;
954 for (
size_t side : {0, 1}) {
955 for (
size_t module : {0, 1, 2, 3}) {
959 peak2ndDerivMinSamples[
side][
module] = peakSample;
960 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
961 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
965 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
966 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
970 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
977 peak2ndDerivMinSamples,
978 peak2ndDerivMinThresholdsHG,
979 peak2ndDerivMinThresholdsLG,
1005 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1006 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1012 return zdcDataAnalyzer;
1022 const int deriv2ndThreshDSHG = -25;
1023 const int deriv2ndThreshDSLG = -10;
1024 const unsigned int peakSample = 10;
1026 const float deltaTcutLow = -10;
1027 const float deltaTcutHigh = 10;
1028 const float chisqDivAmpCutHGVal = 30;
1029 const float chisqDivAmpCutLGVal = 50;
1039 {1.1, 1.1, 1.1, 1.1}}};
1046 for (
size_t side : {0, 1}) {
1047 for (
size_t module : {0, 1, 2, 3}) {
1051 peak2ndDerivMinSamples[
side][
module] = peakSample;
1052 peak2ndDerivMinThresholdsHG[
side][
module] = deriv2ndThreshDSHG;
1053 peak2ndDerivMinThresholdsLG[
side][
module] = deriv2ndThreshDSLG;
1056 deltaT0CutHigh[
side][
module] = deltaTcutHigh;
1057 chisqDivAmpCutLG[
side][
module] = chisqDivAmpCutLGVal;
1058 chisqDivAmpCutHG[
side][
module] = chisqDivAmpCutHGVal;
1062 ATH_MSG_DEBUG(
"PbPb2023: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1069 peak2ndDerivMinSamples,
1070 peak2ndDerivMinThresholdsHG,
1071 peak2ndDerivMinThresholdsLG,
1096 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0HG, t0LG);
1097 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1102 {-10, -10, -10, -10}}};
1107 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
1116 std::array<std::array<std::vector<float>, 4>, 2> nonLinearCorrCoefficHG, nonLinearCorrCoefficLG;
1118 nonLinearCorrCoefficHG = {{ {{{0},
1129 nonLinearCorrCoefficLG = {{ {{{0},
1139 zdcDataAnalyzer->
SetNonlinCorrParams(0, 1000, nonLinearCorrCoefficHG, nonLinearCorrCoefficLG);
1141 std::array<std::array<std::vector<float>, 4>, 2> timeCorrCoefficHG, timeCorrCoefficLG;
1142 timeCorrCoefficHG[0][0] = {};
1143 timeCorrCoefficHG[0][1] = {};
1144 timeCorrCoefficHG[0][2] = {};
1145 timeCorrCoefficHG[0][3] = {};
1147 timeCorrCoefficHG[1][0] = {};
1148 timeCorrCoefficHG[1][1] = {};
1149 timeCorrCoefficHG[1][2] = {};
1150 timeCorrCoefficHG[1][3] = {};
1152 timeCorrCoefficLG[0][0] = {};
1153 timeCorrCoefficLG[0][1] = {};
1154 timeCorrCoefficLG[0][2] = {};
1155 timeCorrCoefficLG[0][3] = {};
1157 timeCorrCoefficLG[1][0] = {};
1158 timeCorrCoefficLG[1][1] = {};
1159 timeCorrCoefficLG[1][2] = {};
1160 timeCorrCoefficLG[1][3] = {};
1168 return zdcDataAnalyzer;
1192 for (
size_t side : {0, 1}) {
1193 for (
size_t module : {0, 1, 2, 3}) {
1210 ATH_MSG_DEBUG(
"Default: delta t cut, value low = " << deltaT0CutLow[0][0] <<
", high = " << deltaT0CutHigh[0][0] );
1219 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
1222 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1, tau2, t0, t0);
1223 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, deltaT0CutLow, deltaT0CutHigh, deltaT0CutLow, deltaT0CutHigh);
1231 return zdcDataAnalyzer;
1242 const int peakSample = 4;
1243 const float peak2ndDerivThreshHG = -12;
1244 const float peak2ndDerivThreshLG = -10;
1246 {4.000, 4.000, 4.000, 4.000}}};
1248 {25.11, 25.08, 25.18, 25.48}}};
1251 {57.28, 57.29, 57.31, 57.33}}};
1253 {57.28, 57.29, 57.31, 57.33}}};
1261 for (
size_t side : {0, 1}) {
1262 for (
size_t module : {0, 1, 2, 3}) {
1266 peak2ndDerivMinSamples[
side][
module] = peakSample;
1267 peak2ndDerivMinThresholdsHG[
side][
module] = peak2ndDerivThreshHG;
1268 peak2ndDerivMinThresholdsLG[
side][
module] = peak2ndDerivThreshLG;
1281 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
1288 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1Arr, tau2Arr, t0HG, t0LG);
1289 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
1294 return zdcDataAnalyzer;
1310 const int peakSample = 5;
1311 const float peak2ndDerivThreshHG = -12;
1312 const float peak2ndDerivThreshLG = -10;
1314 {4.472, 4.656, 3.871, 4.061}
1318 {24.17, 24.22, 25.46, 24.45}
1322 {75.11, 74.94, 73.93, 74.45}
1325 {76.28, 76.07, 74.98, 76.54}
1335 for (
size_t side : {0, 1}) {
1336 for (
size_t module : {0, 1, 2, 3}) {
1340 peak2ndDerivMinSamples[
side][
module] = peakSample;
1341 peak2ndDerivMinThresholdsHG[
side][
module] = peak2ndDerivThreshHG;
1342 peak2ndDerivMinThresholdsLG[
side][
module] = peak2ndDerivThreshLG;
1352 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
1354 slewingParamsHG[0][0] = {0, 0, 0, 0};
1355 slewingParamsHG[0][1] = { -4.780244e-01, -7.150874e-02, 4.614585e-02, 8.015731e-04};
1356 slewingParamsHG[0][2] = { -5.253412e-01, -5.718167e-02, 5.243121e-02, 2.128398e-03};
1357 slewingParamsHG[0][3] = { -5.773952e-01, -5.687478e-02, 4.564267e-02, 1.462294e-03};
1359 slewingParamsHG[1][0] = { 7.105115e-01, -3.686143e-02, 7.727447e-02, 5.924152e-03};
1360 slewingParamsHG[1][1] = { 4.052120e-02, 4.450686e-03, 8.031615e-02, 4.038097e-03};
1361 slewingParamsHG[1][2] = { 3.389476e-02, -2.056782e-02, 4.805321e-02, -2.627999e-03};
1362 slewingParamsHG[1][3] = { 2.069765e-01, -2.890419e-02, 6.084375e-02, 3.742011e-03};
1364 slewingParamsLG[0][0] = {0, 0, 0, 0};
1365 slewingParamsLG[0][1] = { -1.632547e+00, -4.827813e-01, -1.379131e-01, -2.522607e-02};
1366 slewingParamsLG[0][2] = { -7.254288e+00, -5.454064e+00, -1.619126e+00, -1.739665e-01};
1367 slewingParamsLG[0][3] = { -1.548400e+01, -1.277708e+01, -3.729333e+00, -3.700458e-01};
1369 slewingParamsLG[1][0] = { 1.142767e-01, -3.608906e-02, 9.642735e-02, -3.097043e-03};
1370 slewingParamsLG[1][1] = { -5.615388e-01, -1.655047e-02, 8.327350e-02, -4.231348e-03};
1371 slewingParamsLG[1][2] = { -7.370728e-01, -2.887482e-02, 8.293875e-02, -4.482743e-03};
1372 slewingParamsLG[1][3] = { -1.270636e+00, -2.791777e-01, -5.807295e-02, -2.332612e-02};
1379 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
1390 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1Arr, tau2Arr, t0HG, t0LG);
1391 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
1399 zdcDataAnalyzer->
enableDelayed(-12.5, defaultPedestalShifts);
1403 slewingParamsHG, slewingParamsLG);
1406 return zdcDataAnalyzer;
1416 static constexpr
int peakSample = 5;
1417 static constexpr
float peak2ndDerivThreshHG = -35;
1418 static constexpr
float peak2ndDerivThreshLG = -20;
1419 static constexpr
float peak2ndDerivRepassHG = -10;
1420 static constexpr
float peak2ndDerivRepassLG = -6;
1423 {4.296, 4.064, 3.497, 3.642}
1427 {24.42, 24.99, 25.72, 25.29}
1431 {74.18, 72.79, 71.77, 72.62}
1434 {75.16, 73.71, 72.25, 73.61}
1438 {0.3216, 0.2593, 0.2511, 0.1680}
1447 for (
size_t side : {0, 1}) {
1448 for (
size_t module : {0, 1, 2, 3}) {
1452 peak2ndDerivMinSamples[
side][
module] = peakSample;
1453 peak2ndDerivMinThresholdsHG[
side][
module] = peak2ndDerivThreshHG;
1454 peak2ndDerivMinThresholdsLG[
side][
module] = peak2ndDerivThreshLG;
1455 peak2ndDerivMinRepassHG [
side][
module] = peak2ndDerivRepassHG;
1456 peak2ndDerivMinRepassLG [
side][
module] = peak2ndDerivRepassLG;
1470 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
1472 slewingParamsHG[0][0] = { -1.335560e-01, -6.071869e-03, 5.858193e-02, 2.473300e-03};
1473 slewingParamsHG[0][1] = { -1.223062e-01, -4.379469e-02, 4.452285e-02, 2.130210e-03};
1474 slewingParamsHG[0][2] = { -1.021415e-01, -4.254239e-02, 4.939866e-02, 3.849738e-03};
1475 slewingParamsHG[0][3] = { -8.234056e-02, -3.938803e-02, 4.689029e-02, 2.784816e-03};
1477 slewingParamsHG[1][0] = { -1.640979e-01, -2.780350e-02, 5.755065e-02, -4.244651e-04};
1478 slewingParamsHG[1][1] = { -1.422324e-01, 2.663803e-02, 7.295366e-02, 3.740496e-03};
1479 slewingParamsHG[1][2] = { -9.858124e-02, -2.426132e-02, 4.895967e-02, 2.291393e-03};
1480 slewingParamsHG[1][3] = { -1.070401e-01, -2.256383e-03, 5.833770e-02, 2.255208e-03};
1482 slewingParamsLG[0][0] = { -2.588446e-01, -3.241086e-02, 7.828661e-02, 1.945547e-03};
1483 slewingParamsLG[0][1] = { -3.112495e-01, -7.419508e-02, 6.825776e-02, 2.148860e-03};
1484 slewingParamsLG[0][2] = { -3.470650e-01, -5.836748e-02, 6.204396e-02, 1.550421e-03};
1485 slewingParamsLG[0][3] = { -4.485435e-01, -4.603790e-02, 5.944799e-02, -1.174585e-03};
1487 slewingParamsLG[1][0] = { -3.291676e-01, -4.023732e-02, 8.608755e-02, -3.958167e-03};
1488 slewingParamsLG[1][1] = { -2.608969e-01, -2.129786e-03, 6.930791e-02, -4.141910e-03};
1489 slewingParamsLG[1][2] = { -2.505712e-01, -2.195804e-02, 5.137261e-02, -4.058378e-03};
1490 slewingParamsLG[1][3] = { -5.083206e-01, 3.776601e-02, 1.284275e-01, 1.014067e-02};
1496 std::unique_ptr<ZDCDataAnalyzer> zdcDataAnalyzer = std::make_unique<ZDCDataAnalyzer>(
MakeMessageFunction(), 7, 25, 0,
"FermiExpLinear", peak2ndDerivMinSamples,
1497 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode);
1507 zdcDataAnalyzer->
SetTauT0Values(fixTau1Arr, fixTau2Arr, tau1Arr, tau2Arr, t0HG, t0LG);
1509 zdcDataAnalyzer->
SetCutValues(chisqDivAmpCut, chisqDivAmpCut, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
1519 {{ -12.5, -12.5, -12.5, -12.5}}
1523 zdcDataAnalyzer->
enableDelayed(delayDeltaTs, defaultPedestalShifts);
1526 zdcDataAnalyzer->
enableRepass(peak2ndDerivMinRepassHG, peak2ndDerivMinRepassLG);
1528 slewingParamsHG, slewingParamsLG);
1533 return zdcDataAnalyzer;
1542 {{5.0, 3.7, 3.5, 3.5}}
1548 {{19.1, 21.9, 22.6, 23.4}}
1574 bool fixTau1 =
true;
1575 bool fixTau2 =
true;
1577 for (
size_t side : {0, 1}) {
1578 for (
size_t module : {0, 1, 2, 3}) {
1585 {{46.314, 42.267, 50.327, 41.605}}
1589 {{44.295, 41.755, 48.081, 40.175}}
1601 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
1603 slewingParamsHG[0][0] = {0, -7.904e-02, 4.686e-02, 1.530e-03 };
1604 slewingParamsHG[0][1] = {0, 2.250e-02, 4.732e-02, 6.050e-03 };
1605 slewingParamsHG[0][2] = {0, 4.388e-02, 6.707e-02, -5.526e-05 };
1606 slewingParamsHG[0][3] = {0, 1.205e-01, 2.726e-02, 2.610e-03 };
1608 slewingParamsHG[1][0] = {0, 6.861e-02, 5.175e-03, -9.018e-04 };
1609 slewingParamsHG[1][1] = {0, 3.855e-01, -4.442e-02, -2.022e-02 };
1610 slewingParamsHG[1][2] = {0, -4.337e-03, 3.841e-02, 4.661e-03 };
1611 slewingParamsHG[1][3] = {0, 3.623e-01, -3.882e-02, -1.805e-02 };
1613 slewingParamsLG[0][0] = {0, 1.708e-02, 7.929e-02, 5.079e-03 };
1614 slewingParamsLG[0][1] = {0, 1.406e-01, 1.209e-01, -1.922e-04 };
1615 slewingParamsLG[0][2] = {0, 1.762e-01, 1.118e-01, 1.679e-04 };
1616 slewingParamsLG[0][3] = {0, 1.361e-02, -2.685e-02, -4.168e-02 };
1618 slewingParamsLG[1][0] = {0, 1.962e-01, -5.025e-03, -2.001e-02 };
1619 slewingParamsLG[1][1] = {0, 3.258e-01, 1.229e-02, -2.925e-02 };
1620 slewingParamsLG[1][2] = {0, 1.393e-01, 8.113e-02, -2.594e-03 };
1621 slewingParamsLG[1][3] = {0, 1.939e-01, 2.188e-02, -5.579e-02 };
1624 peak2ndDerivMinThresholdsHG, peak2ndDerivMinThresholdsLG,
m_lowGainMode));
1628 m_zdcDataAnalyzer_40MHz->SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
1630 slewingParamsHG, slewingParamsLG);
1632 std::array<std::array<std::vector<float>, 4>, 2> moduleHGNonLinCorr, moduleLGNonLinCorr;
1633 moduleHGNonLinCorr[0][0] = { -3.76800e-02, 4.63597e-02};
1634 moduleHGNonLinCorr[0][1] = { -1.02185e-01, -1.17548e-01};
1635 moduleHGNonLinCorr[0][2] = { -8.78451e-02, -1.52174e-01};
1636 moduleHGNonLinCorr[0][3] = { -1.04835e-01, -1.96514e-01};
1637 moduleHGNonLinCorr[1][0] = { -6.83115e-02, 3.57802e-02};
1638 moduleHGNonLinCorr[1][1] = { -1.08162e-01, -1.91413e-01};
1639 moduleHGNonLinCorr[1][2] = { -7.82514e-02, -1.21218e-01};
1640 moduleHGNonLinCorr[1][3] = { -2.34354e-02, -2.52033e-01};
1642 moduleLGNonLinCorr = {{ {{{0},
1683 bool fixTau1 =
true;
1684 bool fixTau2 =
true;
1686 for (
size_t side : {0, 1}) {
1687 for (
size_t module : {0, 1, 2, 3}) {
1694 {{4.2, 3.6, 3.3, 3.4}}
1699 {{19.1, 21.9, 22.6, 23.4}}
1704 {{36.0, 31.1, 40.75, 30.5}}
1709 {{33.7, 29.9, 39.0, 29.3}}
1720 std::array<std::array<std::vector<float>, 4>, 2> slewingParamsHG, slewingParamsLG;
1722 slewingParamsHG[0][0] = {0, -6.5e-2, 2.85e-2, -2.83e-3};
1723 slewingParamsHG[0][1] = {0, -5.5e-2, 5.13e-2, 5.6e-3};
1724 slewingParamsHG[0][2] = {0, -1.45e-3, 9.3e-2, 3.9e-3};
1725 slewingParamsHG[0][3] = {0, -2.36e-2, 8.3e-2, 1.1e-3};
1727 slewingParamsHG[1][0] = {0, -6.5e-2, 4.84e-2, -3.7e-3};
1728 slewingParamsHG[1][1] = {0, 1.34e-2, 6.57e-2, 5.37e-3};
1729 slewingParamsHG[1][2] = {0, -5.37e-2, 3.49e-2, 3.8e-3};
1730 slewingParamsHG[1][3] = {0, -3.3e-2, 3.9e-2, 2.2e-3};
1732 slewingParamsLG[0][0] = {0, -9.6e-2, 4.39e-2, 2.93e-3 };
1733 slewingParamsLG[0][1] = {0, -5.0e-2, 14.9e-2, 20.6e-3 };
1734 slewingParamsLG[0][2] = {0, -4.4e-2, 5.3e-2, 0, };
1735 slewingParamsLG[0][3] = {0, -9.90e-2, 4.08e-2, 0, };
1737 slewingParamsLG[1][0] = {0, -8.7e-2, 4.2e-2, -3.2e-3 };
1738 slewingParamsLG[1][1] = {0, -3.26e-2, 3.84e-2, -2.32e-3};
1739 slewingParamsLG[1][2] = {0, -26.8e-2, -2.64e-2, -5.3e-3 };
1740 slewingParamsLG[1][3] = {0, -13.2e-2, 0.45e-2, -2.4e-3 };
1748 m_zdcDataAnalyzer_80MHz->SetCutValues(chisqDivAmpCutHG, chisqDivAmpCutLG, DeltaT0CutLowHG, DeltaT0CutHighHG, DeltaT0CutLowLG, DeltaT0CutHighLG);
1750 slewingParamsHG, slewingParamsLG);
1752 std::array<std::array<std::vector<float>, 4>, 2> moduleHGNonLinCorr, moduleLGNonLinCorr;
1753 moduleHGNonLinCorr[0][0] = { -3.76800e-02, 4.63597e-02};
1754 moduleHGNonLinCorr[0][1] = { -1.02185e-01, -1.17548e-01};
1755 moduleHGNonLinCorr[0][2] = { -8.78451e-02, -1.52174e-01};
1756 moduleHGNonLinCorr[0][3] = { -1.04835e-01, -1.96514e-01};
1757 moduleHGNonLinCorr[1][0] = { -6.83115e-02, 3.57802e-02};
1758 moduleHGNonLinCorr[1][1] = { -1.08162e-01, -1.91413e-01};
1759 moduleHGNonLinCorr[1][2] = { -7.82514e-02, -1.21218e-01};
1760 moduleHGNonLinCorr[1][3] = { -2.34354e-02, -2.52033e-01};
1762 moduleLGNonLinCorr = {{ {{{0},
1797 ATH_MSG_ERROR(
"Invalid settings: Forced run > 0 but lumi block < 0");
1798 return StatusCode::FAILURE;
1848 return StatusCode::FAILURE;
1961 return StatusCode::SUCCESS;
1985 return StatusCode::SUCCESS;
1992 if (moduleContainer.
size()==0)
return StatusCode::SUCCESS;
1995 if (!eventInfo.
isValid())
return StatusCode::FAILURE;
2002 return StatusCode::SUCCESS;
2007 unsigned int thisRunNumber = eventInfo->
runNumber();
2009 ATH_MSG_DEBUG(
"ZDC analysis tool will be configured for run " << thisRunNumber);
2017 unsigned int calibRunNumber = thisRunNumber;
2023 catch(std::runtime_error&)
2033 unsigned int calibRunNumber = thisRunNumber;
2039 catch(std::runtime_error&)
2066 const std::vector<unsigned short>* adcUndelayLG = 0;
2067 const std::vector<unsigned short>* adcUndelayHG = 0;
2069 const std::vector<unsigned short>* adcDelayLG = 0;
2070 const std::vector<unsigned short>* adcDelayHG = 0;
2073 for (
const auto zdcModule : moduleContainer)
2076 if (zdcModule->zdcSide() == -1)
side = 0;
2077 else if (zdcModule->zdcSide() == 1)
side = 1;
2081 ATH_MSG_WARNING(
"Invalid side value found for module number: " << zdcModule->zdcModule() <<
", side value = " <<
side);
2085 if(zdcModule->zdcModule() > 4)
continue;
2087 if (zdcModule->zdcType() == 0) {
2093 adcUndelayLG = &g0dataAcc(*zdcModule);
2094 adcUndelayHG = &g1dataAcc(*zdcModule);
2107 adcUndelayLG = &g0d1dataAcc(*zdcModule);
2108 adcUndelayHG = &g1d1dataAcc(*zdcModule);
2109 adcDelayLG = &g0d0dataAcc(*zdcModule);
2110 adcDelayHG = &g1d0dataAcc(*zdcModule);
2114 adcUndelayLG = &g0d0dataAcc(*zdcModule);
2115 adcUndelayHG = &g1d0dataAcc(*zdcModule);
2116 adcDelayLG = &g0d1dataAcc(*zdcModule);
2117 adcDelayHG = &g1d1dataAcc(*zdcModule);
2123 return StatusCode::FAILURE;
2127 std::vector<float> HGUndelADCSamples(
m_numSample);
2128 std::vector<float> LGUndelADCSamples(
m_numSample);
2130 if (LGUndelADCSamples.size() < adcUndelayLG->size()) {
2131 LGUndelADCSamples.resize(adcUndelayLG->size());
2134 if (HGUndelADCSamples.size() < adcUndelayHG->size()) {
2135 HGUndelADCSamples.resize(adcUndelayHG->size());
2138 std::copy(adcUndelayLG->begin(), adcUndelayLG->end(), LGUndelADCSamples.begin());
2139 std::copy(adcUndelayHG->begin(), adcUndelayHG->end(), HGUndelADCSamples.begin());
2141 int side = (zdcModule->zdcSide() == -1) ? 0 : 1 ;
2144 m_zdcDataAnalyzer->LoadAndAnalyzeData(
side, zdcModule->zdcModule(), HGUndelADCSamples, LGUndelADCSamples);
2147 std::vector<float> HGDelayADCSamples(
m_numSample);
2148 std::vector<float> LGDelayADCSamples(
m_numSample);
2149 if (adcDelayLG and adcDelayHG){
2150 std::copy(adcDelayLG->begin(), adcDelayLG->end(), LGDelayADCSamples.begin());
2151 std::copy(adcDelayHG->begin(), adcDelayHG->end(), HGDelayADCSamples.begin());
2153 ATH_MSG_ERROR(
"adcDelayLG or adcDelayHG pointers are null");
2154 return StatusCode::FAILURE;
2161 HGUndelADCSamples, LGUndelADCSamples,
2162 HGDelayADCSamples, LGDelayADCSamples);
2212 for (
const auto zdcModule : moduleContainer)
2214 int side = (zdcModule->zdcSide() == -1) ? 0 : 1 ;
2215 int mod = zdcModule->zdcModule();
2217 if(
mod > 4)
continue;
2219 if (zdcModule->zdcType() == 0) {
2223 zdcModuleCalibEnergy(*zdcModule) = calibEnergy;
2231 zdcModuleChisq(*zdcModule) = pulseAna_p->
GetChisq();
2234 zdcModuleFitAmpError(*zdcModule) = pulseAna_p->
GetAmpError();
2235 zdcModuleFitT0(*zdcModule) = pulseAna_p->
GetFitT0();
2238 zdcModulePresample(*zdcModule) = pulseAna_p->
getPresample();
2240 zdcModuleMaxADC(*zdcModule) = pulseAna_p->
getMaxADCSub();
2241 zdcModuleMaxADCHG(*zdcModule) = pulseAna_p->
getMaxADCHG();
2242 zdcModuleMaxADCLG(*zdcModule) = pulseAna_p->
getMaxADCLG();
2244 zdcModuleAmpLGRefit(*zdcModule) = pulseAna_p->
getRefitLGAmp();
2269 for (
const auto zdc_sum: moduleSumContainer)
2271 ATH_MSG_DEBUG(
"Extracting ZDC side " << zdc_sum->zdcSide());
2273 if (zdc_sum->zdcSide()==0)
continue;
2275 int iside = (zdc_sum->zdcSide()==-1) ? 0 : 1;
2278 zdcSumUncalibSum(*zdc_sum) = uncalibSum;
2280 zdcSumUncalibSumErr(*zdc_sum) = uncalibSumErr;
2283 zdcSumCalibEnergy(*zdc_sum) = calibEnergy;
2285 zdcSumCalibEnergyErr(*zdc_sum) = calibEnergyErr;
2287 float finalEnergy = calibEnergy;
2288 zdcSumFinalEnergy(*zdc_sum) = finalEnergy;
2291 zdcSumModuleMask(*zdc_sum) = (
getModuleMask() >> (4 * iside)) & 0xF;
2294 return StatusCode::SUCCESS;
2318 std::unique_ptr<TFile> fCalib (TFile::Open(
filename.c_str(),
"READ"));
2320 if (fCalib ==
nullptr || fCalib->IsZombie())
2323 throw std::runtime_error (
"failed to open file " +
filename);
2326 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> splines;
2329 TString calibVersion;
2332 for (
int iside = 0; iside < 2; iside++)
2334 for (
int imod = 0; imod < 4; imod++)
2336 sprintf(
name,
"ZDC_Ecalib_run%u_s%d_m%d",
runNumber, iside, imod);
2338 TSpline3*
s = (TSpline3*) fCalib->GetObjectChecked(calibVersion+TString(
name),
"TSpline3");
2347 splines[iside][imod].reset (
s);
2376 ATH_MSG_WARNING(
"No LHC Run defined, so no time calibration allowed");
2380 char name[128] = {0};
2382 std::unique_ptr<TFile> fCalib (TFile::Open(
filename.c_str(),
"READ"));
2385 TString calibVersion =
"";
2388 if (fCalib && !fCalib->IsZombie())
2390 bool success =
true;
2391 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> T0HGOffsetSplines;
2392 std::array<std::array<std::unique_ptr<TSpline>, 4>, 2> T0LGOffsetSplines;
2393 std::unique_ptr<TSpline3> spline;
2394 for (
int iside = 0; iside < 2; iside++)
2396 for (
int imod = 0; imod < 4; imod++)
2398 sprintf(
name,
"ZDC_T0calib_run%u_HG_s%d_m%d",
runNumber, iside, imod);
2399 spline.reset (
static_cast<TSpline3*
>(fCalib->GetObjectChecked(calibVersion+TString(
name),
"TSpline3")));
2402 T0HGOffsetSplines[iside][imod] = std::move (spline);
2410 sprintf(
name,
"ZDC_T0calib_run%u_LG_s%d_m%d",
runNumber, iside, imod);
2411 spline.reset (
static_cast<TSpline3*
>(fCalib->GetObjectChecked(calibVersion+TString(
name),
"TSpline3")));
2414 T0LGOffsetSplines[iside][imod] = std::move (spline);
2442 std::string runString;
2445 else runString = (
"ZdcFADCCorr_Run"+TString::Itoa(
runNumber,10)+
".root").
Data();
2450 ATH_MSG_WARNING(
"setFADCCorrections: FADC corrections not implemented for Run 2");
2456 ATH_MSG_INFO(
"FADC correction requested but no calibration file found");
2462 std::unique_ptr<TFile> fFADCCorr(TFile::Open(
filename.c_str(),
"READ"));
2464 if (!fFADCCorr->IsOpen()) {
2466 throw std::runtime_error (
"ZdcAnalysisTool failed to open FADCCorrections file " +
filename);
2471 bool readSuccess =
true;
2472 std::array<std::array<std::unique_ptr<const TH1>, 4>, 2> histogramsHG;
2473 std::array<std::array<std::unique_ptr<const TH1>, 4>, 2> histogramsLG;
2475 for (
size_t side : {0, 1}) {
2476 for (
int module : {0, 1, 2, 3}) {
2480 ATH_MSG_DEBUG(
"setFADCCorrections: Searching for histograms HG and LG: " << histNameHG <<
", " << histNameLG);
2482 TH1* histHG_ptr =
static_cast<TH1*
>(fFADCCorr->GetObjectChecked(histNameHG.c_str(),
"TH1"));
2483 TH1* histLG_ptr =
static_cast<TH1*
>(fFADCCorr->GetObjectChecked(histNameLG.c_str(),
"TH1"));
2485 if (!histHG_ptr || !histLG_ptr) {
2486 std::string errMsg =
"setFADCCorrections: unable to read FADC correction histogram(s) ";
2487 if (!histHG_ptr) errMsg += histNameHG +
" ";
2488 if (!histLG_ptr) errMsg += histNameLG;
2491 readSuccess =
false;
2499 if ( std::abs(histHG_ptr->GetXaxis()->GetXmin()+0.5) > 1
e-3 || std::abs(histHG_ptr->GetXaxis()->GetXmax() - 4095.5) > 1
e-3) {
2500 ATH_MSG_ERROR(
"setFADCCorrections: invalid axis range for HG FADC corrections in histogram with name " << histNameHG);
2501 readSuccess =
false;
2504 if (std::abs(histLG_ptr->GetXaxis()->GetXmin()+0.5) > 1
e-3 || std::abs(histLG_ptr->GetXaxis()->GetXmax() - 4095.5) > 1
e-3) {
2505 ATH_MSG_ERROR(
"setFADCCorrections: invalid axis range for HG FADC corrections in histogram with name " << histNameLG);
2506 readSuccess =
false;
2510 histogramsHG[
side][
module].reset(histHG_ptr);
2511 histogramsLG[
side][
module].reset(histLG_ptr);
2522 ATH_MSG_ERROR(
"setFADCCorrections: due to at least one error, FADC corrections are not implemented");
2535 return StatusCode::FAILURE;
2550 return StatusCode::SUCCESS;
2555 size_t nsamp =
adc.size();
2556 float presamp =
adc.at(0);
2557 unsigned short max_adc = 0;
2559 for (
size_t i = 0;
i < nsamp;
i++)
2561 if (
adc[
i] > max_adc)
2567 amp = max_adc - presamp;
2568 time = max_index * deltaT;
2571 if (max_index == -1)
2582 size_t nsamp =
adc.size();
2583 float presamp =
adc.at(0);
2585 for (
size_t i = 0;
i < nsamp;
i++)
2660 return eff_pair.second;