groups

name language licence
Installing an RPM Shell Other
Creating a TTree C++ Other
Untitled Snippet Other Other
Chemical equation tricks Latex Other
Untitled Snippet Other Other
To find the yum package containing a file Shell Other
Roman in math mode Latex Other
Untitled Snippet Other

< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 >



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...)