Correction to the previous commit
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Jun 2013 19:45:54 +0000 (19:45 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Jun 2013 19:45:54 +0000 (19:45 +0000)
EVGEN/AliGenSlowNucleons.cxx
EVGEN/AliGenSlowNucleons.h

index 9567e56..5603312 100644 (file)
@@ -35,6 +35,8 @@
 #include "AliConst.h"
 #include "AliCollisionGeometry.h"
 #include "AliStack.h"
+#include "AliRun.h"
+#include "AliMC.h"
 #include "AliGenSlowNucleons.h"
 #include "AliSlowNucleonModel.h"
 
@@ -216,7 +218,7 @@ void AliGenSlowNucleons::Generate()
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
                 time, kPNoProcess, nt, 1.,-2);
        KeepTrack(nt);
-       GetStack()->Particle(nt)->SetUniqueID(kGrayProcess);
+       SetProcessID(nt,kGrayProcess);
     }
 //
 //  Gray neutrons
@@ -229,7 +231,7 @@ void AliGenSlowNucleons::Generate()
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
                 time, kPNoProcess, nt, 1.,-2);
        KeepTrack(nt);
-       GetStack()->Particle(nt)->SetUniqueID(kGrayProcess);
+       SetProcessID(nt,kGrayProcess);
     }
 //
 //  Black protons
@@ -241,7 +243,7 @@ void AliGenSlowNucleons::Generate()
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
                 time, kPNoProcess, nt, 1.,-1);
        KeepTrack(nt);
-       GetStack()->Particle(nt)->SetUniqueID(kBlackProcess);
+       SetProcessID(nt,kBlackProcess);
     }
 //
 //  Black neutrons
@@ -253,7 +255,7 @@ void AliGenSlowNucleons::Generate()
        PushTrack(fTrackIt, -1, kf, p, origin, polar,
                 time, kPNoProcess, nt, 1.,-1);
        KeepTrack(nt);
-       GetStack()->Particle(nt)->SetUniqueID(kBlackProcess);
+       SetProcessID(nt,kBlackProcess);
     }
 }
 
@@ -429,3 +431,13 @@ void  AliGenSlowNucleons::AddAngle(Double_t theta1, Double_t phi1,
   angleSum[1] = fisum;
 }  
 
+//_____________________________________________________________________________
+void AliGenSlowNucleons::SetProcessID(Int_t nt, UInt_t process)
+{
+  // Tag the particle as
+  // gray or black
+  if (fStack)
+    fStack->Particle(nt)->SetUniqueID(process);
+  else 
+    gAlice->GetMCApp()->Particle(nt)->SetUniqueID(process);
+}
index b663269..b6bdd9a 100644 (file)
@@ -63,6 +63,7 @@ public:
     void     BeamCrossDivergence(Int_t iwhat, Float_t *pLab);;
     void     AddAngle(Double_t theta1, Double_t phi1, Double_t theta2,
                        Double_t phi2, Double_t *angle);
+    void     SetProcessID(Int_t nt, UInt_t process);
  protected:
     Float_t  fCMS;             // Center of mass energy
     Double_t fMomentum;        // Target nucleus momentum