File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1010#include " TString.h"
1111#include " TLorentzVector.h"
1212#include < ROOT/TestSupport.hxx>
13+ #include " ROOT/TTreeReaderValueFast.hxx"
14+ #include " TNtuple.h"
1315
1416#include " gtest/gtest.h"
1517
@@ -291,3 +293,20 @@ TEST(TTreeReaderRegressions, UninitializedChain)
291293 }
292294 gSystem ->Unlink (filename);
293295}
296+
297+ // ROOT-8842
298+ TEST (TTreeReaderRegressions, ValueFastTuple)
299+ {
300+ TNtuple tree (" tuple" , " ROOT-8842" , " px:py:pz:energy" );
301+ for (auto i = 0 ; i < 1000000 ; ++i)
302+ tree.Fill (i, i + 1 , i + 2 , i + 3 );
303+ ROOT::Experimental::TTreeReaderFast reader (&tree);
304+ ROOT::Experimental::TTreeReaderValueFast<float > px (reader, " px" );
305+ ROOT::Experimental::TTreeReaderValueFast<float > py (reader, " py" );
306+ ROOT::Experimental::TTreeReaderValueFast<float > pz (reader, " pz" );
307+ double total = 0.0 ;
308+ // reader.SetEntry(0); If I uncomment this, the crash disappears
309+ for (auto it = reader.begin (); it != reader.end (); ++it)
310+ total += sqrt ((*px) * (*px) + (*py) * (*py) + (*pz) * (*pz));
311+ EXPECT_NEAR (total, 866026269930.1345215 , 100 );
312+ }
You can’t perform that action at this time.
0 commit comments