26 std::string mthn =
"[PixelCalibConfiguration::PixelCalibConfiguration()]\t ";
27 std::map<std::string, int> colM;
28 std::vector<std::string> colNames;
43 colNames.push_back(
"CONFIG_KEY");
44 colNames.push_back(
"KEY_TYPE");
45 colNames.push_back(
"KEY_ALIAS");
46 colNames.push_back(
"VERSION");
47 colNames.push_back(
"KIND_OF_COND");
48 colNames.push_back(
"CALIB_TYPE");
49 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
50 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
52 for (
unsigned int c = 0;
c < tableMat[0].size();
c++) {
53 for (
unsigned int n = 0;
n < colNames.size();
n++) {
54 if (tableMat[0][
c] == colNames[
n]) {
55 colM[colNames[
n]] =
c;
60 for (
unsigned int n = 0;
n < colNames.size();
n++) {
61 if (colM.find(colNames[
n]) == colM.end()) {
62 std::cerr << mthn <<
"Couldn't find in the database the column with name " << colNames[
n] << std::endl;
69 std::istringstream
in;
70 in.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]);
81 mode_ =
"FEDChannelOffsetPixel";
82 std::cout << __LINE__ <<
"]\t" << mthn <<
"mode not set, is this an old file? " << std::endl;
88 if (
tmp ==
"SingleROC") {
94 if (
tmp ==
"Parameters:") {
96 while (
tmp !=
"Rows:") {
109 std::vector<unsigned int>
rows;
110 while (
tmp !=
"Cols:") {
116 rows.push_back(atoi(
tmp.c_str()));
126 std::vector<unsigned int> cols;
127 while ((
tmp !=
"VcalLow:") && (
tmp !=
"VcalHigh:") && (
tmp !=
"Vcal:") && (
tmp !=
"VcalHigh") && (
tmp !=
"VcalLow")) {
129 cols_.push_back(cols);
133 cols.push_back(atoi(
tmp.c_str()));
138 cols_.push_back(cols);
143 if (
tmp ==
"VcalLow") {
148 if (
tmp ==
"VcalHigh") {
153 if (
tmp ==
"VcalLow:") {
157 if ((
tmp ==
"VcalLow:") || (
tmp ==
"VcalHigh:") || (
tmp ==
"Vcal:")) {
160 unsigned int index = 1;
161 if (!
dacs_.empty()) {
171 dacs_.push_back(dacrange);
174 while (
tmp ==
"Scan:" ||
tmp ==
"ScanValues:") {
175 if (
tmp ==
"ScanValues:") {
178 vector<unsigned int>
values;
185 unsigned int index = 1;
186 if (!
dacs_.empty()) {
190 dacs_.push_back(dacrange);
197 unsigned int index = 1;
198 if (!
dacs_.empty()) {
208 dacs_.push_back(dacrange);
212 while ((
tmp ==
"Set:") || (
tmp ==
"SetRelative:")) {
217 unsigned int index = 1;
221 if (
tmp ==
"SetRelative:") {
224 dacs_.push_back(dacrange);
236 bool buildROCListNow =
false;
237 if (
tmp ==
"Rocs:") {
238 buildROCListNow =
true;
242 buildROCListNow =
false;
254 if (
tmp ==
"all" ||
tmp ==
"+" ||
tmp ==
"-") {
255 buildROCListNow =
false;
265 if (buildROCListNow) {
266 std::set<PixelROCName> rocSet;
269 ++rocListInstructions_itr) {
271 rocSet.insert(rocname);
286 std::string mthn =
"[PixelCalibConfiguration::PixelCalibConfiguration()]\t ";
293 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open:" <<
filename << std::endl;
303 if (
tmp ==
"Mode:") {
305 std::cout << __LINE__ <<
"]\t" << mthn <<
"PixelCalibConfiguration mode=" <<
mode_ << std::endl;
308 mode_ =
"FEDChannelOffsetPixel";
309 std::cout << __LINE__ <<
"]\t" << mthn <<
"PixelCalibConfiguration mode not set, is this an old file? " << __LINE__
310 <<
"]\t" << std::endl;
316 if (
tmp ==
"SingleROC") {
322 if (
tmp ==
"Parameters:") {
324 while (
tmp !=
"Rows:") {
337 std::vector<unsigned int>
rows;
338 while (
tmp !=
"Cols:") {
344 rows.push_back(atoi(
tmp.c_str()));
354 std::vector<unsigned int> cols;
355 while ((
tmp !=
"VcalLow:") && (
tmp !=
"VcalHigh:") && (
tmp !=
"Vcal:") && (
tmp !=
"VcalHigh") && (
tmp !=
"VcalLow")) {
357 cols_.push_back(cols);
361 cols.push_back(atoi(
tmp.c_str()));
366 cols_.push_back(cols);
371 if (
tmp ==
"VcalLow") {
376 if (
tmp ==
"VcalHigh") {
381 if (
tmp ==
"VcalLow:") {
385 if ((
tmp ==
"VcalLow:") || (
tmp ==
"VcalHigh:") || (
tmp ==
"Vcal:")) {
388 unsigned int index = 1;
389 if (!
dacs_.empty()) {
399 dacs_.push_back(dacrange);
402 while (
tmp ==
"Scan:" ||
tmp ==
"ScanValues:") {
403 if (
tmp ==
"ScanValues:") {
406 vector<unsigned int>
values;
413 unsigned int index = 1;
414 if (!
dacs_.empty()) {
418 dacs_.push_back(dacrange);
425 unsigned int index = 1;
426 if (!
dacs_.empty()) {
436 dacs_.push_back(dacrange);
440 while ((
tmp ==
"Set:") || (
tmp ==
"SetRelative:")) {
446 unsigned int index = 1;
450 if (
tmp ==
"SetRelative:") {
456 dacs_.push_back(dacrange);
468 bool buildROCListNow =
false;
469 if (
tmp ==
"Rocs:") {
470 buildROCListNow =
true;
474 buildROCListNow =
false;
486 if (
tmp ==
"all" ||
tmp ==
"+" ||
tmp ==
"-") {
487 buildROCListNow =
false;
499 if (buildROCListNow) {
500 std::set<PixelROCName> rocSet;
503 ++rocListInstructions_itr) {
505 rocSet.insert(rocname);
513 std::ifstream inTmp(
filename.c_str());
515 while (!inTmp.eof()) {
517 getline(inTmp, tmpString);
531 assert(translation !=
nullptr);
532 assert(detconfig !=
nullptr);
540 std::set<PixelROCName> rocSet;
542 const map<PixelROCName, PixelROCStatus>& iroclist = detconfig->
getROCsList();
545 ++rocListInstructions_itr) {
546 std::string instruction = *rocListInstructions_itr;
548 if (instruction ==
"+") {
552 if (instruction ==
"-") {
557 if (instruction ==
"all") {
561 for (std::vector<PixelModuleName>::const_iterator moduleList_itr =
moduleList.begin();
564 std::vector<PixelROCName> ROCsOnThisModule = translation->
getROCsFromModule(*moduleList_itr);
565 for (std::vector<PixelROCName>::const_iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin();
566 ROCsOnThisModule_itr != ROCsOnThisModule.end();
567 ++ROCsOnThisModule_itr) {
568 map<PixelROCName, PixelROCStatus>::const_iterator it = iroclist.find(*ROCsOnThisModule_itr);
569 assert(it != iroclist.end());
572 rocSet.insert(*ROCsOnThisModule_itr);
594 std::vector<PixelROCName> ROCsOnThisModule = translation->
getROCsFromModule(modulename);
595 for (std::vector<PixelROCName>::iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin();
596 ROCsOnThisModule_itr != ROCsOnThisModule.end();
597 ++ROCsOnThisModule_itr) {
599 map<PixelROCName, PixelROCStatus>::const_iterator it = iroclist.find(*ROCsOnThisModule_itr);
600 assert(it != iroclist.end());
603 rocSet.insert(*ROCsOnThisModule_itr);
605 rocSet.erase(*ROCsOnThisModule_itr);
614 bool foundIt =
false;
615 std::list<const PixelROCName*> allROCs = translation->
getROCs();
616 for (std::list<const PixelROCName*>::iterator allROCs_itr = allROCs.begin(); allROCs_itr != allROCs.end();
618 if ((*(*allROCs_itr)) == rocname) {
624 map<PixelROCName, PixelROCStatus>::const_iterator it = iroclist.find(rocname);
625 assert(it != iroclist.end());
628 rocSet.insert(rocname);
631 rocSet.erase(rocname);
650 std::string mthn =
"[PixelCalibConfiguration::buildROCAndModuleListsFromROCSet()] ";
652 for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin(); rocSet_itr != rocSet.end(); ++rocSet_itr) {
653 rocs_.push_back(*rocSet_itr);
661 std::map<PixelModuleName, unsigned int> countROC;
662 for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin(); rocSet_itr != rocSet.end(); ++rocSet_itr) {
668 countROC[modulename]++;
694 unsigned maxROCs = 0;
695 for (std::map<PixelModuleName, unsigned int>::iterator imodule = countROC.begin(); imodule != countROC.end();
697 if (imodule->second > maxROCs)
698 maxROCs = imodule->second;
702 std::cout << __LINE__ <<
"]\t" << mthn <<
"Max ROCs on a module=" <<
nROC_ << std::endl;
705 for (
unsigned int irocs = 0; irocs <
rocs_.size(); irocs++) {
716 assert(aNameTranslation !=
nullptr);
720 for (std::vector<PixelROCName>::const_iterator rocs_itr =
rocs_.begin(); rocs_itr !=
rocs_.end(); ++rocs_itr) {
728 std::set<PixelROCName> tempROCs;
730 for (std::vector<PixelROCName>::const_iterator it =
rocs_.begin(); it !=
rocs_.end(); ++it) {
731 tempROCs.insert(*it);
734 for (std::set<PixelChannel>::const_iterator channels_itr =
channels_.begin(); channels_itr !=
channels_.end();
736 std::vector<PixelROCName> rocsOnChannel = aNameTranslation->
getROCsFromChannel(*channels_itr);
738 std::set<PixelROCName> foundROCs;
740 for (std::vector<PixelROCName>::const_iterator rocsOnChannel_itr = rocsOnChannel.begin();
741 rocsOnChannel_itr != rocsOnChannel.end();
742 ++rocsOnChannel_itr) {
743 if (tempROCs.find(*rocsOnChannel_itr) != tempROCs.end()) {
745 foundROCs.insert(*rocsOnChannel_itr);
749 for (std::set<PixelROCName>::const_iterator foundROCs_itr = foundROCs.begin(); foundROCs_itr != foundROCs.end();
759 for (
unsigned int i = 0;
i <
dacs_.size();
i++) {
764 std::cout << __LINE__ <<
"]\t[PixelCalibConfiguration::iScan()]\t\t could not find dac=" << dac << std::endl;
781 unsigned int ROCNumber,
782 unsigned int ROCsOnChannel)
const {
786 if (
dacs_[iscan].mixValuesAcrossROCs())
813 return foundROC->second;
820 return foundROC->second;
828 for (
unsigned int i = 0;
i < iscan;
i++) {
832 unsigned int i_threshold = i_scan %
nScanPoints(iscan);
855 std::map<pos::PixelModuleName, pos::PixelMaskBase*>* masks,
856 std::map<pos::PixelModuleName, pos::PixelTrimBase*>* trims,
857 std::map<pos::PixelModuleName, pos::PixelDACSettings*>* dacs,
859 unsigned int state)
const {
860 std::string mthn =
"[PixelCalibConfiguration::nextFECState()]\t\t ";
865 if (modeName ==
"maskAllPixel")
867 if (modeName ==
"useAllPixel" || modeName.empty())
869 if (modeName ==
"default")
872 static bool first =
true;
875 cout << __LINE__ <<
"]\t" << mthn <<
"mode=" <<
mode << endl;
880 cout << __LINE__ <<
"]\t" << mthn <<
"ScanMode=" << modeName <<
" not understood." << endl;
886 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
893 std::map<pos::PixelModuleName, pos::PixelMaskBase*>::const_iterator foundMask = masks->find(
module);
894 if (foundMask == masks->end()) {
895 rocInfo.
use_ =
false;
911 std::map<std::string, unsigned int> defaultDACValues;
914 for (std::vector<PixelDACScanRange>::const_iterator dacs_itr =
dacs_.begin(); dacs_itr !=
dacs_.end();
916 std::map<std::string, unsigned int>::const_iterator foundThisDAC = defaultDACValues.find(dacs_itr->name());
917 assert(foundThisDAC != defaultDACValues.end());
919 pair<unsigned int, unsigned int> dacchannelAndValue(dacs_itr->dacchannel(), foundThisDAC->second);
929 bool changedWBC =
false;
951 unsigned int first_scan =
true;
952 for (
unsigned int i = 0;
i <
dacs_.size();
i++) {
959 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
981 if (first_scan &&
state != 0 &&
mode != 2) {
982 unsigned int previousState =
state - 1;
984 unsigned int i_row_previous =
rowCounter(previousState);
986 unsigned int i_col_previous =
colCounter(previousState);
988 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
998 for (
unsigned int j = 0;
j <
dacs_.size();
j++) {
1028 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
1041 for (
unsigned int ii = 0;
ii <
dacs_.size();
ii++) {
1058 dacvalue = -dacvalue;
1099 unsigned int roccontrolword = (*dacs)[
module]->getDACSettings(
rocs_[
i])->getControlRegister();
1105 roccontrolword |= 0x4;
1107 roccontrolword &= 0xfb;
1124 unsigned int nrow =
rows_[i_row].size();
1125 unsigned int ncol =
cols_[i_col].size();
1126 unsigned int nmax =
std::max(nrow, ncol);
1127 if (nrow == 0 || ncol == 0)
1129 for (
unsigned int n = 0;
n < nmax;
n++) {
1130 unsigned int irow =
n;
1131 unsigned int icol =
n;
1136 unsigned int row =
rows_[i_row][irow];
1137 unsigned int col =
cols_[i_col][icol];
1154 std::map<unsigned int, PixelFECConfigInterface*>::iterator iPixelFEC = pixelFECs.begin();
1155 for (; iPixelFEC != pixelFECs.end(); ++iPixelFEC) {
1156 iPixelFEC->second->qbufsend();
1161 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
1167 int tbmRegister = 14;
1169 string tbmChannel =
rocInfo_[
i].tbmChannel_;
1170 if (tbmChannel ==
"B")
1191 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
1212 std::vector<unsigned int>
tmp;
1214 std::pair<unsigned int, std::vector<unsigned int> > tmp2(hdw->
fednumber(),
tmp);
1221 for (
unsigned int k = 0;
k <
channels.size();
k++) {
1239 std::map<unsigned int, std::set<unsigned int> > fedsChannels;
1241 std::vector<PixelROCName>::iterator iroc =
rocs_.begin();
1243 for (; iroc !=
rocs_.end(); ++iroc) {
1245 unsigned int fednumber = roc_hdwaddress->
fednumber();
1246 unsigned int fedchannel = roc_hdwaddress->
fedchannel();
1247 fedsChannels[fednumber].insert(fedchannel);
1250 return fedsChannels;
1257 std::set<unsigned int> fedcrates;
1259 std::set<PixelModuleName>::iterator imodule =
modules_.begin();
1261 for (; imodule !=
modules_.end(); ++imodule) {
1263 for (std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin();
1264 channelsOnThisModule_itr != channelsOnThisModule.end();
1265 ++channelsOnThisModule_itr) {
1267 unsigned int fednumber = channel_hdwaddress.
fednumber();
1279 std::set<unsigned int> feccrates;
1281 std::set<PixelModuleName>::iterator imodule =
modules_.begin();
1283 for (; imodule !=
modules_.end(); ++imodule) {
1285 for (std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin();
1286 channelsOnThisModule_itr != channelsOnThisModule.end();
1287 ++channelsOnThisModule_itr) {
1289 unsigned int fecnumber = channel_hdwaddress.
fecnumber();
1299 const std::map<std::string, PixelPortCardConfig*>& mapNamePortCard,
1303 std::set<unsigned int> tkfeccrates;
1305 std::set<PixelModuleName>::iterator imodule =
modules_.begin();
1307 for (; imodule !=
modules_.end(); ++imodule) {
1309 const std::set<std::string> portCards = portcardmap->
portcards(*imodule);
1310 for (std::set<std::string>::const_iterator portCards_itr = portCards.begin(); portCards_itr != portCards.end();
1313 std::map<std::string, PixelPortCardConfig*>::const_iterator portcardconfig_itr =
1314 mapNamePortCard.find(portcardname);
1315 assert(portcardconfig_itr != mapNamePortCard.end());
1317 std::string TKFECID = portcardconfig->getTKFECID();
1326 if (!
calib.parameters_.empty()) {
1327 s <<
"Parameters:" << std::endl;
1328 for (std::map<std::string, std::string>::const_iterator paramItr =
calib.parameters_.begin();
1329 paramItr !=
calib.parameters_.end();
1331 s << paramItr->first <<
" " << paramItr->second << std::endl;
1335 s <<
"Rows:" << std::endl;
1336 for (
unsigned int i = 0;
i <
calib.rows_.size();
i++) {
1337 for (
unsigned int j = 0;
j <
calib.rows_[
i].size();
j++) {
1338 s <<
calib.rows_[
i][
j] <<
" " << std::endl;
1340 s <<
"|" << std::endl;
1343 s <<
"Cols:" << std::endl;
1344 for (
unsigned int i = 0;
i <
calib.cols_.size();
i++) {
1345 for (
unsigned int j = 0;
j <
calib.cols_[
i].size();
j++) {
1346 s <<
calib.cols_[
i][
j] <<
" " << std::endl;
1348 s <<
"|" << std::endl;
1351 s <<
"Vcal:" << std::endl;
1355 s <<
"Vcthr:" << std::endl;
1357 s <<
calib.dacs_[0].first() <<
" " <<
calib.dacs_[0].last() <<
" " <<
calib.dacs_[0].step() << std::endl;
1359 s <<
"CalDel:" << std::endl;
1361 s <<
calib.dacs_[1].first() <<
" " <<
calib.dacs_[0].last() <<
" " <<
calib.dacs_[1].step() << std::endl;
1363 s <<
"Repeat:" << std::endl;
1365 s <<
calib.ntrigger_ << std::endl;
1376 for (
unsigned int irow = 0; irow <
rows_[irows].size(); irow++) {
1377 for (
unsigned int icol = 0; icol <
cols_[icols].size(); icol++) {
1385 if (masks ==
nullptr || masks->
mask(
cols_[icols][icol],
rows_[irows][irow]))
1406 for (
unsigned int irow = 0; irow <
rows_[irows].size(); irow++) {
1407 for (
unsigned int icol = 0; icol <
cols_[icols].size(); icol++) {
1431 for (
unsigned int row = 0; row < 80; row++) {
1432 for (
unsigned int col = 0;
col < 52;
col++) {
1448 std::map<std::string, std::string>::const_iterator itr =
parameters_.find(parameterName);
1467 out <<
"SingleROC" << endl;
1469 out <<
"Parameters:" << endl;
1470 std::map<std::string, std::string>::const_iterator it =
parameters_.begin();
1472 out << it->first <<
" " << it->second << endl;
1475 out <<
"Rows:" << endl;
1476 for (
unsigned int i = 0;
i <
rows_.size();
i++) {
1477 for (
unsigned int j = 0;
j <
rows_[
i].size();
j++) {
1480 if (
i !=
rows_.size() - 1)
1484 out <<
"Cols:" << endl;
1485 for (
unsigned int i = 0;
i <
cols_.size();
i++) {
1486 for (
unsigned int j = 0;
j <
cols_[
i].size();
j++) {
1489 if (
i !=
cols_.size() - 1)
1495 out <<
"VcalHigh" << endl;
1497 out <<
"VcalLow" << endl;
1500 for (
unsigned int i = 0;
i <
dacs_.size();
i++) {
1501 if (
dacs_[
i].uniformSteps()) {
1503 out <<
"Scan: " <<
dacs_[
i].name() <<
" ";
1508 out <<
"Set: " <<
dacs_[
i].name() <<
" ";
1512 out <<
"ScanValues: " <<
dacs_[
i].name() <<
" ";
1513 for (
unsigned int ival = 0; ival <
dacs_[
i].getNPoints(); ival++) {
1516 out <<
" -1" << endl;
1520 out <<
"Repeat:" << endl;
1524 out <<
"Rocs:" << endl;
1526 out <<
"ToCalibrate:" << endl;
1541 unsigned int returnValue = 0;
1542 for (
std::vector<std::vector<unsigned int> >::const_iterator rows_itr =
rows_.begin(); rows_itr !=
rows_.end();
1544 for (
std::vector<std::vector<unsigned int> >::const_iterator cols_itr =
cols_.begin(); cols_itr !=
cols_.end();
1546 unsigned int theSize = rows_itr->size() * cols_itr->size();
1547 returnValue =
max(returnValue, theSize);
1554 std::set<std::pair<unsigned int, unsigned int> > pixels;
1563 pixels.insert(std::pair<unsigned int, unsigned int>(*col_itr, *row_itr));
1583 std::ofstream* outstream,
1584 std::ofstream* out1stream,
1585 std::ofstream* out2stream)
const {
1586 std::string mthn =
"[PixelCalibConfiguration::writeXMLHeader()]\t\t ";
1587 std::stringstream maskFullPath;
1592 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl;
1594 outstream->open(maskFullPath.str().c_str());
1596 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
1597 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
1598 *outstream <<
"" << std::endl;
1599 *outstream <<
" <!-- " << mthn <<
"-->" << std::endl;
1600 *outstream <<
"" << std::endl;
1601 *outstream <<
" <HEADER>" << std::endl;
1602 *outstream <<
" <TYPE>" << std::endl;
1603 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl;
1604 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl;
1605 *outstream <<
" </TYPE>" << std::endl;
1606 *outstream <<
" <RUN>" << std::endl;
1607 *outstream <<
" <RUN_TYPE>Gain Calibration</RUN_TYPE>" << std::endl;
1608 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
1610 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl;
1611 *outstream <<
" </RUN>" << std::endl;
1612 *outstream <<
" </HEADER>" << std::endl;
1613 *outstream <<
"" << std::endl;
1614 *outstream <<
" <DATA_SET>" << std::endl;
1615 *outstream <<
"" << std::endl;
1616 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl;
1617 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl;
1618 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl;
1619 *outstream <<
"" << std::endl;
1620 *outstream <<
" <PART>" << std::endl;
1621 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
1622 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
1623 *outstream <<
" </PART>" << std::endl;
1628 std::ofstream* out1stream,
1629 std::ofstream* out2stream)
const {
1630 std::string mthn =
"[PixelCalibConfiguration::writeXML()]\t\t ";
1632 *outstream <<
" " << std::endl;
1633 *outstream <<
" <DATA>" << std::endl;
1634 *outstream <<
" <CALIB_OBJ_DATA_FILE>./calib.dat</CALIB_OBJ_DATA_FILE>" << std::endl;
1635 *outstream <<
" <CALIB_TYPE>calib</CALIB_TYPE>" << std::endl;
1636 *outstream <<
" </DATA>" << std::endl;
1637 *outstream <<
" " << std::endl;
1642 std::ofstream* out1stream,
1643 std::ofstream* out2stream)
const {
1644 std::string mthn =
"[PixelCalibConfiguration::writeXMLTrailer()]\t\t ";
1646 *outstream <<
" </DATA_SET>" << std::endl;
1647 *outstream <<
"</ROOT>" << std::endl;
1650 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl;
void enablePixels(PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCMaskBits *masks, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
unsigned int ROCNumberOnChannelAmongThoseCalibrated(PixelROCName roc) const
bool rocAndModuleListsBuilt_
std::vector< std::vector< unsigned int > > rows_
This class specifies which FEC boards are used and how they are addressed.
std::set< PixelChannel > getChannelsOnModule(const PixelModuleName &aModule) const
This file contains the base class for "pixel configuration data" management.
std::vector< PixelROCName > getROCsFromModule(const PixelModuleName &aModule) const
std::set< unsigned int > getTKFECCrates(const PixelPortcardMap *portcardmap, const std::map< std::string, PixelPortCardConfig *> &mapNamePortCard, const PixelTKFECConfig *tkfecconfig) const
std::set< PixelChannel > channels_
void nextFECState(std::map< unsigned int, PixelFECConfigInterface *> &pixelFECs, PixelDetectorConfig *detconfig, PixelNameTranslation *trans, std::map< pos::PixelModuleName, pos::PixelMaskBase *> *masks, std::map< pos::PixelModuleName, pos::PixelTrimBase *> *trims, std::map< pos::PixelModuleName, pos::PixelDACSettings *> *dacss, unsigned int state) const
std::string parameterValue(std::string parameterName) const
const PixelChannel & getChannelForROC(const PixelROCName &aROC) const
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > fedCardsAndChannels_
std::string scanName(unsigned int iscan) const
PixelROCTrimBits * trims_
const unsigned int k_DACAddress_WBC
~PixelCalibConfiguration() override
unsigned int mfec() const
unsigned int scanROC(unsigned int state) const
std::set< unsigned int > getFECCrates(const PixelNameTranslation *translation, const PixelFECConfig *fecconfig) const
unsigned int crateFromTKFECID(std::string TKFECID) const
std::string getComment() const
const std::vector< PixelROCName > & getROCsFromChannel(const PixelChannel &aChannel) const
bool containsModule(const PixelModuleName &moduleToFind) const
std::string mode() const override
void buildROCAndModuleLists(const PixelNameTranslation *translation, const PixelDetectorConfig *detconfig)
std::vector< PixelROCInfo > rocInfo_
bool containsScan(std::string name) const
unsigned int fedchannel() const
const std::vector< PixelModuleName > & getModuleList() const
void buildROCAndModuleListsFromROCSet(const std::set< PixelROCName > &rocSet)
unsigned int scanCounter(std::string dac, unsigned int state) const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
bool objectsDependingOnTheNameTranslationBuilt_
std::vector< PixelDACScanRange > dacs_
const std::set< PixelModuleName > & moduleList() const
unsigned int crateFromFECNumber(unsigned int fecnumber) const
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
unsigned int portaddress() const
unsigned int colCounter(unsigned int state) const
const PixelHdwAddress * hdwadd_
void disablePixels(PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
std::string TBMChannelString() const
bool scanningROCForState(PixelROCName roc, unsigned int state) const
PixelCalibConfiguration(std::string filename="")
unsigned int iScan(std::string dac) const
std::vector< std::pair< unsigned int, unsigned int > > defaultDACs_
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
unsigned int numberOfScanVariables() const
This class specifies which TKFEC boards are used and how they are addressed.
std::map< unsigned int, std::set< unsigned int > > getFEDsAndChannels(PixelNameTranslation *translation)
unsigned int nConfigurations() const
This class implements the steps that are used in a scan over Threshold and CalDelay.
Abs< T >::type abs(const T &t)
This is the documentation about PixelDetectorConfig...
std::string modulename() const
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > & fedCardsAndChannels(unsigned int crate, PixelNameTranslation *translation, PixelFEDConfig *fedconfig, PixelDetectorConfig *detconfig) const
Store mfec, mfecchannel etc.
std::vector< std::string > rocListInstructions_
const std::map< PixelROCName, PixelROCStatus > & getROCsList() const
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
unsigned int mfecchannel() const
const std::string k_DACName_Vcal
unsigned int rocid() const
PixelROCMaskBits * masks_
This is the documentation about PixelNameTranslation...
std::map< PixelROCName, unsigned int > ROCNumberOnChannelAmongThoseCalibrated_
unsigned int fecnumber() const
const std::set< std::string > portcards(const PixelModuleName &aModule) const
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
std::set< PixelModuleName > modules_
unsigned int rowCounter(unsigned int state) const
virtual int progpix(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int coladdr, int rowaddress, unsigned char databyte, bool buffermode=false)=0
void writeASCII(std::string dir="") const override
unsigned int maxNumHitsPerROC() const
std::map< std::string, std::string > parameters_
This is the documentation about PixelNameTranslation...
std::vector< int > old_irows
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
unsigned int numROCsCalibratedOnChannel(PixelROCName roc) const
std::list< const PixelROCName * > getROCs() const
This is the documentation about PixelFEDConfig...
std::vector< PixelROCName > rocs_
unsigned int nScanPoints() const
std::string getAuthor() const
A dummy class with ALL public variables.
unsigned int crateFromFEDNumber(unsigned int fednumber) const
void buildObjectsDependingOnTheNameTranslation(const PixelNameTranslation *aNameTranslation)
std::map< PixelROCName, unsigned int > numROCsCalibratedOnChannel_
unsigned int trim(unsigned int col, unsigned int row) const
unsigned int hubaddress() const
std::vector< std::vector< unsigned int > > cols_
std::set< unsigned int > getFEDCrates(const PixelNameTranslation *translation, const PixelFEDConfig *fedconfig) const
std::string calibFileContent_
unsigned int fednumber() const
unsigned int mask(unsigned int col, unsigned int row) const
std::set< std::pair< unsigned int, unsigned int > > pixelsWithHits(unsigned int state) const
void clear(ROCstatus stat)
This class implements the steps that are used in a scan over Threshold and CalDelay.
std::vector< int > old_icols