Vertex() generation in the standard way.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Dec 2003 11:42:28 +0000 (11:42 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Dec 2003 11:42:28 +0000 (11:42 +0000)
PYTHIA6/AliGenPythia.cxx

index b5210c1..3406499 100644 (file)
@@ -298,16 +298,11 @@ void AliGenPythia::Generate()
     Int_t jev=0;
     Int_t j, kf;
     fTrials=0;
+    
 
     //  Set collision vertex position 
-    if(fVertexSmear==kPerEvent) {
-       fPythia->SetMSTP(151,1);
-       for (j=0;j<3;j++) {
-           fPythia->SetPARP(151+j, fOsigma[j]*10.);
-       }
-    } else if (fVertexSmear==kPerTrack) {
-       fPythia->SetMSTP(151,0);
-    }
+    if (fVertexSmear == kPerEvent) Vertex();
+    
 //  event loop    
     while(1)
     {
@@ -338,14 +333,8 @@ void AliGenPythia::Generate()
        
        Int_t np = fParticles->GetEntriesFast();
        if (np == 0 ) continue;
-// Get event vertex and discard the event if the Z coord. is too big   
-       TParticle *iparticle = (TParticle *) fParticles->At(0);
-       Float_t distz = iparticle->Vz()/10.;
-       if(TMath::Abs(distz)>fCutVertexZ*fOsigma[2]) continue;
 //
-       fVertex[0] = iparticle->Vx()/10.+fOrigin.At(0);
-       fVertex[1] = iparticle->Vy()/10.+fOrigin.At(1);
-       fVertex[2] = iparticle->Vz()/10.+fOrigin.At(2);
+       
 //
        Int_t* pParent   = new Int_t[np];
        Int_t* pSelected = new Int_t[np];
@@ -364,7 +353,7 @@ void AliGenPythia::Generate()
            fProcess != kPyMbNonDiffr) {
            
            for (i = 0; i<np; i++) {
-               iparticle = (TParticle *) fParticles->At(i);
+               TParticle* iparticle = (TParticle *) fParticles->At(i);
                Int_t ks = iparticle->GetStatusCode();
                kf = CheckPDGCode(iparticle->GetPdgCode());
 // No initial state partons
@@ -485,9 +474,10 @@ void AliGenPythia::Generate()
                    p[2] = iparticle->Pz();
                    p[3] = iparticle->Energy();
                    
-                   origin[0] = fOrigin[0]+iparticle->Vx()/10.;
-                   origin[1] = fOrigin[1]+iparticle->Vy()/10.;
-                   origin[2] = fOrigin[2]+iparticle->Vz()/10.;
+                   origin[0] = fVertex[0]+iparticle->Vx()/10; // [cm]
+                   origin[1] = fVertex[1]+iparticle->Vy()/10; // [cm]
+                   origin[2] = fVertex[2]+iparticle->Vz()/10; // [cm]
+                   
                    Float_t tof   = kconv*iparticle->T();
                    Int_t ipa     = iparticle->GetFirstMother()-1;
                    Int_t iparent = (ipa > -1) ? pParent[ipa] : -1;
@@ -589,9 +579,10 @@ Int_t  AliGenPythia::GenerateMB()
            p[2] = iparticle->Pz();
            p[3] = iparticle->Energy();
            
-           origin[0] = fOrigin[0]+iparticle->Vx()/10.;
-           origin[1] = fOrigin[1]+iparticle->Vy()/10.;
-           origin[2] = fOrigin[2]+iparticle->Vz()/10.;
+           origin[0] = fVertex[0]+iparticle->Vx()/10; // [cm]
+           origin[1] = fVertex[1]+iparticle->Vy()/10; // [cm]
+           origin[2] = fVertex[2]+iparticle->Vz()/10; // [cm]
+           
            Float_t tof=kconv*iparticle->T();
 
            PushTrack(fTrackIt*trackIt, iparent, kf,