]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- SetTrack, KeepTrack and SetHighWaterMark methods added to delegate to local
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Jul 2001 17:13:12 +0000 (17:13 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Jul 2001 17:13:12 +0000 (17:13 +0000)
stack or stack owned by AliRun. (Piotr Skowronski, A.M.)
- Changes needed for afterburners (Piotr Skowronski)

STEER/AliGenerator.cxx
STEER/AliGenerator.h

index 8892df5ec2b6fe1ba6290104be564e15489412b0..a0c1b580eed726dd75be1c63acc5d57290381bdb 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.13  2001/05/16 14:57:22  alibrary
+New files for folders and Stack
+
 Revision 1.12  2001/02/02 11:12:50  morsch
 Add Vertex() method that allows to get vertex from merging manager, if needed.
 
@@ -68,6 +71,8 @@ Introduction of the Copyright and cvs Log
 #include "TGenerator.h"
 #include "AliRun.h"
 #include "AliConfig.h"
+#include "AliStack.h"
+
 
 ClassImp(AliGenerator)
 
@@ -103,6 +108,7 @@ AliGenerator::AliGenerator()
     fVMin[0]=fVMin[1]=fVMin[2]=0;
     fVMax.Set(3);
     fVMax[0]=fVMax[1]=fVMax[2]=10000;
+    fStack = 0;
 }
 
 //____________________________________________________________
@@ -137,7 +143,8 @@ AliGenerator::AliGenerator(Int_t npart)
 
     SetNumberParticles(npart);
 
-    AliConfig::Instance()->Add(this);    
+    AliConfig::Instance()->Add(this);
+    fStack = 0;    
 }
 
 //____________________________________________________________
@@ -322,4 +329,49 @@ void AliGenerator::VertexInternal()
     }
 }
 
+void  AliGenerator::SetTrack(Int_t done, Int_t parent, Int_t pdg,
+                               Float_t *pmom, Float_t *vpos, Float_t *polar,
+                               Float_t tof, AliMCProcess mech, Int_t &ntr,
+                               Float_t weight=1)
+{
+
+  if (fStack)
+    fStack->SetTrack(done, parent, pdg, pmom, vpos, polar, tof,
+                     mech, ntr, weight);
+  else 
+    gAlice->SetTrack(done, parent, pdg, pmom, vpos, polar, tof,
+                     mech, ntr, weight);
+}
+void  AliGenerator::SetTrack(Int_t done, Int_t parent, Int_t pdg,
+                      Double_t px, Double_t py, Double_t pz, Double_t e,
+                      Double_t vx, Double_t vy, Double_t vz, Double_t tof,
+                      Double_t polx, Double_t poly, Double_t polz,
+                      AliMCProcess mech, Int_t &ntr, Float_t weight=1)
+{
+  
+  if (fStack)
+     fStack->SetTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
+                      polx, poly, polz, mech, ntr, weight);
+  else 
+     gAlice->SetTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
+                        polx, poly, polz, mech, ntr, weight);
+}
 
+
+void AliGenerator:: KeepTrack(Int_t itrack)
+{
+  if (fStack)
+     fStack->KeepTrack(itrack);
+  else 
+     gAlice->KeepTrack(itrack);
+   
+}
+
+void AliGenerator:: SetHighWaterMark(Int_t nt)
+{
+  if (fStack)
+     fStack->SetHighWaterMark(nt);
+  else 
+     gAlice->SetHighWaterMark(nt);
+   
+}
index df7cf75f655075e0baa31a62280c037bc7b6386a..19e0ddbcdf6a30d50532f0f1c6284bb93043442c 100644 (file)
 //                                                       //
 ///////////////////////////////////////////////////////////
 
-class TGenerator;
-
 #include "TLorentzVector.h"
 #include "TArrayF.h"
 #include "AliRndm.h"
+#include "AliMCProcess.h"
+class TGenerator;
+class AliStack;
+
 
 typedef enum { kNoSmear, kPerEvent, kPerTrack } VertexSmear_t;
 typedef enum { kExternal, kInternal}            VertexSource_t;
 
+
 class AliGenerator : public TNamed, public AliRndm
 {
 
@@ -68,8 +71,26 @@ class AliGenerator : public TNamed, public AliRndm
     virtual void GetOrigin(TLorentzVector &o) const
        {o[0]=fOrigin.At(0);o[1]=fOrigin.At(1);o[2]=fOrigin.At(2);o[3]=0;}
 
-protected:
-    static TGenerator* fgMCEvGen; // Pointer to the generator
+    virtual void SetNumberOfEvents(Int_t n) {fNumberOfEvents=n;}
+    virtual Int_t GetNumberOfEvents() {return fNumberOfEvents;}
+    void SetStack (AliStack *stack) {fStack = stack;}
+    AliStack* GetStack(){return fStack;}
+// Comminication with stack
+ protected:
+    virtual  void  SetTrack(Int_t done, Int_t parent, Int_t pdg,
+                               Float_t *pmom, Float_t *vpos, Float_t *polar,
+                               Float_t tof, AliMCProcess mech, Int_t &ntr,
+                               Float_t weight=1);
+    virtual  void  SetTrack(Int_t done, Int_t parent, Int_t pdg,
+                      Double_t px, Double_t py, Double_t pz, Double_t e,
+                      Double_t vx, Double_t vy, Double_t vz, Double_t tof,
+                      Double_t polx, Double_t poly, Double_t polz,
+                      AliMCProcess mech, Int_t &ntr, Float_t weight=1);
+    virtual void   KeepTrack(Int_t itrack); 
+    virtual void   SetHighWaterMark(Int_t nt);
+    
+ protected:
+    static  TGenerator* fgMCEvGen; // Pointer to the generator
     Float_t     fThetaMin;     //Minimum theta of generation in radians
     Float_t     fThetaMax;     //Maximum theta of generation in radians
     Float_t     fPhiMin;       //Minimum phi of generation in radians
@@ -85,7 +106,7 @@ protected:
     Int_t       fNpart;        //Maximum number of particles per event
     Float_t     fParentWeight; //Parent Weight
     Float_t     fChildWeight;  //ChildWeight
-    Int_t       fAnalog;       //Flaf for anolog or pt-weighted generation
+    Int_t       fAnalog;       //Flag for anolog or pt-weighted generation
    //
     VertexSmear_t     fVertexSmear;  //Vertex Smearing mode
     VertexSource_t    fVertexSource; //Vertex source (internal/external)    
@@ -93,16 +114,27 @@ protected:
     TArrayF     fOrigin;     // Origin of event
     TArrayF     fOsigma;     // Sigma of the Origin of even
     TArrayF     fVertex;     //! Vertex of current event
-    
+    Int_t fNumberOfEvents;
+    AliStack *fStack;        //! Local pointer to stack
+    Int_t fActiveEvent;      //HBT Processor needs more then one event to do correlations
+                             //Due to complications in fortran, it first calls C routine
+                             //that sets the active event to be read. All alihbtp_gettrack
+                             //are addressed to this event
+     
+    Int_t fNParticles;       //number of particles in current event
+
+    /*************************************************************************/
     enum {kThetaRange    = BIT(14),
          kVertexRange   = BIT(15),
-         kPhiRange      = BIT(16), 
+         kPhiRange      = BIT(16),
          kPtRange       = BIT(17),
-         kYRange        = BIT(18), 
-         kMomentumRange = BIT(19)
+         kYRange        = BIT(18),
+         kMomentumRange = BIT(19)     
     };
-
     ClassDef(AliGenerator,1) // Base class for event generators
 };
 
 #endif
+
+
+