00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef StBTOFSORTRAWHIT_H
00015 #define StBTOFSORTRAWHIT_H
00016
00017 class StMaker;
00018 class StEvent;
00019 class StBTofRawHit;
00020 class StBTofCollection;
00021 class StBTofHeader;
00022 class StBTofRawHitCollection;
00023 class StBTofDaqMap;
00024
00025 #include "StObject.h"
00026 #include "TDataSet.h"
00027 #include "TDataSetIter.h"
00028 #include "TObjectSet.h"
00029
00030 #include <vector>
00031 #ifndef ST_NO_NAMESPACES
00032 using std::vector;
00033 #endif
00034
00035 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
00036
00037 typedef vector<Int_t> IntVec;
00038 typedef vector<UInt_t> UIntVec;
00039 #else
00040 typedef vector<Int_t, allocator<Int_t>> IntVec;
00041 typedef vector<UInt_t, allocator<UInt_t>> UIntVec;
00042 #endif
00043
00044 struct TOFRawHit {
00045 int fiberId;
00046 int tray;
00047 int channel;
00048 UIntVec leadingTdc;
00049 UIntVec trailingTdc;
00050 };
00051
00052 #ifndef ST_NO_TEMPLATE_DEF_ARGS
00053 typedef vector<TOFRawHit> tofRawHitVector;
00054 #else
00055 typedef vector<TOFRawHit,allocator<TOFRawHit>> tofRawHitVector;
00056 #endif
00057 typedef vector<TOFRawHit>::iterator tofRawHitVectorIter;
00058
00064 class StBTofSortRawHit : public StObject {
00065 private:
00066
00067 static const Int_t mNTRAY = 124;
00068 static const Int_t mNCHAN = 192;
00069 static const Int_t mNFIBER = 4;
00070 static const Int_t mNVPD = 19;
00071 tofRawHitVector mRawHitVec[mNTRAY];
00072
00073 Float_t mTriggerTimeWindow[mNTRAY][2];
00074 Float_t mTriggerOffset;
00075 UInt_t mTriggerTime[mNFIBER];
00076
00077 Float_t mVpdDelay[2*mNVPD];
00078
00079 Bool_t mDebug;
00080 StBTofDaqMap *mDaqMap;
00081
00082 public:
00083 StBTofSortRawHit();
00084 ~StBTofSortRawHit();
00085
00086 void Init();
00089 void Init(StMaker *maker, StBTofDaqMap *daqMap);
00090 void Reset();
00092
00093
00094 void setBTofCollection(StBTofCollection* tofColl);
00095
00097 IntVec GetValidChannel(int tray);
00099 UIntVec GetLeadingTdc(int tray, int channel, bool triggerevent=true);
00101 UIntVec GetTrailingTdc(int tray, int channel, bool triggerevent=true);
00102
00103 };
00104 #endif