]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenBox.cxx
Coding rule violations corrected.
[u/mrichter/AliRoot.git] / EVGEN / AliGenBox.cxx
index 52cc3101356511fa580fb3da2807d013c7083a6c..ebe0548d5e33d648092e5357b8a7e3d9ed8b17bb 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-*/
-
-/*
-Old Log:
-Revision 1.8  2000/06/08 13:34:50  fca
-Better control of momentum range in GenBox
-
-Revision 1.7  2000/06/07 16:29:58  fca
-Adding check for pt range in AliGenBox
-
-Revision 1.6  1999/11/03 17:43:20  fca
-New version from G.Martinez & A.Morsch
-
-Revision 1.5  1999/09/29 09:24:14  fca
-Introduction of the Copyright and cvs Log
-*/
-
-///////////////////////////////////////////////////////////////////
-//                                                               //
-//    Generate the final state of the interaction as the input   //
-//    to the MonteCarlo                                          //
-//
-//Begin_Html
-/*
-<img src="picts/AliGeneratorClass.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
-</font>
-<pre>
-*/
-//End_Html
-//                                                               //
-///////////////////////////////////////////////////////////////////
+/* $Id$ */
 
+
+// Generator for particles in a preset
+// kinematic range (flat distribution)
+// Note that for a given theta pt and p are not independent 
+// Range for only one variable (pt or p) should be given.
+// Comments and suggestions: andreas.morsch@cern.ch
+
+
+#include "TPDGCode.h"
+
+#include "AliConst.h"
 #include "AliGenBox.h"
 #include "AliRun.h"
-#include "AliConst.h"
-#include "AliPDG.h"
 
 ClassImp(AliGenBox)
 
@@ -76,8 +48,8 @@ AliGenBox::AliGenBox(Int_t npart)
   //
   // Standard constructor
   //
-  fName="Box";
-  fTitle="Box particle generator";
+  fName  = "Box";
+  fTitle = "Box particle generator";
   // Generate Proton by default
   fIpart=kProton;
 }
@@ -100,15 +72,13 @@ void AliGenBox::Generate()
     Float_t random[6];
   //
     for (j=0;j<3;j++) origin[j]=fOrigin[j];
-    if(fVertexSmear==perEvent) {
-       gMC->Rndm(random,6);
-       for (j=0;j<3;j++) {
-           origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
-               TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
-       }
+    if(fVertexSmear==kPerEvent) {
+       Vertex();
+       for (j=0;j<3;j++) origin[j]=fVertex[j];
     }
+
     for(i=0;i<fNpart;i++) {
-       gMC->Rndm(random,3);
+       Rndm(random,3);
        theta=fThetaMin+random[0]*(fThetaMax-fThetaMin);
        if(TestBit(kMomentumRange)) {
            pmom=fPMin+random[1]*(fPMax-fPMin);
@@ -123,14 +93,14 @@ void AliGenBox::Generate()
        p[1] = pt*TMath::Sin(phi);
        p[2] = pmom*TMath::Cos(theta);
 
-       if(fVertexSmear==perTrack) {
-           gMC->Rndm(random,6);
+       if(fVertexSmear==kPerTrack) {
+           Rndm(random,6);
            for (j=0;j<3;j++) {
                origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
                    TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
            }
        }
-       gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
+       PushTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
     }
 }