]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliGenPythia.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PYTHIA6 / AliGenPythia.cxx
index abfcc526a7c9155818b500270c77c2c15e36f0d7..f2a4023d2c33c55de511ebc6ffd65d7550268307 100644 (file)
@@ -70,6 +70,7 @@ AliGenPythia::AliGenPythia():
     fFlavorSelect(0),
     fXsection(0.),
     fPythia(0),
+    fWeightPower(0.),
     fPtHardMin(0.),
     fPtHardMax(1.e4),
     fYHardMin(-1.e10),
@@ -126,6 +127,8 @@ AliGenPythia::AliGenPythia():
     fNucPdf(0),
     fTriggerParticle(0),
     fTriggerEta(0.9),     
+    fTriggerY(999.),     
+    fTriggerEtaMin(0.9),     
     fTriggerMinPt(-1),  
     fTriggerMaxPt(1000),  
     fTriggerMultiplicity(0),
@@ -190,6 +193,7 @@ AliGenPythia::AliGenPythia(Int_t npart)
      fFlavorSelect(0),
      fXsection(0.),
      fPythia(0),
+     fWeightPower(0.),
      fPtHardMin(0.),
      fPtHardMax(1.e4),
      fYHardMin(-1.e10),
@@ -246,6 +250,8 @@ AliGenPythia::AliGenPythia(Int_t npart)
      fNucPdf(0),
      fTriggerParticle(0),
      fTriggerEta(0.9), 
+     fTriggerY(999.), 
+     fTriggerEtaMin(0.9),     
      fTriggerMinPt(-1),  
      fTriggerMaxPt(1000),      
      fTriggerMultiplicity(0),
@@ -387,8 +393,8 @@ void AliGenPythia::Init()
 //
     fParentWeight=1./Float_t(fNpart);
 //
-
-
+    if (fWeightPower != 0)
+      fPythia->SetWeightPower(fWeightPower);
     fPythia->SetCKIN(3,fPtHardMin);
     fPythia->SetCKIN(4,fPtHardMax);
     fPythia->SetCKIN(7,fYHardMin);
@@ -773,14 +779,14 @@ void AliGenPythia::Generate()
            fProcess != kPyMbMSEL1     &&
            fProcess != kPyW && 
            fProcess != kPyZ &&
-      fProcess != kPyZgamma &&
+            fProcess != kPyZgamma &&
            fProcess != kPyCharmppMNRwmi && 
            fProcess != kPyBeautyppMNRwmi &&
            fProcess != kPyBeautyJets &&
-     fProcess != kPyWPWHG &&
-     fProcess != kPyJetsPWHG &&
-     fProcess != kPyCharmPWHG &&
-     fProcess != kPyBeautyPWHG) {
+            fProcess != kPyWPWHG &&
+            fProcess != kPyJetsPWHG &&
+            fProcess != kPyCharmPWHG &&
+            fProcess != kPyBeautyPWHG) {
            
            for (i = 0; i < np; i++) {
                TParticle* iparticle = (TParticle *) fParticles.At(i);
@@ -1087,7 +1093,12 @@ Int_t  AliGenPythia::GenerateMB()
            kf = CheckPDGCode(iparticle->GetPdgCode());
            if (kf != fTriggerParticle) continue;
            if (iparticle->Pt() == 0.) continue;
-           if (TMath::Abs(iparticle->Eta()) > fTriggerEta) continue;
+           if (TMath::Abs(iparticle->Y()) > fTriggerY) continue;
+           if (fTriggerEtaMin == fTriggerEta) {
+             if (TMath::Abs(iparticle->Eta()) > fTriggerEta) continue;
+           } else {
+             if (iparticle->Eta() > fTriggerEta || iparticle->Eta() < fTriggerEtaMin) continue;
+           }
            if ( iparticle->Pt() > fTriggerMaxPt || iparticle->Pt() < fTriggerMinPt ) continue;
            triggered = kTRUE;
            break;
@@ -1109,8 +1120,8 @@ Int_t  AliGenPythia::GenerateMB()
       Bool_t  theChild=kFALSE;
       Bool_t  triggered=kFALSE;
       Float_t y;  
-      Int_t   pdg,mpdg,mpdgUpperFamily;
-      for(i=0; i<np; i++) {
+      Int_t   pdg, mpdg, mpdgUpperFamily;
+      for(i = 0; i < np; i++) {
        partCheck = (TParticle*)fParticles.At(i);
        pdg = partCheck->GetPdgCode();  
        if(TMath::Abs(pdg) == fFlavorSelect) { // quark  
@@ -1153,10 +1164,10 @@ Int_t  AliGenPythia::GenerateMB()
 
     //Introducing child cuts in case kPyW, kPyZ, kPyMb, and kPyMbNonDiff
     if ( (
-    fProcess == kPyWPWHG ||
-    fProcess == kPyW ||
+         fProcess == kPyWPWHG ||
+         fProcess == kPyW ||
          fProcess == kPyZ ||
-    fProcess == kPyZgamma ||
+         fProcess == kPyZgamma ||
          fProcess == kPyMbDefault ||
          fProcess == kPyMb ||
          fProcess == kPyMbAtlasTuneMC09 ||
@@ -1168,7 +1179,7 @@ Int_t  AliGenPythia::GenerateMB()
        return 0;
       }
     }
-  
+    
 
     for (i = 0; i < np; i++) {
        Int_t trackIt = 0;
@@ -1370,8 +1381,9 @@ void AliGenPythia::MakeHeader()
                
 //
 // Store Event Weight
-    ((AliGenPythiaEventHeader*) fHeader)->SetEventWeight(fPythia->GetPARI(7));
-                               
+    ((AliGenPythiaEventHeader*) fHeader)->SetEventWeight(fPythia->GetPARI(7)*fPythia->GetPARI(10));
+    // PARI(7) is 1 or -1, for weighted generation with accept/reject, e.g. POWHEG
+    // PARI(10) is a weight associated with reweighted generation, using Pyevwt
 //
 //  Pass header
 //