Keep products of decay(cascades) of primary particles on the stack.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Jan 2011 20:16:49 +0000 (20:16 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Jan 2011 20:16:49 +0000 (20:16 +0000)
STEER/AliStack.cxx

index 273ef78..897f1d7 100644 (file)
@@ -314,6 +314,7 @@ Bool_t AliStack::PurifyKine()
          if((part=GetParticleMapEntry(i))) {
 //
 //        Check of this track should be kept for physics reasons 
+           printf("KeepPhysics %5d %5d \n", i, part->GetPdgCode());
              if (KeepPhysics(part)) KeepTrack(i);
 //
              part->ResetBit(kDaughtersBit);
@@ -513,7 +514,20 @@ Bool_t AliStack::KeepPhysics(const TParticle* part)
        //
        // e+e- from pair production of primary gammas
        //
-       if ((part->GetUniqueID()) == kPPair) keep = kTRUE;
+       if ((part->GetUniqueID()) == kPPair)  keep = kTRUE;
+    }
+    //
+    // Decay(cascade) from primaries
+    // 
+    if ((part->GetUniqueID() == kPDecay) && (parent >= 0)) {
+      // Particles from decay
+      TParticle* father = GetParticleMapEntry(parent);
+      Int_t imo = parent;
+      while((imo > fHgwmk) && (father->GetUniqueID() == kPDecay)) {
+       father = GetParticleMapEntry(imo);
+       imo =  father->GetFirstMother();
+      }
+      if (imo <= fHgwmk) keep = kTRUE;
     }
     return keep;
 }