]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenHIJINGpara.cxx
order of filling in 2D hitsos and GetValues mthod correceted
[u/mrichter/AliRoot.git] / EVGEN / AliGenHIJINGpara.cxx
index 53bff6123583cddb143d632cd3b16122c0a64576..438a878efde738e9239bed8055e9160d75a23498 100644 (file)
 
 /*
 $Log$
+Revision 1.9  2001/07/27 17:09:36  morsch
+Use local SetTrack, KeepTrack and SetHighWaterMark methods
+to delegate either to local stack or to stack owned by AliRun.
+(Piotr Skowronski, A.M.)
+
+Revision 1.8  2001/07/20 11:03:58  morsch
+Issue warning message if used outside allowed eta range (-8 to 8).
+
+Revision 1.7  2001/07/17 12:41:01  morsch
+- Calculation of fraction of event corresponding to selected pt-range corrected
+(R. Turrisi)
+- Parent weight corrected.
+
 Revision 1.6  2001/05/16 14:57:10  alibrary
 New files for folders and Stack
 
@@ -59,11 +72,14 @@ All coding rule violations except RS3 corrected (AM)
 ///////////////////////////////////////////////////////////////////
 
 #include "AliGenHIJINGpara.h"
-#include "TF1.h"
+#include "AliGenEventHeader.h"
 #include "AliRun.h"
 #include "AliConst.h"
 #include "AliPDG.h"
 
+#include <TF1.h>
+#include <TArrayF.h>
+
 ClassImp(AliGenHIJINGpara)
 
 AliGenHIJINGpara::AliGenHIJINGpara(const AliGenHIJINGpara & para)
@@ -178,6 +194,7 @@ AliGenHIJINGpara::AliGenHIJINGpara()
     fPtka = 0;
     fETApic = 0;
     fETAkac = 0;
+    SetCutVertexZ();
 }
 
 //_____________________________________________________________________________
@@ -193,6 +210,7 @@ AliGenHIJINGpara::AliGenHIJINGpara(Int_t npart)
     fPtka = 0;
     fETApic = 0;
     fETAkac = 0;
+    SetCutVertexZ();
 }
 
 //_____________________________________________________________________________
@@ -250,7 +268,15 @@ void AliGenHIJINGpara::Init()
     
     printf("%s: The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ", 
           ClassName(),100.*fParentWeight);
-    
+
+// Issue warning message if etaMin or etaMax are outside the alowed range 
+// of the parametrization
+    if (etaMin < -8.001 || etaMax > 8.001) {
+       printf("\n \n WARNING FROM AliGenHIJINGPara !");
+       printf("\n YOU ARE USING THE PARAMETERISATION OUTSIDE ");       
+       printf("\n THE ALLOWED PSEUDORAPIDITY RANGE (-8. - 8.)");           
+       printf("\n YOUR LIMITS: %f %f \n \n ", etaMin, etaMax);
+    }
 }
 
 //_____________________________________________________________________________
@@ -280,13 +306,25 @@ void AliGenHIJINGpara::Generate()
     Float_t random[6];
     //
     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]));
+
+    if(fVertexSmear == kPerEvent) {
+       Float_t dv[3];
+       dv[2] = 1.e10;
+       while(TMath::Abs(dv[2]) > fCutVertexZ*fOsigma[2]) {
+           Rndm(random,6);
+           for (j=0; j < 3; j++) {
+               dv[j] = fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
+                   TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
+           }
        }
-    }
+       for (j=0; j < 3; j++) origin[j] += dv[j];
+    } // if kPerEvent
+    TArrayF eventVertex;
+    eventVertex.Set(3);
+    eventVertex[0] = origin[0];
+    eventVertex[1] = origin[1];
+    eventVertex[2] = origin[2];
+
     for(i=0;i<fNpart;i++) {
        while(1) {
            Rndm(random,3);
@@ -316,10 +354,15 @@ void AliGenHIJINGpara::Generate()
                        TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
                }
            }
-           gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
+           SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
            break;
        }
     }
+// Header
+    AliGenEventHeader* header = new AliGenEventHeader("HIJINGparam");
+// Event Vertex
+    header->SetPrimaryVertex(eventVertex);
+    gAlice->SetGenEventHeader(header); 
 }
 
 AliGenHIJINGpara& AliGenHIJINGpara::operator=(const  AliGenHIJINGpara& rhs)