#include #include #include #include using namespace std; void test(){ gStyle->SetPalette(55); TCanvas *c = NULL; cout << "1" << endl; // debug flag 1 if(c != NULL) delete c; cout << "2" << endl; // debug flag 2 c = new TCanvas("c", "c", 400, 400); cout << "3" << endl; // debug flag 3 TH2D *h = NULL; char ch = 'b'; for(int i=0; i<20; i++){ cout << "Press \"A/a\" to show next pixel, \"Q/q\" to quit." << endl; cin >> ch; while(ch != 'a' && ch != 'A' && ch != 'q' && ch != 'Q') ch = getchar(); if(ch == 'q' || ch == 'Q') break; c->cd(); if(i>0) h->Reset("M"); if(h != NULL) delete h; h = new TH2D("h", Form("h%d", i), 20, 0, 20, 20, 0, 20); h->GetZaxis()->SetRangeUser(1, 21); for(int j=0; jFill(i, i); h->Draw("COLZ"); c->Update(); } return; }