]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliGenPythia.cxx
Using gRandom instead of pyr (Yu.Kharlov)
[u/mrichter/AliRoot.git] / PYTHIA6 / AliGenPythia.cxx
index 7cdb6c9d6739bf0475feccf20e1e17d59cf2c89b..8743ba83b7c97a5c0d93d25eb9d17df2f35c6a70 100644 (file)
 
 /*
 $Log$
+Revision 1.5  2003/04/04 08:12:56  morsch
+Boost for assymmetric systems added.
+
+Revision 1.4  2003/04/01 20:39:00  morsch
+Pycell configurable.
+
+Revision 1.3  2003/03/31 15:47:16  morsch
+Unhandled cases added.
+
+Revision 1.2  2003/03/27 09:28:38  morsch
+Charm production process configuration for pPb and pp added
+(A. Dainese, N. Carrer)
+
+Revision 1.1  2003/03/15 15:00:48  morsch
+Classed imported from EVGEN.
+
 Revision 1.69  2003/01/14 10:50:19  alibrary
 Cleanup of STEER coding conventions
 
@@ -249,6 +265,7 @@ AliGenPythia::AliGenPythia()
   SetGammaPhiRange();
   SetGammaEtaRange();
   SetPtKick();
+  fSetNuclei = kFALSE;
 }
 
 AliGenPythia::AliGenPythia(Int_t npart)
@@ -261,8 +278,6 @@ AliGenPythia::AliGenPythia(Int_t npart)
     fName = "Pythia";
     fTitle= "Particle Generator using PYTHIA";
     fXsection  = 0.;
-    fNucA1=0;
-    fNucA2=0;
     SetProcess();
     SetStrucFunc();
     SetForceDecay();
@@ -291,6 +306,9 @@ AliGenPythia::AliGenPythia(Int_t npart)
     fFragmentation = kTRUE;
     // Default counting mode
     fCountMode = kCountAll;
+    // Pycel
+    SetPycellParameters();
+    fSetNuclei = kFALSE;
 }
 
 AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
@@ -304,6 +322,21 @@ AliGenPythia::~AliGenPythia()
 // Destructor
 }
 
+void AliGenPythia::SetPycellParameters(Float_t etamax, Int_t neta, Int_t nphi,
+                                      Float_t thresh, Float_t etseed, Float_t minet, Float_t r)
+{
+// Set pycell parameters
+    fPycellEtaMax    =  etamax;
+    fPycellNEta      =  neta;
+    fPycellNPhi      =  nphi;
+    fPycellThreshold =  thresh;
+    fPycellEtSeed    =  etseed;
+    fPycellMinEtJet  =  minet;
+    fPycellMaxRadius =  r;
+}
+
+
+
 void AliGenPythia::SetEventListRange(Int_t eventFirst, Int_t eventLast)
 {
   // Set a range of event numbers, for which a table
@@ -332,7 +365,7 @@ void AliGenPythia::Init()
     fPythia->SetCKIN(7,fYHardMin);
     fPythia->SetCKIN(8,fYHardMax);
     
-    if (fNucA1 > 0 && fNucA2 > 0) fPythia->SetNuclei(fNucA1, fNucA2);  
+    if (fAProjectile > 0 && fATarget > 0) fPythia->SetNuclei(fAProjectile, fATarget);  
     // Fragmentation?
     if (fFragmentation) {
       fPythia->SetMSTP(111,1);
@@ -362,19 +395,25 @@ void AliGenPythia::Init()
     {
     case kPyCharm:
     case kPyCharmUnforced:
-    case kPyCharmPbMNR:
+    case kPyCharmPbPbMNR:
+    case kPyCharmppMNR:
+    case kPyCharmpPbMNR:
        fParentSelect[0] =   411;
        fParentSelect[1] =   421;
        fParentSelect[2] =   431;
        fParentSelect[3] =  4122;
        fFlavorSelect    =  4;  
        break;
-    case kPyD0PbMNR:
+    case kPyD0PbPbMNR:
+    case kPyD0pPbMNR:
+    case kPyD0ppMNR:
        fParentSelect[0] =   421;
        fFlavorSelect    =   4; 
        break;
     case kPyBeauty:
-    case kPyBeautyPbMNR:
+    case kPyBeautyPbPbMNR:
+    case kPyBeautypPbMNR:
+    case kPyBeautyppMNR:
        fParentSelect[0]=  511;
        fParentSelect[1]=  521;
        fParentSelect[2]=  531;
@@ -405,6 +444,23 @@ void AliGenPythia::Init()
        break;
     }
 //
+//
+//  JetFinder for Trigger
+//
+//  Configure detector (EMCAL like)
+//
+       fPythia->SetPARU(51, fPycellEtaMax);
+       fPythia->SetMSTU(51, fPycellNEta);
+       fPythia->SetMSTU(52, fPycellNPhi);
+//
+//  Configure Jet Finder
+//  
+       fPythia->SetPARU(58,  fPycellThreshold);
+       fPythia->SetPARU(52,  fPycellEtSeed);
+       fPythia->SetPARU(53,  fPycellMinEtJet);
+       fPythia->SetPARU(54,  fPycellMaxRadius);
+       fPythia->SetMSTU(54,  2);
+//
 //  This counts the total number of calls to Pyevnt() per run.
     fTrialsRun = 0;
     fQ         = 0.;
@@ -412,7 +468,16 @@ void AliGenPythia::Init()
     fX2        = 0.;    
     fNev       = 0 ;
 //    
+//
+//
     AliGenMC::Init();
+//
+//
+//  
+    if (fSetNuclei) {
+       fDyBoost = 0;
+       Warning("Init","SetNuclei used. Use SetProjectile + SetTarget instead. fDyBoost has been reset to 0\n");
+    }
 }
 
 void AliGenPythia::Generate()
@@ -450,6 +515,7 @@ void AliGenPythia::Generate()
        
        fPythia->ImportParticles(fParticles,"All");
 
+       Boost();
 //
 //
 //
@@ -746,8 +812,10 @@ void AliGenPythia::AdjustWeights()
 void AliGenPythia::SetNuclei(Int_t a1, Int_t a2)
 {
 // Treat protons as inside nuclei with mass numbers a1 and a2  
-    fNucA1 = a1;
-    fNucA2 = a2;
+
+    fAProjectile = a1;
+    fATarget     = a2;
+    fSetNuclei   = kTRUE;
 }
 
 
@@ -875,19 +943,6 @@ void AliGenPythia::RecJetsUA1(Float_t eCellMin, Float_t eCellSeed, Float_t eMin,
 //  Calls the Pythia jet finding algorithm to find jets in the current event
 //
 //
-//  Configure detector (EMCAL like)
-//
-    fPythia->SetPARU(51,2.);
-    fPythia->SetMSTU(51,Int_t(96 * 2./0.7));
-    fPythia->SetMSTU(52,3 * 144);
-//
-//  Configure Jet Finder
-//  
-    fPythia->SetPARU(58, eCellMin);
-    fPythia->SetPARU(52, eCellSeed);
-    fPythia->SetPARU(53, eMin);
-    fPythia->SetPARU(54, rMax);
-    fPythia->SetMSTU(54, 2);
 //
 //  Save jets
     Int_t n     = fPythia->GetN();
@@ -933,20 +988,7 @@ void  AliGenPythia::GetJets(Int_t& nJets, Int_t& nJetsTrig, Float_t jets[4][10])
 //  Loading jets from common block
 //
     } else {
-//
-//  Configure detector (EMCAL like)
-//
-       fPythia->SetPARU(51,2.);
-       fPythia->SetMSTU(51,Int_t(96 * 2./0.7));
-       fPythia->SetMSTU(52,3 * 144);
-//
-//  Configure Jet Finder
-//  
-       fPythia->SetPARU(58,  0.0);
-       fPythia->SetPARU(52,  4.0);
-       fPythia->SetPARU(53, 10.0);
-       fPythia->SetPARU(54,  1.0);
-       fPythia->SetMSTU(54,  2);
+
 //
 //  Run Jet Finder
        fPythia->Pycell(nJets);