testShowGraphs.cxx 984 Bytes
Newer Older
1 2 3 4 5
void testShowGraphs()
{

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

6 7
	const Long64_t kFirstEvent = 128;

8
//	TFile fr("../data/dataDSR4/analysis_07_1.root");
9 10
//	TFile fr("../data/dataDSR4/analysis_07_8.root");
	TFile fr("../data/dataTektronix/analysisExp7.root");
11
	TTree *tr = (TTree*)fr.Get("atree");
12

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

	TGraph *gr[10];

18 19 20 21
	cout << "warning" << endl;

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

22
	//loop over events
23
	for (Long64_t i = 0; i < 10; i++) {
24
		gr[i] = 0;
25 26 27 28 29 30
	cout << "warning 1" << endl;
		cout << i+kFirstEvent << endl;
//		tr->GetEntry(i+kFirstEvent);
		tr->GetEntry(i);
	cout << "warning 2" << endl;
		gr[i] = new TGraph(*revent->GetGraphSignal());
31
	}//for over events
32

33
	cout << "warning 3" << endl;
34

35
	TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
36 37
	c1->Divide(3,2);

38 39 40
	for (Int_t k = 0; k < 6; k++) {
		c1->cd(k+1);
		gr[k]->Draw();
41 42 43 44 45
	}

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