Hadron production in proton proton with the JETSCAPE framework - TianyuDai/JETSCAPE-rhic-ags GitHub Wiki

Configuring p+p collisions

Using the proper configuration file, JETSCAPE-rhic-ags/config/jetscape_user_pp2760.xml, to generate p+p events with the center of energy at 2760 GeV.

<jetscape>
  
  <nEvents> 500 </nEvents>
  
  <outputFilename>../../JETSCAPE-output/pp2760/500.000000</outputFilename>
  <JetScapeWriterAscii> on </JetScapeWriterAscii>
  
  
  <Hard>
    <PythiaGun>
      <pTHatMin>500.0</pTHatMin>
      <pTHatMax>1380.0</pTHatMax>
      <eCM>2760</eCM>
    </PythiaGun>
  </Hard>
  
  
  <Eloss>
    <Matter> 
      <Q0> 1.0 </Q0>
      <in_vac> 1 </in_vac>
      <vir_factor> 0.25 </vir_factor>
      <recoil_on> 0 </recoil_on>
      <broadening_on> 0 </broadening_on>
      <brick_med> 0 </brick_med>
    </Matter>
  </Eloss>
  
  
  <JetHadronization>
    <name>colored</name>
  </JetHadronization>
  
</jetscape>

Run p+p collisions

Run the p+p events using the configuration file

mkdir /rhic_ags_school/JETSCAPE-output/pp2760
cd /rhic_ags_school/JETSCAPE-rhic-ags/build
./runJetscape ../config/jetscape_user_pp2760.xml

Use a python script to generate p+p events for different pTHatBins, and run the p+p events with corresponding configuration file. The python script is JETSCAPE-rhic-ags/analysis/ppEventGenerator.py:

#!/usr/bin/env python

import os
import xml.etree.ElementTree as ET
import argparse

pTHat_list = [10., 20., 50., 80., 120., 200., 500., 1380.]
current_path = os.getcwd()

for i, new_pT_hat_min in enumerate(pTHat_list[:-1]): 
    with open(current_path+'/../config/jetscape_user_pp2760.xml', 'rb') as xml_file: 
        tree = ET.parse(xml_file)
        root = tree.getroot()
        
        name = root.find('outputFilename') 
        file_name = current_path+'/../../JETSCAPE-output/pp2760/%.6f' %(new_pT_hat_min)
        name.text = file_name
        name.set('updated', 'yes')

        hard = root.find('Hard')
        pythia = hard.find('PythiaGun')
        pT_hat_min = pythia.find('pTHatMin')
        pT_hat_max = pythia.find('pTHatMax')

        pT_hat_min.text = str(new_pT_hat_min)
        pT_hat_min.set('updated', 'yes')
        new_pT_hat_max = pTHat_list[i+1]
        pT_hat_max.text = str(new_pT_hat_max)
        pT_hat_max.set('updated', 'yes')

        tree.write(current_path+'/../config/jetscape_user_pp2760.xml', xml_declaration=True, encoding='utf-8')
    os.system(current_path+'/../build/runJetscape '+current_path+'/../config/jetscape_user_pp2760.xml')

Run the following command:

mkdir /rhic_ags_school/JETSCAPE-output/pp2760
cd /rhic_ags_school/JETSCAPE-rhic-ags/build
cp ../analysis/ppEventGenerator.py .
python3 ppEventGenerator.py

Analyze p+p collisions

Check the code JETSCAPE-rhich-ags/analysis/ppAnalysis.cc, which reads JETSCAPE Ascii output file and processes the final hadron information.

The framework JETSCAPE-rhic-ags is modified to read to cross section information for each pTHatBin. This modification is not included in public version of JETSCAPE. JETSCAPE-rhich-ags/src/framework/StringTokenizer.cc has been added this part:

bool StringTokenizer::isSigmaGenEntry() const {
  if (buffer.length() == 0)
    return false; 
  if (buffer.find("# sigmaGen") < 100)
    return true; 
  return false; 
}

bool StringTokenizer::isSigmaErrEntry() const {
  if (buffer.length() == 0)
    return false; 
  if (buffer.find("# sigmaErr") < 100)
    return true; 
  return false; 
}

JETSCAPE-rhich-ags/src/reader/JetScapeReader.cc has been added this part:

if (strT.isSigmaGenEntry()) {
      string token_s;
      while (!strT.done()) {
        token_s = strT.next();
        if (token_s.compare("#") != 0 && token_s.compare("sigmaGen") != 0) sigmaGen = stod(token_s); 
      }
      continue;  
}

if (strT.isSigmaErrEntry()) {
      string token_s;
      while (!strT.done()) {
        token_s = strT.next();
        if (token_s.compare("#") != 0 && token_s.compare("sigmaErr") != 0) sigmaErr = stod(token_s); 
     }
     continue;  
}

We use JETSCAPE-rhich-ags/analysis/ppAnalysis.cc to analyze p+p collisions. To get it run with JETSCAPE, we should re-compile the framework.

Add the following lines to JETSCAPE-rhic-ags/CMakeList.txt:

include_directories(./analysis/ )

add_executable(ppAnalysis ./analysis/ppAnalysis.cc)
target_link_libraries(ppAnalysis JetScape )

Run the following command to re-compile:

cd /rhic_ags_school/JETSCAPE-rhic-ags/build
cmake -DUSE_MUSIC=ON ..
make -j4
./ppAnalysis

The processed data will be created in /rhic_ags_school/JETSCAPE-output/pp2760/pp2760_chargedHadron.txt.

p+p results

Plot p+p cross section using a python script and compare the results with CMS12 data:

python3 /rhic_ags_school/JETSCAPE-rhic-ags/analysis/plot_pp2760_charged_hadron.py

The figure of charged hadron cross section will be generated in /rhic_ags_school/JETSCAPE-output/pp2760/pp2760_chargedHadron_data_compare.pdf.

⚠️ **GitHub.com Fallback** ⚠️