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

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

6 7
	const Long64_t kFirstEvent = 128;

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

11
	AEvent *revent = new AEvent();
12
	tr->SetBranchAddress("Ach0.",&revent);
13 14 15

	TGraph *gr[10];

16
	//loop over events
17 18
	for (Int_t i = 0; i < 10; i++) {
		gr[i] = 0;
19
		tr->GetEntry(i+kFirstEvent);
20
		gr[i] = new TGraph(*revent->GetGraph());
21
	}//for over events
22 23


24
	TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
25 26 27 28 29 30 31 32 33 34
	c1->Divide(3,2);

	for (Int_t i = 0; i < 6; i++) {
		c1->cd(i+1);
		gr[i]->Draw();
	}

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