AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
PlotEfficiency.C File Reference

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"
Include dependency graph for PlotEfficiency.C:

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)
 

Detailed Description

Generates efficiency plots from the histograms generated by AliAnalysisTaskLinkToMC.

Author
Artur Szostak artur.nosp@m.sz@i.nosp@m.afric.nosp@m.a.co.nosp@m.m

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.

Function Documentation

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]

Parameters
prefixThe string to print before the calculated efficiency result. [in]
passThe histogram of reconstructed tracks. [in]
totalThe histogram of findable (reconstructable) tracks. [out]
effFilled by the total integrated efficiency calculated. [out]
errorFilled by the uncertainty in the efficiency value. [in]
includeOverflowIf 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.

Parameters
histfilenameThe name of the root file containing the histograms generated by the AliAnalysisTaskLinkToMC analysis task.
includeOverflowIndicates 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.