StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBET4pMakerImpTest.hh
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 #ifndef STBET4PMAKERIMPTEST_HH
3 #define STBET4PMAKERIMPTEST_HH
4 
5 #include <cppunit/extensions/HelperMacros.h>
6 
7 class StBET4pMakerImpTest : public CPPUNIT_NS::TestFixture
8 {
9  CPPUNIT_TEST_SUITE( StBET4pMakerImpTest );
10  CPPUNIT_TEST( testGetTrackAndEnergyList_withCut );
11  CPPUNIT_TEST( testGetTrackAndEnergyList_withoutCut );
12  CPPUNIT_TEST( testMake );
13  CPPUNIT_TEST_SUITE_END();
14 
15 public:
16  void setUp();
17  void tearDown();
18 
19  void testGetTrackAndEnergyList_withCut();
20  void testGetTrackAndEnergyList_withoutCut();
21  void testMake();
22 
23 private:
24 
25  class StjTPCMock : public StjTPC {
26  public:
27  StjTPCMock(int n) : _n(n) { }
28  StjTrackList getTrackList()
29  {
30  StjTrackList ret;
31  for(int i = 0; i < _n; ++i)
32  ret.push_back(StjTrack());
33  return ret;
34  };
35  private:
36  int _n;
37  };
38 
39  class StjBEMCMock : public StjBEMC {
40  public:
41  StjBEMCMock(int n) : _n(n) { }
42  StjTowerEnergyList getEnergyList()
43  {
44  StjTowerEnergyList ret;
45  for(int i = 0; i < _n; ++i)
46  ret.push_back(StjTowerEnergy());
47  return ret;
48  };
49  private:
50  int _n;
51  };
52 
53  class StjEEMCMock : public StjEEMC {
54  public:
55  StjEEMCMock(int n) : _n(n) { }
56  StjTowerEnergyList getEnergyList()
57  {
58  StjTowerEnergyList ret;
59  for(int i = 0; i < _n; ++i)
60  ret.push_back(StjTowerEnergy());
61  return ret;
62  };
63  private:
64  int _n;
65  };
66 
67  class StjTrackCutMock : public StjTrackCut {
68  bool operator()(const StjTrack& track)
69  {
70  return true;
71  }
72  };
73 
74  class StjTowerEnergyCutMock : public StjTowerEnergyCut {
75  bool operator()(const StjTowerEnergy& energy)
76  {
77  return true;
78  }
79  };
80 
81  void assertResults(const char *path);
82  void writeExpected(const char *path);
83 
84  StjTPC* tpc;
85  StjTrackListCut* tpcCut;
86  StjBEMC* bemc;
87  StjTowerEnergyListCut *bemcCut;
88  StjEEMC* eemc;
89 
91  StBET4pMakerImp *imp;
92 
93 };
94 
95 #endif // STBET4PMAKERIMPTEST_HH
Definition: StjTPC.h:12