Use bit 14 of TParticle to flag tracks that have been transported.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Aug 2007 18:03:47 +0000 (18:03 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Aug 2007 18:03:47 +0000 (18:03 +0000)
This makes the synchronization between TreeTR and TreeK more robust.

STEER/AliMC.cxx
STEER/AliStack.cxx
STEER/AliStack.h

index a5b153e063a5295919297a55861210ee4331eaf7..c50793860a9ca1f8ad11f690a001b65ae4212e9e 100644 (file)
@@ -1251,7 +1251,8 @@ void AliMC::ReorderAndExpandTreeTR()
        // Skip primaries that have not been transported
        Int_t dau1  = part->GetFirstDaughter();
        Int_t dau2  = -1;
-       if ((dau1 > -1 && dau1 < np) || part->GetStatusCode() > 1) continue;
+       // if ((dau1 > -1 && dau1 < np) || part->GetStatusCode() > 1) continue;
+       if (!part->TestBit(kTransportBit)) continue;
        //
        fTmpTreeTR->GetEntry(it++);
        Int_t nh = fTmpTrackReferences->GetEntries();
@@ -1302,7 +1303,9 @@ void AliMC::ReorderAndExpandTreeTR()
     it = nt - 1;
     for (Int_t ip = 0; ip < np; ip++) {
        TParticle* part = stack->Particle(ip);
-       if ((part->GetFirstDaughter() == -1 && part->GetStatusCode() <= 1) || part->GetFirstDaughter() >= np) {
+//     if ((part->GetFirstDaughter() == -1 && part->GetStatusCode() <= 1) || part->GetFirstDaughter() >= np) 
+       if (part->TestBit(kTransportBit));
+       {
            // Skip particles that have not been transported
            fTmpTreeTR->GetEntry(it--);
            Int_t nh = fTmpTrackReferences->GetEntries();
index 185b6c7894e4b796e9d5d99cf60aff33f9fc3988..d6e4f9a0b0a317b9cc770bdcc51a5c4a2214e02b 100644 (file)
@@ -216,7 +216,15 @@ void AliStack::PushTrack(Int_t done, Int_t parent, Int_t pdg,
   particle->SetWeight(weight);
   particle->SetUniqueID(mech);
 
-  if(!done) particle->SetBit(kDoneBit);
+  
+  
+  if(!done) {
+      particle->SetBit(kDoneBit);
+  } else {
+      particle->SetBit(kTransportBit);
+  }
+  
+  
 
   //  Declare that the daughter information is valid
   particle->SetBit(kDaughtersBit);
index 2b204fb7d69de18ed0e0f473a26b93c28e0359d9..2189820578257498f29cc3fe90f572b4ee6aef0c 100644 (file)
@@ -21,7 +21,7 @@ class TTree;
 class AliHeader;
 #include "AliConfig.h"
 
-enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
+enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4, kTransportBit=BIT(14)};
 
 class AliStack : public TVirtualMCStack
 {