00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef STTOFRDAQMAP_H
00031 #define STTOFRDAQMAP_H
00032
00033 #include "StObject.h"
00034 #include "StMaker.h"
00035 #include <assert.h>
00036 #include "Stypes.h"
00037 #include "TDataSet.h"
00038 #include "TDataSetIter.h"
00039 #include "TObjectSet.h"
00040 #include <string>
00041
00042 #include <vector>
00043 #ifndef ST_NO_NAMESPACES
00044 using std::vector;
00045 #endif
00046
00047 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
00048
00049 typedef vector<Int_t> IntVec;
00050 #else
00051 typedef vector<Int_t, allocator<Int_t>> IntVec;
00052 #endif
00053
00054 class StTofrDaqMap{
00055 private:
00056 static const Int_t mDAQOVERFLOW = 255;
00057 static const Int_t mNTOFR = 120;
00058 static const Int_t mNTOFR5 = 192;
00059
00060 static const Int_t mNTOF = 192;
00061 static const Int_t mNTray = 120;
00062 static const Int_t mNModule = 32;
00063 static const Int_t mNCell = 6;
00064 static const Int_t mNVPD = 19;
00065
00066 Int_t mNValidTrays;
00067
00068 Int_t mTrayId[mNTOFR], mModuleId[mNTOFR], mCellId[mNTOFR];
00069 Int_t mAdc[mNTOFR], mTdc[mNTOFR];
00070
00071
00072 Int_t mGlobalTDCChan[mNTOFR5], mGlobalModuleChan[mNTOFR5];
00073
00074
00075 Int_t mMRPC2TDIGChan[mNTOF];
00076 Int_t mTDIG2MRPCChan[mNTOF];
00077 Int_t mEastPMT2TDIGLeChan[mNVPD], mEastPMT2TDIGTeChan[mNVPD];
00078 Int_t mTDIGLe2EastPMTChan[mNTOF], mTDIGTe2EastPMTChan[mNTOF];
00079 Int_t mWestPMT2TDIGLeChan[mNVPD], mWestPMT2TDIGTeChan[mNVPD];
00080 Int_t mTDIGLe2WestPMTChan[mNTOF], mTDIGTe2WestPMTChan[mNTOF];
00081
00082
00083 Int_t mValidTrayId[mNTray];
00084
00085 public:
00086 StTofrDaqMap();
00087 ~StTofrDaqMap();
00088
00089 void init();
00090 void init(StMaker *maker);
00091 void initFromDbase(StMaker *maker);
00092 void initFromDbaseY5(StMaker *maker);
00093 void initFromDbaseGeneral(StMaker *maker);
00094 void Reset();
00095
00096 void setNValidTrays(int ntrays);
00097
00098 IntVec DaqChan2Cell( const Int_t iTofrDaq );
00099 Int_t Cell2DaqChan( const Int_t iTray, const Int_t iModule, const Int_t iCell );
00100 IntVec ADCChan2Cell( const Int_t iAdc );
00101 IntVec TDCChan2Cell( const Int_t iTdc );
00102 Int_t Cell2ADCChan( const Int_t iTray, const Int_t iModule, const Int_t iCell );
00103 Int_t Cell2TDCChan( const Int_t iTray, const Int_t iModule, const Int_t iCell );
00104 Int_t DaqChan2ADCChan( const Int_t iTofrDaq );
00105 Int_t DaqChan2TDCChan( const Int_t iTofrDaq );
00106 Int_t ADCChan2DaqChan( const Int_t iAdc );
00107 Int_t TDCChan2DaqChan( const Int_t iTdc );
00108
00109
00110 IntVec Tofr5TDCChan2Cell( const Int_t iTdc );
00111 Int_t Tofr5Cell2TDCChan( const Int_t iTray, const Int_t iModule, const Int_t iCell );
00112
00113
00114 IntVec TDIGChan2Cell( const Int_t iTdc );
00115 Int_t Cell2TDIGChan( const Int_t iModule, const Int_t iCell );
00116 Int_t EastPMT2TDIGLeChan( const Int_t iTube );
00117 Int_t TDIGLeChan2EastPMT( const Int_t iTdc );
00118 Int_t EastPMT2TDIGTeChan( const Int_t iTube );
00119 Int_t TDIGTeChan2EastPMT( const Int_t iTdc );
00120 Int_t WestPMT2TDIGLeChan( const Int_t iTube );
00121 Int_t TDIGLeChan2WestPMT( const Int_t iTdc );
00122 Int_t WestPMT2TDIGTeChan( const Int_t iTube );
00123 Int_t TDIGTeChan2WestPMT( const Int_t iTdc );
00124
00125 IntVec ValidTrays();
00126 };
00127
00128 inline void StTofrDaqMap::setNValidTrays(int ntrays) { mNValidTrays = ntrays; }
00129
00130 #endif