gregsStHbtMuDstReader.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #ifndef gregsStHbtMuDstReader_hh
  2. #define gregsStHbtMuDstReader_hh
  3. #include <string>
  4. #include "StMaker.h"
  5. #include "StChain.h"
  6. #include "St_DataSetIter.h"
  7. #include "StThreeVector.hh"
  8. #include "StThreeVectorF.hh"
  9. #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
  10. #include "StMuDSTMaker/COMMON/StMuEvent.h"
  11. #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h" //Needed for the primary vertex loop
  12. #include "Base/StHbtEventReader.hh"
  13. #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
  14. class StMuEvent;
  15. class StMuDst;
  16. class StMuCut;
  17. class StMuPrimaryVertex;
  18. class StEvent;
  19. class StTrackNode;
  20. class StTrack;
  21. class StRichSpectra;
  22. class StDetectorState;
  23. class StL3AlgorithmInfo;
  24. class StuProbabilityPidAlgorithm;
  25. class StMuCut;
  26. class TFile;
  27. class TTree;
  28. class TChain;
  29. class TClonesArray;
  30. //!class ioMode;//!enum ioMode {ioRead, ioWrite};
  31. //!class ioNameMode;//!enum ioNameMode {ioFix, ioAuto};
  32. //_________________
  33. class gregsStHbtMuDstReader : public StHbtEventReader {
  34. public:
  35. gregsStHbtMuDstReader(StMuDstMaker* maker);
  36. ~gregsStHbtMuDstReader();
  37. //Standard methods
  38. int Init();
  39. int Init(const char* ReadWrite, StHbtString& Message) {
  40. return StHbtEventReader::Init(ReadWrite,Message);
  41. }//WarnOff
  42. void Clear();
  43. void Finish();
  44. //Reader methods
  45. void clear();
  46. StMuDst* muDst();
  47. StHbtEvent* ReturnHbtEvent();
  48. bool readTracks();
  49. bool readV0s();
  50. unsigned int trackType();
  51. void setProbabilityPidFile(const char* file);
  52. void setTrackType(unsigned int);
  53. void setReadTracks(bool);
  54. void setReadV0s(bool);
  55. void AddTriggerId(const unsigned int& id);
  56. void SetProcessAllVertices(bool);
  57. enum ioMode {ioRead, ioWrite};
  58. enum ioNameMode {ioFix, ioAuto};
  59. private:
  60. StMuDst* mMuDst;
  61. StMuDstMaker *mMuDstMaker;
  62. StMuPrimaryVertex *mPrimVert; //For the vertex loop
  63. StHbtEvent *mHbtEvent;
  64. StuProbabilityPidAlgorithm* mProbabilityPidAlgorithm;
  65. int mEventCounter;
  66. vector<unsigned int> mTriggerIdCollection;
  67. ioMode mIoMode;
  68. ioNameMode mIoNameMode;
  69. string mDirName;
  70. string mFileName;
  71. string mFilter;
  72. int mMaxFiles;
  73. unsigned int mTrackType;
  74. bool mReadTracks;
  75. bool mReadV0s;
  76. bool mFinish;
  77. bool mProcessAllVertices;
  78. TFile* mCurrentFile;
  79. string mCurrentFileName;
  80. bool IsGoodTrigger(StMuEvent *event);
  81. bool IsGoodPrimaryVertex(StMuPrimaryVertex *vertex,
  82. Float_t vpdVz);
  83. bool IsGoodTrack(StMuTrack *track, unsigned short vertInd);
  84. ClassDef(gregsStHbtMuDstReader, 1)
  85. };
  86. inline StMuDst* gregsStHbtMuDstReader::muDst() { return mMuDst;}
  87. inline void gregsStHbtMuDstReader::setTrackType(unsigned int t) {mTrackType=t;}
  88. inline unsigned int gregsStHbtMuDstReader::trackType() {return mTrackType;}
  89. inline bool gregsStHbtMuDstReader::readTracks() { return mReadTracks;}
  90. inline bool gregsStHbtMuDstReader::readV0s() { return mReadV0s;}
  91. inline void gregsStHbtMuDstReader::setReadTracks(bool b) { mReadTracks=b;}
  92. inline void gregsStHbtMuDstReader::setReadV0s(bool b) { mReadV0s=b;}
  93. inline void gregsStHbtMuDstReader::AddTriggerId(const unsigned int& id) {
  94. mTriggerIdCollection.push_back(id);
  95. }
  96. inline void gregsStHbtMuDstReader::SetProcessAllVertices(bool b) {
  97. mProcessAllVertices = b;
  98. }
  99. #endif