]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliGenerator.cxx
gAlice replaced by TVirtualMCApplication::Instance()
[u/mrichter/AliRoot.git] / STEER / AliGenerator.cxx
index 44cc80a973112159b82f0c470e1f0921ce24f342..1c17326f09c314df9fd504267532679c2b3df315 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.18  2002/02/18 19:23:00  hristov
-Put protection in the destructor
-
-Revision 1.17  2001/11/26 15:46:35  morsch
-Set default value for vertex truncation in constructor.
-
-Revision 1.16  2001/10/16 08:45:37  morsch
-All vertex truncation and event vertex moved here.
-
-Revision 1.15  2001/07/28 10:43:41  hristov
-Default argument initialised once
-
-Revision 1.14  2001/07/27 17:13:12  morsch
-- SetTrack, KeepTrack and SetHighWaterMark methods added to delegate to local
-stack or stack owned by AliRun. (Piotr Skowronski, A.M.)
-- Changes needed for afterburners (Piotr Skowronski)
-
-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.
-
-Revision 1.11  2001/01/26 19:58:48  hristov
-Major upgrade of AliRoot code
-
-Revision 1.10  2000/12/21 15:30:18  fca
-Correcting coding convention violations
-
-Revision 1.9  2000/10/04 10:08:01  fca
-Correction of minor typing mistakes
-
-Revision 1.8  2000/10/02 21:28:14  fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.7  2000/07/12 08:56:25  fca
-Coding convention correction and warning removal
-
-Revision 1.6  2000/07/11 18:24:59  fca
-Coding convention corrections + few minor bug fixes
-
-Revision 1.5  2000/06/08 13:34:50  fca
-Better control of momentum range in GenBox
-
-Revision 1.4  1999/09/29 09:24:29  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////
 //                                                               //
@@ -83,20 +34,46 @@ Introduction of the Copyright and cvs Log
 //End_Html
 //                                                               //
 ///////////////////////////////////////////////////////////////////
+#include <TGenerator.h>
 
+#include "AliCollisionGeometry.h"
+#include "AliConfig.h"
 #include "AliGenerator.h"
-#include "TGenerator.h"
 #include "AliRun.h"
-#include "AliConfig.h"
 #include "AliStack.h"
 
-
 ClassImp(AliGenerator)
 
 TGenerator* AliGenerator::fgMCEvGen=0;
 
-//____________________________________________________________
-AliGenerator::AliGenerator()
+//_______________________________________________________________________
+AliGenerator::AliGenerator():
+  fThetaMin(0),
+  fThetaMax(0),
+  fPhiMin(0),
+  fPhiMax(0),
+  fPMin(0),
+  fPMax(0),
+  fPtMin(0),
+  fPtMax(0),
+  fYMin(0),
+  fYMax(0),
+  fVMin(3),
+  fVMax(3),
+  fNpart(0),
+  fParentWeight(0),
+  fChildWeight(0),
+  fAnalog(0),
+  fVertexSmear(kNoSmear),
+  fVertexSource(kExternal),
+  fCutVertexZ(0),
+  fTrackIt(0),
+  fOrigin(3),
+  fOsigma(3),
+  fVertex(3),
+  fEventVertex(0),
+  fStack(0),
+  fCollisionGeometry(0)
 {
   //
   // Default constructor
@@ -117,24 +94,42 @@ AliGenerator::AliGenerator()
     SetCutVertexZ();
 
 
-    fOrigin.Set(3);
-    fOsigma.Set(3);
-    fVertex.Set(3);
-
     fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
     fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
     fVertex[0]=fVertex[1]=fVertex[2]=0;
 
-    fVMin.Set(3);
     fVMin[0]=fVMin[1]=fVMin[2]=0;
-    fVMax.Set(3);
     fVMax[0]=fVMax[1]=fVMax[2]=10000;
-    fStack = 0;
 }
 
-//____________________________________________________________
-AliGenerator::AliGenerator(Int_t npart)
-    : TNamed(" "," ")
+//_______________________________________________________________________
+AliGenerator::AliGenerator(Int_t npart):
+  fThetaMin(0),
+  fThetaMax(0),
+  fPhiMin(0),
+  fPhiMax(0),
+  fPMin(0),
+  fPMax(0),
+  fPtMin(0),
+  fPtMax(0),
+  fYMin(0),
+  fYMax(0),
+  fVMin(3),
+  fVMax(3),
+  fNpart(0),
+  fParentWeight(0),
+  fChildWeight(0),
+  fAnalog(0),
+  fVertexSmear(kNoSmear),
+  fVertexSource(kExternal),
+  fCutVertexZ(0),
+  fTrackIt(0),
+  fOrigin(3),
+  fOsigma(3),
+  fVertex(3),
+  fEventVertex(0),
+  fStack(0),
+  fCollisionGeometry(0)
 {
   //
   // Standard constructor
@@ -153,27 +148,47 @@ AliGenerator::AliGenerator(Int_t npart)
     SetTrackingFlag();
     SetCutVertexZ();
 
-    fOrigin.Set(3);
-    fOsigma.Set(3);
-    fVertex.Set(3);
-
     fOrigin[0]=fOrigin[1]=fOrigin[2]=0;
     fOsigma[0]=fOsigma[1]=fOsigma[2]=0;
     fVertex[0]=fVertex[1]=fVertex[2]=0;
 
-    fVMin.Set(3);
     fVMin[0]=fVMin[1]=fVMin[2]=0;
-    fVMax.Set(3);
     fVMax[0]=fVMax[1]=fVMax[2]=10000;
 
     SetNumberParticles(npart);
 
     AliConfig::Instance()->Add(this);
-    fStack = 0;    
 }
 
-//____________________________________________________________
-AliGenerator::AliGenerator(const AliGenerator &gen) : TNamed(" "," ")
+//_______________________________________________________________________
+AliGenerator::AliGenerator(const AliGenerator &gen): 
+  TNamed(gen),
+  AliRndm(gen),
+  fThetaMin(0),
+  fThetaMax(0),
+  fPhiMin(0),
+  fPhiMax(0),
+  fPMin(0),
+  fPMax(0),
+  fPtMin(0),
+  fPtMax(0),
+  fYMin(0),
+  fYMax(0),
+  fVMin(3),
+  fVMax(3),
+  fNpart(0),
+  fParentWeight(0),
+  fChildWeight(0),
+  fAnalog(0),
+  fVertexSmear(kNoSmear),
+  fVertexSource(kExternal),
+  fCutVertexZ(0),
+  fTrackIt(0),
+  fOrigin(3),
+  fOsigma(3),
+  fVertex(3),
+  fEventVertex(0),
+  fStack(0)
 {
   //
   // Copy constructor
@@ -181,7 +196,7 @@ AliGenerator::AliGenerator(const AliGenerator &gen) : TNamed(" "," ")
   gen.Copy(*this);
 }
 
-//____________________________________________________________
+//_______________________________________________________________________
 AliGenerator & AliGenerator::operator=(const AliGenerator &gen)
 {
   //
@@ -191,7 +206,7 @@ AliGenerator & AliGenerator::operator=(const AliGenerator &gen)
   return (*this);
 }
 
-//____________________________________________________________
+//_______________________________________________________________________
 void AliGenerator::Copy(AliGenerator &/* gen */) const
 {
   //
@@ -200,7 +215,7 @@ void AliGenerator::Copy(AliGenerator &/* gen */) const
   Fatal("Copy","Not implemented!\n");
 }
 
-//____________________________________________________________
+//_______________________________________________________________________
 AliGenerator::~AliGenerator()
 {
   //
@@ -214,6 +229,7 @@ AliGenerator::~AliGenerator()
   }
 }
 
+//_______________________________________________________________________
 void AliGenerator::Init()
 {   
   //
@@ -334,7 +350,7 @@ void AliGenerator::Vertex()
     }
 }
 
-
+//_______________________________________________________________________
 void AliGenerator::VertexExternal()
 {
     // Dummy !!!!!!
@@ -345,6 +361,7 @@ void AliGenerator::VertexExternal()
     fVertex[0]=fVertex[1]=fVertex[2]=0;  
 }
 
+//_______________________________________________________________________
 void AliGenerator::VertexInternal()
 {
     // 
@@ -359,11 +376,15 @@ 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 tof, TMCProcess mech, Int_t &ntr,
                                Float_t weight, Int_t is)
 {
+  //
+  // Loads one track on the stack
+  //
 
   if (fStack)
     fStack->SetTrack(done, parent, pdg, pmom, vpos, polar, tof,
@@ -372,12 +393,17 @@ void  AliGenerator::SetTrack(Int_t done, Int_t parent, Int_t pdg,
     gAlice->SetTrack(done, parent, pdg, pmom, vpos, polar, tof,
                      mech, ntr, weight, is);
 }
+
+//_______________________________________________________________________
 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, Int_t is)
+                      TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
 {
+  //
+  // Loads one track on the stack
+  //
   
   if (fStack)
      fStack->SetTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
@@ -388,8 +414,12 @@ void  AliGenerator::SetTrack(Int_t done, Int_t parent, Int_t pdg,
 }
 
 
+//_______________________________________________________________________
 void AliGenerator:: KeepTrack(Int_t itrack)
 {
+  //
+  // Declare a track permanent on the stack
+  //
   if (fStack)
      fStack->KeepTrack(itrack);
   else 
@@ -397,8 +427,12 @@ void AliGenerator:: KeepTrack(Int_t itrack)
    
 }
 
+//_______________________________________________________________________
 void AliGenerator:: SetHighWaterMark(Int_t nt)
 {
+  //
+  // Internal function to set the maximum index used in the stack
+  //
   if (fStack)
      fStack->SetHighWaterMark(nt);
   else