AliRoot Core  3dc7879 (3dc7879)
TStatToolkit Namespace Reference

Summary of statistics functions. More...

Enumerations

enum  TStatType {
  kEntries, kSum, kMean, kRMS,
  kMedian, kLTM, kLTMRMS
}
 
enum  ENormType {
  kL1, kL2, kLp, kMax,
  kHamming, kNNormType
}
 

Functions

void EvaluateUni (Int_t nvectors, Double_t *data, Double_t &mean, Double_t &sigma, Int_t hh)
 
void EvaluateUniExternal (Int_t nvectors, Double_t *data, Double_t &mean, Double_t &sigma, Int_t hh, Float_t externalfactor=1)
 
Int_t Freq (Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down)
 
template<typename T >
void TruncatedMean (const TH1 *his, TVectorT< T > *param, Float_t down=0, Float_t up=1.0, Bool_t verbose=kFALSE)
 
void MedianFilter (TH1 *his1D, Int_t nmedian)
 
template<typename T >
Bool_t LTMHisto (TH1 *his, TVectorT< T > &param, Float_t fraction=1)
 
template<typename T >
Int_t * LTMUnbinned (int np, const T *arr, TVectorT< T > &params, Float_t keep=1.0)
 
template<typename T >
void Reorder (int np, T *arr, const int *idx)
 
template<typename T >
void LTM (TH1 *his, TVectorT< T > *param=0, Float_t fraction=1, Bool_t verbose=kFALSE)
 
template<typename T >
Double_t FitGaus (TH1 *his, TVectorT< T > *param=0, TMatrixT< T > *matrix=0, Float_t xmin=0, Float_t xmax=0, Bool_t verbose=kFALSE)
 
template<typename T >
Double_t FitGaus (Float_t *arr, Int_t nBins, Float_t xMin, Float_t xMax, TVectorT< T > *param=0, TMatrixT< T > *matrix=0, Bool_t verbose=kFALSE)
 
Float_t GetCOG (const Short_t *arr, Int_t nBins, Float_t xMin, Float_t xMax, Float_t *rms=0, Float_t *sum=0)
 
TGraph2D * MakeStat2D (TH3 *his, Int_t delta0, Int_t delta1, Int_t type)
 
TGraphErrors * MakeStat1D (TH2 *his, Int_t deltaBin, Double_t fraction, Int_t returnType, Int_t markerStyle, Int_t markerColor)
 
Double_t RobustBinMedian (TH1 *hist, Double_t fractionCut=1.)
 
THashList * AddMetadata (TTree *, const char *vartagName, const char *varTagValue)
 
TNamed * GetMetadata (TTree *tree, const char *vartagName, TString *prefix=0, Bool_t fullMatch=kFALSE)
 
THashList * GetMetadata (TTree *tree)
 
TGraph * MakeGraphSparse (TTree *tree, const char *expr="Entry", const char *cut="1", Int_t mstyle=25, Int_t mcolor=1, Float_t msize=-1, Float_t offset=0.0)
 
TGraphErrors * MakeGraphErrors (TTree *tree, const char *expr="Entry", const char *cut="1", Int_t mstyle=25, Int_t mcolor=1, Float_t msize=-1, Float_t offset=0.0, Int_t entries=10000000, Int_t firstEntry=0)
 
TMultiGraph * MakeMultGraph (TTree *tree, const char *groupName, const char *expr, const char *cut, const char *markers, const char *colors, Bool_t drawSparse, Float_t msize, Float_t sigmaRange, TLegend *legend, Bool_t comp=kTRUE)
 
void RebinSparseGraph (TGraph *graph0, TGraph *graph1, Option_t *option="")
 
void RebinSparseMultiGraph (TMultiGraph *multiGraph, TGraph *graphRef)
 
void MakeMultiGraphSparse (TMultiGraph *multiGraph)
 
TString * FitPlane (TTree *tree, const char *drawCommand, const char *formula, const char *cuts, Double_t &chi2, Int_t &npoints, TVectorD &fitParam, TMatrixD &covMatrix, Float_t frac=-1, Int_t start=0, Int_t stop=10000000, Bool_t fix0=kFALSE)
 
TString * FitPlaneFixed (TTree *tree, const char *drawCommand, const char *formula, const char *cuts, Double_t &chi2, Int_t &npoints, TVectorD &fitParam, TMatrixD &covMatrix, Float_t frac=-1, Int_t start=0, Int_t stop=10000000)
 
TString * FitPlaneConstrain (TTree *tree, const char *drawCommand, const char *formula, const char *cuts, Double_t &chi2, Int_t &npoints, TVectorD &fitParam, TMatrixD &covMatrix, Float_t frac=-1, Int_t start=0, Int_t stop=10000000, Double_t constrain=-1)
 
Int_t GetFitIndex (const TString fString, const TString subString)
 
TString FilterFit (const TString &input, const TString filter, TVectorD &vec, TMatrixD &covar)
 
void Update1D (Double_t delta, Double_t sigma, Int_t s1, TMatrixD &param, TMatrixD &covar)
 
void Constrain1D (const TString &input, const TString filter, TVectorD &param, TMatrixD &covar, Double_t mean, Double_t sigma)
 
TString MakeFitString (const TString &input, const TVectorD &param, const TMatrixD &covar, Bool_t verbose=kFALSE)
 
Int_t MakeStatAlias (TTree *tree, const char *expr, const char *cut, const char *alias)
 
void MakeAnchorAlias (TTree *tree, TString &sTrendVars, Int_t doCheck, Int_t verbose)
 
void MakeCombinedAlias (TTree *tree, TString &sCombinedStatus, Bool_t doCheck, Int_t verbose)
 
Int_t SetStatusAlias (TTree *tree, const char *expr, const char *cut, const char *alias)
 
TMultiGraph * MakeStatusMultGr (TTree *tree, const char *expr, const char *cut, const char *alias, Int_t igr=0)
 
void AddStatusPad (TCanvas *c1, Float_t padratio, Float_t bottommargin)
 
void DrawMultiGraph (TMultiGraph *graph, Option_t *option)
 
void DrawStatusGraphs (TObjArray *oaMultGr)
 
TTree * WriteStatusToTree (TObject *oStatusGr)
 
TMultiGraph * MakeStatusLines (TTree *tree, const char *expr, const char *cut, const char *alias)
 
void MakeSummaryTree (TTree *treeIn, TTreeSRedirector *pcstream, TObjString &sumID, TCut &selection)
 
Double_t GetDefaultStat (TTree *tree, const char *var, const char *selection, TStatType statType)
 
void MakeDistortionMap (Int_t iter, THnBase *histo, TTreeSRedirector *pcstream, TMatrixD &projectionInfo, Int_t dumpHisto=100, Int_t verbose=kFALSE)
 
void MakeDistortionMapFast (THnBase *histo, TTreeSRedirector *pcstream, TMatrixD &projectionInfo, Int_t verbose=0, Double_t fractionCut=0.1, const char *estimators=0)
 
void CombineArray (TTree *tree, TVectorD &values)
 
Double_t GetDistance (const TVectorD &values, const ENormType normType, const Bool_t normaliseToEntries=kFALSE, const Double_t pvalue=1.)
 
Double_t GetDistance (const Int_t size, const Double_t *values, const ENormType normType, const Bool_t normaliseToEntries=kFALSE, const Double_t pvalue=1.)
 
Double_t GetDistance (TTree *tree, const char *var, const char *selection, const ENormType normType, const Bool_t normaliseToEntries=kFALSE, const Double_t pvalue=1.)
 
TH1 * DrawHistogram (TTree *tree, const char *drawCommand, const char *cuts="1", const char *hname="histo", const char *htitle="histo", Int_t nsigma=4, Float_t fraction=0.75, TObjArray *description=0)
 
Int_t AdaptHistoMetadata (TTree *tree, TH1 *histogram, TString option)
 
void TestGausFit (Int_t nhistos=5000)
 
void CheckTreeAliases (TTree *tree, Int_t ncheck)
 
template<typename T >
void GetMinMax (const T *arr, Long64_t n, double &minVal, double &maxVal)
 
template<typename T >
void GetMinMaxMean (const T *arr, Long64_t n, double &minVal, double &maxVal, double &meanVal)
 

Detailed Description

Summary of statistics functions.

Authors
Marian Ivanov, Jens Wiechula, Ruben Shahoian, Sebastian Lehner ... Subset of mathematical functions not included in the TMath
Marian Ivanov maria.nosp@m.n.iv.nosp@m.anov@.nosp@m.cern.nosp@m..ch, Jens Wiechula, Ruben Shahoian, Sebastian Lehner ...

Enumeration Type Documentation

Enumerator
kL1 
kL2 
kLp 
kMax 
kHamming 
kNNormType 

Definition at line 56 of file TStatToolkit.h.

Enumerator
kEntries 
kSum 
kMean 
kRMS 
kMedian 
kLTM 
kLTMRMS 

Definition at line 55 of file TStatToolkit.h.

Function Documentation

Int_t TStatToolkit::AdaptHistoMetadata ( TTree *  tree,
TH1 *  histogram,
TString  option 
)

Adapt style for histogram created by TTree queries

Parameters
tree- input tree (owner of metadata)
histogram- pointer to histogram to AdaptStyle if NULL tree->GetHistogram used
option- draw option
Returns

TODO - TEMPORARY -make z tilte vissible - using pallet size should be done using CSS

Definition at line 3131 of file TStatToolkit.cxx.

THashList * TStatToolkit::AddMetadata ( TTree *  tree,
const char *  varTagName,
const char *  varTagValue 
)

AddMetadata to the input tree - see https://alice.its.cern.ch/jira/browse/ATO-290

Parameters
tree- input tree
varTagName- tag to register
varTagValue- value
Returns
- return has list Currently supported metadata

Definition at line 1078 of file TStatToolkit.cxx.

Referenced by addHtmlMetadata(), AliExternalInfo::BuildIndex(), AliTreePlayer::LoadTrees(), logbookAddMetadata(), qaitsAddMetadata(), qatpcAddMetadata(), qatrdAddMetadata(), and AliTPCclusterFast::SetMetadata().

void TStatToolkit::AddStatusPad ( TCanvas *  c1,
Float_t  padratio,
Float_t  bottommargin 
)

Definition at line 1902 of file TStatToolkit.cxx.

void TStatToolkit::CheckTreeAliases ( TTree *  tree,
Int_t  ncheck 
)

Definition at line 2314 of file TStatToolkit.cxx.

void TStatToolkit::CombineArray ( TTree *  tree,
TVectorD &  values 
)

Collect all variables from the last draw in one array.

It is assumed that the Draw function of the TTree was called before if e.g. Draw("v1:v2:v3") had been called, then values will contain the concatenated array of the values from v1,v2 and v3. E.g. if the v1[0..n], v2[0..n], v3[0..n] then values[0..3n] = [v1, v2, v3]

Parameters
[in]treeinput tree
[out]valuesarray in which to summarise all 'drawn' values

Definition at line 2359 of file TStatToolkit.cxx.

Referenced by GetDistance().

void TStatToolkit::Constrain1D ( const TString &  input,
const TString  filter,
TVectorD &  param,
TMatrixD &  covar,
Double_t  mean,
Double_t  sigma 
)

Definition at line 941 of file TStatToolkit.cxx.

TH1 * TStatToolkit::DrawHistogram ( TTree *  tree,
const char *  drawCommand,
const char *  cuts = "1",
const char *  hname = "histo",
const char *  htitle = "histo",
Int_t  nsigma = 4,
Float_t  fraction = 0.75,
TObjArray description = 0 
)

Definition at line 2216 of file TStatToolkit.cxx.

void TStatToolkit::DrawMultiGraph ( TMultiGraph *  graph,
Option_t *  option 
)
void TStatToolkit::DrawStatusGraphs ( TObjArray oaMultGr)

Definition at line 1933 of file TStatToolkit.cxx.

void TStatToolkit::EvaluateUni ( Int_t  nvectors,
Double_t *  data,
Double_t &  mean,
Double_t &  sigma,
Int_t  hh 
)
void TStatToolkit::EvaluateUniExternal ( Int_t  nvectors,
Double_t *  data,
Double_t &  mean,
Double_t &  sigma,
Int_t  hh,
Float_t  externalfactor = 1 
)

Definition at line 92 of file TStatToolkit.cxx.

TString TStatToolkit::FilterFit ( const TString &  input,
const TString  filter,
TVectorD &  vec,
TMatrixD &  covar 
)

Definition at line 862 of file TStatToolkit.cxx.

template<typename T >
Double_t TStatToolkit::FitGaus ( TH1 *  his,
TVectorT< T > *  param = 0,
TMatrixT< T > *  matrix = 0,
Float_t  xmin = 0,
Float_t  xmax = 0,
Bool_t  verbose = kFALSE 
)

Definition at line 347 of file TStatToolkit.h.

Referenced by TestGausFit().

template<typename T >
Double_t TStatToolkit::FitGaus ( Float_t *  arr,
Int_t  nBins,
Float_t  xMin,
Float_t  xMax,
TVectorT< T > *  param = 0,
TMatrixT< T > *  matrix = 0,
Bool_t  verbose = kFALSE 
)

Definition at line 489 of file TStatToolkit.h.

TString * TStatToolkit::FitPlane ( TTree *  tree,
const char *  drawCommand,
const char *  formula,
const char *  cuts,
Double_t &  chi2,
Int_t &  npoints,
TVectorD &  fitParam,
TMatrixD &  covMatrix,
Float_t  frac = -1,
Int_t  start = 0,
Int_t  stop = 10000000,
Bool_t  fix0 = kFALSE 
)
TString * TStatToolkit::FitPlaneConstrain ( TTree *  tree,
const char *  drawCommand,
const char *  formula,
const char *  cuts,
Double_t &  chi2,
Int_t &  npoints,
TVectorD &  fitParam,
TMatrixD &  covMatrix,
Float_t  frac = -1,
Int_t  start = 0,
Int_t  stop = 10000000,
Double_t  constrain = -1 
)

Definition at line 625 of file TStatToolkit.cxx.

Referenced by DrawDriftCorel().

TString * TStatToolkit::FitPlaneFixed ( TTree *  tree,
const char *  drawCommand,
const char *  formula,
const char *  cuts,
Double_t &  chi2,
Int_t &  npoints,
TVectorD &  fitParam,
TMatrixD &  covMatrix,
Float_t  frac = -1,
Int_t  start = 0,
Int_t  stop = 10000000 
)

Definition at line 735 of file TStatToolkit.cxx.

Int_t TStatToolkit::Freq ( Int_t  n,
const Int_t *  inlist,
Int_t *  outlist,
Bool_t  down 
)

Definition at line 145 of file TStatToolkit.cxx.

Float_t TStatToolkit::GetCOG ( const Short_t *  arr,
Int_t  nBins,
Float_t  xMin,
Float_t  xMax,
Float_t *  rms = 0,
Float_t *  sum = 0 
)

Definition at line 217 of file TStatToolkit.cxx.

Double_t TStatToolkit::GetDefaultStat ( TTree *  tree,
const char *  var,
const char *  selection,
TStatType  statType 
)

Definition at line 2336 of file TStatToolkit.cxx.

Double_t TStatToolkit::GetDistance ( const TVectorD &  values,
const ENormType  normType,
const Bool_t  normaliseToEntries = kFALSE,
const Double_t  pvalue = 1. 
)

Calculate the distance of the elements in values using a certain norm

Parameters
[in]valuesarray with input values
[in]normTypenormalisation to use
[in]normaliseToEntriesdivide the norm by the number of eleements ('average norm')
[in]pvaluethe p value for the p-type norm, ignored for all other norms
Returns
calculated distance

Definition at line 2392 of file TStatToolkit.cxx.

Referenced by GetDistance(), and TestNormTypes().

Double_t TStatToolkit::GetDistance ( const Int_t  size,
const Double_t *  values,
const ENormType  normType,
const Bool_t  normaliseToEntries = kFALSE,
const Double_t  pvalue = 1. 
)

Calculate the distance of the elements in values using a certain norm

See also
GetDistance()

Definition at line 2446 of file TStatToolkit.cxx.

Double_t TStatToolkit::GetDistance ( TTree *  tree,
const char *  var,
const char *  selection,
const ENormType  normType,
const Bool_t  normaliseToEntries = kFALSE,
const Double_t  pvalue = 1. 
)

Calculate the distance of the values selecte in tree->Draw(var, selection)

If var contains more than one variable (separated by ':' as usual) the arrays are concatenated:
E.g. if var="v1:v2:v3", then the norm of the the concatenated array of the values from v1,v2 and v3 will be calculated:
This means if the internal tree arrays for each variable are v1[0..n], v2[0..n], v3[0..n] then the norm of vx[0..3n] = [v1, v2, v3] is calculated.

Parameters
[in]treeinput tree
[in]varvariable expression for the tree->Draw()
[in]selectionselection for the tree->Draw()
[in]normTypenorm to use for calculating the point distances
[in]normaliseToEntriesdivide the norm by the number of eleements ('average norm')
[in]pvaluep-value for the p-norm (ignored for other norm types
Returns
calculated distnace

Definition at line 2457 of file TStatToolkit.cxx.

Int_t TStatToolkit::GetFitIndex ( const TString  fString,
const TString  subString 
)

Definition at line 838 of file TStatToolkit.cxx.

TNamed * TStatToolkit::GetMetadata ( TTree *  tree,
const char *  varTagName,
TString *  prefix = 0,
Bool_t  fullMatch = kFALSE 
)

Get metadata description In case metadata contains friend part - friend path os returned as prefix Metadata are supposed to be added into tree using TStatToolkit::AddMetadata() function

Parameters
tree- input tree
varTagName- tag name
prefix- friend prefix in case metadata are in friend tree
fullMatch- request full match in varTagName (to enable different metadata for tree and friend tree)
Returns
- metadata description TODO: too many string operations - to be speed up using char array arithmetic

Definition at line 1106 of file TStatToolkit.cxx.

Referenced by AdaptHistoMetadata(), AddMetadata(), AliTreeTrending::DecomposeStatusAlias(), DrawHistogram(), AliTMinuitToolkit::GetFitFunctionAsAlias(), MakeGraphErrors(), MakeGraphSparse(), AliTreePlayer::MakeHistograms(), MakeMultGraph(), AliTreePlayer::selectTreeInfo(), and AliTreePlayer::selectWhatWhereOrderBy().

THashList * TStatToolkit::GetMetadata ( TTree *  tree)

Definition at line 3150 of file TStatToolkit.cxx.

template<typename T >
void TStatToolkit::GetMinMax ( const T *  arr,
Long64_t  n,
double &  minVal,
double &  maxVal 
)

Definition at line 166 of file TStatToolkit.h.

template<typename T >
void TStatToolkit::GetMinMaxMean ( const T *  arr,
Long64_t  n,
double &  minVal,
double &  maxVal,
double &  meanVal 
)

Definition at line 180 of file TStatToolkit.h.

Referenced by DrawHistogram().

template<typename T >
void TStatToolkit::LTM ( TH1 *  his,
TVectorT< T > *  param = 0,
Float_t  fraction = 1,
Bool_t  verbose = kFALSE 
)

Definition at line 444 of file TStatToolkit.h.

Referenced by MakeStat2D(), and TestLTM().

template<typename T >
Bool_t TStatToolkit::LTMHisto ( TH1 *  his,
TVectorT< T > &  param,
Float_t  fraction = 1 
)

Definition at line 228 of file TStatToolkit.h.

Referenced by MakeDistortionMapFast(), MakeStat1D(), and TestLTM().

template<typename T >
Int_t * TStatToolkit::LTMUnbinned ( int  np,
const T *  arr,
TVectorT< T > &  params,
Float_t  keep = 1.0 
)

Definition at line 629 of file TStatToolkit.h.

Referenced by AliTreePlayer::AddStatInfo().

void TStatToolkit::MakeAnchorAlias ( TTree *  tree,
TString &  sTrendVars,
Int_t  doCheck,
Int_t  verbose 
)

Build anchor aliases and check consistency of aliases strings Input:

Parameters
tree- input tree
doCheck- force check of the variables if valid formulas are used (slow down execution)
verbose- verbosity level
sTrendVars- semicolomn seprated list of tuples with 5 elements tuple: (variable, variableAnchor, deltaWarning,deltaError, PhysAcc) <variable>_AnchorWarning:= |variable-variableAnchor|>deltaWarning <variable>_AnchorError:= |variable-variableAnchor|>deltaError <variable>_AnchorPhysAcceptable:= |variable-variableAnchor|>PhysAcc Example configuration:

Definition at line 1685 of file TStatToolkit.cxx.

void TStatToolkit::MakeCombinedAlias ( TTree *  tree,
TString &  sCombinedStatus,
Bool_t  doCheck,
Int_t  verbose 
)

============================================================== Build combined aliases as a logical OR of subexpressions and check consistency for combined status

Parameters
tree- input tree
doCheck- flag to check validity of aliases (time consuminng to evaluat formulas)
verbose- specify verbosity (verbode>0 recomended)
sCombinedStatus- coma separated list of expression
  • <combinedAlias, expr0, expr1, expr2, ....> Example: make combined status for the ncl and DCAResol TString sCombinedStatus=";"; sCombinedStatus+="ncl,TPC.Anchor.meanTPCncl,TPC.Anchor.meanTPCnclF;"; // Status number of clusters and findable clusters

    sCombinedStatus+="dcarResol,TPC.Anchor.dcarAP0,TPC.Anchor.dcarAP1,TPC.Anchor.dcarCP0,TPC.Anchor.dcarCP1;"; // Status: DCA resolution

Definition at line 1759 of file TStatToolkit.cxx.

void TStatToolkit::MakeDistortionMap ( Int_t  iter,
THnBase *  histo,
TTreeSRedirector pcstream,
TMatrixD &  projectionInfo,
Int_t  dumpHisto = 100,
Int_t  verbose = kFALSE 
)

Definition at line 2485 of file TStatToolkit.cxx.

void TStatToolkit::MakeDistortionMapFast ( THnBase *  histo,
TTreeSRedirector pcstream,
TMatrixD &  projectionInfo,
Int_t  verbose = 0,
Double_t  fractionCut = 0.1,
const char *  estimators = 0 
)

dump all histograms fraction>=1 independent of the status

Definition at line 2623 of file TStatToolkit.cxx.

TString TStatToolkit::MakeFitString ( const TString &  input,
const TVectorD &  param,
const TMatrixD &  covar,
Bool_t  verbose = kFALSE 
)

Definition at line 976 of file TStatToolkit.cxx.

TGraphErrors * TStatToolkit::MakeGraphErrors ( TTree *  tree,
const char *  expr = "Entry",
const char *  cut = "1",
Int_t  mstyle = 25,
Int_t  mcolor = 1,
Float_t  msize = -1,
Float_t  offset = 0.0,
Int_t  entries = 10000000,
Int_t  firstEntry = 0 
)
TGraph * TStatToolkit::MakeGraphSparse ( TTree *  tree,
const char *  expr = "Entry",
const char *  cut = "1",
Int_t  mstyle = 25,
Int_t  mcolor = 1,
Float_t  msize = -1,
Float_t  offset = 0.0 
)
TMultiGraph * TStatToolkit::MakeMultGraph ( TTree *  tree,
const char *  groupName,
const char *  expr,
const char *  cut,
const char *  styles,
const char *  colors,
Bool_t  drawSparse,
Float_t  msize,
Float_t  sigmaRange,
TLegend *  legend,
Bool_t  comp = kTRUE 
)

Create MultiGraphs

Parameters
tree- tree containing data to be plot
groupname- name of the output graph
expr- string <variablearray>:<tagID>:<variablearrayError> <variablearray>="var0; ...; varN <variablearrayError>="err0; ...;errN" \param cut - string "selection", resp. cut array - <variablearray>="defaultCut;cut0;cut1;...; cutN" \param markers - "marker0:...; markerN" \param colors - "color0:...; colorN"
drawSparse- swith use sparse drawing
comp- swith: demanding that every variable in expr returned a plot OR accepting variables yielding no result Example usage
Example usage of the TSTatToolkit::MakeMultGraph for T0 QA :
legend=new TLegend(0.1,0.1,0.3,0.3,"T0 <Q> per sector");
legend->SetNColumns(2);
TMultiGraph * mGraph=TStatToolkit::MakeMultGraph(tree, "T0 <Q>","amplPMT1;amplPMT2;amplPMT3;amplPMT4;amplPMT5;amplPMT6:tagID:0.02;0.02;0.02;0.02;0.02;0.02","","21;22;25;26;27;28","1;2;4;3;856;616",kTRUE,0.9,10, legend);
mGraph->Draw();
legend->Draw();

Definition at line 1299 of file TStatToolkit.cxx.

Referenced by AliTreeTrending::AppendBand(), AliTreeTrending::AppendDefaultBands(), AliTreeTrending::AppendDefaultBandsMinMax(), drawLogbookMultiCut(), drawLogbookMultiExpr(), and AliTreeTrending::MakePlot().

void TStatToolkit::MakeMultiGraphSparse ( TMultiGraph *  multiGraph)

MakeMultiGraphSparse - transform TMultiGraph using sparse representation for X axis

  • Currently the code is working only for the integer x values
  • TODO Support for the string x values
    Parameters
    multiGraphExample case: Rebin run lists

Input graph with run list for the logbook, QA.TPC and QA.EVS

  • Logbook runs list 192 entries
  • QA.TPC run list has 11 runs
  • QA.EVS has 8 runs

Output multi graph

  • x axis with 192 bins (superset of all runs)
AliExternalInfo info; tree = info->GetTree("Logbook","LHC15o","pass3_lowIR_pidfix","Logbook;QA.TPC;QA.EVS")
graph = TStatToolkit::MakeMultGraph(tree,"","Logbook.run;QA.EVS.run;QA.TPC.run:run","runDuration>600","25;21;24","1;2;4",0,1,10,0);

Definition at line 3088 of file TStatToolkit.cxx.

TGraphErrors * TStatToolkit::MakeStat1D ( TH2 *  his,
Int_t  deltaBin,
Double_t  fraction,
Int_t  returnType,
Int_t  markerStyle,
Int_t  markerColor 
)

Definition at line 391 of file TStatToolkit.cxx.

Referenced by AliTreePlayer::DrawHistograms(), Test1D(), and TestLTM().

TGraph2D * TStatToolkit::MakeStat2D ( TH3 *  his,
Int_t  delta0,
Int_t  delta1,
Int_t  type 
)

Definition at line 348 of file TStatToolkit.cxx.

Int_t TStatToolkit::MakeStatAlias ( TTree *  tree,
const char *  expr,
const char *  cut,
const char *  alias 
)

Definition at line 1534 of file TStatToolkit.cxx.

TMultiGraph * TStatToolkit::MakeStatusLines ( TTree *  tree,
const char *  expr,
const char *  cut,
const char *  alias 
)

Definition at line 2169 of file TStatToolkit.cxx.

TMultiGraph * TStatToolkit::MakeStatusMultGr ( TTree *  tree,
const char *  expr,
const char *  cut,
const char *  alias,
Int_t  igr = 0 
)

Compute a trending multigraph that shows for which runs a variable has outliers. format of expr : varname:xaxis (e.g. meanTPCncl:run, but 'varname' can be any string that you need for seach-and-replace) format of cut : char like in TCut format of alias: (1):(statisticOK):(varname_Warning):(varname_Out)[:(varname_PhysAcc):(varname_Extra)]

function MakeGraphSparse() is called for each alias argument, which will be used as tree expression. each alias argument is supposed to be a Boolean statement which can be evaluated as tree expression. the order of these criteria should be kept, as the marker styles and colors are chosen to be meaningful this way! 'statisticOK' could e.g. be an alias for '(meanTPCncl>0)'. if you dont need e.g. a 'warning' condition, then just replace it by (0). in the alias, 'varname' will be replaced by its content (e.g. varname_Out -> meanTPCncl_Out) note: the aliases 'varname_Out' etc have to be defined by function TStatToolkit::SetStatusAlias(...) counter igr is used to shift the multigraph in y when filling a TObjArray.

Parameters
tree- tree containing data to be plot
expr- string <variablearray>:<tagID>:<variablearrayError> <variablearray>="var0; ...; varN <variablearrayError>="err0; ...;errN"
alias- Boolean statement which can be evaluated as tree expression
igr- counter used to shift the multigraph in y when filling a TObjArray Example usage
To create the Status Bar, the following is done in principle.
( example current usage in $ALICE_ROOT/PWGPP/TPC/macros/drawPerformanceTPCQAMatchTrends.C and ./qaConfig.C. )
TStatToolkit::SetStatusAlias(tree, "meanTPCncl", "", "varname_Out:(abs(varname-MeanEF)>6.*RMSEF):0.8");
TStatToolkit::SetStatusAlias(tree, "tpcItsMatchA", "", "varname_Out:(abs(varname-MeanEF)>6.*RMSEF):0.8");
TStatToolkit::SetStatusAlias(tree, "meanTPCncl", "", "varname_Warning:(abs(varname-MeanEF)>3.*RMSEF):0.8");
TStatToolkit::SetStatusAlias(tree, "tpcItsMatchA", "", "varname_Warning:(abs(varname-MeanEF)>3.*RMSEF):0.8");
TObjArray* oaMultGr = new TObjArray(); int igr=0;
oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "tpcItsMatchA:run", "", "(1):(meanTPCncl>0):(varname_Warning):(varname_Outlier):", igr) ); igr++;
oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "meanTPCncl:run", "", "(1):(meanTPCncl>0):(varname_Warning):(varname_Outlier):", igr) ); igr++;
TCanvas *c1 = new TCanvas("c1","c1");

Definition at line 1853 of file TStatToolkit.cxx.

Referenced by AliTreeTrending::MakeMultiGraphStatus().

void TStatToolkit::MakeSummaryTree ( TTree *  treeIn,
TTreeSRedirector pcstream,
TObjString &  sumID,
TCut &  selection 
)

Definition at line 2106 of file TStatToolkit.cxx.

void TStatToolkit::MedianFilter ( TH1 *  his1D,
Int_t  nmedian 
)

Definition at line 192 of file TStatToolkit.cxx.

void TStatToolkit::RebinSparseGraph ( TGraph *  graph0,
TGraph *  graph1,
Option_t *  option = "" 
)

Remap bin labels for sparse graphs

Parameters
graph0- sparse graph to be rebinned
graph1- graph with "template x axis" (default)
option- TODO - implement merge option as an option

Example - remap sparse run list of QA.EVS graph to be like as in Logbook run list

AliExternalInfo info; tree = info->GetTree("QA.TPC","LHC15o","pass1","Logbook;QA.TPC;QA.EVS")
graph = TStatToolkit::MakeMultGraph(tree,"","Logbook.run;QA.EVS.run:run","run>0","21;21","2;4",1.0,1,4,0);
graph1 = (TGraph*)graph->GetListOfGraphs()->At(0); graph0 = (TGraph*)graph->GetListOfGraphs()->At(1);
//

Definition at line 3010 of file TStatToolkit.cxx.

Referenced by RebinSparseMultiGraph().

void TStatToolkit::RebinSparseMultiGraph ( TMultiGraph *  multiGraph,
TGraph *  graphRef 
)

Rebin sparse MultiGraph to have the same granularity of x axis as in reference graphRef

Parameters
multiGraph- multiGraph to remap
graphRef- reference graph

Used e.g to remap graphs in case of missing measurement in one of the sources

  • e.g Logbook run list for period LHC15o is longer than run list for the QA.EVS and QA.TPC "pass3_lowIR_pidfix"
AliExternalInfo info; tree = info->GetTree("Logbook","LHC15o","pass3_lowIR_pidfix","Logbook;QA.TPC;QA.EVS")
graph = TStatToolkit::MakeMultGraph(tree,"","Logbook.run;QA.TPC.run;QA.EVS.run:run","runDuration>600","25;21;24","1;2;4",1.5,1,4,0);

Definition at line 3053 of file TStatToolkit.cxx.

Referenced by AliTreeTrending::AppendBand(), AliTreeTrending::AppendDefaultBands(), AliTreeTrending::AppendDefaultBandsMinMax(), AliTreeTrending::MakePlot(), and AliTreeTrending::MakeStatusPlot().

template<typename T >
void TStatToolkit::Reorder ( int  np,
T *  arr,
const int *  idx 
)

Definition at line 709 of file TStatToolkit.h.

Double_t TStatToolkit::RobustBinMedian ( TH1 *  hist,
Double_t  fractionCut = 1. 
)

Definition at line 493 of file TStatToolkit.cxx.

Referenced by MakeStat1D().

Int_t TStatToolkit::SetStatusAlias ( TTree *  tree,
const char *  expr,
const char *  cut,
const char *  alias 
)

Definition at line 1587 of file TStatToolkit.cxx.

void TStatToolkit::TestGausFit ( Int_t  nhistos = 5000)

Definition at line 265 of file TStatToolkit.cxx.

template<typename T >
void TStatToolkit::TruncatedMean ( const TH1 *  his,
TVectorT< T > *  param,
Float_t  down = 0,
Float_t  up = 1.0,
Bool_t  verbose = kFALSE 
)

Definition at line 197 of file TStatToolkit.h.

void TStatToolkit::Update1D ( Double_t  delta,
Double_t  sigma,
Int_t  s1,
TMatrixD &  param,
TMatrixD &  covar 
)

Definition at line 888 of file TStatToolkit.cxx.

Referenced by Constrain1D().

TTree * TStatToolkit::WriteStatusToTree ( TObject *  oStatusGr)

Definition at line 1962 of file TStatToolkit.cxx.