]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliGenPythia.cxx
Method SetTriggerParticle added.
[u/mrichter/AliRoot.git] / PYTHIA6 / AliGenPythia.cxx
index f1dc4b74474d3997b8634eb86d9090fedbdb9f90..9d4b0b114ea57883c3162de3b8c4a746d4ddd7e4 100644 (file)
@@ -65,10 +65,13 @@ AliGenPythia::AliGenPythia()
   SetJetEtRange();
   SetGammaPhiRange();
   SetGammaEtaRange();
+  SetTriggerParticle();
   SetPtKick();
   SetQuench();
   SetHadronisation();  
   fSetNuclei = kFALSE;
+  fNewMIS    = kFALSE;
+  fHFoff     = kFALSE;
   if (!AliPythiaRndm::GetPythiaRandom()) 
     AliPythiaRndm::SetPythiaRandom(GetRandom());
 }
@@ -109,6 +112,7 @@ AliGenPythia::AliGenPythia(Int_t npart)
     SetJetEtRange();
     SetGammaPhiRange();
     SetGammaEtaRange();
+    SetTriggerParticle();
     SetJetReconstructionMode();
     SetQuench();
     SetHadronisation();
@@ -123,6 +127,8 @@ AliGenPythia::AliGenPythia(Int_t npart)
     // Pycel
     SetPycellParameters();
     fSetNuclei = kFALSE;
+    fNewMIS    = kFALSE;
+    fHFoff     = kFALSE;
 }
 
 AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
@@ -261,8 +267,12 @@ void AliGenPythia::Init()
     } else {
        fRL = 0x0;
     }
-    
-    
+// Switch off Heavy Flavors on request  
+    if (fHFoff) {
+       fPythia->SetMSTP(58, 3);
+       fPythia->SetMSTJ(45, 3);        
+       for (Int_t i = 156; i <= 160; i++) fPythia->SetMDME(i, 1, 0);
+    }
  //
     fPythia->ProcInit(fProcess,fEnergyCMS,fStrucFunc);
 
@@ -411,7 +421,11 @@ void AliGenPythia::Generate()
 // Either produce new event or read partons from file
 //     
        if (!fReadFromFile) {
-           fPythia->Pyevnt();
+           if (!fNewMIS) {
+               fPythia->Pyevnt();
+           } else {
+               fPythia->Pyevnw();
+           }
            fNpartons = fPythia->GetN();
        } else {
            printf("Loading Event %d\n",AliRunLoader::GetRunLoader()->GetEventNumber());
@@ -656,8 +670,6 @@ void AliGenPythia::Generate()
          }
            if (jev >= fNpart || fNpart == -1) {
                fKineBias=Float_t(fNpart)/Float_t(fTrials);
-               printf("\n Trials: %i %i %i\n",fTrials, fNpart, jev);
-
                fQ  += fPythia->GetVINT(51);
                fX1 += fPythia->GetVINT(41);
                fX2 += fPythia->GetVINT(42);
@@ -688,8 +700,6 @@ Int_t  AliGenPythia::GenerateMB()
 //  converts from mm/c to s
     const Float_t kconv=0.001/2.999792458e8;
     
-
-    
     Int_t np = (fHadronisation) ? fParticles->GetEntriesFast() : fNpartons;
 
 
@@ -701,6 +711,20 @@ Int_t  AliGenPythia::GenerateMB()
        if (!CheckTrigger(jet1, jet2)) return 0;
     }
     
+    if (fTriggerParticle) {
+       Bool_t triggered = kFALSE;
+       for (i = 0; i < np; i++) {
+           TParticle *  iparticle = (TParticle *) fParticles->At(i);
+           kf = CheckPDGCode(iparticle->GetPdgCode());
+           if (TMath::Abs(kf) != fTriggerParticle) continue;
+           if (iparticle->Pt() == 0.) continue;
+           if (TMath::Abs(iparticle->Eta()) > fTriggerEta) continue;
+           triggered = kTRUE;
+           break;
+       }
+       if (!triggered) return 0;
+    }
+    
 
     //Introducing child cuts in case kPyW, kPyZ, kPyMb, and kPyMbNonDiff
     if ( (fProcess == kPyW || fProcess == kPyZ || fProcess == kPyMb || fProcess == kPyMbNonDiffr)  
@@ -712,6 +736,7 @@ Int_t  AliGenPythia::GenerateMB()
     }
   
 
+    
     for (i = 0; i < np; i++) {
        Int_t trackIt = 0;
        TParticle *  iparticle = (TParticle *) fParticles->At(i);
@@ -768,8 +793,6 @@ Int_t  AliGenPythia::GenerateMB()
     } // particle loop 
 
     if (pParent) delete[] pParent;
-    
-    printf("\n I've put %i particles on the stack \n",nc);
     return 1;
 }
 
@@ -886,7 +909,9 @@ void AliGenPythia::MakeHeader()
            ((AliGenPythiaEventHeader*) fHeader)->SetXYJet(xp, yp);
            ((AliGenPythiaEventHeader*) fHeader)->SetZQuench(z);
        }
-    
+//
+// Store pt^hard 
+    ((AliGenPythiaEventHeader*) fHeader)->SetPtHard(fPythia->GetVINT(47));
 //
 //  Pass header
 //