message: More user-friendly names for output png files
diff: #include <TTree.h>
  #include <TH1.h>
  #include <TFile.h>
  +#include <TObjString.h>
  #include <TCanvas.h>
  #endif
  @@ -46,19 +47,56 @@ Bool_t DrawTrendingPIDQA(TString mergedTrendFile = "trending.root"){
  }
  - TCanvas* c=0x0;
  - for(Int_t k=0; k<nVars-1; k++){
  - if(k%4==0){
  - if(c) c->SaveAs(Form("PIDqaTrend%d.png",k/4));
  - c=new TCanvas(Form("c%d",k/4),Form("c%d",k/4),1500,600);
  - c->Divide(2,2);
  + TCanvas** c=new TCanvas*[20];
  + TString detStrings[4]={"ITS","TPC_Basic","TPC_TOF","TOF"};
  + TString partStrings[5]={"electron","pion","kaon","proton","deuteron"};
  + TString canname[20];
  + for(Int_t k=0; k<20; k++){
  + c[k]=new TCanvas(Form("c%d",k),Form("c%d",k),1500,600);
  + c[k]->Divide(2,2);
  + canname[k]="PIDqaTrend";
  + }
  + for(Int_t jdet=0; jdet<4; jdet++){
  + for(Int_t jpar=0; jpar<5; jpar++){
  + Int_t k=jdet*5+jpar;
  + canname[k].Append(detStrings[jdet].Data());
  + canname[k].Append(partStrings[jpar].Data());
  + }
  + }
  +
  + for(Int_t jvar=0; jvar<nVars-1; jvar++){
  + TString hname=htr[jvar]->GetName();
  + Int_t theDet=-1;
  + for(Int_t jdet=0; jdet<4; jdet++){
  + if(hname.Contains(Form("nSigma%s",detStrings[jdet].Data()))) theDet=jdet;
  + }
  + Int_t thePar=-1;
  + for(Int_t jpar=0; jpar<5; jpar++){
  + if(hname.Contains(partStrings[jpar].Data())) thePar=jpar;
  + }
  + if(theDet>=0 && thePar>=0){
  + Int_t theCanv=theDet*5+thePar;
  + Int_t thePad=-1;
  + if(hname.Contains("meannSigma")) thePad=1;
  + else if(hname.Contains("signSigma")) thePad=2;
  + if(thePad>0){
  + TObjArray* arr=hname.Tokenize("_");
  + TObjString* lasts=(TObjString*)arr->At(arr->GetEntries()-1);
  + TString stmom=lasts->GetString();
  + if(stmom.Contains("MeV")){
  + stmom.ReplaceAll("p","");
  + stmom.ReplaceAll("MeV","");
  + Int_t mom=stmom.Atoi();
  + if(theDet<=2 && mom>800) thePad+=2;
  + if(theDet==3 && mom>1100) thePad+=2;
  + c[theCanv]->cd(thePad);
  + htr[jvar]->Draw("");
  + htr[jvar]->Draw("psame");
  + }
  + }
  }
  - Int_t thePad=(k%4)+1;
  - c->cd(thePad);
  - htr[k]->Draw("");
  - htr[k]->Draw("psame");
  }
  - if(c) c->SaveAs(Form("PIDqaTrend%d.png",(nVars-1)/4));
  + for(Int_t k=0; k<20; k++) c[k]->SaveAs(Form("%s.png",canname[k].Data()));
  delete [] vect;
  }
  