Re: use TTree in g++

From: Dan Holmes <dan.holmes_at_cern.ch>
Date: Mon, 15 May 2006 14:17:02 +0200


wow, that was very easy, thanks!

Rene Brun wrote:
> Dan,
>
> see the simple example below
>
> compile and link it with
>
> g++ -o dan dan.cxx `root-config --cflags --libs`
>
> //file dan.cxx
> #include "TFile.h"
> #include "TTree.h"
> #include "TRandom3.h"
>
> int main()
> {
> TFile hfile("dan.root","RECREATE");
>
> double px,py;
> TTree *T = new TTree("T","Demo");
> T->Branch("px",&px,"px/D");
> T->Branch("py",&py,"py/D");
>
> TRandom3 r(0);
> for ( int i=0; i<10000; i++) {
> r.Rannor(px,py); //px and py will be two gaussian random numbers
> T->Fill();
> }
>
> T->Print();
> T->Write();
> return 0;
> }
>
>
> Rene
>
> On Mon, 15 May 2006, Dan Holmes wrote:
>

>> ..what do i have to do to be able to use a TTree is a standalone g++ 
>> on slc3 compiled executable?
>>
>> ..is it as simple as including TTree.h in the header and the 
>> libTree.so in the library path?
>>
>> ..maybe you have some doc on it somewhere that i have missed..?
>>
>> cheers,
>>
>> Dan.
>>
Received on Mon May 15 2006 - 14:17:00 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET