Skip to content

Plotting trigger efficiencies

Alp edited this page Jun 3, 2023 · 8 revisions

Plotting trigger efficiencies

Once the output coffea files are merged via jmerge (please see here for the instructions), trigger efficiencies can be plotted. The plotting scripts are located under plot/studies/trigger_analysis_run3.

Comparing trigger efficiencies

Using compare_turnons.py, trigger efficiencies from different datasets can be compared. You can run it as follows:

./compare_turnons.py /path/to/merged/files -d '<dataset_regex1>' '<dataset_regex2>' ... -l '<dataset_label1>' '<dataset_label2>' ...

The above command will look up the histograms from the accumulator in /path/to/merged/files, and plot efficiencies for Jet500, HT1050 and METNoMu120 triggers for different datasets. Each argument to -d specify a regular expression matching a dataset name we want to plot. Each argument to -l in turn specifies the label for that dataset. The latter will be used to fill the plot legend.

If you want to make the plots using CMS style, you can also pass the flag --cms-style while running the script.

As an example, if we have an accumulator that has Muon_2022G and Muon_2023C datasets processed, we can run a comparison of efficiencies for those two as follows:

./compare_turnons.py /path/to/merged/files -d 'Muon.*2022G' 'Muon.*2023C' -l 'Muon_2022G' 'Muon_2023C'
Clone this wiki locally