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

	AculCalibration cal;
	cal->SetInputParameters();

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

	TCanvas *c1 = new TCanvas();
Kostyleva D.A's avatar
Kostyleva D.A committed
11
	cal->CalibrateRawSpectra("clb03_0001.root", "SQ22", 22, "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
Kostyleva D.A's avatar
Kostyleva D.A committed
12 13 14 15 16 17 18 19

	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
20 21 22

	for (Int_t i = 0; i < 32; i++) 
	{
Kostyleva D.A's avatar
Kostyleva D.A committed
23 24 25 26 27 28
		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
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
/*	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
52
}