ROOT logo
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
#include "TRandom.h"
#include "AliGenPythiaPlus.h"
#include "AliPythia8.h"
#include "TSystem.h"
#endif

AliGenerator* GenPythia8()
{
  AliGenPythiaPlus* generator = new AliGenPythiaPlus(AliPythia8::Instance());

  generator->SetProcess((Process_t)9999);
  
  // below the default setup corresponding to kPyMbDefault
  // that we're not using directly otherwise the AliPythia8::ProcInit will
  // override all our settings...

  (AliPythia8::Instance())->ReadString("SoftQCD:minBias = on");
	(AliPythia8::Instance())->ReadString("SoftQCD:singleDiffractive = on");
	(AliPythia8::Instance())->ReadString("SoftQCD:doubleDiffractive = on");
  
  //   Centre of mass energy
  generator->SetEnergyCMS(VAR_PYTHIA8_CMS_ENERGY);
  
  generator->SetTrackingFlag(1);

  
  Int_t seed = atoi(gSystem->Getenv("CONFIG_SEED"));
  
  seed = seed%900000000;
  (AliPythia8::Instance())->ReadString("Random:setSeed = on");
  (AliPythia8::Instance())->ReadString(Form("Random:seed = %d", seed));

  std::cout << "Pythia8 seed set to " << seed << std::endl;

  
  TString pythia8setup = VAR_PYTHIA8_SETUP_STRINGS;
  TObjArray* setups = pythia8setup.Tokenize(";");
  TIter next(setups);
  TObjString* s;
  
  while ( ( s = static_cast<TObjString*>(next()) ) )
  {
    std::cout << "Passing setup string " << s->String().Data() << " to Pythia8" << std::endl;
    (AliPythia8::Instance())->ReadString(Form("%s",s->String().Data()));
  }
  
  delete setups;

  std::cout << "end of GenPythia8" << std::endl;

  return generator;
}
 GenPythia8.C:1
 GenPythia8.C:2
 GenPythia8.C:3
 GenPythia8.C:4
 GenPythia8.C:5
 GenPythia8.C:6
 GenPythia8.C:7
 GenPythia8.C:8
 GenPythia8.C:9
 GenPythia8.C:10
 GenPythia8.C:11
 GenPythia8.C:12
 GenPythia8.C:13
 GenPythia8.C:14
 GenPythia8.C:15
 GenPythia8.C:16
 GenPythia8.C:17
 GenPythia8.C:18
 GenPythia8.C:19
 GenPythia8.C:20
 GenPythia8.C:21
 GenPythia8.C:22
 GenPythia8.C:23
 GenPythia8.C:24
 GenPythia8.C:25
 GenPythia8.C:26
 GenPythia8.C:27
 GenPythia8.C:28
 GenPythia8.C:29
 GenPythia8.C:30
 GenPythia8.C:31
 GenPythia8.C:32
 GenPythia8.C:33
 GenPythia8.C:34
 GenPythia8.C:35
 GenPythia8.C:36
 GenPythia8.C:37
 GenPythia8.C:38
 GenPythia8.C:39
 GenPythia8.C:40
 GenPythia8.C:41
 GenPythia8.C:42
 GenPythia8.C:43
 GenPythia8.C:44
 GenPythia8.C:45
 GenPythia8.C:46
 GenPythia8.C:47
 GenPythia8.C:48
 GenPythia8.C:49
 GenPythia8.C:50
 GenPythia8.C:51
 GenPythia8.C:52
 GenPythia8.C:53
 GenPythia8.C:54
 GenPythia8.C:55