This class implements..
More...
#include "interface/PixelFEDTestDAC.h"
|
std::vector< unsigned int > | dacs_ |
|
This class implements..
A longer explanation will be placed here later
Definition at line 29 of file PixelFEDTestDAC.h.
◆ PixelFEDTestDAC() [1/2]
PixelFEDTestDAC::PixelFEDTestDAC |
( |
std::string |
filename | ) |
|
Definition at line 218 of file PixelFEDTestDAC.cc.
219 std::string mthn =
"[PixelFEDTestDAC::PixelFEDTestDAC()]\t\t\t\t ";
220 const unsigned long int UB = 200;
221 const unsigned long int B = 500;
222 const unsigned long int offset = 0;
223 vector<unsigned int> pulseTrain(256), pixelDCol(1), pixelPxl(2), pixelTBMHeader(3), pixelTBMTrailer(3);
224 unsigned int DCol, LorR,
start = 15;
227 unsigned long int npos = std::string::npos;
231 for (
unsigned int i = 0;
i < pulseTrain.size(); ++
i) {
241 assert(
mode_ ==
"EmulatedPhysics" ||
mode_ ==
"FEDBaselineWithTestDACs" ||
mode_ ==
"FEDAddressLevelWithTestDACs");
246 if (
line.find(
"TBMHeader") != npos) {
247 loc1 =
line.find(
'(');
249 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMHeader.\n";
252 loc2 =
line.find(
')', loc1 + 1);
254 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMHeader.\n";
257 int TBMHeader = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
278 }
else if (
line.find(
"ROCHeader") != std::string::npos) {
279 loc1 =
line.find(
'(');
281 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after ROCHeader.\n";
284 loc2 =
line.find(
')', loc1 + 1);
286 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after ROCHeader.\n";
289 int LastDAC = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
291 std::cout <<
"--------------" << std::endl;
299 }
else if (
line.find(
"PixelHit") != std::string::npos) {
300 loc1 =
line.find(
'(');
302 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after PixelHit.\n";
305 loc2 =
line.find(
',', loc1 + 1);
307 cout << __LINE__ <<
"]\t" << mthn <<
"',' not found after the first argument of PixelHit.\n";
310 loc3 =
line.find(
',', loc2 + 1);
312 cout << __LINE__ <<
"]\t" << mthn <<
"'.' not found after the second argument of PixelHit.\n";
315 loc4 =
line.find(
')', loc3 + 1);
317 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after the third argument of PixelHit.\n";
320 int column = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
321 int row = atoi(
line.substr(loc2 + 1, loc3 - loc2 - 1).c_str());
322 int charge = atoi(
line.substr(loc3 + 1, loc4 - loc3 - 1).c_str());
324 DCol =
int(column / 2);
325 LorR =
int(column - DCol * 2);
329 std::cout <<
"Pxl = " << pixelPxl[2] << pixelPxl[1] << pixelPxl[0] <<
", DCol= " << pixelDCol[1] << pixelDCol[0]
345 }
else if (
line.find(
"TBMTrailer") != std::string::npos) {
346 loc1 =
line.find(
'(');
348 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMTrailer.\n";
351 loc2 =
line.find(
')', loc1 + 1);
353 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMTrailer.\n";
356 int TBMTrailer = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
References cms::cuda::assert(), TtFullHadDaughter::B, ALCARECOTkAlJpsiMuMu_cff::charge, gather_cfg::cout, corrVsCorr::filename, groupFilesInBlocks::fin, mps_fire::i, createfilelist::int, mps_splice::line, hltrates_dqm_sourceclient-live_cfg::offset, command_line::start, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ PixelFEDTestDAC() [2/2]
PixelFEDTestDAC::PixelFEDTestDAC |
( |
std::vector< std::vector< std::string > > & |
tableMat | ) |
|
EXTENSION_TABLE_NAME: PIXEL_CALIB_CLOB (VIEW: CONF_KEY_PIXEL_CALIB_V)
CONFIG_KEY NOT NULL VARCHAR2(80) KEY_TYPE NOT NULL VARCHAR2(80) KEY_ALIAS NOT NULL VARCHAR2(80) VERSION VARCHAR2(40) KIND_OF_COND NOT NULL VARCHAR2(40) CALIB_TYPE VARCHAR2(200) CALIB_OBJ_DATA_FILE NOT NULL VARCHAR2(200) CALIB_OBJ_DATA_CLOB NOT NULL CLOB
Definition at line 12 of file PixelFEDTestDAC.cc.
13 std::string mthn =
"[PixelFEDTestDAC::PixelFEDTestDAC()]\t\t\t ";
14 const unsigned long int UB = 200;
15 const unsigned long int B = 500;
16 const unsigned long int offset = 0;
17 vector<unsigned int> pulseTrain(256), pixelDCol(1), pixelPxl(2), pixelTBMHeader(3), pixelTBMTrailer(3);
18 unsigned int DCol, LorR,
start = 15;
21 unsigned long int npos = std::string::npos;
24 std::map<std::string, int> colM;
25 std::vector<std::string> colNames;
40 colNames.push_back(
"CONFIG_KEY");
41 colNames.push_back(
"KEY_TYPE");
42 colNames.push_back(
"KEY_ALIAS");
43 colNames.push_back(
"VERSION");
44 colNames.push_back(
"KIND_OF_COND");
45 colNames.push_back(
"CALIB_TYPE");
46 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
47 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
49 for (
unsigned int c = 0;
c < tableMat[0].size();
c++) {
50 for (
unsigned int n = 0;
n < colNames.size();
n++) {
51 if (tableMat[0][
c] == colNames[
n]) {
52 colM[colNames[
n]] =
c;
57 for (
unsigned int n = 0;
n < colNames.size();
n++) {
58 if (colM.find(colNames[
n]) == colM.end()) {
59 std::cerr << __LINE__ <<
"]\t" << mthn <<
"Couldn't find in the database the column with name " << colNames[
n]
65 std::istringstream
fin;
66 fin.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]);
69 for (
unsigned int i = 0;
i < pulseTrain.size(); ++
i) {
77 assert(
mode_ ==
"EmulatedPhysics" ||
mode_ ==
"FEDBaselineWithTestDACs" ||
mode_ ==
"FEDAddressLevelWithTestDACs");
82 if (
line.find(
"TBMHeader") != npos) {
83 loc1 =
line.find(
'(');
85 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMHeader.\n";
88 loc2 =
line.find(
')', loc1 + 1);
90 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMHeader.\n";
93 int TBMHeader = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
114 }
else if (
line.find(
"ROCHeader") != std::string::npos) {
115 loc1 =
line.find(
'(');
117 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after ROCHeader.\n";
120 loc2 =
line.find(
')', loc1 + 1);
122 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after ROCHeader.\n";
125 int LastDAC = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
127 std::cout <<
"--------------" << std::endl;
135 }
else if (
line.find(
"PixelHit") != std::string::npos) {
136 loc1 =
line.find(
'(');
138 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after PixelHit.\n";
141 loc2 =
line.find(
',', loc1 + 1);
143 cout << __LINE__ <<
"]\t" << mthn <<
"',' not found after the first argument of PixelHit.\n";
146 loc3 =
line.find(
',', loc2 + 1);
148 cout << __LINE__ <<
"]\t" << mthn <<
"'.' not found after the second argument of PixelHit.\n";
151 loc4 =
line.find(
')', loc3 + 1);
153 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after the third argument of PixelHit.\n";
156 int column = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
157 int row = atoi(
line.substr(loc2 + 1, loc3 - loc2 - 1).c_str());
158 int charge = atoi(
line.substr(loc3 + 1, loc4 - loc3 - 1).c_str());
160 DCol =
int(column / 2);
161 LorR =
int(column - DCol * 2);
165 std::cout <<
"Pxl = " << pixelPxl[2] << pixelPxl[1] << pixelPxl[0] <<
", DCol= " << pixelDCol[1] << pixelDCol[0]
181 }
else if (
line.find(
"TBMTrailer") != std::string::npos) {
182 loc1 =
line.find(
'(');
184 cout << __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMTrailer.\n";
187 loc2 =
line.find(
')', loc1 + 1);
189 cout << __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMTrailer.\n";
192 int TBMTrailer = atoi(
line.substr(loc1 + 1, loc2 - loc1 - 1).c_str());
References cms::cuda::assert(), TtFullHadDaughter::B, c, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, ALCARECOTkAlJpsiMuMu_cff::charge, gather_cfg::cout, groupFilesInBlocks::fin, mps_fire::i, createfilelist::int, mps_splice::line, dqmiodumpmetadata::n, hltrates_dqm_sourceclient-live_cfg::offset, command_line::start, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ dacs()
std::vector<unsigned int> pos::PixelFEDTestDAC::dacs |
( |
| ) |
|
|
inline |
◆ decimalToBaseX()
vector< unsigned int > PixelFEDTestDAC::decimalToBaseX |
( |
unsigned int |
a, |
|
|
unsigned int |
x, |
|
|
unsigned int |
length |
|
) |
| |
|
private |
◆ levelEncoder()
unsigned int PixelFEDTestDAC::levelEncoder |
( |
int |
level | ) |
|
|
private |
◆ mode()
std::string pos::PixelFEDTestDAC::mode |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ writeXML()
void PixelFEDTestDAC::writeXML |
( |
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = nullptr , |
|
|
std::ofstream * |
out2 = nullptr |
|
) |
| const |
|
overridevirtual |
Reimplemented from pos::PixelCalibBase.
Definition at line 479 of file PixelFEDTestDAC.cc.
480 std::string mthn =
"[PixelFEDTestDAC::writeXML()]\t\t\t ";
482 *outstream <<
" " << std::endl;
483 *outstream <<
" <DATA>" << std::endl;
484 *outstream <<
" <CALIB_OBJ_DATA_FILE>./fedtestdac.dat</CALIB_OBJ_DATA_FILE>" << std::endl;
485 *outstream <<
" <CALIB_TYPE>fedtestdac</CALIB_TYPE>" << std::endl;
486 *outstream <<
" </DATA>" << std::endl;
487 *outstream <<
" " << std::endl;
References AlCaHLTBitMon_QueryRunRegistry::string.
◆ writeXMLHeader()
void PixelFEDTestDAC::writeXMLHeader |
( |
pos::PixelConfigKey |
key, |
|
|
int |
version, |
|
|
std::string |
path, |
|
|
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = nullptr , |
|
|
std::ofstream * |
out2 = nullptr |
|
) |
| const |
|
overridevirtual |
Reimplemented from pos::PixelCalibBase.
Definition at line 432 of file PixelFEDTestDAC.cc.
438 std::string mthn =
"[PixelFEDTestDAC::writeXMLHeader()]\t\t\t ";
439 std::stringstream maskFullPath;
444 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl;
446 outstream->open(maskFullPath.str().c_str());
448 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
449 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
450 *outstream <<
"" << std::endl;
451 *outstream <<
" <HEADER>" << std::endl;
452 *outstream <<
" <TYPE>" << std::endl;
453 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl;
454 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl;
455 *outstream <<
" </TYPE>" << std::endl;
456 *outstream <<
" <RUN>" << std::endl;
457 *outstream <<
" <RUN_TYPE>PixelFEDTestDAC</RUN_TYPE>" << std::endl;
458 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
460 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl;
461 *outstream <<
" </RUN>" << std::endl;
462 *outstream <<
" </HEADER>" << std::endl;
463 *outstream <<
"" << std::endl;
464 *outstream <<
" <DATA_SET>" << std::endl;
465 *outstream <<
"" << std::endl;
466 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl;
467 *outstream <<
" <COMMENT_DESCRIPTION>No comment defined: this class does NOT inherit from "
468 "PixelCalibBase</COMMENT_DESCRIPTION>"
470 *outstream <<
" <CREATED_BY_USER>Unknown user</CREATED_BY_USER>" << std::endl;
471 *outstream <<
"" << std::endl;
472 *outstream <<
" <PART>" << std::endl;
473 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
474 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
475 *outstream <<
" </PART>" << std::endl;
References gather_cfg::cout, edmStreamStallGrapher::getTime(), castor_dqm_sourceclient_file_cfg::path, AlCaHLTBitMon_QueryRunRegistry::string, and BeamSplash_cfg::version.
◆ writeXMLTrailer()
void PixelFEDTestDAC::writeXMLTrailer |
( |
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = nullptr , |
|
|
std::ofstream * |
out2 = nullptr |
|
) |
| const |
|
overridevirtual |
◆ dacs_
std::vector<unsigned int> pos::PixelFEDTestDAC::dacs_ |
|
private |