StHbtEventReader.hh 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. #ifndef StHbtEventReader_hh
  64. #define StHbtEventReader_hh
  65. #include "Stiostream.h"
  66. class StHbtEvent;
  67. class StHbtEventCut;
  68. class StHbtTrackCut;
  69. class StHbtV0Cut;
  70. class StHbtXiCut;
  71. class StHbtKinkCut;
  72. #include "StMaker.h"
  73. #include "StHbtMaker/Infrastructure/StHbtString.hh"
  74. class StHbtEventReader {
  75. protected:
  76. StHbtEventCut* mEventCut; //!
  77. StHbtTrackCut* mTrackCut; //!
  78. StHbtV0Cut* mV0Cut; //!
  79. StHbtXiCut* mXiCut; //!
  80. StHbtKinkCut* mKinkCut; //!
  81. int mReaderStatus; // 0="good"
  82. int mDebug;
  83. public:
  84. // even tho it's only a base class and never constructed, if you don't have an implementation,
  85. // you get "StHbtEventReader type_info node" upon dynamical loading
  86. StHbtEventReader() : mEventCut(0), mTrackCut(0), mV0Cut(0), mXiCut(0), mKinkCut(0), mDebug(1) { /* no-op */ }
  87. virtual ~StHbtEventReader(){/* no-op */}
  88. virtual StHbtEvent* ReturnHbtEvent() =0;
  89. virtual StHbtString Report(); // user-written method to return string describing reader
  90. // Including whatever "early" cuts are being done
  91. // this next method does NOT need to be implemented, in which case the
  92. // "default" method below is executed
  93. virtual int WriteHbtEvent(StHbtEvent*){cout << "No WriteHbtEvent implemented\n"; return (0);}
  94. // these next two are optional but would make sense for, e.g., opening and closing a file
  95. virtual int Init(const char* ReadWrite, StHbtString& Message){cout << "do-nothing StHbtEventReader::Init()\n"; return(0);}
  96. virtual void Finish(){/*no-op*/};
  97. int Status(){return mReaderStatus;} // StHbtManager looks at this for guidance if it gets null pointer from ReturnHbtEvent
  98. virtual void SetEventCut(StHbtEventCut* ecut);
  99. virtual void SetTrackCut(StHbtTrackCut* pcut);
  100. virtual void SetV0Cut(StHbtV0Cut* pcut);
  101. virtual void SetXiCut(StHbtXiCut* pcut);
  102. virtual void SetKinkCut(StHbtKinkCut* pcut);
  103. virtual StHbtEventCut* EventCut();
  104. virtual StHbtTrackCut* TrackCut();
  105. virtual StHbtV0Cut* V0Cut();
  106. virtual StHbtXiCut* XiCut();
  107. virtual StHbtKinkCut* KinkCut();
  108. /* control of debug informations print out, my rule is: */
  109. /* 0: no output at all */
  110. /* 1: once (e.g. in constructor, finsh */
  111. /* 2: once per event */
  112. /* 3: once per track */
  113. /* 4: once per pair */
  114. int Debug(){return mDebug;}
  115. void SetDebug(int d){mDebug=d;}
  116. #ifdef __ROOT__
  117. ClassDef(StHbtEventReader,0)
  118. #endif
  119. };
  120. #endif