#include "TStyle.h" #include "TList.h" #include "TH3.h" #include "TF1.h" const Double_t tempLowEdge = 85.; Double_t transfer_function(Double_t *x, Double_t * /*param*/) { //This function is required to suppress //boxes for empty bins - make them transparent. if (x) return *x > tempLowEdge ? 1. : 0.; return 0.; } void Oven_Homogeneity() { const unsigned nBins = 40; TH3F * const histo = new TH3F("histo","Oven Homgeneity", nBins, 0.,122., nBins, 0., 122., nBins, 0., 122.); TList * const lof = histo->GetListOfFunctions(); if (!lof) { std::cout<<"List of functions is null\n"; delete histo; return; } lof->Add(new TF1("TransferFunction", transfer_function, 0., 1000., 0)); gStyle->SetCanvasPreferGL(kTRUE); gStyle->SetPalette(1); histo->Fill(100., 95., 108., 94.46); histo->Fill(100., 95., 89., 94.19); histo->Fill(100., 95., 69., 93.12); histo->Fill(100., 95., 48., 91.9); histo->Fill(100., 95., 28., 87.6); for (unsigned i = 0; i < nBins; ++i) { for (unsigned j = 0; j < nBins; ++j) { for (unsigned k = 0; k < nBins; ++k) { if (!histo->GetBinContent(i + 1, j + 1, k + 1)) histo->SetBinContent(i + 1, j + 1, k + 1, tempLowEdge); } } } histo->Draw("glcolz"); }