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

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

6
	const Long64_t kFirstEvent = 128;
7

8
	TFile fr("../data/dataDSR4/analysis_08_2.root");
9
//	TFile fr("../data/dataDSR4/analysis_07_8.root");
Kostyleva D.A's avatar
Kostyleva D.A committed
10 11 12

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

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

15
//	TFile fr("../data/dataTektronix/analysisExp7.root");
16
	TTree *tr = (TTree*)fr.Get("atree");
17

18
	AEvent *revent = new AEvent();
19
	cout << tr->SetBranchAddress("Ach0.",&revent) << endl;
20

21 22 23
	TGraph *gr[13];
	Double_t t10[13];
	Double_t t90[13];
24

25
//	cout << "warning" << endl;
26 27 28

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

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

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


47
	}//for over events
48

49
//	cout << "warning 3" << endl;
50

51
	TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
Kostyleva D.A's avatar
Kostyleva D.A committed
52

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

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

57

58 59 60
	TF1 *f1 = new TF1("f1name", "[0]+x*[1]");
//	TF1 *f1 = new TF1("pol1", );

Kostyleva D.A's avatar
Kostyleva D.A committed
61 62 63 64 65

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

//	for (Int_t k = 0; k < 12; k++) {

66
		c1->cd(k+1);
67 68
		gr[k]->Draw("AL*");

Muzalevsky I.A's avatar
Muzalevsky I.A committed
69 70 71
		//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
72
	}
73 74 75 76

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