StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTowerEnergyListToStMuTrackFourVecListTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 #include <StjeTowerEnergyListToStMuTrackFourVecList.h>
3 #include <StMuTrackFourVec.h>
4 
5 #include "StjTowerEnergyListToStMuTrackFourVecListTest.hh"
6 
7 
8 using namespace std;
9 
10 // Registers the fixture into the 'registry'
11 CPPUNIT_TEST_SUITE_REGISTRATION( StjTowerEnergyListToStMuTrackFourVecListTest );
12 
13 void StjTowerEnergyListToStMuTrackFourVecListTest::setUp()
14 {
15 
16 }
17 
18 void StjTowerEnergyListToStMuTrackFourVecListTest::tearDown()
19 {
20 
21 }
22 
23 void StjTowerEnergyListToStMuTrackFourVecListTest::testOne()
24 {
26  StjTowerEnergyList elist;
27 
28  StjTowerEnergy energy;
29  energy.energy = 1.8530849;
30  energy.towerR = 225.40499;
31  energy.towerEta = 0.8750000;
32  energy.towerPhi = -1.281418;
33  energy.vertexX = -0.840182;
34  energy.vertexY = 0.0856855;
35  energy.vertexZ = -78.94999;
36  elist.push_back(energy);
37 
38  FourList flist = etof(elist);
39  CPPUNIT_ASSERT_EQUAL( (size_t)1, flist.size());
40  StMuTrackFourVec *p4 = (StMuTrackFourVec*)flist[0];
41  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.1086495 , p4->pt() , 1e-5);
42  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.10221 , p4->eta() , 1e-5);
43  CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.277958 , p4->phi() , 1e-5);
44  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , p4->mass() , 1e-5);
45 
46 }
47