- if (!fCHistoArr) { // create control histos
- const int kNResDef=7;
- const double kResDef[kNResDef]={0.05,0.05,0.3, 0.05,1,0.5,1.5};
- fCHistoArr = new TObjArray();
- fCHistoArr->SetOwner(kTRUE);
- const double ptMax=10;
- const double plMax=10;
- const double chiMax=100;
- const int nptbins=50;
- const int nresbins=400;
- const int nplbins=50;
- const int nchbins=200;
- const int maxBr = 15;
- const int maxCand = 200;
- TString ttl;
- for (int stp=0;stp<kNTrackingPhases;stp++) {
- for (int ilr=0;ilr<fNLrActive;ilr++) {
- int hoffs = stp*kHistosPhase + ilr;
- double mxdf = ilr>=kNResDef ? kResDef[kNResDef-1] : kResDef[ilr];
- ttl = Form("S%d_residY%d",stp,ilr);
- TH2F* hdy = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nresbins,-mxdf,mxdf);
- fCHistoArr->AddAtAndExpand(hdy,hoffs + kHResY);
- hdy->SetDirectory(0);
- //
- ttl = Form("S%d_residYPull%d",stp,ilr);
- TH2F* hdyp = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nplbins,-plMax,plMax);
- fCHistoArr->AddAtAndExpand(hdyp,hoffs + kHResYP);
- hdyp->SetDirectory(0);
- //
- ttl = Form("S%d_residZ%d",stp,ilr);
- TH2F* hdz = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nresbins,-mxdf,mxdf);
- fCHistoArr->AddAtAndExpand(hdz,hoffs + kHResZ);
- hdz->SetDirectory(0);
- //
- ttl = Form("S%d_residZPull%d",stp,ilr);
- TH2F* hdzp = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nplbins,-plMax,plMax);
- hdzp->SetDirectory(0);
- fCHistoArr->AddAtAndExpand(hdzp,hoffs + kHResZP);
- //
- ttl = Form("S%d_chi2Cl%d",stp,ilr);
- TH2F* hchi = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax, nchbins,0.,chiMax);
- hchi->SetDirectory(0);
- fCHistoArr->AddAtAndExpand(hchi,hoffs + kHChi2Cl);
+ if (fCHistoArr) return;
+ const int kNResDef=7;
+ const double kResDef[kNResDef]={0.05,0.05,0.3, 0.05,1,0.5,1.5};
+ fCHistoArr = new TObjArray();
+ fCHistoArr->SetOwner(kTRUE);
+ const double ptMax=10;
+ const double plMax=10;
+ const double chiMax=100;
+ const int nptbins=50;
+ const int nresbins=400;
+ const int nplbins=50;
+ const int nchbins=200;
+ const int maxBr = 15;
+ const int maxCand = 200;
+ TString ttl;
+ for (int stp=0;stp<kNTrackingPhases;stp++) {
+ for (int ilr=0;ilr<fNLrActive;ilr++) {
+ int hoffs = (1+stp)*kHistosPhase + ilr;
+ double mxdf = ilr>=kNResDef ? kResDef[kNResDef-1] : kResDef[ilr];
+ ttl = Form("S%d_residY%d",stp,ilr);
+ TH2F* hdy = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nresbins,-mxdf,mxdf);
+ fCHistoArr->AddAtAndExpand(hdy,hoffs + kHResY);
+ hdy->SetDirectory(0);
+ //
+ ttl = Form("S%d_residYPull%d",stp,ilr);
+ TH2F* hdyp = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nplbins,-plMax,plMax);
+ fCHistoArr->AddAtAndExpand(hdyp,hoffs + kHResYP);
+ hdyp->SetDirectory(0);
+ //
+ ttl = Form("S%d_residZ%d",stp,ilr);
+ TH2F* hdz = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nresbins,-mxdf,mxdf);
+ fCHistoArr->AddAtAndExpand(hdz,hoffs + kHResZ);
+ hdz->SetDirectory(0);
+ //
+ ttl = Form("S%d_residZPull%d",stp,ilr);
+ TH2F* hdzp = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax,nplbins,-plMax,plMax);
+ hdzp->SetDirectory(0);
+ fCHistoArr->AddAtAndExpand(hdzp,hoffs + kHResZP);
+ //
+ ttl = Form("S%d_chi2Cl%d",stp,ilr);
+ TH2F* hchi = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax, nchbins,0.,chiMax);
+ hchi->SetDirectory(0);
+ fCHistoArr->AddAtAndExpand(hchi,hoffs + kHChi2Cl);
+ //
+ ttl = Form("S%d_chi2Nrm%d",stp,ilr);
+ TH2F* hchiN = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax, nchbins,0.,chiMax);
+ hchiN->SetDirectory(0);
+ fCHistoArr->AddAtAndExpand(hchiN,hoffs + kHChi2Nrm);
+ //
+ if (stp==0) { // these histos make sense only for clusters2tracks stage
+ ttl = Form("S%d_bestInBranch%d",stp,ilr);
+ TH2* hnbr = new TH2F(ttl.Data(),ttl.Data(),nptbins,0,ptMax, maxBr,-0.5,maxBr-0.5);
+ hnbr->SetDirectory(0);
+ fCHistoArr->AddAtAndExpand(hnbr,hoffs + kHBestInBranch);