[Frost] root Trees
Brian Morrison
btmorr at jlab.org
Tue May 11 15:46:54 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):
#define MAX_PARTICLES 20
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();
I've tested and shown that the Ngpid.x[n] and GPID[n].x are identicle for
all itterations, however when it goes to fill I get just a bunch of
garbage once past the pid bank. I can't seem to find many good examples
of this online so I was hoping that one of you may have some experience
with this and be able to point out where I'm going wrong. Thanks.
-Brian
More information about the Frost
mailing list