StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuDbReader.h
1 /***************************************************************************
2  *
3  * $Id: StMuDbReader.h,v 1.7 2016/05/04 19:08:27 smirnovd Exp $
4  * Author: Frank Laue, BNL, laue@bnl.gov
5  *
6  ***************************************************************************/
7 #ifndef StMuDbReader_hh
8 #define StMuDbReader_hh
9 
10 #include <string>
11 #include <vector>
12 #include <list>
13 
19 class StMuDbReader {
20  public:
21  static StMuDbReader* instance();
22  static StMuDbReader* Instance();
23 
24  int createDB(const char* dbFile, const char* inputList);
25  int addDb(const char* dbFile);
26  void showDb();
27  void sortDb();
28  int entriesDb();
29  int entries(const char* file);
30  protected:
31  StMuDbReader();
32  virtual ~StMuDbReader();
33  protected:
34  static StMuDbReader* _instance;
35 
37  vector< pair<string,int> > mDb;
38  vector< pair<string,int> >::iterator iter;
39 
40  ClassDef(StMuDbReader,0)
41 };
42 
43 
45 inline int StMuDbReader::entriesDb() { return mDb.size(); }
46 
47 
48 #endif
49 
50 
51 /***************************************************************************
52  *
53  * $Log: StMuDbReader.h,v $
54  * Revision 1.7 2016/05/04 19:08:27 smirnovd
55  * StMuDbReader: Moved inlined method in the header
56  *
57  * Inlined methods need to be defined in the header to avoid unresolved external
58  * errors from the linker
59  *
60  * Revision 1.6 2004/05/02 04:10:13 perev
61  * private => protected
62  *
63  * Revision 1.5 2003/04/15 18:48:34 laue
64  * Minor changes to be able to filter MuDst.root files and an example
65  * how to do this. The StMuDstFilterMaker is just an example, it has to be
66  * customized (spoilers, chrome weels, etc.) by the user.
67  *
68  * Revision 1.4 2002/05/04 23:56:30 laue
69  * some documentation added
70  *
71  * Revision 1.3 2002/04/17 21:04:16 laue
72  * minor updates
73  *
74  * Revision 1.2 2002/04/15 22:38:11 laue
75  * made destructors virtual
76  *
77  * Revision 1.1 2002/04/11 14:19:30 laue
78  * - update for RH 7.2
79  * - decrease default arrays sizes
80  * - add data base readerfor number of events in a file
81  *
82  * Revision 1.1 2002/04/01 22:42:30 laue
83  * improved chain filter options
84  *
85  *
86  **************************************************************************/
int entriesDb()
number of entries in internal data base
Definition: StMuDbReader.h:45
int addDb(const char *dbFile)
add entries in dbFile to internal data base ( mDb ), will call sortDb(), returns number of entries in...
int entries(const char *file)
scan internal data base for file, if found return number of entries, otherwise return 0; ...
StMuDbReader()
Attention: constructor not public, this is a singleton.
void showDb()
show all entries in internal data base
void sortDb()
sort all entries in internal data base according to file name
vector< pair< string, int > > mDb
the internal database, a vector containing pairs of file names and number of events */ ...
Definition: StMuDbReader.h:37
int createDB(const char *dbFile, const char *inputList)
scan the files in inputList for the number of events add add them to the dbFile file. Create dbFile file if not existent returns number of entries in mDb