2 #include "StjTrgMock.hh"
4 #include <StjTrgRaiseThresholdEtHT.h>
6 #include "StjTrgRaiseThresholdEtHTTest.hh"
11 void StjTrgRaiseThresholdEtHTTest::setUp()
16 void StjTrgRaiseThresholdEtHTTest::tearDown()
21 void StjTrgRaiseThresholdEtHTTest::testOneTowerPass()
24 trgSrc._runNumber = 1;
26 trgSrc._passed =
true;
29 trgSrc._towers.push_back(1);
30 trgSrc._towerDsmAdc.push_back(0);
31 trgSrc._towerAdc.push_back(0);
32 trgSrc._towerEnergy.push_back(0);
33 trgSrc._towerEt.push_back(3.4);
37 CPPUNIT_ASSERT( trg.passed() );
38 CPPUNIT_ASSERT( trg.hard() );
39 CPPUNIT_ASSERT( trg.soft() );
40 CPPUNIT_ASSERT_EQUAL( (
size_t)1, trg.towers().size() );
41 CPPUNIT_ASSERT_EQUAL( 1, trg.towers()[0] );
42 CPPUNIT_ASSERT_EQUAL( 3.4, trg.towerEt()[0] );
45 void StjTrgRaiseThresholdEtHTTest::testOneTowerNotPass()
48 trgSrc._runNumber = 1;
50 trgSrc._passed =
true;
53 trgSrc._towers.push_back(1);
54 trgSrc._towerDsmAdc.push_back(0);
55 trgSrc._towerAdc.push_back(0);
56 trgSrc._towerEnergy.push_back(0);
57 trgSrc._towerEt.push_back(3.4);
61 CPPUNIT_ASSERT( ! trg.passed() );
62 CPPUNIT_ASSERT( trg.hard() );
63 CPPUNIT_ASSERT( ! trg.soft() );
64 CPPUNIT_ASSERT_EQUAL( (
size_t)0, trg.towers().size() );
67 void StjTrgRaiseThresholdEtHTTest::testTwoTowersPass()
70 trgSrc._runNumber = 1;
72 trgSrc._passed =
true;
76 trgSrc._towers.push_back(1);
77 trgSrc._towerDsmAdc.push_back(0);
78 trgSrc._towerAdc.push_back(0);
79 trgSrc._towerEnergy.push_back(0);
80 trgSrc._towerEt.push_back(3.4);
82 trgSrc._towers.push_back(10);
83 trgSrc._towerDsmAdc.push_back(0);
84 trgSrc._towerAdc.push_back(0);
85 trgSrc._towerEnergy.push_back(0);
86 trgSrc._towerEt.push_back(2.5);
90 CPPUNIT_ASSERT( trg.passed() );
91 CPPUNIT_ASSERT( trg.hard() );
92 CPPUNIT_ASSERT( trg.soft() );
93 CPPUNIT_ASSERT_EQUAL( (
size_t)1, trg.towers().size() );
94 CPPUNIT_ASSERT_EQUAL( 1, trg.towers()[0] );
95 CPPUNIT_ASSERT_EQUAL( 3.4, trg.towerEt()[0] );
98 void StjTrgRaiseThresholdEtHTTest::testTwoTowersNotPass()
101 trgSrc._runNumber = 1;
103 trgSrc._passed =
true;
107 trgSrc._towers.push_back(1);
108 trgSrc._towerDsmAdc.push_back(0);
109 trgSrc._towerAdc.push_back(0);
110 trgSrc._towerEnergy.push_back(0);
111 trgSrc._towerEt.push_back(3.4);
113 trgSrc._towers.push_back(10);
114 trgSrc._towerDsmAdc.push_back(0);
115 trgSrc._towerAdc.push_back(0);
116 trgSrc._towerEnergy.push_back(0);
117 trgSrc._towerEt.push_back(2.5);
121 CPPUNIT_ASSERT( ! trg.passed() );
122 CPPUNIT_ASSERT( trg.hard() );
123 CPPUNIT_ASSERT( ! trg.soft() );
124 CPPUNIT_ASSERT_EQUAL( (
size_t)0, trg.towers().size() );