--- UserCode/IPHCalignment2/analysis/Layout.cpp 2011/11/28 13:18:09 1.3 +++ UserCode/IPHCalignment2/analysis/Layout.cpp 2011/11/28 13:43:44 1.4 @@ -5,7 +5,7 @@ void Layout::DrawInit() { - /* gStyle->SetCanvasColor(0); + gStyle->SetCanvasColor(0); gStyle->SetCanvasBorderMode(0); gStyle->SetCanvasBorderSize(3); @@ -70,7 +70,7 @@ void Layout::DrawInit() Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); gStyle->SetNumberContours(NCont); - */ + } @@ -91,7 +91,6 @@ void Layout::Draw(const std::vectorSetLineColor( histos[i].linecolor ); } @@ -118,21 +117,10 @@ void Layout::Draw(const std::vectorDraw(); - std::cout << "size = " << mylegend->GetTextSize() << std::endl; - std::cout << "font = " << mylegend->GetTextFont() << std::endl; - - std::cout << mylegend->GetX1() << " " << mylegend->GetX2() << std::endl; - std::cout << mylegend->GetY1() << " " << mylegend->GetY2() << std::endl; - - TPaveText* toto = new TPaveText(0.17,0.72,0.43,0.83); - toto->SetFillColor(2); - toto->SetTextFont(2); - toto->SetTextSize(0); - toto->AddText("toto"); - toto->Draw(); // To Fit std::vector sigmas; + std::vector errors; for (unsigned int i=0;iSetParameter(2,SIG); histos[i].histo->Fit(fitter,"0"); sigmas.push_back(fitter->GetParameter(2)); + errors.push_back(fitter->GetParError(2)); } // Display sigmas + TPaveText* myblock = new TPaveText(0.6,0.65-(0.04*histos.size()),0.80,0.65,"NDC"); + myblock->SetBorderSize(0); + myblock->SetFillColor(0); for (unsigned int i=0;iGetWNDC() << std::endl; + str.precision(3); str << sigmas[i]; + str << " #pm "; + str.precision(3); str << errors[i]; + TText* mytext = myblock->AddText(str.str().c_str()); + mytext->SetTextColor(histos[i].linecolor); + mytext->SetTextAlign(11); } + myblock->Draw(); // Save std::string filename = GetFileName(histos[0].histo->GetTitle());