]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ATO-1 - Modification for the stautus bars and status lines. author=<preichelt@ikf...
authormivanov <marian.ivanov@cern.ch>
Sat, 13 Sep 2014 21:08:48 +0000 (23:08 +0200)
committermivanov <marian.ivanov@cern.ch>
Sat, 13 Sep 2014 21:32:42 +0000 (23:32 +0200)
PWGPP/TPC/macros/drawPerformanceTPCQAMatchTrends.C
PWGPP/TPC/macros/qaConfig.C

index 00911120100503c6b4269597aea7f4e46a5446fd..4cdb76063f712a6ae5021d3abc7cc168439ea05c 100644 (file)
@@ -1,27 +1,33 @@
 
 // 05.2013 new functionality: Status Bar
-// to set the variables, do the following. more info & examples in the TStatToolkit.
+// 07.2014 updated to steer most of this from the qaConfig.C
+// 09.2014 new functions to produce status lines from aliases and to write status infos to a tree for later use (see TStatToolkit).
+// to set the status variables, the following is done in principle. more info & examples in the TStatToolkit 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):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "meanTPCncl:run",    "", "(1):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
-  TStatToolkit::DrawStatusGraphs(oaMultGr);
-  }*/
-
-
-drawPerformanceTPCQAMatchTrends(const char* inFile = "tree_list", const char* runType="pp") {
+ 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++;
+ TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
+ TStatToolkit::DrawStatusGraphs(oaMultGr);
+ }*/
+
+
+TTree *tree;
+TTree *statusTree;
+
+drawPerformanceTPCQAMatchTrends(const char* inFile = "trending.root", const char* runType="pp") {
   //
   if (gSystem->Exec("ls qaConfig.C")==0)
-    gROOT->LoadMacro("qaConfig.C"); //if you run only this macro
+    gROOT->LoadMacro(  "qaConfig.C");
   else {
-    printf("now loading source/qaConfig.C\n");
-    gROOT->LoadMacro("source/qaConfig.C");
+    printf("now loading $ALICE_ROOT/PWGPP/TPC/macros/qaConfig.C\n");
+    gROOT->LoadMacro(  "$ALICE_ROOT/PWGPP/TPC/macros/qaConfig.C");
   }
+  
   //
   // colors & markers:
   Int_t colPosA=kGreen+2; //kRed;
@@ -35,19 +41,21 @@ drawPerformanceTPCQAMatchTrends(const char* inFile = "tree_list", const char* ru
   Int_t marC2=24;
   Int_t marSum=34;//full cross
   Int_t marCorr=31;//snowflake
-  // shifting of graphs for one run:
+  // shifting of graphs within one run for better visibility:
        Float_t sh_gr0=-0.3;
        Float_t sh_gr1=-0.1;
        Float_t sh_gr2=+0.1;
        Float_t sh_gr3=+0.3;
-
+  // properties of status lines:
+  // currently set in 'MakeStatusLines()'
+  
   gROOT->Reset();
   gROOT->SetStyle("Plain");
   gStyle->SetPalette(1);
   gStyle->SetLabelSize(0.04,"x");
   gStyle->SetPadTickX(1);
        gStyle->SetPadTickY(1);
-
+  
   float  ncl_min = 80, ncl_max = 140;
   float  ratio_min = 0.6, ratio_max = 1.2;
   float  mip_min = 30, mip_max = 60;
@@ -106,22 +114,22 @@ drawPerformanceTPCQAMatchTrends(const char* inFile = "tree_list", const char* ru
   
   // open input file
   //
-  TFile *file = TFile::Open(inFile);
-  if(!file) return;
-  file->cd();
+  TFile *_file0 = TFile::Open(inFile);
+  if(!_file0) return;
+  _file0->cd();
   
   //
-  TTree *tree = (TTree*)file->Get("tpcQA");
+  tree = (TTree*)_file0->Get("tpcQA");
   //TTree *tree = ch->GetTree();
   if(!tree) return;
   int const entries_tree = tree->GetEntries();
   cout<<"number of tree entries: "<<entries_tree<<endl; 
-
+  
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanTPCncl:run","");
   int const entries = gr->GetN();
   cout<<"number of graph entries: "<<entries<<endl;
   cout<<"(multiple occurences of runs removed)"<<endl;
-
+  
   if(entries<3)
     const float norm_runs = 8.0; 
   else if(entries<20)
@@ -132,7 +140,7 @@ drawPerformanceTPCQAMatchTrends(const char* inFile = "tree_list", const char* ru
     const float norm_runs = 50.0;
   // 50 is the max number of runs that shall be viewed on a 1700-wide canvas
   // only when there are more runs, the canvas shall become wider than that.
-
+  
   int const canvas_width  = int(((entries*1.0)/norm_runs)*1700.0);
   int const canvas_height = 600;
   gStyle->SetPadLeftMargin(0.1*900/canvas_width);
@@ -144,73 +152,62 @@ drawPerformanceTPCQAMatchTrends(const char* inFile = "tree_list", const char* ru
     gStyle->SetPadLeftMargin(0.1*norm_runs/(entries*1.0));
     gStyle->SetPadRightMargin(0.01*norm_runs/(entries*1.0));
   }
-
+  
   TCanvas *c1 = new TCanvas("can","can",canvas_width,canvas_height);
   c1->SetGrid(3);
   c1->cd();
-
+  
   //
-  // compute TPC Status graphs
-  TStatToolkit::SetStatusAlias(tree, "meanTPCncl",    "", "varname_Out:(abs(varname-MeanEF)>6.*RMSEF):0.8");
-  TStatToolkit::SetStatusAlias(tree, "meanMIP",       "", "varname_Out:(abs(varname-MeanEF)>6.*RMSEF):0.8");
-  TStatToolkit::SetStatusAlias(tree, "meanVertZ",     "", "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, "tpcItsMatchC",  "", "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, "meanMIP",       "", "varname_Warning:(abs(varname-MeanEF)>3.*RMSEF):0.8");
-  TStatToolkit::SetStatusAlias(tree, "meanVertZ",     "", "varname_Warning:(abs(varname-MeanEF)>3.*RMSEF):0.8");
-  TStatToolkit::SetStatusAlias(tree, "tpcItsMatchA",  "", "varname_Warning:(abs(varname-MeanEF)>3.*RMSEF):0.8");
-  TStatToolkit::SetStatusAlias(tree, "tpcItsMatchC",  "", "varname_Warning:(abs(varname-MeanEF)>3.*RMSEF):0.8");
+  // process config file qaConfig.C to initialize status aliases (outliers etc.), status bar criteria, status lines, ...
+  //
+  TString returnStrings[3];
+  qaConfig(tree, returnStrings);
+  // configures outlier criteria and descriptions for the needed TPC variables, as specified in the qaConfig.C.
+  // defines aliases according to these criteria.
+  
+  TString sStatusbarVars  = returnStrings[0];
+  TString sStatusbarNames = returnStrings[1];
+  TString sCriteria       = returnStrings[2];
+  cout << "sStatusbarVars = " << sStatusbarVars.Data() << endl;
+  cout << "sCriteria      = " << sCriteria.Data() << endl;
+  
+  //
+  // compute TPC status graphs
+  //
+  TObjArray* oaStatusbarVars = sStatusbarVars.Tokenize(";");
+  TObjArray* oaStatusbarNames = sStatusbarNames.Tokenize(";");
   TObjArray* oaMultGr = new TObjArray();
   int igr=0;
-  // the order in the status bar (top->down) will be the opposite of this order:
-  oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "tpcItsMatchC:run",  "", "(1):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "tpcItsMatchA:run",  "", "(1):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "meanVertZ:run",     "", "(1):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "meanMIP:run",       "", "(1):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, "meanTPCncl:run",    "", "(1):(varname_Out==0):(varname_Out):(varname_Warning)", igr) ); igr++;
-  // configure the pad in which they are plotted
-  Float_t statPadHeight=0.25; //fraction of canvas height
+  
+  for (Int_t vari=oaStatusbarVars->GetEntriesFast()-1; vari>=0; vari--) // invert the order of the status graphs
+  {
+    TString sVar = Form("%s:run", oaStatusbarVars->At(vari)->GetName()); //e.g. -> dcar:run
+    oaMultGr->Add( TStatToolkit::MakeStatusMultGr(tree, sVar.Data(),  "", sCriteria.Data(), igr) );
+    TString sYtitle = oaStatusbarNames->At(vari)->GetName(); // set better name for y axis of statuspad
+    ((TMultiGraph*) oaMultGr->At(igr))->SetTitle(sYtitle.Data());
+    igr++;
+  }
+  
+  //
+  // save status into Tree and write to rootfile
+  //
+  statusTree = TStatToolkit::WriteStatusToTree(oaMultGr);
+  //for testing with TMultiGraph (case of only 1 status variable):
+  //statusTree = WriteStatusToTree( TStatToolkit::MakeStatusMultGr(tree, "tpcItsMatch:run",  "", sCriteria.Data(), 0) );
+  TFile* file_out = new TFile("trendingStatusTree.root","RECREATE");
+  file_out->cd();
+  statusTree->Write();
+  file_out->Close();
+  Printf("Status tree written to file '%s'", file_out->GetName());
+  
+  
+  // configure the pad in which the status graphs are plotted ('status bar')
+  Float_t statPadHeight=0.30; //fraction of canvas height (was 0.25 until Aug 2014)
   Float_t statPadBotMar=0.40; //bottom margin of pad for run numbers
   //
-
-
-/****** 1/Pt  ******/
-// THIS CAN BE USED FOR TESTING!!!
- /*
-  TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"deltaPt:run:deltaPt_Err","",1,1,1);
-  DrawPlot(gr0, "deltaPt:run", marSum, 1.2, colSum, "AP");
-  TGraphErrors *gr2 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"deltaPtA:run:deltaPtA_Err","",1,1,1, +sh_gr1);
-  DrawPlot(gr2, "deltaPtA:run", marA1, 1.0, colPosA, "P");
-  TGraphErrors *gr4 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"deltaPtC:run:deltaPtC_Err","",1,1,1, -sh_gr1);
-  DrawPlot(gr4, "deltaPtC:run", marC1, 1.0, colPosC, "P");
-
-  gr0->GetHistogram()->SetYTitle("delta (1/pt) ");
-  gr0->GetHistogram()->SetTitle(". delta (1/pt)");
-  gr0->GetHistogram()->SetMinimum(-0.008);
-  gr0->GetHistogram()->SetMaximum(0.008);
-  gr0->GetXaxis()->LabelsOption("v");
+  c1->cd();
+  
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
-  leg->SetTextSize(0.03);
-  leg->SetFillColor(10);
-  leg->SetBorderSize(0);
-  leg->AddEntry("deltaPt:run","deltaPt: both sides","ap");
-  leg->AddEntry("deltaPtA:run","deltaPtA: A side only","p");
-  leg->AddEntry("deltaPtC:run","deltaPtC: C side only","p");
-  leg->Draw();
-
-  PlotThresholds(deltaPt:run); 
-  TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
-  TStatToolkit::DrawStatusGraphs(oaMultGr);
-  c1->SaveAs("1overPt_vs_run.png");
-  //c1->Clear();
-
-break;
-*/
-
-
-
   /****** Number of TPC Clusters vs run number ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanTPCncl:run","",marA1,colPosA,1.0);
   gr->SetName("meanTPCncl:run");
@@ -220,13 +217,14 @@ break;
   gr->GetHistogram()->SetMaximum(ncl_max);
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
-       PlotThresholds(meanTPCncl:run);
+  
+  PlotStatusLines(tree,"meanTPCncl:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanTPCncl_vs_run.png");
   c1->Clear();
-
+  
   /****** Ratio of findable TPC clusters vs run number ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanTPCnclF:run","",marA1,colPosA,1.0);
   gr->SetName("meanTPCnclF:run");
@@ -237,13 +235,13 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   
-       PlotThresholds(meanTPCnclF:run);
+       PlotStatusLines(tree,"meanTPCnclF:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanTPCnclF_vs_run.png");
   c1->Clear();
-
-
+  
   /****** Mean MIPs ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanMIP:run","",marA1,colPosA,1.0);
   gr->SetName("meanMIP:run");
@@ -254,12 +252,13 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   
-       PlotThresholds(meanMIP:run);  
+       PlotStatusLines(tree,"meanMIP:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanMIP_vs_run.png");
   c1->Clear();
-
+  
   /****** Mean MIP Resolution ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"resolutionMIP:run","",marA1,colPosA,1.0);
   gr->SetName("resolutionMIP:run");
@@ -270,7 +269,8 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   
-  PlotThresholds(resolutionMIP:run); 
+  PlotStatusLines(tree,"resolutionMIP:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("resolutionMIP_vs_run.png");
@@ -285,15 +285,15 @@ break;
   gr->GetHistogram()->SetMaximum(110);
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
-
-  //PlotThresholds(meanMIP:run);
+  
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meandEdxele_vs_run.png");
   c1->Clear();
-
-  /****** Mean Energy loss electron Resolutio ******/
+  
+  /****** Mean Energy loss electron Resolution ******/
+  
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"resolutionMIPele:run","",marA1,colPosA,1.0);
   gr->SetName("resolutionMIPele:run");
   gr->GetHistogram()->SetYTitle("Resolution of electrons dEdx");
@@ -303,17 +303,17 @@ break;
   gr->GetHistogram()->SetMaximum(mipr_max);
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
-
-  //PlotThresholds(resolutionMIPele:run);
+  
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("resolutionMeandEdxEle_vs_run.png");
   c1->Clear();
   
-////////////////////////////////////////////////////////////////////////////////////////////////
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  
   
   
-
   /****** Mean VertX ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanVertX:run","",marA1,colPosA,1.0);
   gr->SetName("meanVertX:run");
@@ -324,12 +324,13 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   
-  PlotThresholds(meanVertX:run);  
+  PlotStatusLines(tree,"meanVertX:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanVertX_vs_run.png");
   c1->Clear();
-
+  
   /****** Mean VertY ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanVertY:run","",marA1,colPosA,1.0);
   gr->SetName("meanVertY:run");
@@ -340,12 +341,13 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   
-  PlotThresholds(meanVertY:run); 
+  PlotStatusLines(tree,"meanVertY:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanVertY_vs_run.png");
   c1->Clear();
-
+  
   /****** Mean VertZ ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanVertZ:run","",marA1,colPosA,1.0);
   gr->SetName("meanVertZ:run");
@@ -356,13 +358,14 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   
-  PlotThresholds(meanVertZ:run);  
+  PlotStatusLines(tree,"meanVertZ:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanVertZ_vs_run.png");
   c1->Clear();
   
-
+  
   /****** Offset DCA  ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"offsetdRA:run:offsetdRAErr","",marA1,colPosA,1.0,sh_gr0);
        gr->SetName("offsetdRA:run");
@@ -372,7 +375,9 @@ break;
   gr2->SetName("gr2");
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"offsetdZC:run:offsetdZCErr","",marC2,colNegC,1.0,sh_gr3);
   gr3->SetName("gr3");
-  
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"offsetd_comb4:run","",marSum,colSum,1.2);
+  grComb->SetName("grComb");
+
   gr->GetHistogram()->SetYTitle("DCAs / [cm]");
   gr->GetHistogram()->SetTitle("p_{T} > 0.25GeV/c, |DCA_{R}| < 3cm, |DCA_{Z}| < 3cm, |#eta| < 0.8");
   gr->GetHistogram()->SetMinimum(dca_min);
@@ -382,6 +387,7 @@ break;
   gr1->Draw("P");
   gr2->Draw("P");
   gr3->Draw("P");
+  grComb->Draw("P");
   
   TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
@@ -391,21 +397,25 @@ break;
   leg->AddEntry("gr1","DCA_{Z}, A Side","p");
   leg->AddEntry("gr2","DCA_{R}, C Side","p");
   leg->AddEntry("gr3","DCA_{Z}, C Side","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
-
-  PlotThresholds(offsetdRA:run);
+  
+  PlotStatusLines(tree,"offsetd_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
        c1->SaveAs("DCAOffset_vs_run.png");
   c1->Clear();
-
-
+  
+  
   /****** Mean Mult  ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanMultPos:run:rmsMultPos","",marA1,colPosA,1.0,sh_gr1);
   gr->SetName("meanMultPos:run");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanMultNeg:run:rmsMultPos","",marA2,colNegA,1.0,sh_gr2);
   gr1->SetName("gr1");
-
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"meanMult_comb2:run","",marSum,colSum,1.2);
+  grComb->SetName("grComb");
+  
   gr->GetHistogram()->SetYTitle("Multiplicites of Primary Tracks");
   gr->GetHistogram()->SetTitle("|DCA_{R}| < 3cm, |DCA_{Z}| < 3cm, #Cluster > 70");
   //gr->GetHistogram()->SetMinimum(mult_min);
@@ -415,16 +425,19 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   gr1->Draw("P");
-  
-  TLegend *leg = new TLegend(0.6,0.85,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
+  grComb->Draw("P");
+
+  TLegend *leg = new TLegend(0.6,0.80,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
   leg->AddEntry("meanMultPos:run","Positive Charged Tracks","p");
   leg->AddEntry("gr1","Negative Charged Tracks","p");
+  leg->AddEntry("grComb","combined = (#Sigma x_{i})/N","p");
   leg->Draw();
-
-  PlotThresholds(meanMultPos:run);
+  
+  PlotStatusLines(tree,"meanMult_comb2:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("meanMult_vs_run.png");
@@ -439,7 +452,9 @@ break;
   gr2->SetName("gr2");
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"tpcItsMatchHighPtC:run","",marC2,colNegC,1.0,sh_gr3);
   gr3->SetName("gr3");
-
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"tpcItsMatch_comb4:run","",marSum,colSum,1.2);
+  grComb->SetName("grComb");
+  
   gr->GetHistogram()->SetYTitle("Matching Efficiencies");
   gr->GetHistogram()->SetTitle("");
   gr->GetHistogram()->SetMinimum(0.0);
@@ -449,24 +464,27 @@ break;
   gr1->Draw("P");
   gr2->Draw("P");
   gr3->Draw("P");
+  grComb->Draw("P");
   
   TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
   leg->AddEntry("tpcItsMatchA:run","TPC-ITS matching, A Side","p");
-  leg->AddEntry("gr1","TPC-ITS matching ( Pt>4GeV/c ), A Side","p");
+  leg->AddEntry("gr1","TPC-ITS matching ( p_{T}>4GeV/c ), A Side","p");
   leg->AddEntry("gr2","TPC-ITS matching, C Side","p");
-  leg->AddEntry("gr3","TPC-ITS matching ( Pt>4GeV/c ), C Side","p");
+  leg->AddEntry("gr3","TPC-ITS matching ( p_{T}>4GeV/c ), C Side","p");
+  leg->AddEntry("grComb","combined = (#Sigma x_{i})/N","p");
   leg->Draw();
   
-  PlotThresholds(tpcItsMatchA:run);   
+  PlotStatusLines(tree,"tpcItsMatch_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("TPC-ITS_vs_run.png");
   c1->Clear();
-
-  /****** ITS-TPC matching Efficiency  ******/
+  
+  /****** ITS-TPC matching quality  ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"lambdaPull:run","",marA1,colPosA,1.0,sh_gr0);
   gr->SetName("lambdaPull:run");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"ptPull:run","",marA2,colNegA,1.0,sh_gr1);
@@ -475,6 +493,8 @@ break;
   gr2->SetName("gr2");
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"zPull:run","",marC2,colNegC,1.0,sh_gr3);
   gr3->SetName("gr3");
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"itsTpcPulls_comb4:run","",marSum,colSum,1.2);
+  grComb->SetName("grComb");
 
   gr->GetHistogram()->SetYTitle("Pulls");
   gr->GetHistogram()->SetTitle("");
@@ -485,30 +505,34 @@ break;
   gr1->Draw("P");
   gr2->Draw("P");
   gr3->Draw("P");
+  grComb->Draw("P");
   
   TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("lambdaPull:run","Tan#lambda pull","p");
-  leg->AddEntry("gr1","Pt pull","p");
-  leg->AddEntry("gr2","y pull","p");
-  leg->AddEntry("gr3","z pull","p");
+  leg->AddEntry("lambdaPull:run","Tan#lambda pull bias","p");
+  leg->AddEntry("gr1","q/p_{T} pull bias","p");
+  leg->AddEntry("gr2","y pull bias","p");
+  leg->AddEntry("gr3","z pull bias","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
-
-  PlotThresholds(lambdaPull:run);
+  
+  PlotStatusLines(tree,"itsTpcPulls_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
-       c1->SaveAs("ITS-TPC_vs_run.png");
+       c1->SaveAs("ITS-TPC-matching-quality_vs_run.png");
   c1->Clear();
-
-
+  
   /****** pullPhi for TPC Constrain  ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"tpcConstrainPhiA:run","",marA1,colPosA,1.0,sh_gr1);
   gr->SetName("tpcConstrainPhiA:run");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"tpcConstrainPhiC:run","",marC1,colPosC,1.0,sh_gr2);
   gr1->SetName("gr1");
-
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"tpcConstrainPhi_comb2:run","",marSum,colSum,1.2);
+  grComb->SetName("grComb");
+  
   gr->GetHistogram()->SetYTitle("(sin#phi_{TPC} - sin#phi_{Global})/#sigma");
   gr->GetHistogram()->SetTitle("");
   gr->GetHistogram()->SetMinimum(-1);
@@ -516,21 +540,24 @@ break;
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
   gr1->Draw("P");
+  grComb->Draw("P");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
   leg->AddEntry("tpcConstrainPhiA:run","A Side","p");
   leg->AddEntry("gr1","C Side","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(tpcConstrainPhiA:run); 
+  PlotStatusLines(tree,"tpcConstrainPhi_comb2:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("pullPhiConstrain_vs_run.png");
   c1->Clear();
-
+  
   
        /****** 1/Pt  ******/
   //  TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"deltaPt:run","");
@@ -540,14 +567,14 @@ break;
   DrawPlot(gr2, "deltaPtA:run", marA1, 1.0, colPosA, "P");
   TGraphErrors *gr4 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"deltaPtC:run:deltaPtC_Err","",1,1,1, -sh_gr1);
   DrawPlot(gr4, "deltaPtC:run", marC1, 1.0, colPosC, "P");
-
+  
   gr0->GetHistogram()->SetYTitle("delta (q/pt) ");
   gr0->GetHistogram()->SetTitle("delta (q/pt)");
   gr0->GetHistogram()->SetMinimum(-0.008);
   gr0->GetHistogram()->SetMaximum(0.008);
   gr0->GetXaxis()->LabelsOption("v");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
@@ -555,14 +582,15 @@ break;
   leg->AddEntry("deltaPtA:run","deltaPtA: A side only","p");
   leg->AddEntry("deltaPtC:run","deltaPtC: C side only","p");
   leg->Draw();
-
-  PlotThresholds(deltaPt:run); 
+  
+  PlotStatusLines(tree,"deltaPt:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("1overPt_vs_run.png");
   c1->Clear();
-
-
+  
+  
   /****** DCAr fitting parameters  ******/
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcarAP0:run","",marA1,colPosA,1.0,sh_gr0);
   gr->SetName("dcarAP0:run");
@@ -572,7 +600,9 @@ break;
   gr2->SetName("gr2");
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcarCP1:run","",marC2,colNegC,1.0,sh_gr3);
   gr3->SetName("gr3");
-
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcarFitpar_comb4:run","",marSum,colSum,1.2);
+  grComb->SetName("grComb");
+  
   gr->GetHistogram()->SetYTitle("DCAR Fitting Parameters");
   gr->GetHistogram()->SetTitle("sqrt(P0^{2} + P1^{2}/(pT^{2}))");
   gr->GetHistogram()->SetMinimum(-1);
@@ -582,6 +612,7 @@ break;
   gr1->Draw("P");
   gr2->Draw("P");
   gr3->Draw("P");
+  grComb->Draw("P");
   
   TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
@@ -591,23 +622,25 @@ break;
   leg->AddEntry("gr1","P1, A Side","p");
   leg->AddEntry("gr2","P0, C Side","p");
   leg->AddEntry("gr3","P1, C Side","p");
+  leg->AddEntry("grComb","combined = (#Sigma x_{i})/N","p");
   leg->Draw();
-
-  PlotThresholds(dcarAP0:run);  
+  
+  PlotStatusLines(tree,"dcarFitpar_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c1, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c1->SaveAs("dcar_fitting_run.png");
   c1->Clear();
+  
   ////////////////////////////////////////////////////////////////////////
   //test DCAR plots
   //DCAr first parameter _0
-
+  
   TCanvas *c2  = new  TCanvas("can2","can2",canvas_width,canvas_height); 
   c2->cd();
   c2->Update();
   c2->SetGrid(3);
-   
+  
   //TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_posA_0:run","",1,1,1,sh_gr0);
   TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_posA_0:run:dcar_posA_0_Err","",1,1,1,sh_gr0);
   DrawPlot(gr0, "dcar_posA_0:run", marA1, 1.0, colPosA, "AP");
@@ -617,30 +650,34 @@ break;
   DrawPlot(gr2, "dcar_posC_0:run", marC1, 1.0, colPosC, "P");    
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_negC_0:run:dcar_negC_0_Err","",1,1,1,sh_gr3);
   DrawPlot(gr3, "dcar_negC_0:run", marC2, 1.0, colNegC, "P");    
-
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar0_comb4:run","",1,1,1);
+  DrawPlot(grComb, "grComb", marSum, 1.4, colSum, "P");    
+  
   gr0->GetHistogram()->SetYTitle("DCARs");
   gr0->GetHistogram()->SetMinimum(-0.2);
   gr0->GetHistogram()->SetMaximum(0.2);
   gr0->GetHistogram()->SetTitleOffset(10);
   gr0->GetXaxis()->LabelsOption("v");
-  gr0->SetName("dcar_0:run");
+  gr0->SetName("dcar_posA_0:run");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("dcar_0:run","dcar_posA_0","p");
+  leg->AddEntry("dcar_posA_0:run","dcar_posA_0","p");
   leg->AddEntry("dcar_negA_0:run","dcar_negA_0","p");
   leg->AddEntry("dcar_posC_0:run","dcar_posC_0","p");
   leg->AddEntry("dcar_negC_0:run","dcar_negC_0","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(dcar_0:run);
+  PlotStatusLines(tree,"dcar0_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c2, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c2->SaveAs("dcar_0_vs_run.png");//for C,A side and pos/neg particle
   c2->Update();
-
+  
   ////////////////////////////////////////////////////////////////////////
   //DCAr second parameter _1
   
@@ -657,25 +694,29 @@ break;
   DrawPlot(gr2, "dcar_posC_1:run", marC1, 1.0, colPosC, "P");    
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_negC_1:run:dcar_negC_1_Err","",1,1,1,sh_gr3);
   DrawPlot(gr3, "dcar_negC_1:run", marC2, 1.0, colNegC, "P");    
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar1_comb4:run","",1,1,1);
+  DrawPlot(grComb, "grComb", marSum, 1.4, colSum, "P");    
   
   gr0->GetHistogram()->SetYTitle("DCARs");
   gr0->GetHistogram()->SetMinimum(-0.1);
   gr0->GetHistogram()->SetMaximum(0.1);
   gr0->GetHistogram()->SetTitleOffset(10);
   gr0->GetXaxis()->LabelsOption("v");
-  gr0->SetName("dcar_1:run");
+  gr0->SetName("dcar_posA_1:run");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("dcar_1:run","dcar_posA_1","p");
+  leg->AddEntry("dcar_posA_1:run","dcar_posA_1","p");
   leg->AddEntry("dcar_negA_1:run","dcar_negA_1","p");
   leg->AddEntry("dcar_posC_1:run","dcar_posC_1","p");
   leg->AddEntry("dcar_negC_1:run","dcar_negC_1","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(dcar_1:run);
+  PlotStatusLines(tree,"dcar1_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c3, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c3->SaveAs("dcar_1_vs_run.png");//for C,A side and pos/neg particle
@@ -688,7 +729,7 @@ break;
   c5->cd();
   c5->Update();
   c5->SetGrid(3);
-   
+  
   TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_posA_2:run:dcar_posA_2_Err","",1,1,1,sh_gr0);
   DrawPlot(gr0, "dcar_posA_2:run", marA1, 1.0, colPosA, "AP");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_negA_2:run:dcar_negA_2_Err","",1,1,1,sh_gr1);
@@ -697,39 +738,43 @@ break;
   DrawPlot(gr2, "dcar_posC_2:run", marC1, 1.0, colPosC, "P");    
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar_negC_2:run:dcar_negC_2_Err","",1,1,1,sh_gr3);
   DrawPlot(gr3, "dcar_negC_2:run", marC2, 1.0, colNegC, "P");    
-  
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcar2_comb4:run","",1,1,1);
+  DrawPlot(grComb, "grComb", marSum, 1.4, colSum, "P");    
+
   gr0->GetHistogram()->SetYTitle("DCARs");
   gr0->GetHistogram()->SetMinimum(-0.1);
   gr0->GetHistogram()->SetMaximum(0.1);
   gr0->GetHistogram()->SetTitleOffset(10);
   gr0->GetXaxis()->LabelsOption("v");
-  gr0->SetName("dcar_2:run");
+  gr0->SetName("dcar_posA_2:run");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("dcar_2:run","dcar_posA_2","p");
+  leg->AddEntry("dcar_posA_2:run","dcar_posA_2","p");
   leg->AddEntry("dcar_negA_2:run","dcar_negA_2","p");
   leg->AddEntry("dcar_posC_2:run","dcar_posC_2","p");
   leg->AddEntry("dcar_negC_2:run","dcar_negC_2","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(dcar_2:run);
+  PlotStatusLines(tree,"dcar2_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c5, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c5->SaveAs("dcar_2_vs_run.png");//for C,A side and pos/neg particle
   c5->Update();
-
+  
   ////////////////////////////////////////////////////////////////////////
   //DCAz parameters
   //Dcaz first parameter _0
-
+  
   TCanvas *c6  = new  TCanvas("can6","can6",canvas_width,canvas_height); 
   c6->cd();
   c6->Update();
   c6->SetGrid(3);
-   
+  
   TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_posA_0:run:dcaz_posA_0_Err","",1,1,1,sh_gr0);
   DrawPlot(gr0, "dcaz_posA_0:run", marA1, 1.0, colPosA, "AP");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_negA_0:run:dcaz_negA_0_Err","",1,1,1,sh_gr1);
@@ -738,30 +783,34 @@ break;
   DrawPlot(gr2, "dcaz_posC_0:run", marC1, 1.0, colPosC, "P");    
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_negC_0:run:dcaz_negC_0_Err","",1,1,1,sh_gr3);
   DrawPlot(gr3, "dcaz_negC_0:run", marC2, 1.0, colNegC, "P");    
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz0_comb4:run","",1,1,1);
+  DrawPlot(grComb, "grComb", marSum, 1.4, colSum, "P");    
+
   gr0->GetHistogram()->SetYTitle("DCAZs");
   gr0->GetHistogram()->SetMinimum(-2.);
   gr0->GetHistogram()->SetMaximum(2.);
   gr0->GetHistogram()->SetTitleOffset(10);
   gr0->GetXaxis()->LabelsOption("v");
-  gr0->SetName("dcaz_0:run");
+  gr0->SetName("dcaz_posA_0:run");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("dcaz_0:run","dcaz_posA_0","p");
+  leg->AddEntry("dcaz_posA_0:run","dcaz_posA_0","p");
   leg->AddEntry("dcaz_negA_0:run","dcaz_negA_0","p");
   leg->AddEntry("dcaz_posC_0:run","dcaz_posC_0","p");
   leg->AddEntry("dcaz_negC_0:run","dcaz_negC_0","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(dcaz_0:run);
+  PlotStatusLines(tree,"dcaz0_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c6, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c6->SaveAs("dcaz_0_vs_run.png");//for C,A side and pos/neg particle
   c6->Update();
-
+  
   ////////////////////////////////////////////////////////////////////////
   //Dcaz second parameter _1
   
@@ -769,7 +818,7 @@ break;
   c7->cd();
   c7->Update();
   c7->SetGrid(3);
-
+  
   TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_posA_1:run:dcaz_posA_1_Err","",1,1,1,sh_gr0);
   DrawPlot(gr0, "dcaz_posA_1:run", marA1, 1.0, colPosA, "AP");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_negA_1:run:dcaz_negA_1_Err","",1,1,1,sh_gr1);
@@ -778,25 +827,29 @@ break;
   DrawPlot(gr2, "dcaz_posC_1:run", marC1, 1.0, colPosC, "P");    
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_negC_1:run:dcaz_negC_1_Err","",1,1,1,sh_gr3);
   DrawPlot(gr3, "dcaz_negC_1:run", marC2, 1.0, colNegC, "P");    
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz1_comb4:run","",1,1,1);
+  DrawPlot(grComb, "grComb", marSum, 1.4, colSum, "P");    
+
   gr0->GetHistogram()->SetYTitle("DCAZs");
   gr0->GetHistogram()->SetMinimum(-0.2);
   gr0->GetHistogram()->SetMaximum(0.2);
   gr0->GetHistogram()->SetTitleOffset(10);
   gr0->GetXaxis()->LabelsOption("v");
-  gr0->SetName("dcaz_1:run");
+  gr0->SetName("dcaz_posA_1:run");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("dcaz_1:run","dcaz_posA_1","p");
+  leg->AddEntry("dcaz_posA_1:run","dcaz_posA_1","p");
   leg->AddEntry("dcaz_negA_1:run","dcaz_negA_1","p");
   leg->AddEntry("dcaz_posC_1:run","dcaz_posC_1","p");
   leg->AddEntry("dcaz_negC_1:run","dcaz_negC_1","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(dcaz_1:run);
+  PlotStatusLines(tree,"dcaz1_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c7, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c7->SaveAs("dcaz_1_vs_run.png");//for C,A side and pos/neg particle
@@ -809,7 +862,7 @@ break;
   c8->cd();
   c8->Update();
   c8->SetGrid(3);
-
+  
   TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_posA_2:run:dcaz_posA_2_Err","",1,1,1,sh_gr0);
   DrawPlot(gr0, "dcaz_posA_2:run", marA1, 1.0, colPosA, "AP");
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_negA_2:run:dcaz_negA_2_Err","",1,1,1,sh_gr1);
@@ -818,30 +871,34 @@ break;
   DrawPlot(gr2, "dcaz_posC_2:run", marC1, 1.0, colPosC, "P"); 
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz_negC_2:run:dcaz_negC_2_Err","",1,1,1,sh_gr3);
   DrawPlot(gr3, "dcaz_negC_2:run", marC2, 1.0, colNegC, "P");
+  TGraphErrors *grComb = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"dcaz2_comb4:run","",1,1,1);
+  DrawPlot(grComb, "grComb", marSum, 1.4, colSum, "P");    
 
   gr0->GetHistogram()->SetYTitle("DCAZs");
   gr0->GetHistogram()->SetMinimum(-0.1);
   gr0->GetHistogram()->SetMaximum(0.1);
   gr0->GetHistogram()->SetTitleOffset(10);
   gr0->GetXaxis()->LabelsOption("v");
-  gr0->SetName("dcaz_2:run");
+  gr0->SetName("dcaz_posA_2:run");
   
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
-  leg->AddEntry("dcaz_2:run","dcaz_posA_2","p");
+  leg->AddEntry("dcaz_posA_2:run","dcaz_posA_2","p");
   leg->AddEntry("dcaz_negA_2:run","dcaz_negA_2","p");
   leg->AddEntry("dcaz_posC_2:run","dcaz_posC_2","p");
   leg->AddEntry("dcaz_negC_2:run","dcaz_negC_2","p");
+  leg->AddEntry("grComb","combined = #sqrt{#Sigma x_{i}^{2}}","p");
   leg->Draw();
   
-  PlotThresholds(dcaz_2:run);
+  PlotStatusLines(tree,"dcaz2_comb4:run","");
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c8, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c8->SaveAs("dcaz_2_vs_run.png");//for C,A side and pos/neg particle
   c8->Update();
-
+  
   ///////////////////////////////////////////////////////////////////////////////////////////////
   // Plot Occupancy IROC, OROC, A,C side
   
@@ -849,19 +906,16 @@ break;
   c9->cd();
   c9->Update();
   c9->SetGrid(3);
-
+  
   TGraphErrors *gr0 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"iroc_A_side:run","",marA1,colPosA,1.0,sh_gr0);
   gr0->SetName("iroc_A_side:run");
-
   TGraphErrors *gr1 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"oroc_A_side:run","",marA2,colNegA,1.0,sh_gr1);
   gr1->SetName("gr1");
-
   TGraphErrors *gr2 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"iroc_C_side:run","",marC1,colPosC,1.0,sh_gr2);
   gr2->SetName("gr2");
-
   TGraphErrors *gr3 = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"oroc_C_side:run","",marC2,colNegC,1.0,sh_gr3);
   gr3->SetName("gr3");
-
+  
   gr0->GetHistogram()->SetYTitle("(nr_Chamber) - (nr_Chamber_lowOcc)");
   gr0->GetHistogram()->SetMinimum(14.0);
   gr0->GetHistogram()->SetMaximum(20.0);
@@ -873,8 +927,8 @@ break;
   gr1->Draw("P");
   gr2->Draw("P");
   gr3->Draw("P");
-
-  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.9,"","brNDC");
+  
+  TLegend *leg = new TLegend(0.6,0.75,0.62*sqrt(norm_runs/entries),0.95,"","brNDC");
   leg->SetTextSize(0.03);
   leg->SetFillColor(10);
   leg->SetBorderSize(0);
@@ -883,13 +937,14 @@ break;
   leg->AddEntry("gr2","iroc_C_side","p");
   leg->AddEntry("gr3","oroc_C_side","p");
   leg->Draw();
-
+  
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c9, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c9->SaveAs("occ_AC_Side_IROC_OROC_vs_run.png");//for C,A side and IROC,OROC                                                                                                 
   c9->Update();
-                                                                                                                                                 
-  /****** attachemnt parameters for A and C side ******/
+  
+  /****** attachment parameters for A and C side ******/
   
   TCanvas *c10  = new  TCanvas("can10","can10",canvas_width,canvas_height);
   c10->cd();
@@ -903,18 +958,19 @@ break;
   gr->GetHistogram()->SetMaximum(20);
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
-
+  
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c10, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c10->SaveAs("MIPattachSlopeA_vs_run.png");
   c10->Clear();
-
+  
   //C side
   TCanvas *c11  = new  TCanvas("can11","can11",canvas_width,canvas_height);
   c11->cd();
   c11->Update();
   c11->SetGrid(3);
-
+  
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"MIPattachSlopeC:run","",marA1,colPosA,1.0);
   gr->SetName("MIPattachSlopeC:run");
   gr->GetHistogram()->SetYTitle("Attachment parameter p1");
@@ -922,19 +978,20 @@ break;
   gr->GetHistogram()->SetMaximum(20);
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
-
+  
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c11, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c11->SaveAs("MIPattachSlopeC_vs_run.png");
   c11->Clear();
-
+  
   /****** electron and MIPs separation ******/
-
+  
   TCanvas *c12  = new  TCanvas("can12","can12",canvas_width,canvas_height);
   c12->cd();
   c12->Update();
   c12->SetGrid(3);
-
+  
   TGraphErrors *gr = (TGraphErrors*) TStatToolkit::MakeGraphSparse(tree,"electroMIPSeparation:run","",marA1,colPosA,1.0);
   gr->SetName("electroMIPSeparation:run");
   gr->GetHistogram()->SetYTitle("Electron - MIP");
@@ -942,7 +999,8 @@ break;
   gr->GetHistogram()->SetMaximum(120);
   gr->GetXaxis()->LabelsOption("v");
   gr->Draw("AP");
-
+  
+  PlotTimestamp();
   TStatToolkit::AddStatusPad(c12, statPadHeight, statPadBotMar);
   TStatToolkit::DrawStatusGraphs(oaMultGr);
   c12->SaveAs("ElectroMIPSeparation_vs_run.png");
@@ -950,28 +1008,40 @@ break;
   
 }
 
-//the function plots thresholds
-Int_t PlotThresholds(TGraphErrors* h)
+
+//the function plots status lines and timestamp
+Int_t PlotStatusLines(TTree * tree, const char * expr, const char * cut)
 {
-  TMap* configMap = qaConfig();
-  Float_t min = ConfigEntryMin(configMap,h);
-  Float_t max = ConfigEntryMax(configMap,h);
-  
-  cout<<"min, max "<< min << " "<< max << endl;
-  
-  TString desc = ConfigEntryDescription(configMap,h);
-  TAxis *xaxis = h->GetXaxis();
-  Float_t x1 = xaxis->GetBinLowEdge(1);
-  Float_t x2 = xaxis->GetBinUpEdge(xaxis->GetLast());
-  TLine *lineMin = new TLine(x1,min,x2,min); lineMin->SetLineColor(kRed);
-  lineMin->Draw();
-  TLine *lineMax = new TLine(x1,max,x2,max); lineMax->SetLineColor(kRed);
-  lineMax->Draw();
+  char* alias = "varname_OutlierMin:varname_OutlierMax:varname_WarningMin:varname_WarningMax:varname_PhysAccMin:varname_PhysAccMax:varname_RobustMean";
+  TMultiGraph* mgStatusLines = TStatToolkit::MakeStatusLines(tree,expr,cut,alias);
+  
+  if (mgStatusLines) mgStatusLines->Draw("l");
+  else { cout << " no mgStatusLines available!" << endl; return 0; }
+  
+  return 1;
+}
 
+//the function plots a timestamp and the used Aliroot version
+Int_t PlotTimestamp()
+{
+  // draw timestamp and Aliroot version
+  TString sTimestamp  = gSystem->GetFromPipe("date");
+  TString sAlirootVer = "AliRoot " + gSystem->GetFromPipe("wdir=`pwd`; cd $ALICE_ROOT; git describe; cd $wdir;");
+  TLatex* latTime = new TLatex(0.99,0.95,sTimestamp.Data());
+  latTime->SetTextSize(0.03);
+  latTime->SetTextAlign(31);
+  latTime->SetNDC();
+  latTime->Draw("same");
+  TLatex* latAliroot = new TLatex(0.99,0.91,sAlirootVer.Data());
+  latAliroot->SetTextSize(0.03);
+  latAliroot->SetTextAlign(31);
+  latAliroot->SetNDC();
+  latAliroot->Draw("same");
+  
   return 1;
 }
 
+
 //the function draws the plots
 Int_t DrawPlot(TGraphErrors* gr, TString nameHisto, Int_t markerStyle, Int_t markerSize, Int_t markerColor, TString drawMode)
 {
@@ -983,4 +1053,3 @@ Int_t DrawPlot(TGraphErrors* gr, TString nameHisto, Int_t markerStyle, Int_t mar
   return 1;
 }
 
-
index 3b00a1a51095dc1c6adc176832e9d43396c368bd..3292d43163bbe49579d31bbdad659af0ae7ded48 100644 (file)
-TMap* qaConfig()
-{
-  TMap* c = new TMap();
-  
-  ConfigEntryNew(c, "meanTPCncl:run", 130., 140., "description");
-  ConfigEntryNew(c, "meanTPCnclF:run", 0.8, 1.0, "description");
-  ConfigEntryNew(c, "meanMIP:run", 47., 53., "description");
-  ConfigEntryNew(c, "resolutionMIP:run", 0.002, 0.1, "description");
-  
-  ConfigEntryNew(c, "meanVertX:run", 0., 0.2, "description");
-  ConfigEntryNew(c, "meanVertY:run", 0.2, 0.4, "description");
-  ConfigEntryNew(c, "meanVertZ:run", -2., 2., "description");
-  
-  ConfigEntryNew(c, "offsetdRA:run", -0.2, 0.6, "description");
-  ConfigEntryNew(c, "meanMultPos:run", 50., 100., "description");
-  ConfigEntryNew(c, "tpcItsMatchA:run", 0.7, 1., "description");// TPC-ITS matching eff.
-  ConfigEntryNew(c, "lambdaPull:run", -1., 1., "description"); // ITS-TPC matching eff.
-  ConfigEntryNew(c, "tpcConstrainPhiA:run", -0.4, 0.4, "description");
-  ConfigEntryNew(c, "deltaPt:run", -0.006, 0.006, "description");
-  
-  ConfigEntryNew(c, "dcarAP0:run", -0.6, 0.6, "description");
-  ConfigEntryNew(c, "dcar_0:run", -0.02, 0.125, "description");
-  ConfigEntryNew(c, "dcar_1:run", -0.08, 0.04, "description");
-  ConfigEntryNew(c, "dcar_2:run", -0.04, 0.06, "description");
-  ConfigEntryNew(c, "dcaz_0:run", -0.04, 0.04, "description");
-  ConfigEntryNew(c, "dcaz_1:run", -0.01, 0.15, "description");
-  ConfigEntryNew(c, "dcaz_2:run", -0.04, 0.04, "description");
-   
-  return c;
-}
-
-ConfigEntryNew(TMap* m, TString keyName, Float_t min, Float_t max, TString desc)
-{
-  TObjString* key = new TObjString(keyName);
-  TObjString* description = new TObjString(desc);
-  TVectorF* values = new TVectorF(2);
-  values(0) = min; values(1) = max;
-  TList* list = new TList();
-  list->Add(values); //0
-  list->Add(description); //1
-  m->Add(key,list);
-}
 
-Float_t ConfigEntryMin(TMap* m, TNamed* h)
+Int_t qaConfig(TTree* tree, TString* returnStrings)
 {
-  TPair* p = dynamic_cast<TPair*>(m->FindObject(h->GetName()));
-  TList* l = dynamic_cast<TList*>(p->Value());
-  l->Print();
-  if (!l) return -9999999;
-  TVectorF* v = dynamic_cast<TVectorF*>(l->At(0));
-  if (!v) return -1111111;  
-  return v(0);
-}
-
-Float_t ConfigEntryMax(TMap* m, TNamed* h)
-{
-  TPair* p = dynamic_cast<TPair*>(m->FindObject(h->GetName()));
-  TList* l = dynamic_cast<TList*>(p->Value());
-  if (!l) return -9999999;
-  TVectorF* v = dynamic_cast<TVectorF*>(l->At(0));
-  if (!v) return 11111111;  
-  return v(1);
-}
-
-TString ConfigEntryDescription(TMap* m, TNamed* h)
-{
-  TString dummy;
-  TPair* p = dynamic_cast<TPair*>(m->FindObject(h->GetName()));
-  TList* l = dynamic_cast<TList*>(p->Value());
-  if (!l) return dummy;
-  TObjString* os = dynamic_cast<TObjString*>(l->At(1));
-  return os->GetString();
-}
-
-/*
-example()
-{
-  gROOT->LoadMacro("qaConfig.C");
-  TMap* configMap = qaConfig();
-
-  TH1F* histi = new TH1F("test","test",1,0,1);
-  Float_t min = ConfigEntryMin(configMap,hist);
-  Float_t max = ConfigEntryMax(configMap,hist);
-  TString desc = ConfigEntryDescription(configMap,hist);
-  hist->Draw();
-  TAxis* xaxis=hist->GetXaxis();
-  Float_t x1 = xaxis->GetBinLowEdge(1);
-  Float_t x2 = xaxis->GetBinUpEdge(xaxis->GetLast());
-  TLine* lineMin = TLine(x1,min,x2,min); lineMin->SetLineColor(kRed);
-  lineMin->Draw();
-  TLine* lineMax = TLaxe(x1,max,x2,max); lineMax->SetLineColor(kRed);
-  lineMax->Draw();
+  Float_t entryFrac=0.8, nsigmaOutlier=6., nsigmaWarning=3., epsilon=1.0e-6;
+  
+  //
+  // specify all variables for which the status aliases shall be defined.
+  // only for these variables the lines in the trending plots can be computed and plotted.
+  //
+  TString sTrendVars="meanTPCncl;meanTPCnclF;meanMIP;resolutionMIP;meanVertX;meanVertY;meanVertZ;meanMultPos;meanMultNeg;";
+  sTrendVars+=";tpcItsMatchA;tpcItsMatchC;tpcItsMatchHighPtA;tpcItsMatchHighPtC;lambdaPull;ptPull;yPull;zPull;";
+  sTrendVars+=";tpcConstrainPhiA;tpcConstrainPhiC;deltaPt;";
+  sTrendVars+=";offsetdRA;offsetdZA;offsetdRC;offsetdZC;dcarAP0;dcarAP1;dcarCP0;dcarCP1;";
+  sTrendVars+=";dcar_posA_0;dcar_posA_1;dcar_posA_2;dcaz_posA_0;dcaz_posA_1;dcaz_posA_2;";
+  sTrendVars+=";dcar_posC_0;dcar_posC_1;dcar_posC_2;dcaz_posC_0;dcaz_posC_1;dcaz_posC_2;";
+  sTrendVars+=";dcar_negA_0;dcar_negA_1;dcar_negA_2;dcaz_negA_0;dcaz_negA_1;dcaz_negA_2;";
+  sTrendVars+=";dcar_negC_0;dcar_negC_1;dcar_negC_2;dcaz_negC_0;dcaz_negC_1;dcaz_negC_2;";
+  
+  //
+  // combined variables
+  // name them '..._combN' with N being the number of combined variables!
+  //
+  tree->SetAlias("meanMult_comb2"         , "((meanMultPos+meanMultNeg)/2.)");
+  tree->SetAlias("tpcItsMatch_comb4"      , "((tpcItsMatchA+tpcItsMatchC+tpcItsMatchHighPtA+tpcItsMatchHighPtC)/4)"); // mean of all 4.
+  tree->SetAlias("itsTpcPulls_comb4"      , "(TMath::Sqrt(lambdaPull**2+ptPull**2+yPull**2+zPull**2))");
+  tree->SetAlias("tpcConstrainPhi_comb2"  , "(TMath::Sqrt(tpcConstrainPhiA**2+tpcConstrainPhiC**2))"); // sqrt of quadr. sum ok because it's a bias.
+  tree->SetAlias("offsetd_comb4"          , "(TMath::Sqrt(offsetdRA**2+offsetdZA**2+offsetdRC**2+offsetdZC**2))");
+  tree->SetAlias("dcarFitpar_comb4"       , "((dcarAP0+dcarAP1+dcarCP0+dcarCP1)/4)"); // mean of 4.
+  tree->SetAlias("dcar0_comb4"            , "(TMath::Sqrt(dcar_posA_0**2+dcar_posC_0**2+dcar_negA_0**2+dcar_negC_0**2))");
+  tree->SetAlias("dcar1_comb4"            , "(TMath::Sqrt(dcar_posA_1**2+dcar_posC_1**2+dcar_negA_1**2+dcar_negC_1**2))");
+  tree->SetAlias("dcar2_comb4"            , "(TMath::Sqrt(dcar_posA_2**2+dcar_posC_2**2+dcar_negA_2**2+dcar_negC_2**2))");
+  tree->SetAlias("dcaz0_comb4"            , "(TMath::Sqrt(dcaz_posA_0**2+dcaz_posC_0**2+dcaz_negA_0**2+dcaz_negC_0**2))");
+  tree->SetAlias("dcaz1_comb4"            , "(TMath::Sqrt(dcaz_posA_1**2+dcaz_posC_1**2+dcaz_negA_1**2+dcaz_negC_1**2))");
+  tree->SetAlias("dcaz2_comb4"            , "(TMath::Sqrt(dcaz_posA_2**2+dcaz_posC_2**2+dcaz_negA_2**2+dcaz_negC_2**2))");
+  //
+  // add all combined variables to sTrendVars!
+  // only then the statistics aliases will be computed for them as well.
+  //
+  sTrendVars+=";meanMult_comb2;tpcItsMatch_comb4;itsTpcPulls_comb4;tpcConstrainPhi_comb2;";
+  sTrendVars+=";offsetd_comb4;dcarFitpar_comb4;dcar0_comb4;dcar1_comb4;dcar2_comb4;dcaz0_comb4;dcaz1_comb4;dcaz2_comb4;";
+  
+  //
+  // specify criterion to mark runs with enough statistics.
+  // these runs are the basis for the computation of the outlier criteria.
+  // -> robust mean and rms are computed from given entry fraction (EF) of these runs!
+  //
+  tree->SetAlias("statisticOK", "(meanTPCncl>0)");
+  
+  //
+  // creation of aliases for Outliers, Warnings, PhysicsAcceptable ...
+  // upper and lower limits needed separately to retrieve the numerical values for the line positions.
+  // for that reason the aliases are expected to be computable expressions.
+  //
+  TObjArray* oaTrendVars = sTrendVars.Tokenize(",;");
+  for (Int_t vari=0; vari<oaTrendVars->GetEntriesFast(); vari++)
+  {
+    TString sVar( oaTrendVars->At(vari)->GetName() );
+    
+    // outliers, warnings and robust mean are set for all variables identically.
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_OutlierMin:(MeanEF-%f*RMSEF-%f):%f", nsigmaOutlier, epsilon, entryFrac));
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_OutlierMax:(MeanEF+%f*RMSEF+%f):%f", nsigmaOutlier, epsilon, entryFrac));
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_WarningMin:(MeanEF-%f*RMSEF-%f):%f", nsigmaWarning, epsilon, entryFrac));
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_WarningMax:(MeanEF+%f*RMSEF+%f):%f", nsigmaWarning, epsilon, entryFrac));
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_RobustMean:(MeanEF+0):%f", entryFrac));
+    
+    // physics acceptable should be set for each type of variable individually.
+    // some sets of variables are already set here, the rest should be set appropriately after the loop!
+    Float_t combfac=1.;
+    if (sVar.Contains("_comb")) {
+      TString last = sVar(sVar.Last('b')+1, sVar.Length());
+      combfac = TMath::Sqrt( atoi(last.Data()) );
+    }
+    if (sVar.Contains("dca")) {
+      TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_PhysAccMin:(MeanEF-%f+0)", 0.2*combfac)); // 2 mm around mean
+      TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_PhysAccMax:(MeanEF+%f+0)", 0.2*combfac)); // 2 mm around mean
+    }
+    else if (sVar.Contains("Pull")) {
+      TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_PhysAccMin:(MeanEF-%f+0)", 1.0*combfac));
+      TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_PhysAccMax:(MeanEF+%f+0)", 1.0*combfac));
+    }
+    else { // other variables set to +- 5% of the mean as default to avoid crashes:
+      TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_PhysAccMin:(MeanEF-%f*MeanEF):%f", 0.05*combfac, entryFrac));
+      TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "statisticOK", Form("varname_PhysAccMax:(MeanEF+%f*MeanEF):%f", 0.05*combfac, entryFrac));
+    }
+    
+  }
+  
+  //
+  // all aliases can just be overwritten here...
+  // PhysAcc should be set to relative or absolute values appropriately!
+  //
+  TStatToolkit::SetStatusAlias(tree, "meanTPCncl",    "statisticOK", Form("varname_PhysAccMin:(MeanEF-%f*MeanEF):%f", 0.05, entryFrac));
+  TStatToolkit::SetStatusAlias(tree, "meanTPCncl",    "statisticOK", Form("varname_PhysAccMax:(MeanEF+%f*MeanEF):%f", 0.05, entryFrac));
+  TStatToolkit::SetStatusAlias(tree, "meanMIP",       "statisticOK", Form("varname_PhysAccMin:(MeanEF-%f*MeanEF):%f", 0.01, entryFrac));
+  TStatToolkit::SetStatusAlias(tree, "meanMIP",       "statisticOK", Form("varname_PhysAccMax:(MeanEF+%f*MeanEF):%f", 0.01, entryFrac));
+  TStatToolkit::SetStatusAlias(tree, "resolutionMIP", "statisticOK", Form("varname_PhysAccMin:(MeanEF-%f*MeanEF):%f", 0.10, entryFrac));
+  TStatToolkit::SetStatusAlias(tree, "resolutionMIP", "statisticOK", Form("varname_PhysAccMax:(MeanEF+%f*MeanEF):%f", 0.10, entryFrac));
+  TStatToolkit::SetStatusAlias(tree, "meanVertZ",     "statisticOK", Form("varname_PhysAccMin:(%f+0)",-1.0 ));
+  TStatToolkit::SetStatusAlias(tree, "meanVertZ",     "statisticOK", Form("varname_PhysAccMax:(%f+0)", 1.0 ));
+//  TStatToolkit::SetStatusAlias(tree, "tpcItsMatchA",  "statisticOK", Form("varname_PhysAccMin:(%f+0)", 0.7 )); // TODO: set to +-3% after multiplicity correction (see wiki)
+//  TStatToolkit::SetStatusAlias(tree, "tpcItsMatchA",  "statisticOK", Form("varname_PhysAccMax:(%f+0)", 1.0 ));
+//  TStatToolkit::SetStatusAlias(tree, "tpcItsMatchC",  "statisticOK", Form("varname_PhysAccMin:(%f+0)", 0.7 ));
+//  TStatToolkit::SetStatusAlias(tree, "tpcItsMatchC",  "statisticOK", Form("varname_PhysAccMax:(%f+0)", 1.0 ));
+  
+  //
+  // now the actual criteria for each variable are set automatically.
+  //
+  for (Int_t vari=0; vari<oaTrendVars->GetEntriesFast(); vari++)
+  {
+    TString sVar( oaTrendVars->At(vari)->GetName() );
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "", Form("varname_Outlier:(varname>varname_OutlierMax||varname<varname_OutlierMin)"));
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "", Form("varname_Warning:(varname>varname_WarningMax||varname<varname_WarningMin)"));
+    TStatToolkit::SetStatusAlias(tree, sVar.Data(),    "", Form("varname_PhysAcc:(varname>varname_PhysAccMin&&varname<varname_PhysAccMax)"));
+  }
+  
+  //
+  // COMBINED CRITERIA
+  //
+  
+  // combined MIP quality
+  tree->SetAlias("MIPquality_Outlier", "(meanMIP_Outlier||resolutionMIP_Outlier)");
+  tree->SetAlias("MIPquality_Warning", "(meanMIP_Warning||resolutionMIP_Warning)");
+  tree->SetAlias("MIPquality_PhysAcc", "(meanMIP_PhysAcc&&resolutionMIP_PhysAcc)");
+  
+  // combined matching efficiency
+  tree->SetAlias("tpcItsMatch_Outlier", "(tpcItsMatchA_Outlier||tpcItsMatchC_Outlier||tpcItsMatchHighPtA_Outlier||tpcItsMatchHighPtC_Outlier)");
+  tree->SetAlias("tpcItsMatch_Warning", "(tpcItsMatchA_Warning||tpcItsMatchC_Warning||tpcItsMatchHighPtA_Warning||tpcItsMatchHighPtC_Warning)");
+  tree->SetAlias("tpcItsMatch_PhysAcc", "(tpcItsMatchA_PhysAcc&&tpcItsMatchC_PhysAcc&&tpcItsMatchHighPtA_PhysAcc&&tpcItsMatchHighPtC_PhysAcc)");
+  
+  // combined matching quality (lambdaPull ptPull yPull zPull)
+  tree->SetAlias("itsTpcPulls_Outlier", "(lambdaPull_Outlier||ptPull_Outlier||yPull_Outlier||zPull_Outlier)");
+  tree->SetAlias("itsTpcPulls_Warning", "(lambdaPull_Warning||ptPull_Warning||yPull_Warning||zPull_Warning)");
+  tree->SetAlias("itsTpcPulls_PhysAcc", "(lambdaPull_PhysAcc&&ptPull_PhysAcc&&yPull_PhysAcc&&zPull_PhysAcc)");
+  
+  // combined DCA R and Z
+  tree->SetAlias("dcar0_Outlier", "(dcar_posA_0_Outlier||dcar_posC_0_Outlier||dcar_negA_0_Outlier||dcar_negC_0_Outlier)");
+  tree->SetAlias("dcar1_Outlier", "(dcar_posA_1_Outlier||dcar_posC_1_Outlier||dcar_negA_1_Outlier||dcar_negC_1_Outlier)");
+  tree->SetAlias("dcar2_Outlier", "(dcar_posA_2_Outlier||dcar_posC_2_Outlier||dcar_negA_2_Outlier||dcar_negC_2_Outlier)");
+  tree->SetAlias("dcar_Outlier" , "(dcar0_Outlier||dcar1_Outlier||dcar2_Outlier)");
+  tree->SetAlias("dcaz0_Outlier", "(dcaz_posA_0_Outlier||dcaz_posC_0_Outlier||dcaz_negA_0_Outlier||dcaz_negC_0_Outlier)");
+  tree->SetAlias("dcaz1_Outlier", "(dcaz_posA_1_Outlier||dcaz_posC_1_Outlier||dcaz_negA_1_Outlier||dcaz_negC_1_Outlier)");
+  tree->SetAlias("dcaz2_Outlier", "(dcaz_posA_2_Outlier||dcaz_posC_2_Outlier||dcaz_negA_2_Outlier||dcaz_negC_2_Outlier)");
+  tree->SetAlias("dcaz_Outlier" , "(dcaz0_Outlier||dcaz1_Outlier||dcaz2_Outlier)");
+  
+  tree->SetAlias("dcar0_Warning", "(dcar_posA_0_Warning||dcar_posC_0_Warning||dcar_negA_0_Warning||dcar_negC_0_Warning)");
+  tree->SetAlias("dcar1_Warning", "(dcar_posA_1_Warning||dcar_posC_1_Warning||dcar_negA_1_Warning||dcar_negC_1_Warning)");
+  tree->SetAlias("dcar2_Warning", "(dcar_posA_2_Warning||dcar_posC_2_Warning||dcar_negA_2_Warning||dcar_negC_2_Warning)");
+  tree->SetAlias("dcar_Warning" , "(dcar0_Warning||dcar1_Warning||dcar2_Warning)");
+  tree->SetAlias("dcaz0_Warning", "(dcaz_posA_0_Warning||dcaz_posC_0_Warning||dcaz_negA_0_Warning||dcaz_negC_0_Warning)");
+  tree->SetAlias("dcaz1_Warning", "(dcaz_posA_1_Warning||dcaz_posC_1_Warning||dcaz_negA_1_Warning||dcaz_negC_1_Warning)");
+  tree->SetAlias("dcaz2_Warning", "(dcaz_posA_2_Warning||dcaz_posC_2_Warning||dcaz_negA_2_Warning||dcaz_negC_2_Warning)");
+  tree->SetAlias("dcaz_Warning" , "(dcaz0_Warning||dcaz1_Warning||dcaz2_Warning)");
+  
+  tree->SetAlias("dcar0_PhysAcc", "(dcar_posA_0_PhysAcc&&dcar_posC_0_PhysAcc&&dcar_negA_0_PhysAcc&&dcar_negC_0_PhysAcc)");
+  tree->SetAlias("dcar1_PhysAcc", "(dcar_posA_1_PhysAcc&&dcar_posC_1_PhysAcc&&dcar_negA_1_PhysAcc&&dcar_negC_1_PhysAcc)");
+  tree->SetAlias("dcar2_PhysAcc", "(dcar_posA_2_PhysAcc&&dcar_posC_2_PhysAcc&&dcar_negA_2_PhysAcc&&dcar_negC_2_PhysAcc)");
+  tree->SetAlias("dcar_PhysAcc" , "(dcar0_PhysAcc&&dcar1_PhysAcc&&dcar2_PhysAcc)");
+  tree->SetAlias("dcaz0_PhysAcc", "(dcaz_posA_0_PhysAcc&&dcaz_posC_0_PhysAcc&&dcaz_negA_0_PhysAcc&&dcaz_negC_0_PhysAcc)");
+  tree->SetAlias("dcaz1_PhysAcc", "(dcaz_posA_1_PhysAcc&&dcaz_posC_1_PhysAcc&&dcaz_negA_1_PhysAcc&&dcaz_negC_1_PhysAcc)");
+  tree->SetAlias("dcaz2_PhysAcc", "(dcaz_posA_2_PhysAcc&&dcaz_posC_2_PhysAcc&&dcaz_negA_2_PhysAcc&&dcaz_negC_2_PhysAcc)");
+  tree->SetAlias("dcaz_PhysAcc" , "(dcaz0_PhysAcc&&dcaz1_PhysAcc&&dcaz2_PhysAcc)");
+  
+  
+  //
+  // specify the variables which shall be included in the status bar.
+  // give them meaningful names for the y axis of the status bar!
+  //
+  TString sStatusbarVars ("MIPquality;dcaz;dcar;tpcItsMatch;itsTpcPulls;meanTPCncl;global");
+  TString sStatusbarNames("MIP mean&rms;v_drift(DCAZ);space p.(DCAR);TPC-ITS m.eff.;ITS-TPC m.qual.;mean TPC Ncl;global result");
+  
+  //
+  // global descision is made automatically from the other entries in the status bar.
+  //
+  TString sVarsNoGlobal = sStatusbarVars;
+  sVarsNoGlobal.Remove(sVarsNoGlobal.Last(';'), sVarsNoGlobal.Length()); // remove last item (';global')
+  // global PhysAcc
+  TString sGlobalCriterion = sVarsNoGlobal;
+  sGlobalCriterion.ReplaceAll(";","_PhysAcc&&"); sGlobalCriterion.Append("_PhysAcc");
+  cout << "global PhysAcc:  " << sGlobalCriterion.Data() << endl;
+  tree->SetAlias("global_PhysAcc" , sGlobalCriterion.Data());
+  // global Outlier
+  sGlobalCriterion="";
+  TObjArray* oaVarsNoGlobal = sVarsNoGlobal.Tokenize(";");
+  for (Int_t vari=0; vari<oaVarsNoGlobal->GetEntriesFast(); vari++)
+  {
+    TString sVar( oaVarsNoGlobal->At(vari)->GetName() );
+    sGlobalCriterion+=Form("(%s_Outlier&&!%s_PhysAcc)", sVar.Data(), sVar.Data());
+    if (vari<oaVarsNoGlobal->GetEntriesFast()-1) sGlobalCriterion+="||";
+  }
+  cout << "global Outlier:  " << sGlobalCriterion.Data() << endl;
+  tree->SetAlias("global_Outlier" , sGlobalCriterion.Data());
+  // global Warning
+  sGlobalCriterion.ReplaceAll("_Outlier","_Warning");
+  cout << "global Warning:  " << sGlobalCriterion.Data() << endl;
+  tree->SetAlias("global_Warning" , sGlobalCriterion.Data());
+  
+  //
+  // set Boolean criteria to be checked for the markers in the status bar:
+  // separate them by colon ":"   (1) = true --> first marker always plotted
+  //
+  TString sCriteria("(1):(statisticOK):(varname_Warning):(varname_Outlier):(varname_PhysAcc)"); // or to just show vetos: (varname_PhysAcc&&varname_Warning)
+  
+  returnStrings[0] = sStatusbarVars;
+  returnStrings[1] = sStatusbarNames;
+  returnStrings[2] = sCriteria;
+  
+  return 1;
 }
-*/