![]() |
AliPhysics
116b2d6 (116b2d6)
|
Generates efficiency plots from the histograms generated by AliAnalysisTaskLinkToMC. More...
#include "Riostream.h"
#include "TH1.h"
#include "TH2.h"
#include "TFile.h"
#include "TList.h"
#include "TGraphAsymmErrors.h"
#include "TCanvas.h"
Go to the source code of this file.
Functions | |
void | EfficiencyIntegral (const char *prefix, TH1 *pass, TH1 *total, double &eff, double &error, bool includeOverflow=false) |
void | PlotEfficiency (const char *histfilename="hists.root", bool includeOverflow=true) |
Generates efficiency plots from the histograms generated by AliAnalysisTaskLinkToMC.
This macro is used to generate efficiency plots, fake track ratio plots and also calculate the total integrated efficiency and fake track ratio. The histograms generated by the AliAnalysisTaskLinkToMC analysis task is used as input. The macro can be run with root as follows:
$ root PlotEfficiency.C("hists.root")
where hists.root is the name of the output file containing the histograms generated by the analysis task. Note that the '\' character before the '(' and '"' characters is required. Alternatively run the macros as follows from the root command prompt:
$ root .L PlotEfficiency.C PlotEfficiency("hists.root")
Definition in file PlotEfficiency.C.
void EfficiencyIntegral | ( | const char * | prefix, |
TH1 * | pass, | ||
TH1 * | total, | ||
double & | eff, | ||
double & | error, | ||
bool | includeOverflow = false |
||
) |
This routine calculates the integrated efficiency for a 1D histogram. [in]
prefix | The string to print before the calculated efficiency result. [in] |
pass | The histogram of reconstructed tracks. [in] |
total | The histogram of findable (reconstructable) tracks. [out] |
eff | Filled by the total integrated efficiency calculated. [out] |
error | Filled by the uncertainty in the efficiency value. [in] |
includeOverflow | If set then the overflow bins are also used in the calculation. |
Definition at line 50 of file PlotEfficiency.C.
Referenced by PlotEfficiency().
void PlotEfficiency | ( | const char * | histfilename = "hists.root" , |
bool | includeOverflow = true |
||
) |
Opens the file containing the histograms generated by the AliAnalysisTaskLinkToMC analysis task and tries to find the first TList in the file. From the TList we try to find TH2 classes with the following names: "findableTracksHist", "foundTracksHistMC" and "fakeTracksHist" From these we plot the efficiency plots for the pT and rapidity dimension by projecting the 2D histograms. Also, the fake track ratio histograms are created. Finally the total integrated efficiency and fake track ratio is calculated and printed.
histfilename | The name of the root file containing the histograms generated by the AliAnalysisTaskLinkToMC analysis task. |
includeOverflow | Indicates if the overflow bins should be used for for the total integral efficiency and fake track ratio calculations. The default is not to use the overflow bins. |
Definition at line 82 of file PlotEfficiency.C.