![]() |
AliPhysics
239578e (239578e)
|
#include <TCanvas.h>
#include <TList.h>
#include <TH1.h>
#include <TH2.h>
#include <THStack.h>
#include <TFile.h>
#include <TError.h>
#include <TLatex.h>
#include <TFitResult.h>
#include <TF1.h>
#include <TMath.h>
#include <THashList.h>
#include <TParameter.h>
Go to the source code of this file.
Functions | |
void | SimpleCorrect (UShort_t flags=0x3, UShort_t scaleMode=1, const char *realFileName="trdt.root", const char *simFileName="trmc.root", Int_t nBins=9, const char *otherFileName="") |
Object retrival | |
TObject * | GetO (TSeqCollection *l, const char *name, TClass *cls) |
TObject * | CopyO (TSeqCollection *l, const char *name, const char *newName, TClass *cls) |
TH1 * | GetH1 (TSeqCollection *l, const char *name) |
TH2 * | GetH2 (TSeqCollection *l, const char *name) |
TH1 * | CopyH1 (TSeqCollection *l, const char *name, const char *newName=0) |
TH2 * | CopyH2 (TSeqCollection *l, const char *name, const char *newName=0) |
Histogram compatiblity tests | |
Bool_t | CheckAxisNBins (const char *which, const TAxis *a1, const TAxis *a2) |
Bool_t | CheckAxisLimits (const char *which, const TAxis *a1, const TAxis *a2) |
Bool_t | CheckAxisBins (const char *which, const TAxis *a1, const TAxis *a2) |
Bool_t | CheckAxisLabels (const char *which, const TAxis *a1, const TAxis *a2) |
Bool_t | CheckAxis (const char *which, const TAxis *a1, const TAxis *a2, Bool_t alsoLbls) |
Bool_t | CheckConsistency (const TH1 *h1, const TH1 *h2) |
TH1 * | Coerce (const TH1 *templ, TH1 *src) |
TH2 * | Coerce (const TH2 *templ, TH2 *src) |
Various histogram operations | |
TH1 * | SetAttr (TH1 *h, Color_t color, Style_t marker=20, Double_t size=1., Style_t fill=0, Style_t line=1, Width_t width=1) |
void | PrintH (TH2 *h, Int_t prec=2) |
void | PrintH (TH1 *h, Int_t prec=2) |
Various calculations | |
Double_t | Integrate (TH1 *h, Double_t min, Double_t max, Double_t &err) |
Double_t | RatioE (Double_t n, Double_t en, Double_t d, Double_t ed, Double_t &er) |
Specific histogram operations | |
TH2 * | Scale (TH2 *h, TH1 *g) |
TH1 * | Scale (TH1 *h, Double_t s, Double_t se) |
TH2 * | Scale (TH2 *h, Double_t s, Double_t se) |
TH2 * | CorrectForIPz (TH2 *in, TH1 *ipz, Bool_t full=true) |
TH1 * | Avg (TH2 *h, TH1 *ipz, UShort_t mode, const char *name, TH2 *other=0) |
TH1 * | Avg2 (TH2 *h, TH1 *ipz, UShort_t mode, const char *name) |
background scaling | |
Double_t | GetDeltaScale (TH1 *deltaRec, TH1 *deltaBg, Double_t &eR, Double_t nEvRec=1, Double_t nEvBg=1, Double_t lim=1e9) |
Double_t | GetDeltaScale (TSeqCollection *list, Int_t b, Double_t &eR, Double_t nEv=1, Double_t lim=1e9) |
Double_t | GetDeltaScale (TSeqCollection *realList, TSeqCollection *simList, Int_t b, Double_t &eR, Double_t nEvReal=1, Double_t nEvSim=1, Double_t lim=1e9) |
TH1 * | GetDeltaDist (TH2 *deltaReal, TH2 *deltaSim, Double_t nEvReal, Double_t nEvSim, Double_t lim=1e9) |
TH1 * | GetDeltaDist (TSeqCollection *list, Int_t b, Double_t nEv=1) |
TH1 * | GetDeltaDist (TSeqCollection *realList, TSeqCollection *simList, Int_t b, Double_t nEvReal, Double_t nEvSim, Double_t lim=1e9) |
Utility function for signal extraction | |
TH2 * | GetBg (Bool_t comb, TSeqCollection *list, Int_t b, Double_t nEv=1, Double_t lim=1e9) |
TH2 * | CorrectSignal (Bool_t comb, TH2 *meas, TH2 *bg, TH2 *simMeas) |
TH1 * | GetDelta (TSeqCollection *l, const char *which, Int_t b, Int_t nEv, Double_t scale=0, Double_t scaleE=0, Double_t lim=1e9) |
void | CorrectOneBin (THStack *stack, TDirectory *dir, Int_t b, TSeqCollection *realList, TSeqCollection *simList, Bool_t realComb, Bool_t simComb, Bool_t preScale=false, Bool_t full=false, Bool_t showOne=false, UShort_t scaleMode=2, Double_t lim=1e9) |
Steering and other functions | |
void | ShowStats (TList *list, const char *title, const char *path) |
Variables | |
const Bool_t | kSimpleCorrectLoaded = true |
const char * | dndetaTitle = "d#it{N}_{ch}/d#it{#eta}" |
const Color_t | cc [] |
Calculate average of \( h(\eta,\mathrm{IP}_z)\) over \(\mathrm{IP}_z\) in each \(\eta\) bin. \(\mathrm{IP}_z\) bins that makes the errors worse are ignored.
h | \( h(\eta,\mathrm{IP}_z)\) |
ipz | (optional) \(\mathrm{IP}_z\) distribution |
mode | How to scale |
name | Name of output histogram |
other | (optional) mask to apply to \( h\) |
Definition at line 709 of file SimpleCorrect.C.
Referenced by Avg2(), and CorrectOneBin().
Calculate average of \( h(\eta,\mathrm{IP}_z)\) over \(\mathrm{IP}_z\) in each \(\eta\) bin. \(\mathrm{IP}_z\) bins that makes the errors worse are ignored. \( h(\eta,\mathrm{IP}_z)\) iscaled to the \(\mathrm{IP}_z\) distribution
h | \( h(\eta,\mathrm{IP}_z)\) |
ipz | (optional) \(\mathrm{IP}_z\) distribution |
mode | How to scale |
name | Name of output histogram |
Definition at line 819 of file SimpleCorrect.C.
Check if axis are compatible same
which | Which axis |
a1 | Axis 1 |
a2 | Axis 2 |
alsoLbls | If true, also check labels |
Definition at line 292 of file SimpleCorrect.C.
Referenced by CheckConsistency().
Check that the bins of the passed axis are exactly the same
which | Which axis |
a1 | Axis 1 |
a2 | Axis 2 |
Definition at line 210 of file SimpleCorrect.C.
Referenced by CheckAxis().
Check if both axis have labels, and if they do, that they are the same
which | Which axis |
a1 | Axis 1 |
a2 | Axis 2 |
Definition at line 248 of file SimpleCorrect.C.
Referenced by CheckAxis().
Check if the both passed axis have the same minimum and maximum
which | Which axis |
a1 | Axis 1 |
a2 | Axis 2 |
Definition at line 187 of file SimpleCorrect.C.
Referenced by CheckAxis().
Check if the number of bins in both passed axis are the same
which | Which axis |
a1 | Axis 1 |
a2 | Axis 2 |
Definition at line 166 of file SimpleCorrect.C.
Referenced by CheckAxis().
Check that histograms are compatible
h1 | First histogram |
h2 | Second histogram |
Definition at line 312 of file SimpleCorrect.C.
Referenced by Coerce(), CorrectOneBin(), and SimpleCorrect().
Force src to be compatible with templ
templ | Template to coform to |
src | Histogram to coerce to fit templ |
Definition at line 346 of file SimpleCorrect.C.
Referenced by CorrectOneBin().
Force src to be compatible with templ
templ | Template to coform to |
src | Histogram to coerce to fit templ |
Definition at line 373 of file SimpleCorrect.C.
TH1* CopyH1 | ( | TSeqCollection * | l, |
const char * | name, | ||
const char * | newName = 0 |
||
) |
Get a copy of 1 dimensional histogram from a collection
l | Collection |
name | Name of histogram to look for |
newName | Optional new name |
Definition at line 128 of file SimpleCorrect.C.
Referenced by GetDelta(), and GetDeltaScale().
TH2* CopyH2 | ( | TSeqCollection * | l, |
const char * | name, | ||
const char * | newName = 0 |
||
) |
Get a copy of 2 dimensional histogram from a collection
l | Collection |
name | Name of histogram to look for |
newName | Optional new name |
Definition at line 144 of file SimpleCorrect.C.
Referenced by GetDeltaDist().
TObject* CopyO | ( | TSeqCollection * | l, |
const char * | name, | ||
const char * | newName, | ||
TClass * | cls | ||
) |
Definition at line 84 of file SimpleCorrect.C.
Scale a 2D distribution \( h\) in \( (\eta,\mathrm{IP}_z)\) to the \(\mathrm{IP}_z\) distribution
in | \( h(\eta,\mathrm{IP}_z)\) |
ipz | Distribution of \(\mathrm{IP}_z\) |
full | If true, also scale errors |
Definition at line 665 of file SimpleCorrect.C.
Referenced by Avg2(), and CorrectOneBin().
void CorrectOneBin | ( | THStack * | stack, |
TDirectory * | dir, | ||
Int_t | b, | ||
TSeqCollection * | realList, | ||
TSeqCollection * | simList, | ||
Bool_t | realComb, | ||
Bool_t | simComb, | ||
Bool_t | preScale = false , |
||
Bool_t | full = false , |
||
Bool_t | showOne = false , |
||
UShort_t | scaleMode = 2 , |
||
Double_t | lim = 1e9 |
||
) |
Calculates the result as
\[ R = \frac{P}{(1-\beta\prime)M\prime} (1-\beta)M \]
where
In case we use MC-labels for the background correction in simulations, we have that
\[ (1-\beta\prime)M\prime = (1-C\prime/M\prime)M\prime = M\prime-C\prime \]
where
In case we use MC-labels for the background correction for real data, we have that
\[ (1-\beta)M = (1-k\beta\prime)M = (1-kC/M\prime)M \]
where \( k\) is a constant scaling factor (1.3).
If we use injected clusters as an estimator for the background correction in simulations, we have
\[ (1-\beta\prime)M\prime = (1-B\prime/M\prime)M\prime = M\prime-B\prime \]
where
The same expression holds for the case when we use injected clusters to estimate the background in real data.
\[ (1-\beta)M = (1-B/M)M = M-B \]
where \( B\) has the same meaning as \( B\prime\) except we use real data.
Note, if we use MC-labels for both the simulated and real data backgrounds, and \( k=1\) we find that
\[ R = \frac{P}{M\prime}M \]
stack | Stack to add results to |
dir | Directory to write to |
b | Bin number |
realList | List of real data histograms |
simList | List of simulated data histograms |
realComb | Whether to use MC-labels for real data |
simComb | Whether to use MC-labels for simulated data |
preScale | Whether to scale all histograms to the vertex distribution fully before doing any calculations. |
full | If true, pre-scale fully (including errors) |
showOne | |
scaleMode | Scaling mode (0: fixed, 1: per c, 2: per \(\eta\) and c) |
lim | Limit |
Definition at line 1254 of file SimpleCorrect.C.
Referenced by SimpleCorrect().
Correct measured distribution for background. If we do not use MC-labels then we simply substract the background.
If we use MC labels, then multiply the measures signal by \( 1-\beta\), where \( \beta\) is
\[ C/M\prime \]
where \( C\) is the combinatorial background, and \( M\prime\) is the measured distribution in simulations.
comb | true if we use combinatorial background |
meas | The measured distribution to correct (in-place) |
bg | The background (or combinatorial background) |
simMeas | The measured distribution (in MC) |
Definition at line 1104 of file SimpleCorrect.C.
Referenced by CorrectOneBin().
Get the background from a list. In case we use the background from events with injected clusters, we scale the distribution to tail of the \( \Delta\) distribution
comb | if true, use combinatorial background |
list | collection to get distribution from |
b | Centrality bin number |
nEv | Number of events |
lim | integration limit |
Definition at line 1053 of file SimpleCorrect.C.
Referenced by CorrectOneBin().
TH1* GetDelta | ( | TSeqCollection * | l, |
const char * | which, | ||
Int_t | b, | ||
Int_t | nEv, | ||
Double_t | scale = 0 , |
||
Double_t | scaleE = 0 , |
||
Double_t | lim = 1e9 |
||
) |
Definition at line 1126 of file SimpleCorrect.C.
Referenced by CorrectOneBin().
TH1* GetDeltaDist | ( | TH2 * | deltaReal, |
TH2 * | deltaSim, | ||
Double_t | nEvReal, | ||
Double_t | nEvSim, | ||
Double_t | lim = 1e9 |
||
) |
Get the \(\eta\) dependent \(\Delta\) scaling factor \( k(\eta)\) between \( f_R(\eta,\Delta)\) and \( f_B(\eta,\Delta)\)
deltaReal | \( f_R(\eta,\Delta)\) |
deltaSim | \( f_B(\eta,\Delta)\) |
nEvReal | Number of events in \( f_R(\eta,\Delta)\) |
nEvSim | Number of events in \( f_B(\eta,\Delta)\) |
lim | Integration limit |
Definition at line 959 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), GetBg(), and GetDeltaDist().
Get the \( \eta\) dependent \(\Delta\) scaling factor \( k(\eta)\) between observed \( f(\eta,\Delta)\) and \( f(\eta,\Delta)\) in events with injected clusters.
list | List of histograms to retrieve data from |
b | Bin number |
nEv | Number of events |
Definition at line 996 of file SimpleCorrect.C.
TH1* GetDeltaDist | ( | TSeqCollection * | realList, |
TSeqCollection * | simList, | ||
Int_t | b, | ||
Double_t | nEvReal, | ||
Double_t | nEvSim, | ||
Double_t | lim = 1e9 |
||
) |
Get the \(\eta\) dependent \(\Delta\) scaling factor \( k(\eta)\) between real observed \( f(\eta,\Delta)\) and simulated observed \( f(\eta,\Delta)\)
realList | List of real data histogram |
simList | List of simulated data histogram |
b | Bin number |
nEvReal | Number of real events |
nEvSim | Number of simulated events |
lim | Integration limit |
Definition at line 1020 of file SimpleCorrect.C.
Double_t GetDeltaScale | ( | TH1 * | deltaRec, |
TH1 * | deltaBg, | ||
Double_t & | eR, | ||
Double_t | nEvRec = 1 , |
||
Double_t | nEvBg = 1 , |
||
Double_t | lim = 1e9 |
||
) |
Get scaling factor between tails of 2 \( \Delta\) distributions. The scale factor is determined as
\[ k = \frac{\int_{\Delta_{bg}}^{\infty} d\Delta f_R(\Delta)}{ \int_{\Delta_{bg}}^{\infty} d\Delta f_B(\Delta)} \]
where \( \Delta_{bg}=5\) is the cut-off on background particles (where the \(\Delta\) distributions of secondaries and primaries cross).
deltaRec | \( f_R(\Delta)\) |
deltaBg | \( f_B(\Delta)\) |
eR | On return, the error on \( k\) |
nEvRec | Number of events in \( f_R(\Delta)\) |
nEvBg | Number of events in \( f_B(\Delta)\) |
lim | Integration limit |
Definition at line 859 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), GetBg(), GetDelta(), GetDeltaDist(), and GetDeltaScale().
Double_t GetDeltaScale | ( | TSeqCollection * | list, |
Int_t | b, | ||
Double_t & | eR, | ||
Double_t | nEv = 1 , |
||
Double_t | lim = 1e9 |
||
) |
Get the \(\Delta\) scaling factor \( k\) between observed \( f(\Delta)\) and \( f(\Delta)\) in events with injected clusters.
list | List of histograms to retrieve data from |
eR | On return, the error on scaling factor \( k\) |
b | Bin number |
nEv | Number of events |
lim | Integration limit |
Definition at line 900 of file SimpleCorrect.C.
Double_t GetDeltaScale | ( | TSeqCollection * | realList, |
TSeqCollection * | simList, | ||
Int_t | b, | ||
Double_t & | eR, | ||
Double_t | nEvReal = 1 , |
||
Double_t | nEvSim = 1 , |
||
Double_t | lim = 1e9 |
||
) |
Get the \(\Delta\) scaling factor \( k\) between real observed \( f(\Delta)\) and simulated observed \( f(\Delta)\) with injected clusters.
realList | List of real data histogram |
simList | List of simulated data histogram |
eR | On return, the error on \( k\) |
b | Bin number |
nEvReal | Number of real events |
nEvSim | Number of simulated events |
lim | Integration limit |
Definition at line 929 of file SimpleCorrect.C.
TH1* GetH1 | ( | TSeqCollection * | l, |
const char * | name | ||
) |
Get a 1 dimensional histogram from a collection
l | Collection |
name | Name of histogram to look for |
Definition at line 101 of file SimpleCorrect.C.
Referenced by ShowStats(), and SimpleCorrect().
TH2* GetH2 | ( | TSeqCollection * | l, |
const char * | name | ||
) |
Get a 2 dimensional histogram from a collection
l | Collection |
name | Name of histogram to look for |
Definition at line 114 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), GetBg(), GetDeltaDist(), and SimpleCorrect().
TObject* GetO | ( | TSeqCollection * | l, |
const char * | name, | ||
TClass * | cls | ||
) |
Integrate a histogram \( h(x)\) between \( a\) and \( b\)
\[ i = \int_{a}^{b} dx h(x) \]
h | Histogram \( h(x)\) |
min | \( a\) |
max | \( b\) |
err | Error on \( i\) |
Definition at line 496 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), and GetDeltaScale().
Print a histogram
h | Histgram to print |
prec | Precision to use |
Definition at line 442 of file SimpleCorrect.C.
Print a histogram
h | Histgram to print |
prec | Precision to use |
Definition at line 465 of file SimpleCorrect.C.
Calculate the ratio between \( n\pm\delta n\) and \( d\pm\delta d\)
\[ r = \frac{n}{d} \]
n | \( n\) |
en | \( \delta n\) |
d | \( d\) |
ed | \( \delta d\) |
er | On return, error on \( r\) |
Definition at line 534 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), and GetDeltaScale().
Scale a 2 dimensional distribution \( h(x,y)\) to a distribution \( g(x)\)
\[ r(x,y) = \frac{h(x,y)}{g(x)} \]
Errors are propagated
h | \( h(x,y)\) |
g | \( g(x)\) |
Definition at line 568 of file SimpleCorrect.C.
Referenced by CompilationTrackSelection(), CorrectOneBin(), DrawPtHardBins(), GetBg(), GetDelta(), AliAnalysisTaskMuonQA::Terminate(), AliAnalysisTaskSED0MassCutVarFDSub::Terminate(), AliAnalysisTaskSED0Mass::Terminate(), and AliAnalysisTaskSED0MassNonPromptFraction::Terminate().
Scale a 1 dimensional distribution \( h(x)\) to \( s\pm\delta s\)
\[ r(x) = \frac{h(x)}{s} \]
Errors are propagated
h | \( h(x)\) |
s | \( s\) |
se | \( \delta s\) |
Definition at line 605 of file SimpleCorrect.C.
Scale a 2 dimensional distribution \( h(x,y)\) to a distribution \( s\pm\delta s\)
\[ r(x,y) = \frac{h(x,y)}{s} \]
Errors are propagated
h | \( h(x,y)\) |
s | \( s\) |
se | \( \delta s\) |
Definition at line 638 of file SimpleCorrect.C.
TH1* SetAttr | ( | TH1 * | h, |
Color_t | color, | ||
Style_t | marker = 20 , |
||
Double_t | size = 1. , |
||
Style_t | fill = 0 , |
||
Style_t | line = 1 , |
||
Width_t | width = 1 |
||
) |
Set attributes on a histogram
h | Histogram to modify |
color | Marker, line, fill color |
marker | Marker style |
size | Base marker size |
fill | Fill style |
line | Line style |
width | Line width |
Definition at line 414 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), GetDelta(), AliTrackletAODdNdeta::Histos::IsGenerated(), SimpleCorrect(), spectra::Cent::Terminate(), and AliTrackletAODdNdeta::Histos::WorkerInit().
void ShowStats | ( | TList * | list, |
const char * | title, | ||
const char * | path | ||
) |
Print the stats stored in hStat histogram
list | List to get histogram from |
title | Title |
path | Path to the file |
Definition at line 1628 of file SimpleCorrect.C.
Referenced by SimpleCorrect().
void SimpleCorrect | ( | UShort_t | flags = 0x3 , |
UShort_t | scaleMode = 1 , |
||
const char * | realFileName = "trdt.root" , |
||
const char * | simFileName = "trmc.root" , |
||
Int_t | nBins = 9 , |
||
const char * | otherFileName = "" |
||
) |
Correct measured tracklet distributions using MC. The flags select how to do the correction. It is a bit mask of options.
Scale mode can be one of
The input is two files generated by running AliTrackletTaskMulti on real and simulated data. The files are expected to be in trdt.root for real data and trmc.root for simulated data.
flags | Flags for the processing |
scaleMode | Scaling mode |
realFileName | Name of real input file |
simFileName | Name of simulation input file |
nBins | Number of bins to process |
otherFileName | Name of aux input file |
Definition at line 1678 of file SimpleCorrect.C.
Referenced by Correct().
const Color_t cc[] |
Color scale
Definition at line 36 of file SimpleCorrect.C.
Referenced by CorrectOneBin(), and SimpleCorrect().
const char* dndetaTitle = "d#it{N}_{ch}/d#it{#eta}" |
const Bool_t kSimpleCorrectLoaded = true |
Definition at line 27 of file SimpleCorrect.C.