[Frost] root Trees
Brian Morrison
btmorr at jlab.org
Tue May 11 15:43:41 EDT 2010
Hey All,
Just wondering if anyone has any experience working with ROOT Trees. I'm
currently trying to make a branch for the GPID bank and fill it with
arrays of each of the bank values for each event (as shown below):
typedef struct{
int gpidN;
int pid[MAX_PARTICLES];
float x[MAX_PARTICLES];
float y[MAX_PARTICLES];
float z[MAX_PARTICLES];
.
.
.
int Ngrf[MAX_PARTICLES];
} Ngpid_t;
static Ngpid_t Ngpid;
TTree *gpid_tree = new TTree("T","test");
gpid_tree->Branch("Ngpid",&Ngpid,"gpidN/i:pid/i:x/F:y/F:...Ngrf/i");
(in the event loop now)
Ngpid.gpidN = GPID_NH;
for(int n=0;n<GPID_NH;n++){
Ngpid.pid[n] = GPID[n].pid;
Ngpid.x[n] =GPID[n].x;
.
.
.
Ngpid.Ngrf[n] = GPID[n].ngrf;
}
gpid_tree->Fill();
More information about the Frost
mailing list