testShowGraphs.cxx 1.55 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
	TFile fr("../data/dataDSR4/analysis_08_2.root");
Muzalevsky I.A's avatar
Muzalevsky I.A committed
12
//	TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");
13
//	TFile fr("../data/dataTektronix/exp18.root");
14
//	TFile fr("../data/dataTektronix/analysisExp7.root");
15
	TTree *tr = (TTree*)fr.Get("atree");
16

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

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

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

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

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

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


46
	}//for over events
47

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

50
	TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
51
	//c1->Divide(3,2);
52
	c1->Divide(3,4);
53

54 55 56
	TF1 *f1 = new TF1("f1name", "[0]+x*[1]");
//	TF1 *f1 = new TF1("pol1", );

57
	for (Int_t k = 0; k < 12; k++) {
Muzalevsky I.A's avatar
Muzalevsky I.A committed
58

59
		c1->cd(k+1);
60 61
		gr[k]->Draw("AL*");

Muzalevsky I.A's avatar
Muzalevsky I.A committed
62 63 64
		//cout << t10[k] << "\t" << t90[k] << endl;
		//f1->SetRange(t10[k], t90[k]);
		//gr[k]->Fit(f1, "RQ");
Muzalevsky I.A's avatar
Muzalevsky I.A committed
65
	}
66 67 68 69

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