Filling a TH1D with diffenrces between two ULong64_t numbers?

Hi all,

I am dealing with ULong64_t for the first time so have little ideas how do they work, and have the following problem at hand.

I have two timestamps

ULong64_t t1 = 439742383004780 ;
ULong64_t t2 = 439742383004750 ;

I am trying to subtract them to get the time between them and fill it in a histogram (TH1D)


is it okay to directly do this or I need to do some conversions before extracting the time ?

Thanking You


In your code, a difference between the two variables is performed, and the result will be cast to a double. If that’s what you are after, that is the way to go.


Thank You for reply,

Is it possible to get the result as an integer itself ?

The x axis of the TH1 histogram will always be double, so there’s no way to get the result as integer.
The y axis of the TH1 histogram will be int or double depending on if you choose TH1L or TH1D. But that is just for counting how many entries per bin, it has nothing to do with t1 and t2.