Skip to content

Commit f44769d

Browse files
committed
Changes from review
1 parent 7d203db commit f44769d

File tree

1 file changed

+103
-105
lines changed

1 file changed

+103
-105
lines changed

CalibFormats/SiPixelObjects/src/PixelFEDCard.cc

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

0 commit comments

Comments
 (0)