StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StJetMakerTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 #include "StJetMakerTest.hh"
3 
4 #include <StJetMaker.h>
5 #include <StppAnaPars.h>
6 #include <StConePars.h>
7 #include <StjeDefaultJetTreeWriter.h>
8 
9 using namespace std;
10 
11 // Registers the fixture into the 'registry'
12 CPPUNIT_TEST_SUITE_REGISTRATION( StJetMakerTest );
13 
14 void StJetMakerTest::setUp()
15 {
16 
17 }
18 
19 void StJetMakerTest::tearDown()
20 {
21 
22 }
23 
24 void StJetMakerTest::testConstruct()
25 {
26  StJetMaker* jetmaker = new StJetMaker("emcJetMaker", 0, "");
27  delete jetmaker;
28 }
29 
30 void StJetMakerTest::testMacroInterface()
31 {
32  StJetMaker* jetmaker = new StJetMaker("emcJetMaker", 0, "");
33 
34  StppAnaPars* anapars = new StppAnaPars();
35  StConePars* cpars = new StConePars();
36  jetmaker->addAnalyzer(anapars, cpars, 0, "ConeJets5");
37  delete jetmaker;
38 }
39 
40 void StJetMakerTest::testTreeWriter()
41 {
42  StJetMaker* jetmaker = new StJetMaker("emcJetMaker", 0, "test.root");
43 
44  StppAnaPars* anapars = new StppAnaPars();
45  StConePars* cpars = new StConePars();
46  jetmaker->addAnalyzer(anapars, cpars, 0, "ConeJets12");
47 
48  CPPUNIT_ASSERT(static_cast<StjeDefaultJetTreeWriter*>(jetmaker->getTreeWriter()));
49 
50  jetmaker->Init();
51  delete jetmaker;
52 }
53 
54 void StJetMakerTest::testInit()
55 {
56  StJetMaker* jetmaker = new StJetMaker("emcJetMaker", 0, "test.root");
57 
58  StppAnaPars* anapars = new StppAnaPars();
59  StConePars* cpars = new StConePars();
60  jetmaker->addAnalyzer(anapars, cpars, 0, "ConeJets12");
61 
62  jetmaker->Init();
63  delete jetmaker;
64 }