StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEventClusteringHints.h
1 
14 /***************************************************************************
15  *
16  * $Id: StEventClusteringHints.h,v 2.8 2003/09/02 17:58:05 perev Exp $
17  *
18  * Author: Thomas Ullrich, Apr 2001
19  ***************************************************************************
20  *
21  * Description: Class to provide clustering hints for StEvent I/O.
22  * The class can distinguish between two modes
23  * miniDST and DST mode in which clustering hints
24  * are different.
25  * With clustering hints we mean the association
26  * of a class stored *directly* in the StEvent class
27  * (StEvent::mContent) and the name of the branch it
28  * will be written to.
29  *
30  ***************************************************************************
31  *
32  * $Log: StEventClusteringHints.h,v $
33  * Revision 2.8 2003/09/02 17:58:05 perev
34  * gcc 3.2 updates + WarnOff
35  *
36  * Revision 2.7 2002/02/22 22:56:47 jeromel
37  * Doxygen basic documentation in all header files. None of this is required
38  * for QM production.
39  *
40  * Revision 2.6 2001/05/30 17:45:54 perev
41  * StEvent branching
42  *
43  * Revision 2.5 2001/05/01 03:48:36 ullrich
44  * Added branch IDs.
45  *
46  * Revision 2.4 2001/04/23 19:28:53 ullrich
47  * Inherit from StObject. Not a singleton anymore.
48  *
49  * Revision 2.3 2001/04/20 00:50:49 ullrich
50  * Added new query methods.
51  *
52  * Revision 2.2 2001/04/11 03:44:07 ullrich
53  * Added namespaces for Sun CC5.
54  *
55  * Revision 2.1 2001/04/06 17:47:20 ullrich
56  * Initial Revision
57  *
58  **************************************************************************/
59 #ifndef StEventClusteringHints_hh
60 #define StEventClusteringHints_hh
61 
62 #include <map>
63 #include <string>
64 #include <vector>
65 #include <Stiostream.h>
66 #include "StObject.h"
67 #if !defined(ST_NO_NAMESPACES)
68 using std::map;
69 using std::string;
70 using std::vector;
71 #endif
72 
74 public:
76  virtual ~StEventClusteringHints();
77 
78  void setDstMode(); // switch to DST mode
79  void setMiniDstMode(); // switch to miniDST mode
80  const char* branchName(const char*) const; // get branch name for given class name
81  int branchId(const char*) const; // return unique ID for given branch
82  void SetParent(TObject *par){fParent=par;}
83 #if !defined(__CINT__)
84  vector<string> listOfBranches() const; // list of all branches for given mode (miniDST or DST)
85  vector<string> listOfClasses() const; // list of all top level classes known
86  vector<string> listOfClasses(const char*) const; // list of all top level classes for a given branch
87 #endif
88 
89  void setBranch(const char*, const char*, int); // assign classname with a branch name (incl. ID)
90  void print(ostream& = cout); // print current configuration
91 
92 private:
94 
95 private:
96  TObject *fParent;
97  map<string,string> *mNameMap;
98  map<string,string> mDstMap;
99  map<string,string> mMiniDstMap;
100  map<string, int> mBranchIds;
101 
102  ClassDef(StEventClusteringHints,1)
103 };
104 #endif