}
//_____________________________________________________________________________
-void AliStack::PurifyKine()
+Bool_t AliStack::PurifyKine()
{
//
// Compress kinematic tree keeping only flagged particles
//
TObjArray &particles = *fParticleMap;
- int nkeep=fHgwmk+1, parent, i;
+ int nkeep = fHgwmk + 1, parent, i;
TParticle *part, *father;
fTrackLabelMap.Set(particles.GetLast()+1);
// Save in Header total number of tracks before compression
// If no tracks generated return now
- if(fHgwmk+1 == fNtrack) return;
+ if(fHgwmk+1 == fNtrack) return kFALSE;
// First pass, invalid Daughter information
for(i=0; i<fNtrack; i++) {
// Second pass, build map between old and new numbering
for(i=fHgwmk+1; i<fNtrack; i++) {
if(particles.At(i)->TestBit(kKeepBit)) {
-
// This particle has to be kept
fTrackLabelMap[i]=nkeep;
// If old and new are different, have to move the pointer
if(i!=nkeep) particles[nkeep]=particles.At(i);
part = dynamic_cast<TParticle*>(particles.At(nkeep));
-
// as the parent is always *before*, it must be already
// in place. This is what we are checking anyway!
if((parent=part->GetFirstMother())>fHgwmk)
if(fTrackLabelMap[parent]==-99) Fatal("PurifyKine","fTrackLabelMap[%d] = -99!\n",parent);
else part->SetFirstMother(fTrackLabelMap[parent]);
-
nkeep++;
}
}
particles[i]=fParticleBuffer=0;
}
- for (i=nkeep; i<fNtrack; ++i) particles[i]=0;
+ for (i = nkeep; i < fNtrack; ++i) particles[i]=0;
Int_t toshrink = fNtrack-fHgwmk-1;
fLoadPoint-=toshrink;
-
for(i=fLoadPoint; i<fLoadPoint+toshrink; ++i) fParticles->RemoveAt(i);
fNtrack=nkeep;
fHgwmk=nkeep-1;
+ return kTRUE;
}
-void AliStack::ReorderKine()
+
+Bool_t AliStack::ReorderKine()
{
//
// In some transport code children might not come in a continuous sequence.
// In this case the stack has to be reordered in order to establish the
// mother daughter relation using index ranges.
//
- if(fHgwmk+1 == fNtrack) return;
+ if(fHgwmk+1 == fNtrack) return kFALSE;
//
// Howmany secondaries have been produced ?
//
// Reset LoadPoint
//
- fLoadPoint = fHgwmk + 1;
+ Int_t loadPoint = fHgwmk + 1;
//
// Re-Push particles into stack
// The outer loop is over parents, the inner over children.
Int_t jpa = tmp[j]->GetFirstMother();
// Check if daughter of current parent
if (jpa == ipa) {
- particles[fLoadPoint] = tmp[j];
+ particles[loadPoint] = tmp[j];
// Re-establish daughter information
- parP->SetLastDaughter(fLoadPoint);
- if (parP->GetFirstDaughter() == -1) parP->SetFirstDaughter(fLoadPoint);
+ parP->SetLastDaughter(loadPoint);
+ if (parP->GetFirstDaughter() == -1) parP->SetFirstDaughter(loadPoint);
// Set Mother information
if (i != -1) {
tmp[j]->SetFirstMother(map1[i]);
}
// Build the map
- map1[j] = fLoadPoint;
+ map1[j] = loadPoint;
// Increase load point
- fLoadPoint++;
+ loadPoint++;
}
} // children
} // parents
}
}
} // new particles poduced
+
+ return kTRUE;
}
Bool_t AliStack::KeepPhysics(TParticle* part)
//
Clean(size);
-
+ delete fParticleBuffer; fParticleBuffer = 0;
fTreeK = 0x0;
}