Hi Mario,
oops, I meant to answer your email, but forgot. There is already a
similar tutorial on that, see
http://root.cern.ch/root/html/examples/eventa.cxx.html
But it needs an update; I try to get that done.
Axel.
Mario Kadastik wrote:
> Well I managed to get what I wanted. Namely:
>
> TFile f("higgs.root");
> TTree *t = (TTree*)f.Get("particles");
> TClonesArray *part=0;
> TMCParticle *p=0;
> Int_t i=0,j=0;
> t->SetBranchAddress("particles",&part);
> for (i=0; i<t->GetEntries(); i++) {
> t->GetEntry(i);
> for (j=0;j<part->GetEntries();j++) {
> p=(TMCParticle*)part->At(j);
> // here p contains particle nr j from run i.
> printf("Run: %d, Particle nr %d is %s\n",i,j,p->GetName());
> }
> }
>
> Maybe a similiar sample should be added to the tutorial/howto part?
>
> Mario
>
> Mario Kadastik wrote:
>
> > >Received on Mon Feb 14 2005 - 21:32:55 MET
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET