2 #include <StjTPCTree.h>
3 #include "StjTPCTreeTest.hh"
5 #include <StjTreeEntryCoordinator.h>
6 #include <StjTreeIndexList.h>
8 #include <StjTrackListReader.h>
20 void StjTPCTreeTest::setUp()
25 void StjTPCTreeTest::tearDown()
30 void StjTPCTreeTest::testGetEntry()
32 TFile* file =
new TFile(
"./part_run6143024.root");
34 TTree *tree =
dynamic_cast<TTree*
>(file->Get(
"tpcTracks"));
38 tree->BuildIndex(
"runNumber",
"eventId");
44 reader->GetEntryWithIndex(6143024, 38);
46 StjTrackList trackList = tpc->getTrackList();
47 CPPUNIT_ASSERT_EQUAL( (
size_t)13, trackList.size() );
48 CPPUNIT_ASSERT_EQUAL((Short_t) 87, trackList[0].
id );
49 CPPUNIT_ASSERT_EQUAL((Short_t) 80, trackList[1].
id );
50 CPPUNIT_ASSERT_EQUAL((Short_t) 77, trackList[2].
id );
51 CPPUNIT_ASSERT_EQUAL((Short_t) 76, trackList[3].
id );
52 CPPUNIT_ASSERT_EQUAL((Short_t) 67, trackList[4].
id );
53 CPPUNIT_ASSERT_EQUAL((Short_t) 65, trackList[5].
id );
54 CPPUNIT_ASSERT_EQUAL((Short_t) 51, trackList[6].
id );
55 CPPUNIT_ASSERT_EQUAL((Short_t) 29, trackList[7].
id );
56 CPPUNIT_ASSERT_EQUAL((Short_t) 11, trackList[8].
id );
57 CPPUNIT_ASSERT_EQUAL((Short_t)199, trackList[9].
id );
58 CPPUNIT_ASSERT_EQUAL((Short_t)192, trackList[10].
id );
59 CPPUNIT_ASSERT_EQUAL((Short_t)185, trackList[11].
id );
60 CPPUNIT_ASSERT_EQUAL((Short_t)181, trackList[12].
id );
63 reader->GetEntryWithIndex(6143024, 41);
64 trackList = tpc->getTrackList();
65 CPPUNIT_ASSERT_EQUAL( (
size_t)0, trackList.size() );