Hi experts,
I am trying to make some TH3D. Yet as I have a quite specific axis from another histogram, cannot initialize the histogram with linear spacing. What I did is the following:
TH2D* MMKvsBeamEnergy = new TH2D("MMKvsBeamEnergy", "MMKvsBeamEnergy", 400, 0, 2000, Ax->GetNbins(), Ax->GetXbins()->GetArray());
TH3D* MMKvsMMKPionvsBeamEnergy = new TH3D("MMKvsMMKPionvsBeamEnergy", "MMKvsMMKPionvsBeamEnergy", MMKvsBeamEnergy->GetXaxis()->GetNbins(), MMKvsBeamEnergy->GetXaxis()->GetXbins()->GetArray(), MMKvsBeamEnergy->GetXaxis()->GetNbins(), MMKvsBeamEnergy->GetXaxis()->GetXbins()->GetArray(), Ax->GetNbins(), Ax->GetXbins()->GetArray());
The Ax Axis is obtained by:
TFile* fAx = TFile::Open("../Data/Real.root");
TH1* Histo = dynamic_cast<TH1*>(fAx->FindObjectAny("PGamma_Flux_photon_number_flumo"));
TAxis* Ax = Histo->GetXaxis();
Now my problem is the following:
Somehow all my TH3D I initialize in this way have x- and y-Axis going from 0 to 1. I do not understand how this could be and what to change. Is this a bug or is there a workaround?
Note: I tried to initialize the x- and y-axis linear, but there seems to be no implementation for this combination.
Thanks,
Emil