Is there any way to make a copy of TTreeReaderArray so that I can pass it as an argument to a function? Or better yet, is there a simply way to convert it to a std::vector without having to use a for loop?
Thanks,
Charlie
ROOT Version: 6.24/06 Platform: Not Provided Compiler: Not Provided
Or better yet, is there a simply way to convert it to a std::vector without having to use a for loop?
If you mean that the value for all TTree entries should be stored in the vector, then there is no avoiding a loop short of using RDataFrame (which will do the loop for you ).
If you mean that the values for a given TTree entries should be stored in the vector. You may not have to as the TTreeReaderArray<float> behave as an STL collection (it has a begin and end). Alternatively you can use that to feed a vector (std::vector v(array.begin(), array.end()))