75 #ifndef STSSTDAQMAKER_H
76 #define STSSTDAQMAKER_H
79 #include "StRTSBaseMaker.h"
86 class St_sstConfiguration;
87 class St_sstStripCalib;
90 class sstConfiguration_st;
91 class sstChipCorrect_st;
92 class sstStripCalib_st;
93 class sstBadStrips_st;
101 virtual Int_t InitRun(Int_t runumber);
102 virtual Int_t
Make();
103 void Clear(
const Option_t * =
"");
104 virtual const char *GetCVS()
const {
105 static const char cvs[] =
"Tag $Name: $ $Id: StSstDaqMaker.h,v 1.11 2017/04/25 00:32:03 perev Exp $ built " __DATE__
" " __TIME__;
110 Int_t GetHitsDataLength(
int FiberNumber);
111 void DecodeRdoData();
112 void DecodeHitsData();
113 void DecodeRawWords(UInt_t *val,
int vallength,
int channel);
114 void DecodeRawWords_r15(UInt_t *val,
int vallength,
int channel);
115 void DecodeCompressedWords(UInt_t *val,
int valength,
int channel);
116 UInt_t Mid(Int_t start, Int_t end, UInt_t input);
117 Int_t Shift(
int runnumber,
int &channel);
118 void FindLadderSide(
int RDO,
int channel,
int &ladder,
int &side);
119 void FindStripNumber(
int &strip);
120 void FindChannelNumber(
int &channel);
121 void PrintConfiguration(Int_t runumber, sstConfiguration_st *config);
122 void FillData(vector<vector<int> > vadc, vector<vector<float> > vcmnoise, Int_t id_side, Int_t ladder, Int_t valength);
123 void FillData_FixTH(vector<vector<int> > vadc, vector<vector<float> > vcmnoise, Int_t id_side, Int_t ladder, Int_t valength);
125 Float_t CalculateCommonModeNoise(vector<int> vtemp);
126 Float_t CalculateCommonModeNoiseSimple(vector<int> vtemp);
127 Float_t CalculateCommonModeNoise_FPGA(vector<int> vtemp);
128 void FillReadOutPedTable(sstStripCalib_st *noise);
129 void FillDefaultReadOutPedTable();
130 void FillNoiseTable(sstNoise_st *noise);
131 void FillDefaultNoiseTable();
132 void FillChipNoiseTable(sstChipCorrect_st *chipCorrectTable);
133 void FillDefaultChipNoiseTable();
134 void FillBadStripsTable(sstBadStrips_st* badStripTable);
135 Int_t idWaferToWafer(Int_t idWafer);
136 Int_t idWaferToLadderNumb(Int_t idWafer);
140 sstConfiguration_st *mConfigTable;
141 St_spa_strip *spa_strip;
142 St_sstStripCalib *stripCal;
148 Int_t mRdoDataLength;
150 UInt_t *mTrailerData;
151 Int_t mTrailerDataLength;
153 UInt_t *mAdcHeader[8];
154 UInt_t mAdcLength[8];
168 Int_t mEventrunumber;
171 Int_t mCorrectFactor[1920][2];
172 Int_t mNoiseCut[1920][2];
175 map<Int_t, Int_t> mReadOutPed;
176 map<Int_t, Float_t> mIntrinsicRms;
177 map<Int_t, char> mBadStrip;
179 static const UInt_t HEADER_LENGTH = 8;
180 static const UInt_t FIBER_HEADER_LENGTH = 10;
181 static const UInt_t HEADER_TOKEN = 0xAAAAAAAA;
182 static const UInt_t END_TOKEN = 0xBBBBBBBB;
183 static const UInt_t TCD_TOKEN = 0xCCCCCCCC;
184 static const UInt_t FIBER_LINK_TOKEN = 0xDDDDDDDD;
185 static const UInt_t TCD_END_TOKEN = 0xEEEEEEEE;
186 static const UInt_t RDO_START = 24;
187 static const UInt_t RDO_END = 28;
188 static const UInt_t TRIG_START = 0;
189 static const UInt_t TRIG_END = 20;
190 static const UInt_t FIBER_START = 28;
191 static const UInt_t FIBER_END = 31;
192 static const UInt_t HYBRID_ONE_START = 0;
193 static const UInt_t HYBRID_ONE_END = 10;
194 static const UInt_t HYBRID_TWO_START = 10;
195 static const UInt_t HYBRID_TWO_END = 20;
196 static const UInt_t HYBRID_THREE_START = 20;
197 static const UInt_t HYBRID_THREE_END = 30;
198 static const UInt_t COM_ADC_START = 0;
199 static const UInt_t COM_ADC_END = 10;
200 static const UInt_t HYBRID_START = 10;
201 static const UInt_t HYBRID_END = 14;
202 static const UInt_t STRIP_START = 14;
203 static const UInt_t STRIP_END = 24;
204 static const UInt_t ERROR_START = 28;
205 static const UInt_t ERROR_END = 32;
206 static const UInt_t ADC_START = 4;
207 static const UInt_t ADC_END = 20;
208 static const UInt_t DATAMODE_START = 0;
209 static const UInt_t DATAMODE_END = 4;
210 static const UInt_t RAWMODE = 0x0;
211 static const UInt_t COMPRESSEDMODE = 0x1;
212 static const UInt_t CMNSMODE = 0x3;
213 static const UInt_t FLAG_START = 20;
214 static const UInt_t FLAG_END = 32;
215 static const UInt_t NORMAL = 0x0;
216 static const UInt_t NODATA = 0x1;
217 static const UInt_t OVERFLOWFLAG = 0x2;
218 static const UInt_t EARLY_ABORT = 0x3;
219 static const UInt_t WRONG_PIPE_MODE = 0x4;
220 static const UInt_t ADC_LENGTH_LIMIT = 4106;
221 static const UInt_t CMNERRORCODE = 0xB;
224 static const Int_t nSstRdo = 5;
225 static const Int_t nSstSide = 2;
226 static const Int_t nSstLadder = 20;
227 static const Int_t nSstFiberPerRdo = 8;
228 static const Int_t nSstWaferPerLadder = 16;
229 static const Int_t nSstChipPerWafer = 6;
230 static const Int_t nSstStripsPerWafer = 768;
231 static const Int_t nSstStripsPerChip = 128;
232 static const Int_t nSigmaCut = 4;
233 static const Int_t nRmsCut = 10;
234 static const Int_t RDO2LADDER[5][8];
235 static const Int_t ReadOutMap[128];
236 static const Int_t Rev_ReadOutMap[128];
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...