Plot a TGraph from a Ttree

Hi all,
Sorry for asking something so trivia, i want to create some graphs from an already existing tree but cant get any results. I used to use Histograms that where working just fine but don’t know how to do it with a graph.

#define Peisistratos_cxx
#include “Peisistratos.h”
#include <“TGraph.h”>
#include <“TStyle.h”>
#include <“TList.h”>

TGraph *gr1;
TGraph *gr2;

void Peisistratos::Begin(TTree * /tree/)
{TString option = GetOption();}

void Peisistratos::SlaveBegin(TTree * /tree/)
{TString option = GetOption();
TMultiGraph *mg = new TMultiGraph();
TCanvas c1 = new TCanvas(“c1”,“multigraph”,1280,1024);
gr1 = new TGraph();
gr1->SetLineColor(kBlue);
gr2 = new TGraph();
gr2->SetLineColor(kRed);
c1->SetGrid();
}
Bool_t Peisistratos::Process(Long64_t entry)
{
fChain->GetTree()->GetEntry(entry);
if (entry%100==0) cout << “entry=” << entry << endl;
if (Z==48)
{
if (i==1){
gr1=???
Tree->Fill();
gr1->SetMarkerColor(kRed);}
if (i==2){
gr2->???
gr2->SetMarkerCOlor(kBlue);}
mg->Add (gr1);
mg->Add (gr2);
gPad->SetLogy();
TLegend
leg = new TLegend(0.1,0.7,0.48,0.9);
//. make the appropriate Legend
//.
//.
mg->Add (leg);
mg->Draw();}
return kTRUE;}
void Peisistratos::SlaveTerminate()

Thank you in advance,
Stelios.