41 Double_t my_transfer_function(
const Double_t *x,
const Double_t * )
48 if (*x > -1.5 && *x < -0.5)
51 if (*x < -0.5 && *x < 0.)
54 if (*x > 0 && *x < 0.5)
69 const Double_t xMin = -1., xMax = 1., xStep = (xMax - xMin) / (nX - 1);
72 const Double_t yMin = -1., yMax = 1., yStep = (yMax - yMin) / (nY - 1);
75 const Double_t zMin = -1., zMax = 1., zStep = (zMax - zMin) / (nZ - 1);
77 TH3F *hist =
new TH3F(
"glvoxel",
"glvoxel", nX, -1., 1., nY, -1., 1., nZ, -1., 1.);
80 for (UInt_t i = 0; i < nZ; ++i) {
81 const Double_t z = zMin + i * zStep;
83 for (UInt_t j = 0; j < nY; ++j) {
84 const Double_t y = yMin + j * yStep;
86 for (UInt_t k = 0; k < nX; ++k) {
87 const Double_t x = xMin + k * xStep;
89 const Double_t val = 1. - (x * x + y * y + z * z);
90 hist->SetBinContent(k + 1, j + 1, i + 1, val);
96 TList * lf = hist->GetListOfFunctions();
98 TF1 * tf =
new TF1(
"TransferFunction", my_transfer_function);
102 gStyle->SetCanvasPreferGL(1);