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:") {
105 assert(tmp ==
"Rows:");
109 std::vector<unsigned int>
rows;
110 while (tmp !=
"Cols:") {
112 rows_.push_back(rows);
116 rows.push_back(atoi(tmp.c_str()));
121 rows_.push_back(rows);
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:")) {
159 in >> first >> last >>
step;
160 unsigned int index = 1;
161 if (!
dacs_.empty()) {
162 index =
dacs_.back().index() *
dacs_.back().getNPoints();
171 dacs_.push_back(dacrange);
174 while (tmp ==
"Scan:" || tmp ==
"ScanValues:") {
175 if (tmp ==
"ScanValues:") {
178 vector<unsigned int>
values;
182 values.push_back(val);
185 unsigned int index = 1;
186 if (!
dacs_.empty()) {
187 index =
dacs_.back().index() *
dacs_.back().getNPoints();
190 dacs_.push_back(dacrange);
196 in >> first >> last >>
step;
197 unsigned int index = 1;
198 if (!
dacs_.empty()) {
199 index =
dacs_.back().index() *
dacs_.back().getNPoints();
208 dacs_.push_back(dacrange);
212 while ((tmp ==
"Set:") || (tmp ==
"SetRelative:")) {
217 unsigned int index = 1;
219 index =
dacs_.back().index() *
dacs_.back().getNPoints();
221 if (tmp ==
"SetRelative:") {
224 dacs_.push_back(dacrange);
229 assert(tmp ==
"Repeat:");
236 bool buildROCListNow =
false;
237 if (tmp ==
"Rocs:") {
238 buildROCListNow =
true;
241 assert(tmp ==
"ToCalibrate:");
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 ";
290 std::ifstream
in(filename.c_str());
293 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open:" << filename << std::endl;
296 std::cout << __LINE__ <<
"]\t" << mthn <<
"Opened:" << 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:") {
333 assert(tmp ==
"Rows:");
337 std::vector<unsigned int>
rows;
338 while (tmp !=
"Cols:") {
340 rows_.push_back(rows);
344 rows.push_back(atoi(tmp.c_str()));
349 rows_.push_back(rows);
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:")) {
387 in >> first >> last >>
step;
388 unsigned int index = 1;
389 if (!
dacs_.empty()) {
390 index =
dacs_.back().index() *
dacs_.back().getNPoints();
399 dacs_.push_back(dacrange);
402 while (tmp ==
"Scan:" || tmp ==
"ScanValues:") {
403 if (tmp ==
"ScanValues:") {
406 vector<unsigned int>
values;
410 values.push_back(val);
413 unsigned int index = 1;
414 if (!
dacs_.empty()) {
415 index =
dacs_.back().index() *
dacs_.back().getNPoints();
418 dacs_.push_back(dacrange);
424 in >> first >> last >>
step;
425 unsigned int index = 1;
426 if (!
dacs_.empty()) {
427 index =
dacs_.back().index() *
dacs_.back().getNPoints();
436 dacs_.push_back(dacrange);
440 while ((tmp ==
"Set:") || (tmp ==
"SetRelative:")) {
445 unsigned int absval =
std::abs(val);
446 unsigned int index = 1;
448 index =
dacs_.back().index() *
dacs_.back().getNPoints();
450 if (tmp ==
"SetRelative:") {
456 dacs_.push_back(dacrange);
461 assert(tmp ==
"Repeat:");
468 bool buildROCListNow =
false;
469 if (tmp ==
"Rocs:") {
470 buildROCListNow =
true;
473 assert(tmp ==
"ToCalibrate:");
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);
518 calibFileContent_ += tmpString +
"\n";
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();
562 moduleList_itr != moduleList.end();
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 {
783 unsigned int i_threshold =
scanCounter(iscan, state);
786 if (
dacs_[iscan].mixValuesAcrossROCs())
806 return scanValue(iscan, state, ROCNumber, ROCsOnChannel);
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);
840 assert(i_row <
rows_.size());
848 assert(i_col <
cols_.size());
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;
901 rocInfo.
trims_ = (*trims)[module]->getTrimBits(
rocs_[i]);
902 rocInfo.
masks_ = (*masks)[module]->getMaskBits(
rocs_[i]);
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++) {
958 if (state == 0 && (mode == 0 || mode == 1)) {
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")
1189 assert(!
rocs_.empty());
1191 for (
unsigned int i = 0;
i <
rocs_.size();
i++) {
1196 assert(hdw !=
nullptr);
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;
1240 assert(!
rocs_.empty());
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();
1327 s <<
"Parameters:" << std::endl;
1328 for (std::map<std::string, std::string>::const_iterator paramItr = calib.
parameters_.begin();
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;
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);
1463 std::ofstream
out(filename.c_str());
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;
1560 for (std::vector<unsigned int>::const_iterator row_itr =
rows_[
rowCounter(state)].begin();
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;
std::vector< PixelROCName > getROCsFromModule(const PixelModuleName &aModule) const
unsigned int mfec() const
bool rocAndModuleListsBuilt_
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
std::set< unsigned int > getFEDCrates(const PixelNameTranslation *translation, const PixelFEDConfig *fedconfig) const
std::vector< std::vector< unsigned int > > rows_
bool scanningROCForState(PixelROCName roc, unsigned int state) const
This class specifies which FEC boards are used and how they are addressed.
unsigned int nScanPoints() const
This file contains the base class for "pixel configuration data" management.
unsigned int crateFromTKFECID(std::string TKFECID) const
unsigned int numberOfScanVariables() const
unsigned int crateFromFEDNumber(unsigned int fednumber) const
std::set< PixelChannel > channels_
void disablePixels(PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > fedCardsAndChannels_
PixelROCTrimBits * trims_
const unsigned int k_DACAddress_WBC
~PixelCalibConfiguration() override
const std::set< PixelModuleName > & moduleList() const
std::string mode() const override
unsigned int portaddress() const
void buildROCAndModuleLists(const PixelNameTranslation *translation, const PixelDetectorConfig *detconfig)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
std::vector< PixelROCInfo > rocInfo_
unsigned int fednumber() const
std::set< unsigned int > getFECCrates(const PixelNameTranslation *translation, const PixelFECConfig *fecconfig) const
unsigned int trim(unsigned int col, unsigned int row) const
std::set< unsigned int > getTKFECCrates(const PixelPortcardMap *portcardmap, const std::map< std::string, PixelPortCardConfig * > &mapNamePortCard, const PixelTKFECConfig *tkfecconfig) const
unsigned int rowCounter(unsigned int state) const
unsigned int numROCsCalibratedOnChannel(PixelROCName roc) const
unsigned int rocid() const
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > & fedCardsAndChannels(unsigned int crate, PixelNameTranslation *translation, PixelFEDConfig *fedconfig, PixelDetectorConfig *detconfig) const
void buildROCAndModuleListsFromROCSet(const std::set< PixelROCName > &rocSet)
std::string TBMChannelString() const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
bool objectsDependingOnTheNameTranslationBuilt_
std::vector< PixelDACScanRange > dacs_
bool containsScan(std::string name) const
unsigned int mfecchannel() const
unsigned int crateFromFECNumber(unsigned int fecnumber) const
const PixelHdwAddress * hdwadd_
unsigned int maxNumHitsPerROC() const
PixelCalibConfiguration(std::string filename="")
std::vector< std::pair< unsigned int, unsigned int > > defaultDACs_
void writeASCII(std::string dir="") const override
This class specifies which TKFEC boards are used and how they are addressed.
unsigned int iScan(std::string dac) const
std::map< unsigned int, std::set< unsigned int > > getFEDsAndChannels(PixelNameTranslation *translation)
This class implements the steps that are used in a scan over Threshold and CalDelay.
std::string getComment() const
unsigned int fedchannel() const
unsigned int hubaddress() const
Abs< T >::type abs(const T &t)
unsigned int colCounter(unsigned int state) const
This is the documentation about PixelDetectorConfig...
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
Store mfec, mfecchannel etc.
unsigned int nConfigurations() const
std::vector< std::string > rocListInstructions_
std::set< std::pair< unsigned int, unsigned int > > pixelsWithHits(unsigned int state) const
std::string getAuthor() const
const std::string k_DACName_Vcal
std::string parameterValue(std::string parameterName) const
PixelROCMaskBits * masks_
const std::vector< PixelModuleName > & getModuleList() const
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
This is the documentation about PixelNameTranslation...
std::map< PixelROCName, unsigned int > ROCNumberOnChannelAmongThoseCalibrated_
unsigned int scanCounter(std::string dac, unsigned int state) const
std::string modulename() const
std::set< PixelModuleName > modules_
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
virtual int progpix(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int coladdr, int rowaddress, unsigned char databyte, bool buffermode=false)=0
std::list< const PixelROCName * > getROCs() const
void enablePixels(PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCMaskBits *masks, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
std::set< PixelChannel > getChannelsOnModule(const PixelModuleName &aModule) const
std::map< std::string, std::string > parameters_
unsigned int ROCNumberOnChannelAmongThoseCalibrated(PixelROCName roc) const
This is the documentation about PixelNameTranslation...
std::vector< int > old_irows
unsigned int scanROC(unsigned int state) const
This is the documentation about PixelFEDConfig...
std::vector< PixelROCName > rocs_
bool containsModule(const PixelModuleName &moduleToFind) const
unsigned int mask(unsigned int col, unsigned int row) const
const std::set< std::string > portcards(const PixelModuleName &aModule) const
std::string scanName(unsigned int iscan) const
const std::vector< PixelROCName > & getROCsFromChannel(const PixelChannel &aChannel) const
unsigned int fecnumber() const
A dummy class with ALL public variables.
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
void buildObjectsDependingOnTheNameTranslation(const PixelNameTranslation *aNameTranslation)
const std::map< PixelROCName, PixelROCStatus > & getROCsList() const
std::map< PixelROCName, unsigned int > numROCsCalibratedOnChannel_
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
std::vector< std::vector< unsigned int > > cols_
std::string calibFileContent_
const PixelChannel & getChannelForROC(const PixelROCName &aROC) 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