//////////////////////////////////////////
// This is an example macro to obtain //
// some calibration parameter for TDC //
// by test pulse, so called "T-Scan". //
//////////////////////////////////////////

{
gROOT->SetStyle("Plain");
gSystem->Load("../libFemCalib.so");
Scan sc;

sc.SetRange(500,4000,32); // Fit Range (minmum, maximum, npmt)

sc.Read("qscan_120101.root",Scan::easy); // Read rootfile (filename, method easy or fit)

sc.Fill(); // Fill to histogram
sc.Fit(Scan::ADC); // Fit distribution (Scan::ADC)

sc.DumpPar("qscan_120101.dat",Scan::ADC); // Dump parameter (output filename)

sc.Draw(Scan::ADC); // Draw histogram (Scan::ADC)
sc.Dist(Scan::ADC); // Show distribution (Scan::ADC)

sc.WriteHist("qscan_120101_hist.root"); // histogram out (filename)

}