groups

name language licence
Reading a TRefArray C++ Other
SetDirectory C++ Other
MCEvents tree simple analysis C++ Other
Fitting to functions C++ Other
Load and execute a macro C++ Other
Feng's wierd way of making time plots C++ Other
Check to see if a file exists C++ Other
Creating a TTree C++ Other

< 1 2 3 4 5 >



language: C++
licence: Other

Creating a TTree

options: view full snippetsend to code collector
// Define some simple structures
typedef struct {Float_t x,y,z;} POINT;
typedef struct {
   Int_t ntrack,nseg,nvertex;
   UInt_t flag;
   Float_t temperature;
} EVENTN;
static POINT point;
static EVENTN eventn;

// Create a ROOT Tree with various different sorts of braanches
TTree *tree = new TTree("T","An example of ROOT tree with a few branches");
tree->Branch("point",&point,"x:y:z");
tree->Branch("eventn",&eventn,"ntrack/I:nseg:nvertex:flag/i:temperature/F");
tree->Branch("hpx","TH1F",&hpx,128000,0);
	
(Continues...)