@@ -24,7 +24,6 @@ PixelFEDCard::PixelFEDCard(vector<vector<string> > &tableMat) : PixelConfigBase(
2424 vector<string> ins = tableMat[0 ];
2525 map<string, int > colM;
2626 vector<string> colNames;
27- bool first = true ;
2827 /* *
2928 EXTENSION_TABLE_NAME: FED_CONFIGURATION (VIEW: CONF_KEY_FED_CONFIGURATION_V)
3029
@@ -252,111 +251,109 @@ PixelFEDCard::PixelFEDCard(vector<vector<string> > &tableMat) : PixelConfigBase(
252251 }
253252
254253 // Read below quantities pertaining to a single FED that are equal accross 36 channels
255- if (first) {
256- first = false ;
257- // VME base address
258- // Fed Base Address
259- sscanf (tableMat[1 ][colM[" VME_ADDRS_HEX" ]].c_str (), " %lx" , &FEDBASE_0);
260- // sscanf(tableMat[1][colM["PIXEL_FED"]].c_str(), "PxlFED_%ld",&fedNumber);
261- fedNumber = atoi (tableMat[1 ][colM[" PIXEL_FED" ]].c_str ());
262- // Settable optical input parameters (one for each 12-receiver)
263- opt_cap[0 ] = atoi (tableMat[1 ][colM[" OPT1_CAP" ]].c_str ());
264- opt_cap[1 ] = atoi (tableMat[1 ][colM[" OPT2_CAP" ]].c_str ());
265- opt_cap[2 ] = atoi (tableMat[1 ][colM[" OPT3_CAP" ]].c_str ());
266- opt_inadj[0 ] = atoi (tableMat[1 ][colM[" OPT1_INP" ]].c_str ());
267- opt_inadj[1 ] = atoi (tableMat[1 ][colM[" OPT2_INP" ]].c_str ());
268- opt_inadj[2 ] = atoi (tableMat[1 ][colM[" OPT3_INP" ]].c_str ());
269- opt_ouadj[0 ] = atoi (tableMat[1 ][colM[" OPT1_OUT" ]].c_str ());
270- opt_ouadj[1 ] = atoi (tableMat[1 ][colM[" OPT2_OUT" ]].c_str ());
271- opt_ouadj[2 ] = atoi (tableMat[1 ][colM[" OPT3_OUT" ]].c_str ());
272-
273- // clock phases, use bits 0-8, select the clock edged
274- clkphs1_9 = atoi (tableMat[1 ][colM[" NORTH_CLKPHB" ]].c_str ()); // TO BE VERIFIED
275- clkphs10_18 = atoi (tableMat[1 ][colM[" NORTHCENTER_CLKPHB" ]].c_str ()); // TO BE VERIFIED
276- clkphs19_27 = atoi (tableMat[1 ][colM[" SOUTHCENTER_CLKPHB" ]].c_str ()); // TO BE VERIFIED
277- clkphs28_36 = atoi (tableMat[1 ][colM[" SOUTH_CLKPHB" ]].c_str ()); // TO BE VERIFIED
278-
279- // Control register and delays for the TTCrx
280- FineDes1Del = atoi (tableMat[1 ][colM[" REG0_TTCRX_FDLA" ]].c_str ());
281- FineDes2Del = atoi (tableMat[1 ][colM[" REG1_TTCRX_FDLA" ]].c_str ());
282- CoarseDel = atoi (tableMat[1 ][colM[" REG2_TTCRX_CDLA" ]].c_str ());
283- ClkDes2 = atoi (tableMat[1 ][colM[" REG3_TTCRX_CLKD2" ]].c_str ());
284-
285- Ccntrl = atoi (tableMat[1 ][colM[" CENTER_CTRL" ]].c_str ());
286- modeRegister = atoi (tableMat[1 ][colM[" CENTER_MODE" ]].c_str ());
287-
288- // data Regs adjustable fifo Almost Full levels
289- Nfifo1Bzlvl = atoi (tableMat[1 ][colM[" NORTH_FIFO1_BZ_LVL" ]].c_str ());
290- NCfifo1Bzlvl = atoi (tableMat[1 ][colM[" NORTHCENTER_FIFO1_BZ_LVL" ]].c_str ());
291- SCfifo1Bzlvl = atoi (tableMat[1 ][colM[" SOUTHCENTER_FIFO1_BZ_LVL" ]].c_str ());
292- Sfifo1Bzlvl = atoi (tableMat[1 ][colM[" SOUTH_FIFO1_BZ_LVL" ]].c_str ());
293-
294- // Bits (1st 8) used to mask TBM trailer bits
295- N_TBMmask = atoi (tableMat[1 ][colM[" NORTH_TBMMASK" ]].c_str ());
296- NC_TBMmask = atoi (tableMat[1 ][colM[" NORTHCENTER_TBMMASK" ]].c_str ());
297- SC_TBMmask = atoi (tableMat[1 ][colM[" SOUTHCENTER_TBMMASK" ]].c_str ());
298- S_TBMmask = atoi (tableMat[1 ][colM[" SOUTH_TBMMASK" ]].c_str ());
299-
300- // Bits (1st 8) used to set the Private Word in the gap and filler words
301- N_Pword = atoi (tableMat[1 ][colM[" NORTH_PWORD" ]].c_str ());
302- NC_Pword = atoi (tableMat[1 ][colM[" NORTHCENTER_PWORD" ]].c_str ());
303- SC_Pword = atoi (tableMat[1 ][colM[" SOUTHCENTER_PWORD" ]].c_str ());
304- S_Pword = atoi (tableMat[1 ][colM[" SOUTH_PWORD" ]].c_str ());
305-
306- Nbaseln = atoi (tableMat[1 ][colM[" NORTH_BADJ" ]].c_str ());
307- NCbaseln = atoi (tableMat[1 ][colM[" NORTHCENTER_BADJ" ]].c_str ());
308- SCbaseln = atoi (tableMat[1 ][colM[" SOUTHCENTER_BADJ" ]].c_str ());
309- Sbaseln = atoi (tableMat[1 ][colM[" SOUTH_BADJ" ]].c_str ());
310-
311- Ncntrl = atoi (tableMat[1 ][colM[" NORTH_CTRL" ]].c_str ());
312- NCcntrl = atoi (tableMat[1 ][colM[" NORTHCENTER_CTRL" ]].c_str ());
313- SCcntrl = atoi (tableMat[1 ][colM[" SOUTHCENTER_CTRL" ]].c_str ());
314- Scntrl = atoi (tableMat[1 ][colM[" SOUTH_CTRL" ]].c_str ());
315-
316- // These bit sets the special dac mode for random triggers
317- SpecialDac = atoi (tableMat[1 ][colM[" SPECDAC" ]].c_str ());
318-
319- // These bits set the number of Out of consecutive out of sync events until a TTs OOs
320- Ooslvl = atoi (tableMat[1 ][colM[" OOS_LVL" ]].c_str ());
321- // These bits set the number of Empty events until a TTs Error
322- Errlvl = atoi (tableMat[1 ][colM[" ERR_LVL" ]].c_str ());
323-
324- // Control Regs for setting ADC 1Vpp and 2Vpp
325- Nadcg = atoi (tableMat[1 ][colM[" B1_ADCGN" ]].c_str ());
326- NCadcg = atoi (tableMat[1 ][colM[" B2_ADCGN" ]].c_str ());
327- SCadcg = atoi (tableMat[1 ][colM[" B3_ADCGN" ]].c_str ());
328- Sadcg = atoi (tableMat[1 ][colM[" B4_ADCGN" ]].c_str ());
329- fifo3Wrnlvl = atoi (tableMat[1 ][colM[" FIFO3_WRN_LVL" ]].c_str ());
330- FedTTCDelay = atoi (tableMat[1 ][colM[" FED_MASTER_DELAY" ]].c_str ());
331- N_hitlimit = atoi (tableMat[1 ][colM[" NO_HITLIMIT" ]].c_str ());
332- NC_hitlimit = atoi (tableMat[1 ][colM[" NC_HITLIMIT" ]].c_str ());
333- SC_hitlimit = atoi (tableMat[1 ][colM[" SC_HITLIMIT" ]].c_str ());
334- S_hitlimit = atoi (tableMat[1 ][colM[" SO_HITLIMIT" ]].c_str ());
335- N_testreg = atoi (tableMat[1 ][colM[" NO_TESTREG" ]].c_str ());
336- NC_testreg = atoi (tableMat[1 ][colM[" NC_TESTREG" ]].c_str ());
337- SC_testreg = atoi (tableMat[1 ][colM[" SC_TESTREG" ]].c_str ());
338- S_testreg = atoi (tableMat[1 ][colM[" SO_TESTREG" ]].c_str ());
339- BusyHoldMin = atoi (tableMat[1 ][colM[" BUSYHOLDMIN" ]].c_str ());
340- BusyWhenBehind = atoi (tableMat[1 ][colM[" BUSYWHENBEHIND" ]].c_str ());
341- FeatureRegister = atoi (tableMat[1 ][colM[" FEATUREREGISTER" ]].c_str ());
342- FIFO2Limit = atoi (tableMat[1 ][colM[" FIFO2LIMIT" ]].c_str ());
343- LastDacOff = atoi (tableMat[1 ][colM[" LASTDACOFF" ]].c_str ());
344- SimHitsPerRoc = atoi (tableMat[1 ][colM[" SIMHITSPERROC" ]].c_str ());
345- TimeoutOROOSLimit = atoi (tableMat[1 ][colM[" TIMEOUTOROOSLIMIT" ]].c_str ());
346- TriggerHoldoff = atoi (tableMat[1 ][colM[" TRIGGERHOLDOFF" ]].c_str ());
347-
348- SPARE1 = atoi (tableMat[1 ][colM[" SPARE1" ]].c_str ());
349- SPARE2 = atoi (tableMat[1 ][colM[" SPARE2" ]].c_str ());
350- SPARE3 = atoi (tableMat[1 ][colM[" SPARE3" ]].c_str ());
351- SPARE4 = atoi (tableMat[1 ][colM[" SPARE4" ]].c_str ());
352- SPARE5 = atoi (tableMat[1 ][colM[" SPARE5" ]].c_str ());
353- SPARE6 = atoi (tableMat[1 ][colM[" SPARE6" ]].c_str ());
354- SPARE7 = atoi (tableMat[1 ][colM[" SPARE7" ]].c_str ());
355- SPARE8 = atoi (tableMat[1 ][colM[" SPARE8" ]].c_str ());
356- SPARE9 = atoi (tableMat[1 ][colM[" SPARE9" ]].c_str ());
357- SPARE10 = atoi (tableMat[1 ][colM[" SPARE10" ]].c_str ());
358-
359- } // end of 'first' condition
254+
255+ // VME base address
256+ // Fed Base Address
257+ sscanf (tableMat[1 ][colM[" VME_ADDRS_HEX" ]].c_str (), " %lx" , &FEDBASE_0);
258+ // sscanf(tableMat[1][colM["PIXEL_FED"]].c_str(), "PxlFED_%ld",&fedNumber);
259+ fedNumber = atoi (tableMat[1 ][colM[" PIXEL_FED" ]].c_str ());
260+ // Settable optical input parameters (one for each 12-receiver)
261+ opt_cap[0 ] = atoi (tableMat[1 ][colM[" OPT1_CAP" ]].c_str ());
262+ opt_cap[1 ] = atoi (tableMat[1 ][colM[" OPT2_CAP" ]].c_str ());
263+ opt_cap[2 ] = atoi (tableMat[1 ][colM[" OPT3_CAP" ]].c_str ());
264+ opt_inadj[0 ] = atoi (tableMat[1 ][colM[" OPT1_INP" ]].c_str ());
265+ opt_inadj[1 ] = atoi (tableMat[1 ][colM[" OPT2_INP" ]].c_str ());
266+ opt_inadj[2 ] = atoi (tableMat[1 ][colM[" OPT3_INP" ]].c_str ());
267+ opt_ouadj[0 ] = atoi (tableMat[1 ][colM[" OPT1_OUT" ]].c_str ());
268+ opt_ouadj[1 ] = atoi (tableMat[1 ][colM[" OPT2_OUT" ]].c_str ());
269+ opt_ouadj[2 ] = atoi (tableMat[1 ][colM[" OPT3_OUT" ]].c_str ());
270+
271+ // clock phases, use bits 0-8, select the clock edged
272+ clkphs1_9 = atoi (tableMat[1 ][colM[" NORTH_CLKPHB" ]].c_str ()); // TO BE VERIFIED
273+ clkphs10_18 = atoi (tableMat[1 ][colM[" NORTHCENTER_CLKPHB" ]].c_str ()); // TO BE VERIFIED
274+ clkphs19_27 = atoi (tableMat[1 ][colM[" SOUTHCENTER_CLKPHB" ]].c_str ()); // TO BE VERIFIED
275+ clkphs28_36 = atoi (tableMat[1 ][colM[" SOUTH_CLKPHB" ]].c_str ()); // TO BE VERIFIED
276+
277+ // Control register and delays for the TTCrx
278+ FineDes1Del = atoi (tableMat[1 ][colM[" REG0_TTCRX_FDLA" ]].c_str ());
279+ FineDes2Del = atoi (tableMat[1 ][colM[" REG1_TTCRX_FDLA" ]].c_str ());
280+ CoarseDel = atoi (tableMat[1 ][colM[" REG2_TTCRX_CDLA" ]].c_str ());
281+ ClkDes2 = atoi (tableMat[1 ][colM[" REG3_TTCRX_CLKD2" ]].c_str ());
282+
283+ Ccntrl = atoi (tableMat[1 ][colM[" CENTER_CTRL" ]].c_str ());
284+ modeRegister = atoi (tableMat[1 ][colM[" CENTER_MODE" ]].c_str ());
285+
286+ // data Regs adjustable fifo Almost Full levels
287+ Nfifo1Bzlvl = atoi (tableMat[1 ][colM[" NORTH_FIFO1_BZ_LVL" ]].c_str ());
288+ NCfifo1Bzlvl = atoi (tableMat[1 ][colM[" NORTHCENTER_FIFO1_BZ_LVL" ]].c_str ());
289+ SCfifo1Bzlvl = atoi (tableMat[1 ][colM[" SOUTHCENTER_FIFO1_BZ_LVL" ]].c_str ());
290+ Sfifo1Bzlvl = atoi (tableMat[1 ][colM[" SOUTH_FIFO1_BZ_LVL" ]].c_str ());
291+
292+ // Bits (1st 8) used to mask TBM trailer bits
293+ N_TBMmask = atoi (tableMat[1 ][colM[" NORTH_TBMMASK" ]].c_str ());
294+ NC_TBMmask = atoi (tableMat[1 ][colM[" NORTHCENTER_TBMMASK" ]].c_str ());
295+ SC_TBMmask = atoi (tableMat[1 ][colM[" SOUTHCENTER_TBMMASK" ]].c_str ());
296+ S_TBMmask = atoi (tableMat[1 ][colM[" SOUTH_TBMMASK" ]].c_str ());
297+
298+ // Bits (1st 8) used to set the Private Word in the gap and filler words
299+ N_Pword = atoi (tableMat[1 ][colM[" NORTH_PWORD" ]].c_str ());
300+ NC_Pword = atoi (tableMat[1 ][colM[" NORTHCENTER_PWORD" ]].c_str ());
301+ SC_Pword = atoi (tableMat[1 ][colM[" SOUTHCENTER_PWORD" ]].c_str ());
302+ S_Pword = atoi (tableMat[1 ][colM[" SOUTH_PWORD" ]].c_str ());
303+
304+ Nbaseln = atoi (tableMat[1 ][colM[" NORTH_BADJ" ]].c_str ());
305+ NCbaseln = atoi (tableMat[1 ][colM[" NORTHCENTER_BADJ" ]].c_str ());
306+ SCbaseln = atoi (tableMat[1 ][colM[" SOUTHCENTER_BADJ" ]].c_str ());
307+ Sbaseln = atoi (tableMat[1 ][colM[" SOUTH_BADJ" ]].c_str ());
308+
309+ Ncntrl = atoi (tableMat[1 ][colM[" NORTH_CTRL" ]].c_str ());
310+ NCcntrl = atoi (tableMat[1 ][colM[" NORTHCENTER_CTRL" ]].c_str ());
311+ SCcntrl = atoi (tableMat[1 ][colM[" SOUTHCENTER_CTRL" ]].c_str ());
312+ Scntrl = atoi (tableMat[1 ][colM[" SOUTH_CTRL" ]].c_str ());
313+
314+ // These bit sets the special dac mode for random triggers
315+ SpecialDac = atoi (tableMat[1 ][colM[" SPECDAC" ]].c_str ());
316+
317+ // These bits set the number of Out of consecutive out of sync events until a TTs OOs
318+ Ooslvl = atoi (tableMat[1 ][colM[" OOS_LVL" ]].c_str ());
319+ // These bits set the number of Empty events until a TTs Error
320+ Errlvl = atoi (tableMat[1 ][colM[" ERR_LVL" ]].c_str ());
321+
322+ // Control Regs for setting ADC 1Vpp and 2Vpp
323+ Nadcg = atoi (tableMat[1 ][colM[" B1_ADCGN" ]].c_str ());
324+ NCadcg = atoi (tableMat[1 ][colM[" B2_ADCGN" ]].c_str ());
325+ SCadcg = atoi (tableMat[1 ][colM[" B3_ADCGN" ]].c_str ());
326+ Sadcg = atoi (tableMat[1 ][colM[" B4_ADCGN" ]].c_str ());
327+ fifo3Wrnlvl = atoi (tableMat[1 ][colM[" FIFO3_WRN_LVL" ]].c_str ());
328+ FedTTCDelay = atoi (tableMat[1 ][colM[" FED_MASTER_DELAY" ]].c_str ());
329+ N_hitlimit = atoi (tableMat[1 ][colM[" NO_HITLIMIT" ]].c_str ());
330+ NC_hitlimit = atoi (tableMat[1 ][colM[" NC_HITLIMIT" ]].c_str ());
331+ SC_hitlimit = atoi (tableMat[1 ][colM[" SC_HITLIMIT" ]].c_str ());
332+ S_hitlimit = atoi (tableMat[1 ][colM[" SO_HITLIMIT" ]].c_str ());
333+ N_testreg = atoi (tableMat[1 ][colM[" NO_TESTREG" ]].c_str ());
334+ NC_testreg = atoi (tableMat[1 ][colM[" NC_TESTREG" ]].c_str ());
335+ SC_testreg = atoi (tableMat[1 ][colM[" SC_TESTREG" ]].c_str ());
336+ S_testreg = atoi (tableMat[1 ][colM[" SO_TESTREG" ]].c_str ());
337+ BusyHoldMin = atoi (tableMat[1 ][colM[" BUSYHOLDMIN" ]].c_str ());
338+ BusyWhenBehind = atoi (tableMat[1 ][colM[" BUSYWHENBEHIND" ]].c_str ());
339+ FeatureRegister = atoi (tableMat[1 ][colM[" FEATUREREGISTER" ]].c_str ());
340+ FIFO2Limit = atoi (tableMat[1 ][colM[" FIFO2LIMIT" ]].c_str ());
341+ LastDacOff = atoi (tableMat[1 ][colM[" LASTDACOFF" ]].c_str ());
342+ SimHitsPerRoc = atoi (tableMat[1 ][colM[" SIMHITSPERROC" ]].c_str ());
343+ TimeoutOROOSLimit = atoi (tableMat[1 ][colM[" TIMEOUTOROOSLIMIT" ]].c_str ());
344+ TriggerHoldoff = atoi (tableMat[1 ][colM[" TRIGGERHOLDOFF" ]].c_str ());
345+
346+ SPARE1 = atoi (tableMat[1 ][colM[" SPARE1" ]].c_str ());
347+ SPARE2 = atoi (tableMat[1 ][colM[" SPARE2" ]].c_str ());
348+ SPARE3 = atoi (tableMat[1 ][colM[" SPARE3" ]].c_str ());
349+ SPARE4 = atoi (tableMat[1 ][colM[" SPARE4" ]].c_str ());
350+ SPARE5 = atoi (tableMat[1 ][colM[" SPARE5" ]].c_str ());
351+ SPARE6 = atoi (tableMat[1 ][colM[" SPARE6" ]].c_str ());
352+ SPARE7 = atoi (tableMat[1 ][colM[" SPARE7" ]].c_str ());
353+ SPARE8 = atoi (tableMat[1 ][colM[" SPARE8" ]].c_str ());
354+ SPARE9 = atoi (tableMat[1 ][colM[" SPARE9" ]].c_str ());
355+ SPARE10 = atoi (tableMat[1 ][colM[" SPARE10" ]].c_str ());
356+
360357 [[clang::suppress]]
361358 for (int r = 1 ; r < size[0 ]; r++) // Goes to every row of the FIRST Matrix (MUST BE 36, one for each FED channel)
362359 {
0 commit comments