00001
00002
00003 #include "UniqueStringGenerator.hh"
00004
00005 #include <StjTreeIndex.h>
00006 #include <StjTreeIndexList.h>
00007 #include <StjTreeIndexListCreator.h>
00008
00009 #include <TDirectory.h>
00010 #include <TFile.h>
00011 #include <TTree.h>
00012
00013 #include <string>
00014
00015 #include "StjTreeIndexListCreatorTest.hh"
00016
00017 using namespace std;
00018
00019
00020 CPPUNIT_TEST_SUITE_REGISTRATION( StjTreeIndexListCreatorTest );
00021
00022 void StjTreeIndexListCreatorTest::setUp()
00023 {
00024
00025 }
00026
00027 void StjTreeIndexListCreatorTest::tearDown()
00028 {
00029
00030 }
00031
00032 void StjTreeIndexListCreatorTest::testOne()
00033 {
00034 TDirectory* testDir = setupTestTDirecotry();
00035
00036 StjTreeIndexListCreator idxCreator(testDir);
00037 idxCreator.AddTrgTreeName("trgBHT2");
00038 idxCreator.AddTrgTreeName("trgBJP2");
00039
00040 StjTreeIndexList actualList = idxCreator.create();
00041
00042 StjTreeIndexList expectedList = createExpectedList();
00043
00044 cout << endl;
00045 for(StjTreeIndexList::const_iterator it = actualList.begin(); it != actualList.end(); ++it) {
00046 cout << (*it) << endl;
00047 }
00048
00049 CPPUNIT_ASSERT_EQUAL( expectedList, actualList);
00050
00051 }
00052
00053 TDirectory *StjTreeIndexListCreatorTest::setupTestTDirecotry()
00054 {
00055 return new TFile("./part_run6143024.root");
00056 }
00057
00058 StjTreeIndexList StjTreeIndexListCreatorTest::createExpectedList()
00059 {
00060 StjTreeIndexList ret;
00061
00062 ret.push_back(StjTreeIndex(6143024, 3 ));
00063 ret.push_back(StjTreeIndex(6143024, 4 ));
00064 ret.push_back(StjTreeIndex(6143024, 6 ));
00065 ret.push_back(StjTreeIndex(6143024, 1095 ));
00066 ret.push_back(StjTreeIndex(6143024, 4823 ));
00067 ret.push_back(StjTreeIndex(6143024, 14619 ));
00068 ret.push_back(StjTreeIndex(6143024, 17180 ));
00069 ret.push_back(StjTreeIndex(6143024, 17479 ));
00070 ret.push_back(StjTreeIndex(6143024, 18358 ));
00071 ret.push_back(StjTreeIndex(6143024, 20875 ));
00072 ret.push_back(StjTreeIndex(6143024, 23411 ));
00073 ret.push_back(StjTreeIndex(6143024, 24897 ));
00074 ret.push_back(StjTreeIndex(6143024, 28661 ));
00075 ret.push_back(StjTreeIndex(6143024, 31930 ));
00076 ret.push_back(StjTreeIndex(6143024, 33177 ));
00077 ret.push_back(StjTreeIndex(6143024, 34414 ));
00078 ret.push_back(StjTreeIndex(6143024, 38442 ));
00079 ret.push_back(StjTreeIndex(6143024, 39305 ));
00080 ret.push_back(StjTreeIndex(6143024, 43061 ));
00081 ret.push_back(StjTreeIndex(6143024, 43439 ));
00082 ret.push_back(StjTreeIndex(6143024, 45577 ));
00083 ret.push_back(StjTreeIndex(6143024, 46794 ));
00084 ret.push_back(StjTreeIndex(6143024, 48044 ));
00085 ret.push_back(StjTreeIndex(6143024, 53010 ));
00086 ret.push_back(StjTreeIndex(6143024, 53026 ));
00087 ret.push_back(StjTreeIndex(6143024, 55446 ));
00088 ret.push_back(StjTreeIndex(6143024, 55474 ));
00089 ret.push_back(StjTreeIndex(6143024, 55646 ));
00090 ret.push_back(StjTreeIndex(6143024, 55720 ));
00091 ret.push_back(StjTreeIndex(6143024, 56694 ));
00092 ret.push_back(StjTreeIndex(6143024, 56712 ));
00093 ret.push_back(StjTreeIndex(6143024, 57890 ));
00094 ret.push_back(StjTreeIndex(6143024, 64039 ));
00095 ret.push_back(StjTreeIndex(6143024, 65307 ));
00096 ret.push_back(StjTreeIndex(6143024, 67815 ));
00097 ret.push_back(StjTreeIndex(6143024, 70314 ));
00098 ret.push_back(StjTreeIndex(6143024, 71596 ));
00099 ret.push_back(StjTreeIndex(6143024, 72863 ));
00100 ret.push_back(StjTreeIndex(6143024, 74068 ));
00101 ret.push_back(StjTreeIndex(6143024, 80160 ));
00102 ret.push_back(StjTreeIndex(6143024, 81099 ));
00103 ret.push_back(StjTreeIndex(6143024, 81215 ));
00104 ret.push_back(StjTreeIndex(6143024, 81234 ));
00105 ret.push_back(StjTreeIndex(6143024, 81290 ));
00106 ret.push_back(StjTreeIndex(6143024, 81313 ));
00107 ret.push_back(StjTreeIndex(6143024, 81384 ));
00108 ret.push_back(StjTreeIndex(6143024, 86137 ));
00109
00110 return ret;
00111 }
00112