StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjJetListCutTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 
3 #include <StjJetListCut.h>
4 
5 #include <StjJetCutPt.h>
6 #include <StjJetCutEta.h>
7 #include <StjJetCutNFourVecs.h>
8 
9 #include <StjJetList.h>
10 
11 #include <iostream>
12 #include <set>
13 #include <cmath>
14 
15 #include "StjJetListCutTest.hh"
16 
17 using namespace std;
18 
19 // Registers the fixture into the 'registry'
20 CPPUNIT_TEST_SUITE_REGISTRATION( StjJetListCutTest );
21 
22 void StjJetListCutTest::setUp()
23 {
24 
25 }
26 
27 void StjJetListCutTest::tearDown()
28 {
29 
30 }
31 
32 void StjJetListCutTest::testPt()
33 {
34  StjJetListCut* cut = new StjJetListCut();
35  cut->addCut(new StjJetCutPt(5.0));
36 
37  StjJetList listIn;
38 
39  StjJet p1;
40  p1.pt = 4.8;
41  listIn.push_back(p1);
42 
43  StjJet p2;
44  p2.pt = 5.1;
45  listIn.push_back(p2);
46 
47  StjJetList listExpected;
48  listExpected.push_back(p2);
49 
50  StjJetList listActual = (*cut)(listIn);
51 
52  CPPUNIT_ASSERT_EQUAL( listExpected, listActual );
53 
54  delete cut;
55 }
56