00001 #ifndef STAR_StMtdHitMaker_H
00002 #define STAR_StMtdHitMaker_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "StRTSBaseMaker.h"
00012
00013 struct mtd_t;
00014
00015 class StEvent;
00016 class StMtdCollection;
00017 class StMtdRawHit;
00018 class StMtdHit;
00019 class StBTofINLCorr;
00020
00021 struct MtdRawHit {
00022 unsigned int tdc;
00023 unsigned int dataword;
00024 unsigned char fiberid;
00025 unsigned char backlegID;
00026 unsigned char globaltdcchan;
00027 };
00028
00029
00030 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
00031 typedef vector<Int_t> IntVec;
00032 typedef vector<UInt_t> UIntVec;
00033 #else
00034 typedef vector<Int_t, allocator<Int_t>> IntVec;
00035 typedef vector<UInt_t, allocator<UInt_t>> UIntVec;
00036 #endif
00037
00038
00044 class StMtdHitMaker:public StRTSBaseMaker {
00045 private:
00046 StEvent *mStEvent;
00047 mtd_t *fMtd;
00048
00049 Int_t UnpackMtdRawData();
00050 void fillMtdHeader();
00051 void fillMtdRawHitCollection();
00052 void fillMtdHitCollection();
00053 void fillStEvent();
00054
00055 vector<MtdRawHit> MtdLeadingHits;
00056 vector<MtdRawHit> MtdTrailingHits;
00057
00058 Int_t mYear;
00059 Int_t mNValidTrays;
00060 unsigned int mTriggerTimeStamp[2];
00061 StMtdCollection* mMtdCollection;
00062 Int_t mTray2TdigMap[30][5];
00063 Int_t mTrayId[30][5];
00064 Int_t mTdigId[118];
00065 StBTofINLCorr* mINLCorr;
00066
00067 protected:
00068 StRtsTable *GetNextRaw();
00069 StRtsTable *GetNextRaw(int sec);
00070
00071 StMtdCollection *GetMtdCollection();
00072 Int_t tdcChan2globalStrip11(int, int, int, int);
00073 Int_t tdcChan2globalStrip(int, int, int, int);
00074
00075 public:
00076
00078 StMtdHitMaker(const char *name="mtd_raw");
00079 ~StMtdHitMaker() ;
00080
00081 void Clear(Option_t* option="");
00082 Int_t Init();
00083 Int_t InitRun(Int_t);
00084 Int_t FinishRun(Int_t);
00085 Int_t Finish();
00086 Int_t Make();
00087
00089 vector<MtdRawHit> getLeadingHits();
00091 vector<MtdRawHit> getTrailingHits();
00092
00094 virtual const char *GetCVS() const {
00095 static const char cvs[]="Tag $Name: $Id: built "__DATE__" "__TIME__ ; return cvs;
00096 }
00097
00098 ClassDef(StMtdHitMaker, 1)
00099 };
00100
00101 inline vector<MtdRawHit> StMtdHitMaker::getLeadingHits() { return MtdLeadingHits; }
00102 inline vector<MtdRawHit> StMtdHitMaker::getTrailingHits() { return MtdTrailingHits;}
00103
00104 #endif