graph->SetMarkerStyle(mstyle);
graph->SetMarkerColor(mcolor);
graph->SetLineColor(mcolor);
+ graph->SetTitle(expr);
+ TString chstring(expr);
+ TObjArray *charray = chstring.Tokenize(":");
+ graph->GetXaxis()->SetTitle(charray->At(1)->GetName());
+ graph->GetYaxis()->SetTitle(charray->At(0)->GetName());
+ delete charray;
if (msize>0) graph->SetMarkerSize(msize);
for(Int_t i=0;i<graph->GetN();i++) graph->GetX()[i]+=offset;
return graph;
delete [] runNumber;
delete [] index;
delete [] newBins;
- //
+ //
+ graphNew->SetTitle(expr);
+ TString chstring(expr);
+ TObjArray *charray = chstring.Tokenize(":");
+ graphNew->GetXaxis()->SetTitle(charray->At(1)->GetName());
+ graphNew->GetYaxis()->SetTitle(charray->At(0)->GetName());
+ delete charray;
return graphNew;
}
}
-void TStatToolkit::DrawHistogram(TTree * tree, const char* drawCommand, const char* cuts, const char* histoname, const char* histotitle, Int_t nsigma, Float_t fraction )
+TH1* TStatToolkit::DrawHistogram(TTree * tree, const char* drawCommand, const char* cuts, const char* histoname, const char* histotitle, Int_t nsigma, Float_t fraction )
{
//
// Draw histogram from TTree with robust range
if(!tree) {
cerr<<" Tree pointer is NULL!"<<endl;
- return;
+ return 0;
}
// get entries
Int_t entries = tree->Draw(drawStr.Data(), cutStr.Data(), "goff");
if (entries == -1) {
cerr<<"TTree draw returns -1"<<endl;
- return;
+ return 0;
}
// get dimension
if(tree->GetV3()) dim = 3;
if(dim > 2){
cerr<<"TTree has more than 2 dimensions (not yet supported)"<<endl;
- return;
+ return 0;
}
// draw robust
hOut->GetYaxis()->SetTitle(tree->GetHistogram()->GetYaxis()->GetTitle());
hOut->Draw("colz");
}
-
+ return hOut;
}
//
// TTree function for robust draw
//
- static void 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);
+ static 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);
//
// TestFunctions:
//