Hi,
I want to have a variable binning in a TH2 histogram, here is my code:
std::vector<Float_t> ptbins = {4.5e03, 7.e03, 10.e03, 15.e03, 20.e03, 25.e03, 30.e03, 35.e03, 40.e03, 45.e03, 50.e03, 60.e03, 80.e03, 100.e03, 200.e03, 300.e03, 500.e03, 700.e03};
std::vector<Float_t> etabins = {-3.0, -2.47, -2.37, -2.01, -1.81, -1.52, -1.37, -1.15, -0.8, -0.6, -0.1, 0, 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47, 3.};Int_t ptbinnum = sizeof(ptbins);
Int_t etabinnum = sizeof(etabins);Float_t *Ptbins = new Float_t[ptbinnum];
Float_t *Etabins = new Float_t[etabinnum];for(unsigned int i(0); i<ptbinnum; i++) Ptbins[i] = ptbins.at(i);
for(unsigned int j(0); j<etabinnum; j++) Etabins[j] = etabins.at(j);h_2D_el_pt_vs_eta = Init2DHistogramVarBin(“h_2D_el_pt_vs_eta”, "h_2D_el_pt_vs_eta; #eta ; p_{T} [GeV] ", etabinnum, Etabins, ptbinnum, Ptbins);
This is not working, but I have no idea why, is there anything I’m doing wrong here?
Thanks!
ROOT Version: v6-10-06
Platform: macOS
Compiler: Python