StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRootEventManager.cc
1 /***************************************************************************
2  *
3  * $Id: StRootEventManager.cc,v 2.18 2009/11/23 16:37:08 fisyak Exp $
4  *
5  * Author: Original version by T. Wenaus, BNL
6  * Revised version for new StEvent by T. Ullrich, Yale
7  ***************************************************************************
8  *
9  * Description:
10  * Concrete implementation of DST table server (here from ROOT).
11  *
12  ***************************************************************************
13  *
14  * $Log: StRootEventManager.cc,v $
15  * Revision 2.18 2009/11/23 16:37:08 fisyak
16  * Clean up, fix problem with bunch crossing information in StEventInfo and StHddr
17  *
18  * Revision 2.16 2009/11/19 16:54:09 fisyak
19  * Clean up
20  *
21  * Revision 2.15 2007/08/24 15:37:43 perev
22  * Decrease prints
23  *
24  * Revision 2.14 2007/06/04 21:53:46 fine
25  * replace cerr with LOG_INFO
26  *
27  * Revision 2.13 2004/08/28 18:52:03 fisyak
28  * Replace StEvent Hit containers if there are entries in the corrensponding tables
29  *
30  * Revision 2.12 2003/09/02 17:58:09 perev
31  * gcc 3.2 updates + WarnOff
32  *
33  * Revision 2.11 2003/01/22 21:42:00 genevb
34  * Fix solaris compilation
35  *
36  * Revision 2.10 2002/04/18 23:29:35 jeromel
37  * Implementation of the SVT 2 tables scheme ...
38  *
39  * Revision 2.9 2001/11/07 21:20:46 ullrich
40  * Added L1 trigger.
41  *
42  * Revision 2.8 2001/09/12 23:48:33 ullrich
43  * Removed code to load run_header and run_summary tables.
44  *
45  * Revision 2.7 2001/04/23 16:02:02 perev
46  * small fix
47  *
48  * Revision 2.6 2001/04/20 16:23:22 perev
49  * Remove annoing warning
50  *
51  * Revision 2.5 2000/08/17 00:38:05 ullrich
52  * Added CpyTrk table.
53  *
54  * Revision 2.4 2000/05/25 14:44:47 ullrich
55  * Removed remaining pieces of the RICH pixel table.
56  *
57  * Revision 2.3 2000/01/05 16:08:25 ullrich
58  * Removed some unnecessary checks.
59  *
60  * Revision 2.2 1999/12/21 15:13:16 ullrich
61  * Modified to cope with new compiler version on Sun (CC5.0).
62  *
63  * Revision 2.1 1999/11/04 17:41:32 ullrich
64  * Fixed typo
65  *
66  * Revision 2.0 1999/11/04 19:03:00 ullrich
67  * Revised to build new StEvent version
68  *
69  **************************************************************************/
70 #include <string>
71 #include <Stsstream.h>
72 #include <Stiostream.h>
73 #include "Rtypes.h"
74 #include "StRootEventManager.hh"
75 #include "StChain.h"
76 using std::string;
77 
78 StRootEventManager::StRootEventManager():StEventManager() { /* noop */ }
79 
80 StRootEventManager::~StRootEventManager() { /* noop */ }
81 
82 ooStatus
83 StRootEventManager::openEvent(const char* name)
84 {
85  // mDst.Reset(0);
86  // grab the event from the maker
87  if (!mCurrentChain) return oocError;
88  St_DataSet *dsDst = mCurrentChain->GetDataSet(name);
89  if (!dsDst) return oocError;
90  // if (!dsDst->GetList()) return oocError;
91  mDst.Reset(dsDst);
92  return oocSuccess;
93 }
94 
95 ooStatus
96 StRootEventManager::readEvent() {return oocSuccess;}
97 
98 void StRootEventManager::closeEvent() { /* noop */ }
99 
100 void StRootEventManager::setup() { /* noop */ }
101 
102 void StRootEventManager::shutdown() { /* noop */ }
103 
104 #define RETURN_TABLE(TABLE_TYPE,TABLE_NAME) \
105 _NAME2_(TABLE_TYPE,_st)* StRootEventManager::_NAME2_(returnTable_,TABLE_TYPE)(long& nentries) const\
106 {\
107  static int n13=13;\
108  _NAME2_(TABLE_TYPE,_st)* table = NULL;\
109  _NAME2_(St_,TABLE_TYPE) *tableWrap;\
110  const char *nm = _QUOTE_(TABLE_NAME);\
111  const char *nt = _QUOTE_(TABLE_TYPE);\
112  St_DataSetIter *Dst = (St_DataSetIter*)&mDst;\
113  if (! Dst->Pwd()) {nentries = 0; return table;}\
114  tableWrap = (_NAME2_(St_,TABLE_TYPE) *) (*Dst)[nt];\
115  if (!tableWrap && nm[0]!='-') tableWrap = (_NAME2_(St_,TABLE_TYPE) *) (*Dst)[nm];\
116  if (tableWrap) {\
117  table = tableWrap->GetTable();\
118  nentries = tableWrap->GetNRows();\
119  } \
120  else {\
121  if ((n13--)>0) {\
122  LOG_INFO << "StRootEventManager: Table type " << nt << \
123  " - name " << nm << " not found in DataSet " << Dst->Pwd()->GetName() << endm;}\
124  nentries = 0;\
125  }\
126  return table;\
127 }
128 
129 
130 RETURN_TABLE(dst_TrgDet,TrgDet)
131 RETURN_TABLE(dst_L0_Trigger,L0_Trigger)
132 RETURN_TABLE(dst_L1_Trigger,L1_Trigger)
133 
134 #undef RETURN_TABLE
virtual void Reset(TDataSet *l=0, Int_t depth=0)