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
@@ -263,3 +265,20 @@ TEST(TTreeFormulaRegressions, WrongName)
263265 EXPECT_EQ (t.Draw (" s.Eta()" , " " ), -1 );
264266 }
265267}
268+
269+ // ROOT-8842
270+ TEST (TTreeReaderRegressions, ValueFastTuple)
271+ {
272+ TNtuple tree (" tuple" , " ROOT-8842" , " px:py:pz:energy" );
273+ for (auto i=0 ; i<1000000 ; ++i)
274+ tree.Fill (i,i+1 ,i+2 ,i+3 );
275+ ROOT::Experimental::TTreeReaderFast reader (&tree);
276+ ROOT::Experimental::TTreeReaderValueFast<float > px (reader, " px" );
277+ ROOT::Experimental::TTreeReaderValueFast<float > py (reader, " py" );
278+ ROOT::Experimental::TTreeReaderValueFast<float > pz (reader, " pz" );
279+ double total = 0.0 ;
280+ // reader.SetEntry(0); If I uncomment this, the crash disappears
281+ for (auto it = reader.begin (); it != reader.end (); ++it)
282+ total += sqrt ((*px)*(*px) + (*py)*(*py) + (*pz)*(*pz));
283+ EXPECT_EQ (total, 8.6602627e+11 );
284+ }
You can’t perform that action at this time.
0 commit comments