Hi everyone,
I was wondering if someone could help me with a problem i’m having running a ROOT macro that I’ve written.
Basically, the macro reads in a few leafs (which are Ntuples) from a TTree, and then plots one of the Ntuple variables in different bins of another NTuple variable.
It was running fine, but I foolishly declared one of the Ntuple variables (in the source code that makes the NTuples) as an array of double, whereas the others were all arrays of floats. As a result if I try to get my macro to plot something in bins of the double variable, I get a segmentation violation because the memory demands are too high (the ntuple has around 23,000 entries).
What I would like to know is: is there a way to cast the data in the Ntuple from double to float? I tired casting each entry just before it was used but this didn’t help, I guess the segmentation violation is caused by reading in the Ntuple, so I’d like to cast the Ntuple first, and then read it in.
I have attached the ROOT macro (called Luis.C) that I use. I would greatly appreciate any help anyone can give me on this as I need to finish this work soon before I go on holiday!
Cheers,
Laurence Carson
Luis.C (3.58 KB)