]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliGenPythia.cxx
- Change of coordinate system (x->-x, z->-z)
[u/mrichter/AliRoot.git] / PYTHIA6 / AliGenPythia.cxx
index 70bab3d1fc0c512d7f7d9a12ca5fc15ab3d11118..549c6ca3066b9f1208020415b74b8f0d0c22e4fc 100644 (file)
 #include "AliPythia.h"
 #include "AliPythiaRndm.h"
 #include "AliRun.h"
+#include "AliStack.h"
+#include "AliRunLoader.h"
 
- ClassImp(AliGenPythia)
+ClassImp(AliGenPythia)
 
 AliGenPythia::AliGenPythia()
                  :AliGenMC()
@@ -56,6 +58,8 @@ AliGenPythia::AliGenPythia()
   SetGammaPhiRange();
   SetGammaEtaRange();
   SetPtKick();
+  SetQuench();
+  
   fSetNuclei = kFALSE;
   if (!AliPythiaRndm::GetPythiaRandom()) 
     AliPythiaRndm::SetPythiaRandom(GetRandom());
@@ -92,6 +96,7 @@ AliGenPythia::AliGenPythia(Int_t npart)
     SetGammaPhiRange();
     SetGammaEtaRange();
     SetJetReconstructionMode();
+    SetQuench();
     SetPtKick();
     // Options determining what to keep in the stack (Heavy flavour generation)
     fStackFillOpt = kFlavorSelection; // Keep particle with selected flavor
@@ -106,6 +111,7 @@ AliGenPythia::AliGenPythia(Int_t npart)
 }
 
 AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
+    :AliGenMC(Pythia)
 {
 // copy constructor
     Pythia.Copy(*this);
@@ -145,7 +151,7 @@ void AliGenPythia::Init()
 // Initialisation
     
     SetMC(AliPythia::Instance());
-    fPythia=(AliPythia*) fgMCEvGen;
+    fPythia=(AliPythia*) fMCEvGen;
 //
     fParentWeight=1./Float_t(fNpart);
 //
@@ -303,7 +309,19 @@ void AliGenPythia::Generate()
 //  event loop    
     while(1)
     {
+       if (fQuench) {
+           fPythia->SetMSTJ(1, 0);
+       }
+
        fPythia->Pyevnt();
+
+       if (fQuench) {
+           fPythia->Quench();
+           fPythia->SetMSTJ(1, 1);
+           fPythia->Pyexec();
+       }
+       
+       
        if (gAlice->GetEvNumber()>=fDebugEventFirst &&
            gAlice->GetEvNumber()<=fDebugEventLast) fPythia->Pylist(1);
        fTrials++;
@@ -514,7 +532,7 @@ void AliGenPythia::Generate()
     } // event loop
     SetHighWaterMark(nt);
 //  adjust weight due to kinematic selection
-    AdjustWeights();
+//    AdjustWeights();
 //  get cross-section
     fXsection=fPythia->GetPARI(1);
 }
@@ -696,6 +714,7 @@ Bool_t AliGenPythia::CheckTrigger(TParticle* jet1, TParticle* jet2)
 AliGenPythia& AliGenPythia::operator=(const  AliGenPythia& rhs)
 {
 // Assignment operator
+    rhs.Copy(*this);
     return *this;
 }
 
@@ -705,12 +724,12 @@ void  AliGenPythia::LoadEvent()
 // Load event into Pythia Common Block
 //
  
-
-    Int_t npart = (Int_t) (gAlice->TreeK())->GetEntries(); 
+    AliRunLoader* rl = AliRunLoader::GetRunLoader();
+    Int_t npart = (rl->Stack())-> GetNprimary();
    (fPythia->GetPyjets())->N = npart;
 
     for (Int_t part = 0; part < npart; part++) {
-       TParticle *MPart = gAlice->Particle(part);
+       TParticle *MPart = (rl->Stack())->Particle(part);
        Int_t kf     = MPart->GetPdgCode();
        Int_t ks     = MPart->GetStatusCode();
        Float_t px = MPart->Px();
@@ -732,8 +751,7 @@ void  AliGenPythia::LoadEvent()
     }
 }
 
-void AliGenPythia::RecJetsUA1(Float_t eCellMin, Float_t eCellSeed, Float_t eMin, Float_t rMax, 
-                             Int_t& njets, Float_t jets [4][50])
+void AliGenPythia::RecJetsUA1(Int_t& njets, Float_t jets [4][50])
 {
 //
 //  Calls the Pythia jet finding algorithm to find jets in the current event