void testdraw() { TString filedir="/junofs/users/zhaor/Rm107/PMTtest/Defullscan/mcps.txt"; string ss1; ifstream filein(filedir); gStyle->SetOptStat(0); Int_t palette[5]; palette[0] = 15; palette[1] = 20; palette[2] = 23; palette[3] = 30; palette[4] = 32; gStyle->SetPalette(5,palette); Double_t rmax(1.); TH2D* pol_his = new TH2D("polarHist", "polarHist", 36, 0., 2.*TMath::Pi(), 8, 0., rmax); Double_t mu, muerr; for(Int_t i=1; i<=pol_his->GetNbinsX()/2; i++) { getline(filein,ss1); for(Int_t j=1; j<=pol_his->GetNbinsY(); j++) { getline(filein,ss1); istringstream is1(ss1); is1>>mu>>muerr; pol_his->SetBinContent(i+pol_his->GetNbinsX()/2, j, mu); getline(filein,ss1); istringstream is1(ss1); is1>>mu>>muerr; pol_his->SetBinContent(i, j, mu); } } TH2D* dummy_his = new TH2D("dummy", "histo title", 100, -rmax, rmax, 100, -rmax, rmax); TCanvas* c1 = new TCanvas("theCanvas", "theCanvas", 600, 600); dummy_his->Draw("COLZ"); pol_his->Draw("COLZPOL SAME "); pol_his->SetContour(20); }
|