StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrackTowerEnergyListToFourVecListTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 
3 #include <StjTrackTowerEnergyListToFourVecList.h>
4 
5 #include <StjTowerEnergyList.h>
6 #include <StjTrackList.h>
7 #include <StjFourVecList.h>
8 
9 #include "StjTrackTowerEnergyListToFourVecListTest.hh"
10 
11 #include <iostream>
12 
13 using namespace std;
14 
15 // Registers the fixture into the 'registry'
16 CPPUNIT_TEST_SUITE_REGISTRATION( StjTrackTowerEnergyListToFourVecListTest );
17 
18 void StjTrackTowerEnergyListToFourVecListTest::setUp()
19 {
20 
21 }
22 
23 void StjTrackTowerEnergyListToFourVecListTest::tearDown()
24 {
25 
26 }
27 
28 void StjTrackTowerEnergyListToFourVecListTest::testOne()
29 {
30  StjTrackList trackList;
31 
32  StjTrack track1;
33  track1.runNumber = 100;
34  track1.eventId = 10;
35  track1.detectorId = 1;
36  track1.id = 1;
37  track1.pt = 0.2;
38  track1.eta = 0.3;
39  track1.phi = 0.1;
40  trackList.push_back(track1);
41 
42  StjTrack track2;
43  track2.runNumber = 100;
44  track2.eventId = 10;
45  track2.detectorId = 1;
46  track2.id = 2;
47  track2.pt = 0.3;
48  track2.eta = 0.1;
49  track2.phi = 0.2;
50  trackList.push_back(track2);
51 
52  StjTowerEnergyList energyList;
53 
54  StjTowerEnergy energy1;
55  energy1.runNumber = 100;
56  energy1.eventId = 10;
57  energy1.detectorId = 9;
58  energy1.towerId = 9;
59  energy1.energy = 3.2;
60  energy1.towerR = 225.0;
61  energy1.towerEta = 0.3;
62  energy1.towerPhi = 0.0;
63  energy1.towerR = 225.0;
64  energy1.vertexX = 0.0;
65  energy1.vertexY = 0.0;
66  energy1.vertexZ = 0.0;
67  energyList.push_back(energy1);
68 
69  StjTowerEnergy energy2;
70  energy2.runNumber = 100;
71  energy2.eventId = 10;
72  energy2.detectorId = 9;
73  energy2.towerId = 19;
74  energy2.energy = 3.2;
75  energy2.towerR = 225.0;
76  energy2.towerEta = 0.3;
77  energy2.towerPhi = 0.0;
78  energy2.towerR = 225.0;
79  energy2.vertexX = 0.0;
80  energy2.vertexY = 0.0;
81  energy2.vertexZ = 0.0;
82  energyList.push_back(energy2);
83 
84  StjTowerEnergy energy3;
85  energy3.runNumber = 100;
86  energy3.eventId = 10;
87  energy3.detectorId = 9;
88  energy3.towerId = 119;
89  energy3.energy = 3.2;
90  energy3.towerR = 225.0;
91  energy3.towerEta = 0.3;
92  energy3.towerPhi = 0.0;
93  energy3.towerR = 225.0;
94  energy3.vertexX = 0.0;
95  energy3.vertexY = 0.0;
96  energy3.vertexZ = 0.0;
97  energyList.push_back(energy3);
98 
100 
101  StjFourVecList fourList = toFourVec(trackList, energyList);
102 
103  CPPUNIT_ASSERT_EQUAL( (size_t)5, fourList.size());
104  for(StjFourVecList::const_iterator it = fourList.begin(); it != fourList.end(); ++it) {
105 // cout << (*it).runNumber << " "
106 // << (*it).eventId << " "
107 // << (*it).detectorId << " "
108 // << (*it).pt << " "
109 // << (*it).eta << " "
110 // << (*it).phi << " "
111 // << (*it).m << " "
112 // << endl;
113  }
114 
115 }