TGraph with unix time as X entries

I’m creating a TGraph object from an ntuple that contains a “t” variable that is a unix time (seconds from 1970/01/01)

TGraph *grExecuting=new TGraph(BrokStatusNtuple->GetSelectedRows(),BrokStatusNtuple->GetV1(), BrokStatusNtuple->GetV2());

when I try to draw the graph it seems that some V1 values are rounded (probably due to scientific notation:
1.xxxxe+9 ) causing the fact that, for example, several x entries are treated as being the same (that could not be as V1 entries are all different and increasing).
I’ve found:
method but it fix just the way label are displayed in the axis

Any suggestion?
thanks in advance for help

Attach your ROOT file with the “BrokStatusNtuple” here for inspection.

yes probably there are some limits in the way I could fill an ntuple … I used UInt_t values but I see that they are stored in scientific notation and probably somehow rounded
debug.root (28.5 KB)

All leaves in your “broker” tree are “Float_t”, so up to 6 to 9 decimal digits precision.
You need to recreate you tree using (for relevant leaves), for example, “Double_t” values which give 15 to 17 decimal digits precision, or “UInt_t”, or “Long64_t”, or “ULong64_t”.
The simplest thing would be to use a “TNtupleD” instead of a “TNtuple”.

THANKS!!! really appreciated your suggestion
Pier Fortunato

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.