I have a problem similar to Paul's. I have an event class similar to the
example provided with the Root distribution. With each event I have a
three TClonesArrays containing a number of objects of type Trk, Top, Phy.
I loop over these arrays filling histograms as shown in the frag below.
This takes ages for 10k events, ultimately I will have to do it for many
more than that. I don't understand your suggestion for speeding this
process up.. can you explain in more detail.
much thanks
Sean Kelly
fill(){
Int_t nTrk=0;
Float_t *topPar=0;
topCount->Fill(event->GetNTop());
for (Int_t iTop = 0; iTop < event->GetNTop(); iTop++){
top = (Top*) (*(event->topPtr))[iTop];
chiSqRed->Fill(top->GetRedChiSq());
}
return 1;
}
On Fri, 12 Feb 1999, Rene Brun wrote:
> Paul M. Eugenio wrote:
> >
> > Hi,
> >
> > In a macro I open ROOT file containing a TTree of TOjects, and then I plot some histograms for about 20k events. One of my branch objects contains a pointer to a TClonesArray and when I add code to iterate through the array I find that the processing time increases from seconds to minuets. I created the TBranches with split=1 which (I believe) will create sub branches. Is there a way to speed up the macro by setting some branch address to the TClonesArray?
> >
> > Thanks for any pointers...
> >
>
> Hi Paul,
> Currently you cannot use split mode if one of your branches contains
> a pointer to a TClonesArray. It is our intention to introduce a new
> class
> to allow an efficient implementation.
> For the time being, instead of storing the pointer to the object
> in the TClonesArray, store the index of this object in the array.
> This will be far more efficient both in terms of storage volume
> and speed.
>
> Rene Brun
>