38 std::cout <<
"LArParabolaPeakRecoTool: correctBias flag is ON " << std::endl;
47 float timeValue, adccorValue;
50 while( fscanf(
m_fileShape,
"%80d %80d %80f",&idelay,&ilayer,&timeValue) != EOF )
52 if ( ilayer >= 0 && ilayer < 4 && idelay >= 0 && idelay < 25 )
56 if ( idelay == 0 &&
m_QT_Shape[ilayer][0] != 0. )
63 while( fscanf(
m_fileADCcor,
"%80d %80d %80f",&idelay,&ilayer,&adccorValue) != EOF )
65 if ( ilayer >= 0 && ilayer < 4 && idelay >= 0 && idelay < 25 )
74 return StatusCode::SUCCESS;
110 std::vector<float> solution;
112 const std::vector<float>::const_iterator it_max=max_element(samples.begin(),samples.end());
113 if (it_max==samples.end()) {
117 if (it_max==samples.begin() || it_max==samples.end()-1)
119 solution.push_back(*it_max);
126 for (
int i=0;i<3;i++)
127 {beta[i]=*(it_max-1+i);
128 for (
int j=0;j<3;j++)
129 alpha[i][j]=
pow(-1+i,j);
132 float retval=0, tmax=0, traw=0, trec=0;
135 HepVector comp=solve(alpha,beta);
137 tmax=-comp[1]/(2*comp[2]);
139 retval=comp[0]-comp[1]*comp[1]/(4*comp[2]);
144 traw = 25./2.*(beta[0]-beta[2])/(beta[0] - beta[1] + beta[2] - beta[1]);
147 traw += ( it_max-samples.begin() - 3 )*25.;
149 if(layer < 0 || layer > 3) {
156 if(pedestal<0)
ATH_MSG_ERROR(
"Pedestal is wrong ! Ped = " << pedestal );
161 solution.push_back(retval);
163 solution.push_back(tmax);
166 solution.push_back(traw);
167 solution.push_back(trec);
253 float QT_correct_ADC;
267 if ( QT_true_time < 0. )
269 QT_true_time += ( ( (int) std::abs(QT_true_time / 25)) + 1)*25;
276 ichoosedelay = (int) QT_true_time % 25;
282 if ( ilayer >=0 && ilayer< 4 )
284 if ( ichoosedelay < 25 - 1 ){
287 * (QT_true_time - (
int) QT_true_time);
292 * (QT_true_time - (
int) QT_true_time);
297 QT_correct_ADC = 100.;
307 QT_true_ADC = ADCref - PEDref;
308 QT_true_ADC = QT_true_ADC / QT_correct_ADC * 100.;
309 QT_true_ADC += PEDref;