- LoadEvent with stack as argument.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Apr 2004 06:52:54 +0000 (06:52 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Apr 2004 06:52:54 +0000 (06:52 +0000)
- Quenching configuration.

PYTHIA6/AliGenPythia.cxx
PYTHIA6/AliGenPythia.h

index 3406499d1098e1e9031c77964c8520d3a98ff44a..7bf221fc0ab5554a684cbaca15aac62e7b4843f5 100644 (file)
@@ -280,6 +280,11 @@ void AliGenPythia::Init()
        fDyBoost = 0;
        Warning("Init","SetNuclei used. Use SetProjectile + SetTarget instead. fDyBoost has been reset to 0\n");
     }
+
+    if (fQuench) {
+       fPythia->InitQuenching(0., 0.1, 1., 8., 0);
+    }
+    
 }
 
 void AliGenPythia::Generate()
@@ -306,15 +311,28 @@ void AliGenPythia::Generate()
 //  event loop    
     while(1)
     {
+//
+// If quenching option has been selected switch off fragmentation first
+//
        if (fQuench) {
            fPythia->SetMSTJ(1, 0);
        }
+//
+// Produce event
+//
        fPythia->Pyevnt();
-
        if (fQuench) {
+//
+//  Run quenching routine 
+//
            fPythia->Quench();
+//
+// Switch fragmentation on
            fPythia->SetMSTJ(1, 1);
+//
+// .. and perform fragmentation
            fPythia->Pyexec();
+
        }
        
        if (gAlice) {
@@ -324,7 +342,6 @@ void AliGenPythia::Generate()
        
        fTrials++;
        fPythia->ImportParticles(fParticles,"All");
-
        Boost();
 //
 //
@@ -381,21 +398,21 @@ void AliGenPythia::Generate()
                Bool_t flavorOK = kFALSE;
                Bool_t selectOK = kFALSE;
                if (fFeedDownOpt) {
-                 if (kfl >= fFlavorSelect) flavorOK = kTRUE;
+                   if (kfl >= fFlavorSelect) flavorOK = kTRUE;
                } else {
-                 if (kfl > fFlavorSelect) {
-                   nc = -1;
-                   break;
-                 }
-                 if (kfl == fFlavorSelect) flavorOK = kTRUE;
+                   if (kfl > fFlavorSelect) {
+                       nc = -1;
+                       break;
+                   }
+                   if (kfl == fFlavorSelect) flavorOK = kTRUE;
                }
                switch (fStackFillOpt) {
                case kFlavorSelection:
-                 selectOK = kTRUE;
-                 break;
+                   selectOK = kTRUE;
+                   break;
                case kParentSelection:
-                 if (ParentSelected(kf) || kf <= 10) selectOK = kTRUE;
-                 break;
+                   if (ParentSelected(kf) || kf <= 10) selectOK = kTRUE;
+                   break;
                }
                if (flavorOK && selectOK) { 
 //
@@ -725,20 +742,30 @@ AliGenPythia& AliGenPythia::operator=(const  AliGenPythia& rhs)
     return *this;
 }
 
-void  AliGenPythia::LoadEvent()
+void  AliGenPythia::LoadEvent(AliStack* stack, Int_t flag)
 {
 //
 // Load event into Pythia Common Block
 //
  
-    AliRunLoader* rl = AliRunLoader::GetRunLoader();
-    Int_t npart = (rl->Stack())-> GetNprimary();
-   (fPythia->GetPyjets())->N = npart;
-
+//    AliRunLoader* rl = AliRunLoader::GetRunLoader();
+    Int_t npart = stack -> GetNprimary();
+    Int_t n0 = 0;
+    
+    if (!flag) {
+       (fPythia->GetPyjets())->N = npart;
+    } else {
+       n0 = (fPythia->GetPyjets())->N;
+       (fPythia->GetPyjets())->N = n0 + npart;
+    }
+    
+    
     for (Int_t part = 0; part < npart; part++) {
-       TParticle *MPart = (rl->Stack())->Particle(part);
+       TParticle *MPart = stack->Particle(part);
+       
        Int_t kf     = MPart->GetPdgCode();
        Int_t ks     = MPart->GetStatusCode();
+       
        Float_t px = MPart->Px();
        Float_t py = MPart->Py();
        Float_t pz = MPart->Pz();
@@ -746,14 +773,14 @@ void  AliGenPythia::LoadEvent()
        Float_t m  = MPart->GetCalcMass();
        
        
-       (fPythia->GetPyjets())->P[0][part] = px;
-       (fPythia->GetPyjets())->P[1][part] = py;
-       (fPythia->GetPyjets())->P[2][part] = pz;
-       (fPythia->GetPyjets())->P[3][part] = e;
-       (fPythia->GetPyjets())->P[4][part] = m;
+       (fPythia->GetPyjets())->P[0][part+n0] = px;
+       (fPythia->GetPyjets())->P[1][part+n0] = py;
+       (fPythia->GetPyjets())->P[2][part+n0] = pz;
+       (fPythia->GetPyjets())->P[3][part+n0] = e;
+       (fPythia->GetPyjets())->P[4][part+n0] = m;
        
-       (fPythia->GetPyjets())->K[1][part] = kf;
-       (fPythia->GetPyjets())->K[0][part] = ks;
+       (fPythia->GetPyjets())->K[1][part+n0] = kf;
+       (fPythia->GetPyjets())->K[0][part+n0] = ks;
     }
 }
 
index 5b58303d3e3d1a83ebcd2160fbe98cb38eb101dc..9552833854015e7dfcb087d8288fa73c189370b6 100644 (file)
@@ -21,7 +21,7 @@
 class AliPythia;
 class TParticle;
 class AliGenPythiaEventHeader;
-
+class AliStack;
 class AliGenPythia : public AliGenMC
 {
  public:
@@ -98,7 +98,7 @@ class AliGenPythia : public AliGenMC
                             Float_t thresh = 0., Float_t etseed = 4.,
                             Float_t minet = 10., Float_t r = 1.);
     
-    void LoadEvent();
+    void LoadEvent(AliStack* stack, Int_t flag = 0);
     // Getters
     virtual Process_t    GetProcess() {return fProcess;}
     virtual StrucFunc_t  GetStrucFunc() {return fStrucFunc;}