StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBET4pMakerImpTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 
3 #include <StBET4pMakerImp.h>
4 #include <StjTPCTxt.h>
5 #include <StjBEMCTxt.h>
6 #include <StjEEMCTxt.h>
7 
8 #include "StjTrackListCut.h"
9 
10 #include <StjTrackCutDca.h>
11 #include <StjTrackCutDcaPtDependent.h>
12 #include <StjTrackCutEta.h>
13 #include <StjTrackCutPossibleHitRatio.h>
14 
15 #include "StjTowerEnergyListCut.h"
16 
17 #include <StjTowerEnergyCut2003BemcTower.h>
18 #include <StjTowerEnergyCutBemcWestOnly.h>
19 #include <StjTowerEnergyCutEnergy.h>
20 #include <StjTowerEnergyCutBemcStatus.h>
21 #include <StjTowerEnergyCutAdc.h>
22 
23 #include "StjTowerEnergyCorrectionForTracks.h"
24 
25 #include <iostream>
26 #include <fstream>
27 #include <sstream>
28 
29 #include "StBET4pMakerImpTest.hh"
30 
31 using namespace std;
32 
33 // Registers the fixture into the 'registry'
34 CPPUNIT_TEST_SUITE_REGISTRATION( StBET4pMakerImpTest );
35 
36 void StBET4pMakerImpTest::setUp()
37 {
38 
39 }
40 
41 void StBET4pMakerImpTest::tearDown()
42 {
43 
44 }
45 
46 void StBET4pMakerImpTest::testGetTrackAndEnergyList_withCut()
47 {
48  tpc = new StjTPCMock(35);
49  bemc = new StjBEMCMock(4500);
50  eemc = new StjEEMCMock(1000);
51 
52  tpcCut = new StjTrackListCut();
53  tpcCut->addCut(new StjTrackCutMock());
54 
55  bemcCut = new StjTowerEnergyListCut();
56  bemcCut->addCut(new StjTowerEnergyCutMock());
57 
59  imp = new StBET4pMakerImp(tpc, tpcCut, bemc, bemcCut, corr, eemc);
60 
61  pair<StjTrackList, StjTowerEnergyList> actual = imp->getTrackAndEnergyList();
62  CPPUNIT_ASSERT_EQUAL( (size_t)0, actual.first.size() );
63  CPPUNIT_ASSERT_EQUAL( (size_t)1000, actual.second.size() );
64 
65  delete imp;
66  delete corr;
67  delete bemcCut;
68  delete tpcCut;
69  delete eemc;
70  delete bemc;
71  delete tpc;
72 }
73 
74 void StBET4pMakerImpTest::testGetTrackAndEnergyList_withoutCut()
75 {
76  tpc = new StjTPCMock(35);
77  bemc = new StjBEMCMock(4500);
78  eemc = new StjEEMCMock(1000);
79 
80  tpcCut = new StjTrackListCut();
81 
82  bemcCut = new StjTowerEnergyListCut();
83 
85  imp = new StBET4pMakerImp(tpc, tpcCut, bemc, bemcCut, corr, eemc);
86 
87  pair<StjTrackList, StjTowerEnergyList> actual = imp->getTrackAndEnergyList();
88  CPPUNIT_ASSERT_EQUAL( (size_t)35, actual.first.size() );
89  CPPUNIT_ASSERT_EQUAL( (size_t)5500, actual.second.size() );
90 
91  delete imp;
92  delete corr;
93  delete bemcCut;
94  delete tpcCut;
95  delete eemc;
96  delete bemc;
97  delete tpc;
98 }
99 
100 void StBET4pMakerImpTest::testMake()
101 {
102 
103 }