3 ReorganizeTGraph.py
Renata Kopecná edited this page 2022-02-03 13:00:08 +01:00

TGraph in ROOT is saved as an array of the x and y values. When performing the MVA scan, the yield or significance values are not calculated in order of increasing MVA cut. The values are then saved in a mixed up order. When plotting this, it causes the lines in the plot to be all over the place. Hence it is useful to reorganize the TGraph array in a way the first point is the one with the lowest x, the second with the second lowest x and so on.

Table of Contents

Functions

redoGraph()

  • Parameters
    • Run
    • graphFile
    • name
  • Return
    • Nice organized TGraph ordered starting from the smallest x to the largest

rewriteMVAscan()

Opens the file with saved TGraphs from the MVA scan. Reads all the available TGraphs (sig yield, bkg yield, bkg yield from counting, reference sig yield, significance, significance from counting), nicely reorganizes them and saves them in a new ROOT file (the name changes by appending '_new' to the name).

  • Parameters
    • Run