35 return StatusCode::SUCCESS;
37 ATH_MSG_INFO(
"LArParabolaPeakRecoTool: correctBias flag is ON ");
41 if (shapeFilePath.empty()) {
43 return StatusCode::FAILURE;
45 if (adcCorFilePath.empty()) {
47 return StatusCode::FAILURE;
54 return StatusCode::FAILURE;
59 return StatusCode::FAILURE;
62 int idelay{-1}, ilayer{-1};
64 while (in >> idelay >> ilayer >> timeValue) {
65 if (ilayer < 0 || ilayer >= 4 || idelay < 0 || idelay >= 25) {
69 if (idelay == 0 &&
m_QT_Shape[ilayer][0] != 0.F) {
77 while (adcin >> idelay >> ilayer >> adcCorValue) {
78 if (ilayer < 0 || ilayer >= 4 || idelay < 0 || idelay >= 25) {
83 return StatusCode::SUCCESS;
119 std::vector<float> solution;
121 const std::vector<float>::const_iterator it_max=max_element(samples.begin(),samples.end());
122 if (it_max==samples.end()) {
126 if (it_max==samples.begin() || it_max==samples.end()-1)
128 solution.push_back(*it_max);
135 for (
int i=0;i<3;i++)
136 {beta[i]=*(it_max-1+i);
137 for (
int j=0;j<3;j++)
138 alpha[i][j]=pow(-1+i,j);
141 float retval=0, tmax=0, traw=0, trec=0;
144 HepVector comp=solve(alpha,beta);
146 tmax=-comp[1]/(2*comp[2]);
148 retval=comp[0]-comp[1]*comp[1]/(4*comp[2]);
153 traw = 25./2.*(beta[0]-beta[2])/(beta[0] - beta[1] + beta[2] - beta[1]);
156 traw += ( it_max-samples.begin() - 3 )*25.;
158 if(layer < 0 || layer > 3) {
165 if(pedestal<0)
ATH_MSG_ERROR(
"Pedestal is wrong ! Ped = " << pedestal );
170 solution.push_back(retval);
172 solution.push_back(tmax);
175 solution.push_back(traw);
176 solution.push_back(trec);
262 float QT_correct_ADC;
276 if ( QT_true_time < 0. )
278 QT_true_time += ( ( (int) std::abs(QT_true_time / 25)) + 1)*25;
285 ichoosedelay = (int) QT_true_time % 25;
291 if ( ilayer >=0 && ilayer< 4 )
293 if ( ichoosedelay < 25 - 1 ){
296 * (QT_true_time - (
int) QT_true_time);
301 * (QT_true_time - (
int) QT_true_time);
306 QT_correct_ADC = 100.;
316 QT_true_ADC = ADCref - PEDref;
317 QT_true_ADC = QT_true_ADC / QT_correct_ADC * 100.;
318 QT_true_ADC += PEDref;