Skip to content

Lolle2001/hybrid-analyser

Repository files navigation

Hybrid Analyser

Important

This code was developed for my thesis. If you use/fork this code, please use the following citation in your work:

L. J. Huisman, Data analyser for AMPT and IP-Glasma+MUSIC+iSS, version 1.0.0 (2024). https://github.com/Lolle2001/HybridProcessor

🚀 About

This program is for the data analysis of heavy ion collision simulations. Currently it analyses data generated with AMPT1 and the hybrid framework IPGlasma+MUSIC+iSS234. This program (analyser) uses the similarity of the AMPT and iSS data output. The form of the data is in essence a list of particles and their properties for multiple events. The raw data is parsed by this program and processed into histograms. Currently the histograms are hard coded and the framework is setup to generate histograms for yield, transverse momentum spectra, (pseudo)rapidity spectra, anisotropic flow, average transverse momentum and the nuclear modification factor. All histograms are binned as function of centrality, transverse momentum and rapidity. It is easy to change the binning of histograms to a desired format. In addition subprograms exist (evo-music and evo-ampt) to parse evolution data into a format that can be used for animations. There also is a subprogram (fitter) that is able to fit blast wave models to (experimental) data of heavy ion collisions. Currently only simultaneous fitting of the transverse momentum spectrum is supported.

🔧 Installation

Dependencies

Before compilation first make sure that all dependencies are installed.

  • ROOT - Used for simultaneous fitting.
  • json - Used for reading and writing JSON files.
  • fmt - Used for formatting of streams.
  • argparse - Used for parsing command line arguments.
  • omp -Used for multi-threading.

Compilation

Compilation is done by running the following code,

# Main program: analyser
bash compile.sh

# Animation subprograms: evo-ampt & evo-music
bash compile-evo.sh

# Fitter subprogram: fitter
bash compile-fitter.sh

Warning

The program has been tested on linux and MacOS. Depending on your system you might need to modify the makefiles. Currently there is no CMake support.

📚 Documentation

Required data structure

For the usage of analyser, evo-music and evo-ampt it is assumed that the files have a certain name and that the data is sorted in a subfolders. In the following cases, the -i argument is given {NAME} as input. {N} is the event/batch number and is automatically determined. fitter is intended as a framework and uses by default JSON formatted data, the user however can change this to suit their needs.

File Paths

Software File Path Required for (type)
IPGlasma {DATA}/{NAME}/usedParameters{N}.dat analyser iss (log)
MUSIC {DATA}/{NAME}/{NAME}-{N}/evolution_for_movie_xyeta.dat evo-music (data)
iSS {DATA}/{NAME}/{NAME}-{N}/particle_samples.bin analyser iss (data)
AMPT {DATA}/{NAME}/{NAME}-{N}/ana/ampt.dat analyser ampt (data)
{DATA}/{NAME}/{NAME}-{N}/ampt.log analyser ampt (log)
{DATA}/{NAME}/{NAME}-{N}/ana1/h-animate.dat evo-ampt (data)
{DATA}/{NAME}/{NAME}-{N}/ana1/p-animate.dat evo-ampt (data)
{DATA}/{NAME}/{NAME}-{N}/ana1/p-finalft.dat evo-ampt (data)

Running analyser with command line arguments

Running with command line arguments allows to use all features of the program. It was designed for the above structure, but it should work for more. analyser has tow subprograms called iss and ampt which can be used as follows,

# AMPT
./analyser \  # Main program.
 -col ${CLASS} \  # Option for centrality class  definitions.
 ampt \  # Subprogram to parse ampt data.
 -i ${NAME1} ${NAME2} ... ${NAMEn} \  # Input folders.
 -id ${DATA} \  # Input folder directory.
 -o ${OUT} \  # Output folder.
 -od ${OUTDIR} \  # Output folder directory.

# IPGlasma & iSS
./analyser \  # Main program.
 -col ${CLASS} \  # Option for centrality class  definitions.
 iss \  # Subprogram to parse ampt data.
 -i ${NAME1} ${NAME2} ... ${NAMEn} \  # Input folders.
 -id ${DATA} \  # Input folder directory.
 -l ${LOG1} ${LOG2} ... ${LOGn} \  # Log folders.
 -ld ${LOGDIR} \  # Log folder directory.
 -o ${OUT} \  # Output folder.
 -od ${OUTDIR} \  # Output folder directory.

${OUTDIR} could be the same as ${DATA} and ${OUT} the same as ${NAME} if one folder is given as input. It is then recommended to for example write -o ${NAME}/processed. In the program the -id, -ld and -od arguments are put in front of the arguments for -i, -l and -o respectively, to define the right paths. It is possible to give the full path to -i, -l and -o if the data is stored in a different folders.

Running analyser with a configuration file

Running with a configuration file allows to setup jobs quickly when the data is stored in the same folders. If the flag -p is used, then the default arguments will be overwritten by those in the configuration file. Only -col, -o, -i and -l have to be specified. The use would then look like,

# By default -pf is analyser.par and -pd ./
# The configuration file specifies -id, -ld and -od and
# assumes that data is put in a subfolder of ${OUT}.

./analyser -p -col ${CLASS} ampt -o ${OUT} \
-i \
${NAME1} \
${NAME1} \
... \
${NAMEn}

Running evo-ampt

Note

This program requires some updates for proper usage.

Running evo-music

Note

This program requires some updates for proper usage.

Running fitter

Note

This program requires some updates for proper usage.

Instructions

Define a function in the form

double function(double * x, double * par);

Then do

void dofit(){
    CFitter::Chi2Function chi2;
    chi2.SetParIndexes(indexmap);
    chi2.SetData(xvals, yvals, xerrs, yerrs);
    chi2.SetSpecies(species);
    chi2.SetFitRange(fitranges);
    chi2.SetFitFunction(function);

    CFitter::MultiFitter fitter;
    fitter.FixPars(fixedpars);
    fitter.LimitPars(limitpars);
    fitter.SetParLimits(parlimits);
    fitter.SetParStepsize(parsteps);
    fitter.SetParNames(parnames);
    fitter.SetParInit(parinit);
    fitter.StepsizePars(stepsizepars);
    fitter.Run(chi2);
    ROOT::Fit::FitResult result = fitter.GetResult();
}

Footnotes

  1. Z. W. Lin, C. M. Ko, B. A. Li, B. Zhang and S. Pal, A Multi-phase transport model for relativistic heavy ion collisions. Phys. Rev. C 72, 064901 (2005). https://doi.org/10.1103/PhysRevC.72.064901

  2. Schenke, S. Jeon, C. Gale. 3+1D hydrodynamic simulation of relativistic heavy-ion collisions. Phys.Rev.C 82, 014903 (2010) arXiv:1004.1408

  3. Schenke, S. Jeon, C. Gale. Elliptic and triangular flow in event-by-event (3+1)D viscous hydrodynamics. Phys.Rev.Lett. 106, 042301 (2011). arXiv:1009.3244

  4. J.-F. Paquet, C. Shen, G. S. Denicol, M. Luzum, B. Schenke, S. Jeon, and C. Gale. Production of photons in relativistic heavy-ion collisions. Phys. Rev. C 93, 044906 (2016). arXiv:1509.06738