Manual histogram bin distribution

ROOT Version: 6.32.04
Platform: WSL2 Ubuntu

Hello! From what I understand, the following command:

TH1D *hist = new TH1D("hist", " ", 50, 0, 0.4);

… defines a histogram of 50 equally-spaced bins between 0 and 0.4 on the x-axis. However, is it possible to manually set a bin distribution? I need the bins to be defined as follows:

5.00E-3
1.50E-2
2.50E-2
3.50E-2
4.50E-2
6.00E-2
8.00E-2
1.05E-1
1.35E-1
1.85E-1
2.60E-1
3.50E-1

Thanks in advance! Cheers.

Use this constructor:
https://root.cern/doc/master/classTH1D.html#a0a805a27aba096fe3cdba020701da9df

where you pass the number of bins and an array with the lower edges of the bins (see ROOT: TH1 Class Reference)

Thanks for responding. Following your link, I took each value in the previous table I shared and subtracted half a bin width from it. Then I defined the histogram as follows.

float xbin[] = { 0.00E+00, 1.00E-02, 2.00E-02, 3.00E-02, 4.00E-02, 5.00E-02, 7.00E-02, 9.00E-02, 1.20E-01, 1.50E-01, 2.20E-01, 3.00E-01 }; 
TH1D *hist_ThrustP = new TH1D("hist_ThrustP", "Thrust distributions", (sizeof(xbin)/sizeof(xbin[0])-1), xbin);

Is this logic correct?