]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
KeepPhysics method called by PurifyKine added (N. Carrer, A.M.)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Apr 2002 11:47:30 +0000 (11:47 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Apr 2002 11:47:30 +0000 (11:47 +0000)
STEER/AliStack.cxx
STEER/AliStack.h

index c51631b5b191f77c1e158269de807af496473326..4794fc4a1b56a3080b57de4c921dfe499d93c0a8 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.19  2002/03/12 11:06:03  morsch
+Add particle status code to argument list of SetTrack(..).
+
 Revision 1.18  2002/02/20 16:14:41  hristov
 fParticleBuffer points to object which doesn't belong to AliStack, do not delete it (J.Chudoba)
 
@@ -84,7 +87,6 @@ New files for folders and Stack
 #include "AliRun.h"
 #include "AliModule.h"
 #include "AliHit.h"
-//#include "ETrackBits.h"
 
 ClassImp(AliStack)
 
@@ -365,7 +367,11 @@ void AliStack::PurifyKine()
     if(i<=fHgwmk) map[i]=i ; 
     else {
       map[i] = -99;
-      if((part=(TParticle*) particles.At(i))) { 
+      if((part=(TParticle*) particles.At(i))) {
+//
+//        Check of this track should be kept for physics reasons 
+         if (KeepPhysics(part)) KeepTrack(i);
+//
           part->ResetBit(kDaughtersBit);
           part->SetFirstDaughter(-1);
           part->SetLastDaughter(-1);
@@ -461,6 +467,34 @@ void AliStack::PurifyKine()
    //   delete [] map;
 }
 
+Bool_t AliStack::KeepPhysics(TParticle* part)
+{
+    //
+    // Some particles have to kept on the stack for reasons motivated
+    // by physics analysis. Decision is put here.
+    //
+    Bool_t keep = kFALSE;
+    //
+    // Keep first-generation daughter from primaries with heavy flavor 
+    //
+    Int_t parent = part->GetFirstMother();
+    if (parent >= 0 && parent <= fHgwmk) {
+       TParticle* father = (TParticle*) Particles()->At(parent);
+       Int_t kf = father->GetPdgCode();
+       kf = TMath::Abs(kf);
+       Int_t kfl = kf;
+       // meson ?
+       if  (kfl > 10) kfl/=100;
+       // baryon
+       if (kfl > 10) kfl/=10;
+       if (kfl > 10) kfl/=10;
+       if (kfl >= 4) {
+           keep = kTRUE;
+       }
+    }
+    return keep;
+}
+
 //_____________________________________________________________________________
 void AliStack::FinishEvent()
 {
@@ -785,7 +819,6 @@ void AliStack::MakeTree(Int_t event, const char *file)
   TBranch *branch=0;
   // Make Kinematics Tree
   char hname[30];
-//    printf("\n MakeTree called %d", event);
   if (!fTreeK) {
     sprintf(hname,"TreeK%d",event);
     fTreeK = new TTree(hname,"Kinematics");
@@ -821,7 +854,6 @@ void AliStack::FinishRun()
     }
 }
 
-//_____________________________________________________________________________
 Bool_t AliStack::GetEvent(Int_t event)
 {
 //
@@ -848,5 +880,3 @@ Bool_t AliStack::GetEvent(Int_t event)
     ResetArrays(size);
     return kTRUE;
 }
-
-//----------------------------------------------------------------------
index eb2bfcb8e7d089b814fbe0cb2ab20d32b541bd46..e46d1994fc275d8f34e2271d59490b60111a1c65 100644 (file)
@@ -72,6 +72,7 @@ class AliStack : public TObject
     void  CleanParents();
     void  ResetArrays(Int_t size);
     TParticle* GetNextParticle();
+    Bool_t KeepPhysics(TParticle* part);
     
   private:
     // data members