ALICE jet-hadron analysis code
This repository contains jet-hadron analysis code, run macros, tools, etc. Most are predominately documented
through the docstrings in the code itself.
First, setup your environment as you would like (virtualenv, alibuild, etc). This package requires python 3.6
and above. First, a few prerequisites are required which unfortunately cannot be resolved solely by pip
because of the packaging details of probfit
(which is depended on by reaction_plane_fit
).
$ pip install numpy cython
Then the analysis package can be installed as normal with:
$ pip install -e .
Tests are implemented using pytest
. They should be run via
$ pytest -l --cov=jetH --cov-report html --cov-branch . --durations=5
Coverage can be measured by adding the argument --cov=module
(for example, --cov=JetHConfig
). When the
Jet-H analysis code is entirely packaged up, the module can just be jetHAnalysis
, and it will test
everything.
You’re now ready to develop.
The code is structured as:
jet_hadron/analysis
package:correlations
module.response_matrix
module.STAR_response_matrix
module.entry_points
of setup.py
.jet_hadron/plot
package.
- `PlotBase` contains shared plotting functions
- The other modules are the main plotting modules, split up by functionality.
jet_hadron/event_gen
.jet_hadron/toy_models
.Most executables take a uniform set of arguments consisting of a YAML configuration file, along with the
parameters of the analysis (collision system, energy, event activity, and leading hadron bias). The flags can
be accessed through the --help
flag. A YAML config file that stores most of the configuration options is in
the config
directory.
For example, the jet-hadron correlations analysis can be run with:
$ jetHCorrelations -c config/analysisConfigDev.yaml -e 5.02 -s PbPb -a semi_central -b track
This would analyze semi-central Pb—Pb collisions at 5.02 TeV with a leading track bias as defined in the
configuration file. Note that the location of input and output files are specified in the YAML configuration.
In general, modules in the analysis, toy_models, and event_gen packages are executable with python -m ...
if
they don’t have a dedicated executable installed by the package.
The package versions used for my thesis are stored in requirements-thesis.txt
.
When using the command above, the following steps are necessary:
mixedEventSystematics -c ...
. This requires Z vertex binningIt is strongly recommended to install pre-commit
(from pip or elsewhere) and then run
$ pre-commit install
to utilize the git pre-commit checks. They will be run automatically with each commit to help ensure code
quality. (They can also be run manually with pre-commit run
).
It is useful to be able to highlight regions of a 2D surface plot to show where the Reaction Plane Fit (RPF)
is actually fitting. Code to create this plot is in PlotRPFRegions.py
. In short, it modifies the colors the
of the plot in the regions that we want to highlight.
To execute it, the user must specify the root file and the histogram name in that root file. It should be
something like
$ plotRPFRegions -f output/plotting/PbPb/3360/dev/Track/PbPb_correlations.root -i "jetHDEtaDPhi_jetPt1_trackPt4_corr"
All command line options are available with the -h
option. While the Jet-hadron plot is integrated into the
plotting code, others should look at the code in PlotRPFRegions
. In particularly, look at the standalone
functions located at the bottom of the file. These specify a variety of additional options that would be too
cumbersome to pass from the command line.
Some options include:
defineHighlightRegions()
plotRPFRegions()
plotRPFRegions()
Note that it is best to execute it in the jetH
folder, as a number of other modules are utilized and would
also need to be copied!