StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtEventReader.hh
1 /***************************************************************************
2  *
3  * $Id: StHbtEventReader.hh,v 1.13 2003/09/02 17:58:20 perev Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * base class for a StHbtEventReader
10  * All HbtEventReaders should inherit from this.
11  * Objects of these classes are required
12  * to obtain the data and convert it somehow to the STAR StEvent object
13  *
14  * A major change is that on 3sep99, the StHbtReader classes _MUST_ implement
15  * a Report() method, like the Cuts and CorrFctns.
16  * Also, a StHbtReader MAY implement a WriteHbtEvent(StHbtEvent*) method.
17  *
18  ***************************************************************************
19  *
20  * $Log: StHbtEventReader.hh,v $
21  * Revision 1.13 2003/09/02 17:58:20 perev
22  * gcc 3.2 updates + WarnOff
23  *
24  * Revision 1.12 2001/09/05 20:41:00 laue
25  * Updates of the hbtMuDstTree microDSTs
26  *
27  * Revision 1.11 2001/06/21 19:06:49 laue
28  * Some minor structural changes (forward declarations, etc)
29  *
30  * Revision 1.10 2001/05/25 23:23:58 lisa
31  * Added in StHbtKink stuff
32  *
33  * Revision 1.9 2001/05/10 21:00:24 laue
34  * new member 'mDebug' in order to reduce output
35  *
36  * Revision 1.8 2000/02/18 21:25:00 laue
37  * Implementation of a collections of StHbtEventWriters.
38  * We now can write multiple microDsts at a time.
39  *
40  * Revision 1.7 2000/01/07 23:21:17 laue
41  * 0.) all 'ClassDef(...)' put inside #ifdef __ROOT__ #endif
42  * 1.) unnecessary includes of 'StMaker.h' deleted
43  *
44  * Revision 1.6 1999/09/08 04:15:52 lisa
45  * persistent microDST implementation tweaked to please fickle solaris details
46  *
47  * Revision 1.5 1999/09/05 02:58:11 lisa
48  * add ASCII microDST reader/writer AND franksParticle cuts
49  *
50  * Revision 1.4 1999/09/04 04:41:01 lisa
51  * StHbtEvent IO --and-- StHbtEventWriter (microDST) method added to framework
52  *
53  * Revision 1.3 1999/09/03 22:39:14 lisa
54  * Readers now MUST have Report() methods and MAY have WriteHbtEvent() methods
55  *
56  * Revision 1.2 1999/06/29 17:50:26 fisyak
57  * formal changes to account new StEvent, does not complie yet
58  *
59  * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
60  * Installation of StHbtMaker
61  *
62  **************************************************************************/
63 
64 #ifndef StHbtEventReader_hh
65 #define StHbtEventReader_hh
66 #include "Stiostream.h"
67 class StHbtEvent;
68 class StHbtEventCut;
69 class StHbtTrackCut;
70 class StHbtV0Cut;
71 class StHbtXiCut;
72 class StHbtKinkCut;
73 
74 #include "StMaker.h"
75 #include "StHbtMaker/Infrastructure/StHbtString.hh"
76 
78 
79 protected:
80  StHbtEventCut* mEventCut;
81  StHbtTrackCut* mTrackCut;
82  StHbtV0Cut* mV0Cut;
83  StHbtXiCut* mXiCut;
84  StHbtKinkCut* mKinkCut;
85  int mReaderStatus; // 0="good"
86  int mDebug;
87 public:
88  // even tho it's only a base class and never constructed, if you don't have an implementation,
89  // you get "StHbtEventReader type_info node" upon dynamical loading
90  StHbtEventReader() : mEventCut(0), mTrackCut(0), mV0Cut(0), mXiCut(0), mKinkCut(0), mDebug(1) { /* no-op */ }
91  virtual ~StHbtEventReader(){/* no-op */}
92 
93  virtual StHbtEvent* ReturnHbtEvent() =0;
94 
95  virtual StHbtString Report(); // user-written method to return string describing reader
96  // Including whatever "early" cuts are being done
97 
98  // this next method does NOT need to be implemented, in which case the
99  // "default" method below is executed
100  virtual int WriteHbtEvent(StHbtEvent*){cout << "No WriteHbtEvent implemented\n"; return (0);}
101 
102  // these next two are optional but would make sense for, e.g., opening and closing a file
103  virtual int Init(const char* ReadWrite, StHbtString& Message){cout << "do-nothing StHbtEventReader::Init()\n"; return(0);}
104  virtual void Finish(){/*no-op*/};
105 
106  int Status(){return mReaderStatus;} // StHbtManager looks at this for guidance if it gets null pointer from ReturnHbtEvent
107 
108  virtual void SetEventCut(StHbtEventCut* ecut);
109  virtual void SetTrackCut(StHbtTrackCut* pcut);
110  virtual void SetV0Cut(StHbtV0Cut* pcut);
111  virtual void SetXiCut(StHbtXiCut* pcut);
112  virtual void SetKinkCut(StHbtKinkCut* pcut);
113  virtual StHbtEventCut* EventCut();
114  virtual StHbtTrackCut* TrackCut();
115  virtual StHbtV0Cut* V0Cut();
116  virtual StHbtXiCut* XiCut();
117  virtual StHbtKinkCut* KinkCut();
118 
119  /* control of debug informations print out, my rule is: */
120  /* 0: no output at all */
121  /* 1: once (e.g. in constructor, finsh */
122  /* 2: once per event */
123  /* 3: once per track */
124  /* 4: once per pair */
125  int Debug(){return mDebug;}
126  void SetDebug(int d){mDebug=d;}
127 
128 #ifdef __ROOT__
129  ClassDef(StHbtEventReader,0)
130 #endif
131 };
132 
133 
134 #endif
135