00001 #ifndef StSortTofRawData_h
00002 #define StSortTofRawData_h
00003
00004 class StEvent;
00005 class StTofRawData;
00006 class StTofCollection;
00007 class StTofRawDataCollection;
00008 class StTofrDaqMap;
00009
00010 #include "StObject.h"
00011 #include "TDataSet.h"
00012 #include "TDataSetIter.h"
00013 #include "TObjectSet.h"
00014
00015 #include <vector>
00016 #ifndef ST_NO_NAMESPACES
00017 using std::vector;
00018 #endif
00019
00020 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
00021
00022 typedef vector<Int_t> IntVec;
00023 #else
00024 typedef vector<Int_t, allocator<Int_t>> IntVec;
00025 #endif
00026
00027 struct TOFRawHit {
00028 int tray;
00029 int channel;
00030 int triggertime;
00031 IntVec leadingTdc;
00032 IntVec trailingTdc;
00033 };
00034
00035 #ifndef ST_NO_TEMPLATE_DEF_ARGS
00036 typedef vector<TOFRawHit> tofRawHitVector;
00037 #else
00038 typedef vector<TOFRawHit,allocator<TOFRawHit>> tofRawHitVector;
00039 #endif
00040 typedef vector<TOFRawHit>::iterator tofRawHitVectorIter;
00041
00042 class StSortTofRawData : public StObject {
00043 private:
00044 static const UInt_t mNTRAY = 122;
00045 tofRawHitVector mRawHitVec[mNTRAY];
00046
00047 static const Int_t mNTOF = 192;
00048 Int_t mTDIGLeChan2WestPMT[mNTOF], mTDIGTeChan2WestPMT[mNTOF];
00049 Int_t mTDIGLeChan2EastPMT[mNTOF], mTDIGTeChan2EastPMT[mNTOF];
00050
00051
00052 Float_t mTimeWindow[mNTRAY][2];
00053
00054 public:
00055 StSortTofRawData();
00056 StSortTofRawData(StTofCollection*);
00057 StSortTofRawData(StTofCollection*, StTofrDaqMap*);
00058 ~StSortTofRawData();
00059
00060 void Init(StTofCollection*);
00061 void InitRun8(StTofCollection*);
00062 void Reset();
00063
00064 IntVec GetValidChannel();
00065 IntVec GetLeadingTdc(int channel);
00066 IntVec GetTrailingTdc(int channel);
00067
00068 IntVec GetValidChannel(int tray);
00069 IntVec GetLeadingTdc(int tray, int channel);
00070 IntVec GetTrailingTdc(int tray, int channel);
00071
00072 IntVec GetLeadingTdc(int tray, int channel, bool triggerevent);
00073 IntVec GetTrailingTdc(int tray, int channel, bool triggerevent);
00074
00075 Int_t GetTriggerTime(int tray, int channel);
00076
00077 void SetVPDMap(StTofrDaqMap* daqMap);
00078
00079 ClassDef(StSortTofRawData,4)
00080 };
00081 #endif
00082
00083