I am fairly new at ROOT and I have run into a problem I cannot solve by reading the manual.
I am using TPostScript to create graphs. I would like one graph, which is a 2D graph to have its Z-axis logarithmic and Palette set to one like I would do with gStyle->SetPalette(1) if i was only do one graph at a time.
Here is a sample of what I am trying to do, I have inputted comments where I would like assistance.
Thank You
[code]#include
#include
#include
#include
#include
void PostScript(){
TChain *chain = new TChain(“NTuple_gammaP_PipPim”);
chain->Add(“Ntuple_gammaP_PipPim_TOF_no_other.root”);
Int_t nEvent = chain->GetEntries();
std::cout <<"Number of events " <<nEvent <<std::endl;
TCanvas *c1 = new TCanvas(“c1”,“Files”, 800, 650);
c1->Divide(2,1);
TPostScript *ps = new TPostScript(“file.ps”,112);
ps->Range(26,26);
// picture 1
ps->NewPage();
c1->cd(1);
c1->cd(1)->SetLogz();
c1->cd(1)->SetPalette(1); //<<<this doesnt work
//=========I would like this pad to have Palette(1) and Z axis on log scale==========
chain->Draw(“dP_TOF:P_Ptot >> h11(1000,0.0,2.5,1000,-10.0,10.0)”,"",“colz”);
c1->cd(2);
//======I would like this pad to have normal palette and linear scale on Z axis========
chain->Draw(“MP_cal:P_Ptot >> h13(1000,0.0,2.5,1000,0.0,3.0)”,"",“colz”);
c1->Update();
ps->Close();
// invoke Postscript viewer
gSystem->Exec(“gs file.ps”);
}
[/code]