4 RemoveMultipleCandidates.py
Renata Kopecná edited this page 2022-02-10 11:14:55 +01:00

Tool for removing multiple candidates after TMVA. Adds a branch with a boolean for each TMVA cut, whether the event should be removed or not.

The main program execution is defined in RemoveMultipleCandidates.py. In this file, the arguemtn parser is defined, together with the yer dictionary. For the details about the arguemnts, since ROOT is being ROOT (see https://stackoverflow.com/questions/37749852/python-argparse-dont-show-correct-help-message), one cannot run the usual

python RemoveMultipleCandidates.py -h

Hence, have a look at the arguments in the code, they start on line 38 in RemoveMultipleCandidates.py. Most of them are obsolete; the option -all runs over all the available MC and data samples, when not used, the code runs over inclusive sample.

When running over the inclusive sample, it is necesarry to change the IsInc boolean in RemoveMultipleCandidatesSource.py, line 17, to True!

The helper functions are defined in Utils3.py.

Table of Contents

Functions

isMultipleCandidate()

Reads the pariringBranch from the TTree, reads the needed branches based on the options (MLPresponse, TM branch). Loops over the MLPvalues to see at what MLP value are all the events 'alone'. Creates a new IsAloneAt+tag branch, storing the MLP response value at which is th event 'alone', the tag represents the Truth-matching method (if applied). If the event does not pass the truth-matching and it is desired, IsAloneAt+tag is set to two.

  • Parameters
    • year
    • Run
    • Data
    • MC
    • TM
    • TMpid
    • gammaTM
    • ReferenceChannel
    • PHSP
    • KshortDecaysInVelo
    • verbose

Plotting

The ploting of multiple candidates is performed by Scripts/PlotMultiple.py. It is necesary to update the path to your Comparison tool folder.

The code as is plots the fraction of multiple candidates (including the real one!) in the data, MC and truth matched MC for each year versus the MVA reponse.

plotMultiple()

[comment]: # (plotMultiple())

Loads the data from the tuple tree using uproot, checks the branch with the MLP response-dependent boolean whether the multiple candidate is removed and plots the data, MC and truth matched MC for each year versus the MVA reponse.

  • Parameters
    • year
    • Run
    • Reference
    • PHSP
    • verbose