]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Possibility for vertex distribution truncation.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Oct 2001 16:44:46 +0000 (16:44 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Oct 2001 16:44:46 +0000 (16:44 +0000)
- Write mc header with vertex position.

EVGEN/AliGenHIJINGpara.cxx
EVGEN/AliGenHIJINGpara.h

index cae12bbac38f5360ea1610d4b18e2086c5b8d2c5..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).
 
@@ -67,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)
@@ -186,6 +194,7 @@ AliGenHIJINGpara::AliGenHIJINGpara()
     fPtka = 0;
     fETApic = 0;
     fETAkac = 0;
+    SetCutVertexZ();
 }
 
 //_____________________________________________________________________________
@@ -201,6 +210,7 @@ AliGenHIJINGpara::AliGenHIJINGpara(Int_t npart)
     fPtka = 0;
     fETApic = 0;
     fETAkac = 0;
+    SetCutVertexZ();
 }
 
 //_____________________________________________________________________________
@@ -296,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);
@@ -336,6 +358,11 @@ void AliGenHIJINGpara::Generate()
            break;
        }
     }
+// Header
+    AliGenEventHeader* header = new AliGenEventHeader("HIJINGparam");
+// Event Vertex
+    header->SetPrimaryVertex(eventVertex);
+    gAlice->SetGenEventHeader(header); 
 }
 
 AliGenHIJINGpara& AliGenHIJINGpara::operator=(const  AliGenHIJINGpara& rhs)
index db17176bf2d710f600894448f4fe57f2ed935f19..328187776a1447b0022fed1d3a5d49f6d086971e 100644 (file)
@@ -21,17 +21,18 @@ class AliGenHIJINGpara : public AliGenerator
   AliGenHIJINGpara(const AliGenHIJINGpara &HIJINGpara);
      
   virtual ~AliGenHIJINGpara();
+  virtual void SetCutVertexZ(Float_t cut=999999.) {fCutVertexZ = cut;}
   virtual void Generate();
   virtual void Init();
   AliGenHIJINGpara & operator=(const AliGenHIJINGpara & rhs);
  protected:
+  Float_t fCutVertexZ; // Vertex truncation
+  TF1* fPtpi;          // Parametrised pt distribution for pi
+  TF1* fPtka;          // Parametrised pt distribution for ka
+  TF1* fETApic;        // Parametrised eta distribution for pi
+  TF1* fETAkac;        // Parametrised eta distribution fro ka
 
-  TF1* fPtpi; // Parametrised pt distribution for pi
-  TF1* fPtka; // Parametrised pt distribution for ka
-  TF1* fETApic; // Parametrised eta distribution for pi
-  TF1* fETAkac; // Parametrised eta distribution fro ka
-
-  ClassDef(AliGenHIJINGpara,1) // Hijing parametrisation generator
+  ClassDef(AliGenHIJINGpara,2) // Hijing parametrisation generator
 };
 #endif