I have a TClones array of TEventList's called "indlist". I want to make a
new TClonesArray of TEventList called "cumlist" in the following way:
TClonesArray *indlist,*cumlist;
indlist = new TClonesArray("TEventList",NCUT);
cumlist = new TClonesArray("TEventList",NCUT);
Int_t i=0;
TEventList *alist,templist;
TIter next(indlist);
alist = (TEventList *)next();
(*cumlist)[i]= new TEventList(*alist);
templist = *alist;
while(alist = (TEventList *)next()) {
i++;
TEventList lastcum =(*alist)-templist;
(*cumlist)[i]= new TEventList(lastcum);
templist = *alist;
}
After compiling, the code always crashes at the subtraction of the
TEventList's i.e. at "TEventList lastcum =(*alist)-templist;"
How can I get the TEventList subtraction to work? Is it a problem with
memory allocation?
Scott