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

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

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

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

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

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

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


45
	}//for over events
46

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

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

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

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

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

Muzalevsky I.A's avatar
Muzalevsky I.A committed
61 62 63
		//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
64
	}
65 66 67 68

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