Q3D-Calibration/include/getADC.h

19 lines
362 B
C++

#include "GaussFit.h"
#include <TH1F.h>
#include <iostream>
double getADC(TH1F *hist) {
int n, cnt = 0;
double *parma = new double[3];
GaussFit *GF = new GaussFit();
for (int k = 0; k < 300; k++) {
n = hist->GetBinContent(k);
if (n == 0) continue;
GF->addData(k, n);
}
parma = GF->fit();
return parma[1];
}