X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=EVGEN%2FAliGenBox.cxx;h=46c3b9781fa25196e75983f1b4013a32fa02c83f;hp=f0edfd32f91ea7dc45e1192def3d8bc0284eaa84;hb=c50f9dc05854174683012ad3475017dd15480a47;hpb=65fb704d5a3c40dcad260b5c6ceb87aaa8697172 diff --git a/EVGEN/AliGenBox.cxx b/EVGEN/AliGenBox.cxx index f0edfd32f91..46c3b9781fa 100644 --- a/EVGEN/AliGenBox.cxx +++ b/EVGEN/AliGenBox.cxx @@ -13,83 +13,45 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.3 2000/10/02 21:28:06 fca -Removal of useless dependecies via forward declarations - -Revision 1.2 2000/07/11 18:24:55 fca -Coding convention corrections + few minor bug fixes - -Revision 1.1 2000/06/09 20:22:58 morsch -Same class as previously in AliSimpleGen.cxx -All coding rule violations except RS3 corrected (AM) - -*/ - -/* -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 -/* - - -
- -

The responsible person for this module is -Andreas Morsch. - -

-*/
-//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"
+#include "AliGenEventHeader.h"
 
 ClassImp(AliGenBox)
 
 //_____________________________________________________________________________
 AliGenBox::AliGenBox()
-    :AliGenerator()
+    :AliGenerator(), 
+     fIpart(0)
 {
   //
   // Default constructor
   //
-  fIpart=0;
 }
 
 //_____________________________________________________________________________
 AliGenBox::AliGenBox(Int_t npart)
-  :AliGenerator(npart)
+    :AliGenerator(npart),
+     fIpart(kProton)
 {
   //
   // Standard constructor
   //
-  fName="Box";
-  fTitle="Box particle generator";
-  // Generate Proton by default
-  fIpart=kProton;
+  fName  = "Box";
+  fTitle = "Box particle generator";
 }
 
 //_____________________________________________________________________________
@@ -111,12 +73,10 @@ void AliGenBox::Generate()
   //
     for (j=0;j<3;j++) origin[j]=fOrigin[j];
     if(fVertexSmear==kPerEvent) {
-	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]));
-	}
+	Vertex();
+	for (j=0;j<3;j++) origin[j]=fVertex[j];
     }
+
     for(i=0;iSetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
+	PushTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
     }
+
+    AliGenEventHeader* header = new AliGenEventHeader("BOX");
+    header->SetPrimaryVertex(fVertex);
+    gAlice->SetGenEventHeader(header); 
 }
 
 //_____________________________________________________________________________