Warning, /analysis/LightFlavorRatios/cascade_feeddown/Pythia/README.md is written in an unsupported language. File is not indexed.
0001 # Standalone PYTHIA8 setup
0002
0003 ## Obtain the PYTHIA8 package and compile the pythia generation code
0004 - Go to the PYTHIA8 website https://www.pythia.org/ and download the stanalone tarball
0005 - (Version 8.316 was used as of writing. If you use a different version, make sure to update the version number in the commands below accordingly)
0006 - Unpack the tarball and configure to link the HepMC3 package/libraries (these instructions are from Cameron)
0007 ```Bash
0008 tar -zxvf pythia8316.tgz
0009 cd pythia8316
0010 ./configure --with-hepmc3-include=/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/release/release_new/new.15/include --with-hepmc3-lib=/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/release/release_new/new.15/lib64
0011 make -j $(nproc)
0012 ```
0013 - You can copy the `main131.cc` file to the `examples` directory and compile it. To compile, simply do
0014 ```Bash
0015 make main131
0016 ```
0017 - If successful, you should see an executable named `main131` in the `examples` directory. You can run it with
0018 ```Bash
0019 ./main131
0020 ```
0021 or with arguments different from the default ones
0022 ```Bash
0023 ./main131 <output file name (default: main131.hepmc)> <number of events (default: 500000)> <random seed (default: 0)>
0024 ```
0025
0026 ## Convert the hepmc output to a ROOT file
0027 - Compile the `Xi_fraction.cc` with g++ (make sure to link the ROOT and HepMC3 libraries correctly)
0028 ```Bash
0029 g++ -O2 -std=c++17 Xi_fraction.cc -o Xi_fraction $(root-config --cflags --libs) $(HepMC3-config --cflags --libs)
0030 ```
0031 - If successful, you should see an executable named `Xi_fraction`. You can run it with
0032 ```Bash
0033 ./Xi_fraction <input hepmc file name> <output ROOT file name>
0034 ```
0035
0036 ## Submit condor jobs
0037 - You can submit condor jobs to run the above two steps for a large number of events. You may need to change the `Initialdir` (to where you unpack and compile the pythia code), `outputDir`, `NeventsPerJob, and the number of jobs in the `Queue` for your needs
0038 ```
0039 Universe = vanilla
0040 Executable = runPythia.sh
0041 getenv = True
0042 Initialdir = /sphenix/user/hjheng/sPHENIXRepo/HF-analysis/simulation/pythia8316/examples
0043 Output = $(Initialdir)/condorLog/Pythia_ppMinBias_$(Process).out
0044 Error = $(Initialdir)/condorLog/Pythia_ppMinBias_$(Process).err
0045 Log = $(Initialdir)/condorLog/Pythia_ppMinBias_$(Process).log
0046 PeriodicHold = (NumJobStarts>=1 && JobStatus == 1 && !(ON_EVICT_CHECK_RequestMemory_REQUIREMENTS))
0047 request_memory = 2000MB
0048 retry_request_memory_increase = RequestMemory + 2000
0049 retry_request_memory_max = 10000MB
0050 Priority = 20
0051 job_lease_duration = 3600
0052 outputDir = /sphenix/tg/tg01/hf/hjheng/HF-analysis/simulation/Pythia_ppMinBias
0053 outputHepMCFile = $(outputDir)/pythia_ppMinBias_$(Process).hepmc
0054 NeventsPerJob = 500000
0055 outputROOTFile = $(outputDir)/ppMinBias_Xi_fraction_$(Process).root
0056 Arguments = $(outputHepMCFile) $(NeventsPerJob) $(Process) $(outputROOTFile)
0057 Queue 20
0058 ```
0059 - Inspect `runPythia.sh` to make sure everthing is in order. When you are ready to submit jobs, simply do
0060 ```Bash
0061 condor_submit submit_standalonePythia.job
0062 ```