StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTreeIndexListCreator.h
1 // -*- mode: c++;-*-
2 // $Id: StjTreeIndexListCreator.h,v 1.2 2008/08/11 01:28:41 tai Exp $
3 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
4 #ifndef STJTREEINDEXLISTCREATOR_H
5 #define STJTREEINDEXLISTCREATOR_H
6 
7 #include "StjTreeIndexList.h"
8 
9 #include <TObject.h>
10 
11 #include <string>
12 #include <vector>
13 
14 class TDirectory;
15 
16 
17 class StjTreeIndexListCreator : public TObject {
18 
19 public:
20  StjTreeIndexListCreator(TDirectory *file)
21  : _indexMajorName("runNumber"), _indexMinorName("eventId")
22  , _file(file)
23  { }
24  virtual ~StjTreeIndexListCreator() { }
25 
26  void AddTrgTreeName(const char* treeName) { _trgTreeNameList.push_back(treeName); }
27 
28  StjTreeIndexList create();
29 
30  typedef std::vector<std::string> TrgTreeNameList;
31  TrgTreeNameList trgTreeNameList() const { return _trgTreeNameList; }
32 
33 private:
34 
35  StjTreeIndexList getIndexListOfRunsPassedFor(const char* treeName);
36 
37  std::string _indexMajorName;
38  std::string _indexMinorName;
39 
40  TDirectory *_file;
41 
42  TrgTreeNameList _trgTreeNameList;
43 
44  ClassDef(StjTreeIndexListCreator, 1)
45 
46 };
47 
48 #endif // STJTREEINDEXLISTCREATOR_H