Hi all,
in a script I create and save a large number of THStacks into a root file. Unfortunately the axes of the THStacks are not saved as they are with the histograms. When drawing, I have to add the axis titles later on by hand. Example:
{
plot1 = new TH1F("plot1","",50,0,1);
plot2 = new TH1F("plot2","",50,0,1);
plot1->Fill( 0.3 );
plot2->Fill( 0.7 );
stack = new THStack("stack","");
stack->Add( plot1 );
stack->Add( plot2 );
file = new TFile( "scratch.root", "recreate" );
file->WriteTObject( stack );
canvas = new TCanvas( "canvas", "" );
stack->Draw();
stack->GetXaxis()->SetTitle( "p_{T} [GeV]" );
stack->GetXaxis()->DrawClone();
stack->Draw();
file->WriteTObject( canvas );
}
Is there a workaroud to save the information with the THStack? This bites me whenever I want to change something by hand form a TBrowser. Thanks in advance.
Cheers
Jan