calibration1.cxx 1.53 KB
Newer Older
1 2 3 4 5
#include <TSystem.h>
#include <iostream>

using namespace std;

Kostyleva D.A's avatar
Kostyleva D.A committed
6 7
void calibration1()
{
8 9 10
//	gSystem->Load("/home/dariak/AculUtils/libAculData.so");
	gSystem->Load("/home/vratik/workspace/AculUtils/libTELoss.so");
	gSystem->Load("/home/vratik/workspace/AculUtils/libAculData.so");
Kostyleva D.A's avatar
Kostyleva D.A committed
11 12

	AculCalibration cal;
13 14 15 16
//	cal.SetParFileName("/home/dariak/AculUtils/parforcal.par");	//from .par
	cal.SetParFileName("/home/vratik/workspace/AculUtils/parforcal.par");	//from .par
	cal.Init();
//return;
Kostyleva D.A's avatar
Kostyleva D.A committed
17 18
	cal.PrintInputParameters();

19 20 21 22 23 24 25
	TCanvas *c1 = new TCanvas();
	cal.ShowEnergySpectra("SQ22[]E.root", c1, 32);

//	return;
//	cal.CalculateCalibParameters("/home/dariak/AculUtils/exp1016/clb_raw_files/sq22/clb07_0001.root", "SQ22", "AnalysisxTree", 100, 1500);
//	cal.CalculateCalibParameters("/home/vratik/workspace/AculUtils/exp1016/clb_raw_files/clb07_0001.root", "SQ22", "AnalysisxTree", 100, 1500);
return;
Kostyleva D.A's avatar
Kostyleva D.A committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
//	    CalculateCalibParameters(const char* inputfile, const char* block, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1);

	cal.PrintCalibrationParameters();
	TFile fr("/home/dariak/AculUtils/exp1016/SQ22[]E.root");
	cout << fr.GetListOfKeys()->GetEntries() << " histograms" << endl;
	TCanvas *c2 = new TCanvas();
	cal.FindEnergyPeaks(c2,"SQ22[]E.root","outputenergrun07.txt");

/*	TList *histList = fr.GetListOfKeys();
	TH1 *hWork = 0;
	for (Int_t i = 0; i < 32; i++) 
	{
		fr.GetObject(histList->At(i)->GetName(), hWork);		
		cal->PeaksFitting(hWork);
	}*/
}