You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug found by S. Izumiyama in the time residual PDF production which makes a slight bump in the -100ns region. I re-wrote ProducePDF.cpp to correctly rebin the histogram and evaluate the spline. ProducePDF and PDF in inputs has been modified
cout<<"Start to merge bins in higher size bins to optimize PDF"<<endl;
673
+
vector <double> xPos;xPos.clear();
674
+
vector <double> yPos;yPos.clear();
675
+
vector <double> drPos;drPos.clear();
722
676
int iBinActive=0;
723
677
int nRebins=10;//Number of small bin gathered in a big one
724
678
double xAverage=0;
725
679
double yAverage=0;
726
680
double drAverage=0;
727
681
int binLimit=HitTimeTOFProfile[f][i]->FindBin(-limitFitGausExpo[i]);//HitTimeTOFProfile[f][i]->FindBin(limitFitGausExpo[i]-5);//Lower limit of the active big bin
//In between the different limits, the rebinning factor will be different.
696
+
//We should first ensure in which region we are. Based on this, we use a different rebinning value.
697
+
//Then, we will loop over the bins which are in the correct region. We will have an internal counter. As soon as this internal counter reach the rebinning value, we stop and average.
698
+
//Another way of reaching the factor could be to reach another regiob. We should take this into account.
//cout<<"Rebins="<<nRebins<<", bin limit="<<ibinx-binLimit<<", average x="<<xAverage<<endl;
745
-
if((ibinx-binLimit)%nRebins==(nRebins-1)){
746
-
xPos[iBinActive]=xAverage/nRebins;
747
-
drPos[iBinActive]=drAverage/nRebins;
748
-
yPos[iBinActive]=(yAverage/nRebins);
749
-
cout<<"Position = "<<xPos[iBinActive]<<", value="<<yPos[iBinActive]<<", DR = "<<drPos[iBinActive]<<endl;
750
-
iBinActive++;
703
+
cout<<"Bin = "<<ibinx<<" i.e. value of low edge = "<< HitTimeTOFProfile[f][i]->GetBinLowEdge(ibinx)<<", current low edge limit bin = "<<binLowLimits[currentLimit]<<", nBinsAverage = "<<nBinsAverage<<", rebinning factor = "<<rebinLowLimits[currentLimit]<<endl;
//If we reached the number of binning to rebin: store information.
713
+
//Same if we reached the limit of the region to rebin of a given factor.
714
+
//What if both happens at the same time, or worse: we reach limit of bins on bin n, and at n+1, we overcome the limit. In that case, we do not have anyting to fill our average? So, we understand that if we are in the last bin below the limit, we should store and then pass to the next step of limit. So, the check of the limit should always be on the next bin.
715
+
xPos.push_back(xAverage/nBinsAverage);
716
+
drPos.push_back(drAverage/nBinsAverage);
717
+
yPos.push_back((yAverage/nBinsAverage));
718
+
cout<<"Position = "<<xPos[nBins]<<", value="<<yPos[nBins]<<", DR = "<<drPos[nBins]<<endl;
0 commit comments