Hi guys. I’m a beginner ROOT user and have been reading through documentation and questions but can’t really find an answer to what I’m looking for. I have a RooDataSet and I basically want to find the median value. I have 1000 data points and so what I want to do is arrange all my data points from smallest to largest, cast this into a new RooDataSet and then I would clearly use the get class member as (Get(500)+Get(501)) / 2. Does anyone have an idea how I could order my data set? Thanks in advance.
The simplest solution is to put your data in an single vector (e.g. std::vector x, and then you can call the function TMath::Median( x.size(), x.data() )
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.