Skip to content

Improve PIDGen & PIDCorr interface

Michael Thomas Alexander requested to merge malexand/pidcorr-interface into master

I've reworked the PIDGen.py and PIDCorr.py scripts into functions as I wanted a more flexible interface. The scripts work exactly as before, but you can now also do

from PIDGen import run_pid_gen
run_pid_gen(...)

or

from PIDCorr import run_pid_corr
run_pid_corr(...)

instead of making lists of args and passing them to system calls of the scripts.

I also added options to save only the new branch(es) to the output file rather than cloning the whole TTree or to add the new branches to an existing TTree, as well as an option to set the name of the output TTree.

I've updated the scripts Examples/Lb2Lcpi/Lb2Lcpi_pidcorr_Run2.py and Examples/Lb2Lcpi/Lb2Lcpi_pidgen_Run2.py to have the option of using the functions rather than system calls, and tested that using the scripts in both modes returns identical results to previous versions.

Tag @poluekt

Edited by Michael Thomas Alexander

Merge request reports