StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuChainMaker.h
1 /***************************************************************************
2  *
3  * $Id: StMuChainMaker.h,v 1.12 2004/05/02 04:10:13 perev Exp $
4  * Author: Frank Laue, BNL, laue@bnl.gov
5  ***************************************************************************/
10 #ifndef StMuChainMaker_hh
11 #define StMuChainMaker_hh
12 
13 
14 #include <vector>
15 #include <utility>
16 #include <string>
17 #if !defined(ST_NO_NAMESPACES)
18 using namespace std;
19 #endif
20 
21 
22 typedef pair<string,Long_t> StMuStringLongPair;
23 typedef vector<StMuStringLongPair> StMuStringLongPairVector;
24 typedef vector<StMuStringLongPair>::iterator StMuStringLongPairVectorIterator;
25 
26 class TChain;
27 class StMuDbReader;
28 
30 public:
31  StMuChainMaker(const char* name="MuDst");
32  virtual ~StMuChainMaker();
33  static void setUseFileCatalog(const char* connection="mysql://duvall.star.bnl.gov:3306/FileCatalog_BNL") {
34  mSQLConnection = string(connection);
35  }
36 
37  TChain* make(string dir, string file, string filter, int maxFiles=10);
38  void fromFileCatalog(string file);
39  void fromList(string file);
40  void fromFile(string file);
41  void fromDir(string dir);
42 
43  void subFilter(string filter);
44  string basename(string);
45  string dirname(string);
46  string buildFileName(string dir, string fileName, string extention);
47 
48 protected:
49  static string mSQLConnection;
50  TChain *mChain;
51  StMuDbReader* mDbReader;
52  string mSubFilters[100];
53  string mTreeName;
54  int mFileCounter;
55  int mMaxFiles;
56  StMuStringLongPairVector mFileList;
57  bool pass(string file, string* filters);
58  void add(StMuStringLongPairVector);
59  void add(StMuStringLongPair);
60 
61  ClassDef(StMuChainMaker,0)
62  };
63 
64 #endif
65 
66 /***************************************************************************
67  *
68  * $Log: StMuChainMaker.h,v $
69  * Revision 1.12 2004/05/02 04:10:13 perev
70  * private => protected
71  *
72  * Revision 1.11 2003/04/21 18:18:53 laue
73  * Modifications for the new scheduler implementation:
74  * - the filenames and the number of events per files are now supplied
75  * - files on local disk are given in the rootd format
76  *
77  * Revision 1.10 2003/04/15 16:17:11 laue
78  * Minor changes to be able to filter MuDst.root files. The StMuDstFilterMaker
79  * is just an example of how to do it. It has be be customized (spoilers,
80  * chrome weels, etc) by the user.
81  *
82  * Revision 1.9 2003/01/23 21:59:50 laue
83  * Modification to compile on Solaris.
84  *
85  * Revision 1.8 2002/12/19 19:44:25 laue
86  * update to read number of events from database, for files ending with .list
87  *
88  * Revision 1.7 2002/11/18 14:29:31 laue
89  * update for Yuri's new StProbPidTraits
90  *
91  * Revision 1.6 2002/05/04 23:56:29 laue
92  * some documentation added
93  *
94  * Revision 1.5 2002/04/17 21:04:16 laue
95  * minor updates
96  *
97  * Revision 1.4 2002/04/15 22:38:11 laue
98  * made destructors virtual
99  *
100  * Revision 1.3 2002/04/15 22:29:28 laue
101  * updates
102  *
103  * Revision 1.2 2002/04/11 14:19:30 laue
104  * - update for RH 7.2
105  * - decrease default arrays sizes
106  * - add data base readerfor number of events in a file
107  *
108  * Revision 1.1 2002/04/01 22:42:30 laue
109  * improved chain filter options
110  *
111  *
112  **************************************************************************/