3 #include <StBET4pMakerImpBuilder.h>
4 #include <StBET4pMakerImp.h>
6 #include <StjTPCMuDst.h>
7 #include <StjBEMCMuDst.h>
8 #include <StjEEMCMuDst.h>
9 #include <StjTPCNull.h>
10 #include <StjBEMCNull.h>
11 #include <StjEEMCNull.h>
12 #include <StjTPCTree.h>
13 #include <StjBEMCTree.h>
15 #include <StjTrackListCut.h>
17 #include <StjTrackCutDca.h>
18 #include <StjTrackCutDcaPtDependent.h>
19 #include <StjTrackCutEta.h>
20 #include <StjTrackCutPossibleHitRatio.h>
22 #include <StjTowerEnergyListCut.h>
24 #include <StjTowerEnergyCut2003BemcTower.h>
25 #include <StjTowerEnergyCutBemcWestOnly.h>
26 #include <StjTowerEnergyCutEnergy.h>
27 #include <StjTowerEnergyCutBemcStatus.h>
28 #include <StjTowerEnergyCutAdc.h>
30 #include "StBET4pMakerImpBuilderTest.hh"
38 void StBET4pMakerImpBuilderTest::setUp()
43 void StBET4pMakerImpBuilderTest::tearDown()
48 void StBET4pMakerImpBuilderTest::test2003()
51 bool doTowerSwapFix =
true;
55 bool use2003Cuts =
true;
56 bool use2005Cuts =
false;
57 bool use2006Cuts =
false;
60 StBET4pMakerImp* imp = builder.build(useTPC, useBEMC, useEEMC, use2003Cuts, use2005Cuts, use2006Cuts, uDstMaker, doTowerSwapFix);
64 CPPUNIT_ASSERT( dynamic_cast<StjTPCMuDst*>(imp->TPC()) );
65 CPPUNIT_ASSERT( dynamic_cast<StjBEMCMuDst*>(imp->BEMC()) );
66 CPPUNIT_ASSERT( dynamic_cast<StjEEMCNull*>(imp->EEMC()) );
69 StjTowerEnergyListCut::CutList bemcCutList = bemcCut->getCutList();
70 CPPUNIT_ASSERT_EQUAL( (
size_t)4, bemcCutList.size() );
71 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCut2003BemcTower*>(bemcCutList[0]) );
72 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutEnergy*>(bemcCutList[1]) );
73 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutBemcStatus*>(bemcCutList[2]) );
74 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutAdc*>(bemcCutList[3]) );
78 StjTrackListCut::CutList tpcCutList = tpcCut->getCutList();
79 CPPUNIT_ASSERT_EQUAL( (
size_t)3, tpcCutList.size() );
80 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutDca*>(tpcCutList[0]) );
81 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutEta*>(tpcCutList[1]) );
82 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutPossibleHitRatio*>(tpcCutList[2]) );
87 void StBET4pMakerImpBuilderTest::test2005()
90 bool doTowerSwapFix =
true;
94 bool use2003Cuts =
false;
95 bool use2005Cuts =
true;
96 bool use2006Cuts =
false;
99 StBET4pMakerImp* imp = builder.build(useTPC, useBEMC, useEEMC, use2003Cuts, use2005Cuts, use2006Cuts, uDstMaker, doTowerSwapFix);
104 CPPUNIT_ASSERT( dynamic_cast<StjTPCMuDst*>(imp->TPC()) );
105 CPPUNIT_ASSERT( dynamic_cast<StjBEMCMuDst*>(imp->BEMC()) );
106 CPPUNIT_ASSERT( dynamic_cast<StjEEMCNull*>(imp->EEMC()) );
109 StjTowerEnergyListCut::CutList bemcCutList = bemcCut->getCutList();
110 CPPUNIT_ASSERT_EQUAL( (
size_t)4, bemcCutList.size() );
111 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutBemcWestOnly*>(bemcCutList[0]) );
112 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutEnergy*>(bemcCutList[1]) );
113 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutBemcStatus*>(bemcCutList[2]) );
114 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutAdc*>(bemcCutList[3]) );
117 StjTrackListCut::CutList tpcCutList = tpcCut->getCutList();
118 CPPUNIT_ASSERT_EQUAL( (
size_t)3, tpcCutList.size() );
119 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutDca*>(tpcCutList[0]) );
120 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutEta*>(tpcCutList[1]) );
121 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutPossibleHitRatio*>(tpcCutList[2]) );
126 void StBET4pMakerImpBuilderTest::test2006()
129 bool doTowerSwapFix =
true;
133 bool use2003Cuts =
false;
134 bool use2005Cuts =
false;
135 bool use2006Cuts =
true;
138 StBET4pMakerImp* imp = builder.build(useTPC, useBEMC, useEEMC, use2003Cuts, use2005Cuts, use2006Cuts, uDstMaker, doTowerSwapFix);
143 CPPUNIT_ASSERT( dynamic_cast<StjTPCMuDst*>(imp->TPC()) );
144 CPPUNIT_ASSERT( dynamic_cast<StjBEMCMuDst*>(imp->BEMC()) );
145 CPPUNIT_ASSERT( dynamic_cast<StjEEMCMuDst*>(imp->EEMC()) );
148 StjTowerEnergyListCut::CutList bemcCutList = bemcCut->getCutList();
149 CPPUNIT_ASSERT_EQUAL( (
size_t)3, bemcCutList.size() );
150 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutEnergy*>(bemcCutList[0]) );
151 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutBemcStatus*>(bemcCutList[1]) );
152 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutAdc*>(bemcCutList[2]) );
156 StjTrackListCut::CutList tpcCutList = tpcCut->getCutList();
157 CPPUNIT_ASSERT_EQUAL( (
size_t)4, tpcCutList.size() );
158 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutDca*>(tpcCutList[0]) );
159 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutDcaPtDependent*>(tpcCutList[1]) );
160 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutEta*>(tpcCutList[2]) );
161 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutPossibleHitRatio*>(tpcCutList[3]) );
166 void StBET4pMakerImpBuilderTest::testBEMCout()
169 bool doTowerSwapFix =
true;
171 bool useBEMC =
false;
173 bool use2003Cuts =
false;
174 bool use2005Cuts =
false;
175 bool use2006Cuts =
true;
178 StBET4pMakerImp* imp = builder.build(useTPC, useBEMC, useEEMC, use2003Cuts, use2005Cuts, use2006Cuts, uDstMaker, doTowerSwapFix);
183 CPPUNIT_ASSERT( dynamic_cast<StjTPCMuDst*>(imp->TPC()) );
184 CPPUNIT_ASSERT( dynamic_cast<StjBEMCNull*>(imp->BEMC()) );
185 CPPUNIT_ASSERT( dynamic_cast<StjEEMCMuDst*>(imp->EEMC()) );
188 StjTowerEnergyListCut::CutList bemcCutList = bemcCut->getCutList();
189 CPPUNIT_ASSERT_EQUAL( (
size_t)0, bemcCutList.size() );
192 StjTrackListCut::CutList tpcCutList = tpcCut->getCutList();
193 CPPUNIT_ASSERT_EQUAL( (
size_t)4, tpcCutList.size() );
194 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutDca*>(tpcCutList[0]) );
195 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutDcaPtDependent*>(tpcCutList[1]) );
196 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutEta*>(tpcCutList[2]) );
197 CPPUNIT_ASSERT( dynamic_cast<StjTrackCutPossibleHitRatio*>(tpcCutList[3]) );
202 void StBET4pMakerImpBuilderTest::testTPCout()
205 bool doTowerSwapFix =
true;
209 bool use2003Cuts =
false;
210 bool use2005Cuts =
false;
211 bool use2006Cuts =
true;
214 StBET4pMakerImp* imp = builder.build(useTPC, useBEMC, useEEMC, use2003Cuts, use2005Cuts, use2006Cuts, uDstMaker, doTowerSwapFix);
219 CPPUNIT_ASSERT( dynamic_cast<StjTPCNull*>(imp->TPC()) );
220 CPPUNIT_ASSERT( dynamic_cast<StjBEMCMuDst*>(imp->BEMC()) );
221 CPPUNIT_ASSERT( dynamic_cast<StjEEMCMuDst*>(imp->EEMC()) );
224 StjTowerEnergyListCut::CutList bemcCutList = bemcCut->getCutList();
225 CPPUNIT_ASSERT_EQUAL( (
size_t)3, bemcCutList.size() );
226 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutEnergy*>(bemcCutList[0]) );
227 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutBemcStatus*>(bemcCutList[1]) );
228 CPPUNIT_ASSERT( dynamic_cast<StjTowerEnergyCutAdc*>(bemcCutList[2]) );
232 StjTrackListCut::CutList tpcCutList = tpcCut->getCutList();
233 CPPUNIT_ASSERT_EQUAL( (
size_t)0, tpcCutList.size() );