(created on April 11, 2025. Aliases aimed to my pc)
Repository for J/psi-jets analysis within ALICE's Run 3. In general terms, this framework is meant for:
- Prepare ALICE's data for analysis via data skimming
- Reconstruct J/psi mesons from dielectron decays.
- Find J/psi jets using anti-kt clustering algorithm
- Calculate the momentum-fraction distribution of J/psi in jets and other related observables
- Separate prompt from non-prompt J/psis
- Apply similar methods to Monte Carlo (MC) datasets. With this,
- Calculate reconstruction efficiencies
- Calculate bayesian-unfolding corrections
- Apply those corrections on measured distributions
- Compare the results with theoretical models
Below, a detailed tutorial on running things locally.
- Preparing the Framework
- Calculation of Momentum Fraction
- Monte Carlo
- Efficiency Calculation
- Separation of Prompt and Non-Prompt J/psi
The usage of this repository generally demands ALICE's O2 analysis framework
-
Install O2Physics (see O2 Documentation)
-
Recomendations:
- add this to your .bashrc in order to enter ALICE environment with
alice:
O2PhysicsBranch='O2Physics/latest' alice() { cd ~/alice/ alienv enter $O2PhysicsBranch }
- Add
bashrc_alienvtoalice/folder - Add
Jpsi-Jets-Analysis/repository toalice/
- add this to your .bashrc in order to enter ALICE environment with
-
Enter O2Physics environment:
- Using alias:
alice&source bashrc_alienv - Or
alienv enter O2Physics/latest
- Using alias:
This is mainly done by jpsiFragmentationFunction.cxx task.
- The input AODs must be downloaded and prepared
- Compile my task:
- Can be done with AliBuild or with Ninja
- To compile with Ninja (maybe
direnv allowis needed!):- alias:
ninjajpsi - or
cd ~/alice/sw/BUILD/O2Physics-latest/O2Physics/&ninja PWGJE/Tasks/install -j 3
- alias:
- Run my task:
-
To run, a json file must be provided containing:
-
the AOD file as input or a txt file containing a list of AODs paths (in this case the string must start with "@")
- Example:
@CompleteAO2DFilesSubJobs_24Gb_LHC24am_pass1.txt
- Example:
-
Parameters for the jet finder, such as:
-
Vertex z cut
-
event selection
-
p_T, eta, phi
-
Jetalgorithm
-
-
Parameters for JPsi Task, such as: p_T bounds (ex.: 5, 7, 15 and 35 GeV)
-
-
If a json file doesn't exist yet, run without it and it will be automatically generated
-
A script was created to run this, which can be executed as following:
-
cd into
~/alice/Jpsi-Jets-Analysis/JpsiWorkDirorcd $JpsiDir(alias) -
Run the script providing the json file:
-
Make it executable:
chmod +x runJPsiFragmentation.sh -
Execute it:
./runJPsiFragmentation.sh dpl-config.json -
(Or
o2-analysis-je-jet-jpsi-fragmentation -b --configuration json:<JSON> | o2-analysis-je-jet-finder-dielectron-data-charged -b --configuration json://<JSON>)
-
-
A
AnalysisResults.rootshould've been created with jet spectra and z-vs-mass histograms for each pT range
-
- Run the fitter:
cd ~/alice/Jpsi-Jets-Analysis/JpsiFitter- a json file must me passed with
- Input root file
- Histogram to be fitted
- Signal function
- Bkg function
- etc.
- Run
tutorial.py(or similar ones), which runsDQFitterfor every x-projection of the histo:python tutorial.py configFit_z_Xi.json --run_fit_projections
- A root file should've been created in
output/, containing:- A copy of the input histogram and inclusive mass distribution
- Results of the fits for every x projection
- For each fit range, a histogram compiling these results
Analysis done in ~/alice/Jpsi-Jets-Analysis/JpsiWorkDir/MC
- Given J/psi Monte Carlo datasets, Skim them using TableMakerMC_withAssoc. Usually using Hyperloop.
- Provide reco and gen level MCSignals to it. Ex.:
eFromJpsi,eFromPromptJpsi,eFromNonpromptJpsi,Jpsi,nonPromptJpsi,promptJpsi,allBeautyHadrons,Bplus,protonPrimary, everythingFromEverythingFromBeauty - Output:
- AO2D.root with reduced tables for reco-level tracks (mainly electrons) and gen-level (particles matching provided MCSignals or matching reco tracks)
- AnalysisResults.root with general statistics
- Provide reco and gen level MCSignals to it. Ex.:
- run dqEfficiency_withAssoc on reduced AO2D (done in
~/alice/Jpsi-Jets-Analysis/JpsiWorkDir/MC/DQEfficiency)- analysis on pairs of electrons
- For
same-event-pairing, provide gen and reco MCsignals, such as"cfgBarrelMCGenSignals": "promptJpsi,nonPromptJpsi"and"cfgBarrelMCRecSignals": "eePrimaryFromPromptJPsi,eePrimaryFromNonPromptJPsi" - Important: in order to produce
dielectronAlltable, one must:- Produce the reduced dataset containing
ReducedTracksBarrelInfo - Enable
processBarrelOnlyWithCollSkimmed,cfgFlatTablesandfgUseKFVertexing - Add
kalman-filterhistograms tocfgAddSEPHistogram
- Produce the reduced dataset containing
- Output:
- AnalysisResults.root with histograms for dielectron which passes each MCSignal
- AnalysisResults_Trees.root with dielectron trees (tables). Can be
dielectronsAll, for example
Done by the matching between MC-truth-level and MC-reconstructed-level J/psis
- Create a Python virtual environment inside ALIEnv (
alice/Hipe4MLenv, for example) - Install Hipe4ML in it
- Enter ALIEnv:
alice&source bashrc_alienv - Enter Hipe4ML venv:
source Hipe4MLev/bin/activate - Efficiency calculated in
Jpsi-Jets-Analysis/efficiencyAndML/efficienciesJpsi.ipynb- Open with
codeand selectHipe4MLenvPython kernel
- Open with
This is done using Boosted Decision Trees
- Produce a MC J/psi tree (such as one containing
dielectronallproduced usingdqEfficiency) - Enter Hipe4ML virtual environment such as described in Efficiency section
- run
promptSeparation.ipynb - TODO (25-11-14): With the model trained and converted to ONNX, do the inference on data using MLResponse framework