00001 #ifndef STAR_StBTofHitMaker_H
00002 #define STAR_StBTofHitMaker_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "StRTSBaseMaker.h"
00012
00013 #include <vector>
00014 #ifndef ST_NO_NAMESPACES
00015 using std::vector;
00016 #endif
00017
00018 #define VHRBIN2PS 24.4140625 // Very High resolution mode, pico-second per bin
00019
00020 #define HRBIN2PS 97.65625 // High resolution mode, pico-second per bin
00021
00022
00023 struct tof_t;
00024
00025 class StEvent;
00026 class StBTofCollection;
00027 class StBTofRawHit;
00028 class StBTofRawHitCollection;
00029 class StBTofHit;
00030 class StBTofHitCollection;
00031 #include "StBTofUtil/StBTofSortRawHit.h"
00032 class StBTofINLCorr;
00033 class StBTofDaqMap;
00034
00035 struct TofRawHit {
00036 unsigned int tdc;
00037 unsigned int dataword;
00038 unsigned char fiberid;
00039 unsigned char trayID;
00040 unsigned char globaltdcchan;
00041 };
00042
00043 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
00044 typedef vector<Int_t> IntVec;
00045 typedef vector<UInt_t> UIntVec;
00046 #else
00047 typedef vector<Int_t, allocator<Int_t>> IntVec;
00048 typedef vector<UInt_t, allocator<UInt_t>> UIntVec;
00049 #endif
00050
00051
00057 class StBTofHitMaker:public StRTSBaseMaker
00058 {
00059 private:
00060 StEvent *mStEvent;
00061 tof_t *fTof;
00062
00063 Int_t UnpackTofRawData();
00064 void fillBTofHeader();
00065 void fillBTofRawHitCollection();
00066 void fillBTofHitCollection();
00067 void fillStEvent();
00068
00069
00070 vector<TofRawHit> TofLeadingHits;
00071 vector<TofRawHit> TofTrailingHits;
00072
00073 Int_t mNValidTrays;
00074 unsigned int mTriggerTimeStamp[4];
00075 StBTofCollection* mBTofCollection;
00076 StBTofRawHitCollection* mRawHitCollection;
00077 StBTofHitCollection* mHitCollection;
00078 StBTofDaqMap* mBTofDaqMap;
00079 StBTofINLCorr* mBTofINLCorr;
00080 StBTofSortRawHit* mBTofSortRawHit;
00081 enum {
00082 mNVPD = 19
00083 , mWestVpdTrayId = 121
00084 , mEastVpdTrayId = 122
00085 };
00086
00087 protected:
00088 StRtsTable *GetNextRaw();
00089 StRtsTable *GetNextRaw(int sec);
00090
00091 StBTofCollection *GetBTofCollection();
00092
00093 public:
00094
00096 StBTofHitMaker(const char *name="tof_raw");
00097
00098 ~StBTofHitMaker() ;
00099
00100 void Clear(Option_t* option="");
00101 Int_t Init();
00102 Int_t InitRun(Int_t);
00103 Int_t FinishRun(Int_t);
00104 Int_t Finish();
00105 Int_t Make();
00106
00108 vector<TofRawHit> getLeadingHits();
00110 vector<TofRawHit> getTrailingHits();
00111
00113 virtual const char *GetCVS() const
00114 {
00115 static const char cvs[]="Tag $Name: $Id: built "__DATE__" "__TIME__ ; return cvs;
00116 }
00117
00118 ClassDef(StBTofHitMaker, 1)
00119 };
00120
00121 inline vector<TofRawHit> StBTofHitMaker::getLeadingHits() { return TofLeadingHits; }
00122 inline vector<TofRawHit> StBTofHitMaker::getTrailingHits() { return TofTrailingHits; }
00123
00124 #endif