Store all the particles in the stack, but track only the selected ones
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Jun 2003 14:08:38 +0000 (14:08 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Jun 2003 14:08:38 +0000 (14:08 +0000)
EVGEN/AliGenExtFile.cxx

index 81f0a36d1d824c55ea06fa4c759436c10e7aaacc..e751e34f22452a2f3fe22c420c8e438bf2f8d96a 100644 (file)
@@ -142,7 +142,8 @@ void AliGenExtFile::Generate()
     for (i = 0; i < nTracks; i++) {
 
       TParticle* iparticle = fReader->NextParticle();
-      if (!KinematicSelection(iparticle,0)) {
+      Bool_t selected = KinematicSelection(iparticle,0); 
+      if (!selected) {
        Double_t  pz   = iparticle->Pz();
        Double_t  e    = iparticle->Energy();
        Double_t  y;
@@ -160,7 +161,7 @@ void AliGenExtFile::Generate()
               iparticle->Pt(),
               y);
        //PH    delete iparticle;
-       continue;
+       //      continue;
       }
       p[0] = iparticle->Px();
       p[1] = iparticle->Py();
@@ -176,7 +177,7 @@ void AliGenExtFile::Generate()
       }
       Int_t decayed = iparticle->GetFirstDaughter();
       Int_t doTracking = fTrackIt && (decayed < 0) &&
-                        (TMath::Abs(idpart) > 10);
+                        (TMath::Abs(idpart) > 10) && selected;
       // printf("*** pdg, first daughter, trk = %d, %d, %d\n",
       //   idpart,decayed, doTracking);
       //PH      SetTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);