calibration2.cxx 1.39 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();
Kostyleva D.A's avatar
Kostyleva D.A committed
12
	cal->CalibrateRawSpectra("clb09_0001.root", "SQ22", "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
13 14
	cal->CalibrateRawSpectra("clb09_0001.root", "SQ22", "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
//return;
Kostyleva D.A's avatar
Kostyleva D.A committed
15 16 17 18 19 20 21
	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
22 23 24

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

Kostyleva D.A's avatar
Kostyleva D.A committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
/*	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
54
}