calibration2.cxx 1.47 KB
Newer Older
1
void calibration2()
Kostyleva D.A's avatar
Kostyleva D.A committed
2
{
Kostyleva D.A's avatar
Kostyleva D.A committed
3
	gSystem->Load("/home/dariak/AculUtils/libAculData.so");
Kostyleva D.A's avatar
Kostyleva D.A committed
4 5 6 7

	AculCalibration cal;
	cal->SetInputParameters();

Kostyleva D.A's avatar
Kostyleva D.A committed
8
	cal->SetCalibrationParameters("SQ22[].cal"); //takes calibration parameters 
Kostyleva D.A's avatar
Kostyleva D.A committed
9
	cal->PrintCalibrationParameters(22, 22);
Kostyleva D.A's avatar
Kostyleva D.A committed
10 11

	TCanvas *c1 = new TCanvas();
12
	TCanvas *c2 = new TCanvas();
Kostyleva D.A's avatar
Kostyleva D.A committed
13
	cal->CalibrateRawSpectra("clb09_0001.root", "SQ22", "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
14
	//cal->CalibrateRawSpectra("clb09_0001.root", "SQ22", "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
15
//return;
Kostyleva D.A's avatar
Kostyleva D.A committed
16 17 18 19 20 21 22
	TFile fr("SQ22[]E.root");
	cout << fr.GetListOfKeys()->GetEntries() << " histograms" << endl;

	TList *histList = fr.GetListOfKeys();
	TH1 *hWork = 0;
	c1->Clear();
	c1->Divide(6, 6);
Kostyleva D.A's avatar
Kostyleva D.A committed
23 24 25

	for (Int_t i = 0; i < 32; i++) 
	{
Kostyleva D.A's avatar
Kostyleva D.A committed
26 27 28 29 30 31
		fr.GetObject(histList->At(i)->GetName(), hWork);		
		c1->cd(i+1);
		cal->PeaksFitting(hWork);
		hWork->Draw();
	}

32 33
	cal.FindEnergyPeaks(c2,"SQ22[]E.root","output.txt");

Kostyleva D.A's avatar
Kostyleva D.A committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*	c1->Divide(2, 2);

	c1->cd(1);
	fr.GetObject(histList->At(7)->GetName(), hWork);
	cal->PeaksFitting(hWork);
	hWork->Draw();

	fr.GetObject(histList->At(8)->GetName(), hWork);
	c1->cd(2);
	cal->PeaksFitting(hWork);
	hWork->Draw();

	fr.GetObject(histList->At(23)->GetName(), hWork);
	c1->cd(3);
	cal->PeaksFitting(hWork);
	hWork->Draw();

	fr.GetObject(histList->At(24)->GetName(), hWork);
	c1->cd(4);
	cal->PeaksFitting(hWork);
	hWork->Draw();
	*/	

Kostyleva D.A's avatar
Kostyleva D.A committed
57
}