How can I get the absolute value of all the values in a RooRealVar?


Hi, I have a very basic question but I’ve been struggling to find a solution. I have around a million entries in a RooRealVar that I have taken from a TBranch which range from -2.5 to 2.5, how can I turn all the negative values into positives? I need to then cut a different dataset in ranges of 0 ->1 and 1->2.5. Thanks for your help.
ROOT Version: 6.14
RooFit Version: 3.60
Platform: Windows 10(?)
Compiler: Mobatek


Hi

RooDataSet does not allow you to manipulate values. So the easiest solution is to create a new DataSet filled with the absolute values

Lorenzo

Hi Lorenzo,
Thank you for your answer, so can I just write something along the lines of RooDataSet(“data”, “data”, tree, Abs(variable))?