testShowGraphs.cxx 1.92 KB
Newer Older
1 2 3 4 5
void testShowGraphs()
{

	gSystem->Load("../libData.so");

6
	const Long64_t kFirstEvent = 128;
7

Muzalevsky I.A's avatar
Muzalevsky I.A committed
8 9

	TFile fr("../data/dataDSR4/Neurad_7_08_NEW.root");
10
//	TFile fr("../data/dataDSR4/analysis_07_8.root");
11
<<<<<<< HEAD
Kostyleva D.A's avatar
Kostyleva D.A committed
12 13 14

//	TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");

15
//	TFile fr("../data/dataTektronix/exp18.root");
Kostyleva D.A's avatar
Kostyleva D.A committed
16

17
=======
Muzalevsky I.A's avatar
Muzalevsky I.A committed
18
//	TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");
19
//	TFile fr("../data/dataTektronix/exp18.root");
20
>>>>>>> 09d9ad17f40ac0af9d228137f715f25ee9ea15ae
21
//	TFile fr("../data/dataTektronix/analysisExp7.root");
22
	TTree *tr = (TTree*)fr.Get("atree");
23

24
	AEvent *revent = new AEvent();
25
	cout << tr->SetBranchAddress("Ach0.",&revent) << endl;
26

27 28 29
	TGraph *gr[13];
	Double_t t10[13];
	Double_t t90[13];
30

31
//	cout << "warning" << endl;
32 33 34

	cout << tr->GetEntries() << endl;

35
	//loop over events
36
	for (Long64_t i = 0; i < 13; i++) {
37
		gr[i] = 0;
38 39
		t10[i] = 0;
		t90[i] = 0;
40
//	cout << "warning 1" << endl;
41
//		cout << i+kFirstEvent << endl;
42 43 44
		tr->GetEntry(i+kFirstEvent);
//		tr->GetEntry(i);
//	cout << "warning 2" << endl;
45
		gr[i] = new TGraph(*revent->GetGraphSignal());
46 47 48 49 50 51 52
		t10[i] = revent->GetT_10();
		t90[i] = revent->GetT_90();

//		cout << t10[i] << "\t" << t90[i] << endl;
//		cout << revent->GetEdgeSlope() << endl;


53
	}//for over events
54

55
//	cout << "warning 3" << endl;
56

57
	TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
58
<<<<<<< HEAD
Kostyleva D.A's avatar
Kostyleva D.A committed
59

Muzalevsky I.A's avatar
Muzalevsky I.A committed
60
	//c1->Divide(3,2);
Kostyleva D.A's avatar
Kostyleva D.A committed
61

62
	c1->Divide(3,4);
Kostyleva D.A's avatar
Kostyleva D.A committed
63

64
=======
Muzalevsky I.A's avatar
Muzalevsky I.A committed
65
	//c1->Divide(3,2);
66
	c1->Divide(3,4);
67
>>>>>>> 09d9ad17f40ac0af9d228137f715f25ee9ea15ae
68

69 70 71
	TF1 *f1 = new TF1("f1name", "[0]+x*[1]");
//	TF1 *f1 = new TF1("pol1", );

72
<<<<<<< HEAD
Kostyleva D.A's avatar
Kostyleva D.A committed
73 74 75 76

	for (Int_t k = 0; k < 6; k++) {

//	for (Int_t k = 0; k < 12; k++) {
77
=======
78
	for (Int_t k = 0; k < 12; k++) {
79
>>>>>>> 09d9ad17f40ac0af9d228137f715f25ee9ea15ae
Kostyleva D.A's avatar
Kostyleva D.A committed
80

81
		c1->cd(k+1);
82 83
		gr[k]->Draw("AL*");

Muzalevsky I.A's avatar
Muzalevsky I.A committed
84 85 86
		//cout << t10[k] << "\t" << t90[k] << endl;
		//f1->SetRange(t10[k], t90[k]);
		//gr[k]->Fit(f1, "RQ");
Kostyleva D.A's avatar
Kostyleva D.A committed
87
	}
88 89 90 91

//	c1->cd(2);
//	tr->Draw("gAmp.Draw()","","goff",1,124);
}