StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrackListToStMuTrackFourVecListTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 #include <StjeTrackListToStMuTrackFourVecList.h>
3 #include <StMuTrackFourVec.h>
4 
5 #include "StjTrackListToStMuTrackFourVecListTest.hh"
6 
7 using namespace std;
8 
9 // Registers the fixture into the 'registry'
10 CPPUNIT_TEST_SUITE_REGISTRATION( StjTrackListToStMuTrackFourVecListTest );
11 
12 void StjTrackListToStMuTrackFourVecListTest::setUp()
13 {
14 
15 }
16 
17 void StjTrackListToStMuTrackFourVecListTest::tearDown()
18 {
19 
20 }
21 
22 void StjTrackListToStMuTrackFourVecListTest::testOne()
23 {
25  StjTrackList tlist;
26 
28  track.pt = 0.7650294;
29  track.eta = 1.0071259;
30  track.phi = 1.1558674;
31  tlist.push_back(track);
32 
33  FourList flist = ttof(tlist);
34  CPPUNIT_ASSERT_EQUAL( (size_t)1, flist.size());
35  StMuTrackFourVec *p4 = (StMuTrackFourVec*)flist[0];
36  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.7650294 , p4->pt() , 1e-5);
37  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0071259 , p4->eta() , 1e-5);
38  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.1558674 , p4->phi() , 1e-5);
39  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.1395700 , p4->mass() , 1e-5);
40 
41 }
42