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