- if ( ! branch ) {
- AliWarning("EMCAL branch in Hit Tree not found") ;
- } else {
- TClonesArray * tmp = new TClonesArray("AliEMCALHit", 1000) ;
- branch->SetAddress(&tmp) ;
- Int_t index = 0 ;
- for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
- branch->GetEntry(ientry) ;
- for (Int_t ihit = 0 ; ihit < tmp->GetEntries() ; ihit++) {
- AliEMCALHit * hit = dynamic_cast<AliEMCALHit *> (tmp->At(ihit)) ;
- new((*hits)[index]) AliEMCALHit(*hit) ;
- index++ ;
- }
- }
- tmp->Delete() ;
- delete tmp ;
- MakeHits(hits) ;
+ if ( ! branch ) { AliWarning("EMCAL branch in Hit Tree not found") ; return;}
+ //
+ branch->SetAddress(&fHitsArray) ;
+ for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
+ branch->GetEntry(ientry) ;
+ MakeHits() ;
+ fHitsArray->Clear() ;