[ROOT] ROOtt programe how to complie

From: mjami (mjamil@konkuk.ac.kr)
Date: Sat Mar 13 2004 - 10:29:15 MET






Respected all Rooter,

i am a new user of root software... i have problem in compiling the root programe.. as programe   for 2d , 3d histogram should be written in c++, i did so, , wrote this programe in linux editor separte page, then i saved it by the name tprofile.c then tprofile.root,  and just only saving it with trofile name in the ROOT directory.

 but sorry to say  i could not  solve this problem to run it.

 how can i run this programe, as the ROOT is saying me this is not root file.

 also tell me by which command of root i can run this programe.

 the programe i wrote is...

 

file://Creating a canvas and tprofile2d

TCanvas *c1 = new TCanvas

("c1", "Profile histogram example", 200,10,700,500);

hprof2d = new TProfile2d

("hprof2d","Profile of pz versus px and py", 40,-4,4,40,-4,4,0,20);

// filling the Tprofile2d with 25000 points

Float_t px, py, pz;

for (Int_t i=0; i<25000; i++){

gRandom->Rannor(px,Py);

pz=px*px+ py*py;

hprof2d->Fill(px,py,pz,1);

}

hprof2d->Draw()

}

 

 i dont know i sjould write this on root command prompt, but still it is not working.

 as root command[ ] does not support it. i think i should write it seperately then comiple it...

 pls help me , so that i can get solutions.

 yours sincerely

muhammad jamil,

 physics dett: konkuk university, seoul korea

 email mjamil47@hotmail.com

mjmailbal@yahoo.com

mjamil@konkuk.ac.kr

 



 

---------[ 받은 메일 내용 ]----------
제목 : Re: [ROOT] Legend
날짜 : 2004년 03월 13일 [토]요일 05시 29분 42초
보낸이 : Allister Levi Sanchez <allister@hep.sc.niigata-u.ac.jp>
받는이 : Marieke Navin <M.Navin@sheffield.ac.uk>


Hi Marieke,

>  //creating a legend
>  TLegend *legend = new TLegend(0.4,0.4,0.55,0.44);
>  legend->AddEntry(inputSpec,"Uncleaved Positive Theta", "1");
>  legend->AddEntry(inputSpec2, "Uncleave Negative Theta", "kDashDotted");
>  legend->AddEntry(inputSpec3, "Cleaved Positive Theta", "kDotted");
>  legend->AddEntry(inputSpec4, "Cleaved Negative Theta", "kDashed");
>  legend->Draw();
>  
>
You need a fifth argument to the TLegend constructor.

TLegend *legend = new TLegend(0.4,0.4,0.55,0.44,""); // if you don't like a title
TLegend *legend = new TLegend(0.4,0.4,0.55,0.44,"Title");


Best regards,

Allister Levi Sanchez
Niigata University

---
"I pick myself up, dust myself off, start all over again."





This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET