27 std::string mthn =
"[PixelCalibConfiguration::PixelCalibConfiguration()]\t " ;
28 std::map<std::string , int > colM;
29 std::vector<std::string > colNames;
44 colNames.push_back(
"CONFIG_KEY" );
45 colNames.push_back(
"KEY_TYPE" );
46 colNames.push_back(
"KEY_ALIAS" );
47 colNames.push_back(
"VERSION" );
48 colNames.push_back(
"KIND_OF_COND" );
49 colNames.push_back(
"CALIB_TYPE" );
50 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
51 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
53 for(
unsigned int c = 0 ;
c < tableMat[0].size() ;
c++)
55 for(
unsigned int n=0;
n<colNames.size();
n++)
57 if(tableMat[0][
c] == colNames[
n])
59 colM[colNames[
n]] =
c;
64 for(
unsigned int n=0;
n<colNames.size();
n++)
66 if(colM.find(colNames[
n]) == colM.end())
68 std::cerr << mthn <<
"Couldn't find in the database the column with name " << colNames[
n] << std::endl;
75 std::istringstream
in ;
76 in.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]) ;
84 std::cout << __LINE__ <<
"]\t" << mthn <<
"mode=" << mode_ << std::endl;
87 mode_=
"FEDChannelOffsetPixel";
88 std::cout << __LINE__ <<
"]\t" << mthn <<
"mode not set, is this an old file? "
95 if (tmp==
"SingleROC") {
101 if (tmp==
"Parameters:") {
113 assert(tmp==
"Rows:");
117 std::vector <unsigned int>
rows;
118 while (tmp!=
"Cols:"){
120 rows_.push_back(rows);
125 rows.push_back(atoi(tmp.c_str()));
130 rows_.push_back(rows);
135 std::vector <unsigned int> cols;
136 while ((tmp!=
"VcalLow:")&&(tmp!=
"VcalHigh:")&&
137 (tmp!=
"Vcal:")&&(tmp!=
"VcalHigh")&&(tmp!=
"VcalLow")){
139 cols_.push_back(cols);
144 cols.push_back(atoi(tmp.c_str()));
149 cols_.push_back(cols);
154 if (tmp==
"VcalLow") {
159 if (tmp==
"VcalHigh") {
164 if (tmp==
"VcalLow:") {
168 if ((tmp==
"VcalLow:")||(tmp==
"VcalHigh:")||(tmp==
"Vcal:")){
170 in >> first >> last >>
step;
171 unsigned int index=1;
172 if (
dacs_.size()>0) {
173 index=
dacs_.back().index()*
dacs_.back().getNPoints();
183 dacs_.push_back(dacrange);
188 while(tmp==
"Scan:"||tmp==
"ScanValues:"){
189 if (tmp==
"ScanValues:"){
192 vector<unsigned int>
values;
196 values.push_back(val);
199 unsigned int index=1;
200 if (
dacs_.size()>0) {
201 index=
dacs_.back().index()*
dacs_.back().getNPoints();
204 dacs_.push_back(dacrange);
211 in >> first >> last >>
step;
212 unsigned int index=1;
213 if (
dacs_.size()>0) {
214 index=
dacs_.back().index()*
dacs_.back().getNPoints();
224 dacs_.push_back(dacrange);
228 while ((tmp==
"Set:")||(tmp==
"SetRelative:")){
233 unsigned int index=1;
234 if (
dacs_.size()>0) index=
dacs_.back().index()*
dacs_.back().getNPoints();
236 if (tmp==
"SetRelative:") {
239 dacs_.push_back(dacrange);
244 assert(tmp==
"Repeat:");
251 bool buildROCListNow =
false;
252 if ( tmp==
"Rocs:" ) {
253 buildROCListNow =
true;
256 else { assert(tmp==
"ToCalibrate:"); buildROCListNow =
false; }
268 if( tmp==
"all" || tmp==
"+" || tmp==
"-" ){
269 buildROCListNow=
false;
273 if ( tmp==
"" )
continue;
278 if ( buildROCListNow )
280 std::set<PixelROCName> rocSet;
284 rocSet.insert(rocname);
303 std::string mthn =
"[PixelCalibConfiguration::PixelCalibConfiguration()]\t " ;
307 std::ifstream
in(filename.c_str());
310 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open:"<<filename<<std::endl;
314 std::cout << __LINE__ <<
"]\t" << mthn <<
"Opened:"<<filename<<std::endl;
323 std::cout << __LINE__ <<
"]\t" << mthn <<
"PixelCalibConfiguration mode="<<mode_<< std::endl;
326 mode_=
"FEDChannelOffsetPixel";
327 std::cout << __LINE__ <<
"]\t" << mthn <<
"PixelCalibConfiguration mode not set, is this an old file? "
328 << __LINE__ <<
"]\t" << std::endl;
334 if (tmp==
"SingleROC") {
340 if (tmp==
"Parameters:") {
352 assert(tmp==
"Rows:");
356 std::vector <unsigned int>
rows;
357 while (tmp!=
"Cols:"){
359 rows_.push_back(rows);
364 rows.push_back(atoi(tmp.c_str()));
369 rows_.push_back(rows);
374 std::vector <unsigned int> cols;
375 while ((tmp!=
"VcalLow:")&&(tmp!=
"VcalHigh:")&&
376 (tmp!=
"Vcal:")&&(tmp!=
"VcalHigh")&&(tmp!=
"VcalLow")){
378 cols_.push_back(cols);
383 cols.push_back(atoi(tmp.c_str()));
388 cols_.push_back(cols);
393 if (tmp==
"VcalLow") {
398 if (tmp==
"VcalHigh") {
403 if (tmp==
"VcalLow:") {
407 if ((tmp==
"VcalLow:")||(tmp==
"VcalHigh:")||(tmp==
"Vcal:")){
409 in >> first >> last >>
step;
410 unsigned int index=1;
411 if (
dacs_.size()>0) {
412 index=
dacs_.back().index()*
dacs_.back().getNPoints();
422 dacs_.push_back(dacrange);
427 while(tmp==
"Scan:"||tmp==
"ScanValues:"){
428 if (tmp==
"ScanValues:"){
431 vector<unsigned int>
values;
435 values.push_back(val);
438 unsigned int index=1;
439 if (
dacs_.size()>0) {
440 index=
dacs_.back().index()*
dacs_.back().getNPoints();
443 dacs_.push_back(dacrange);
450 in >> first >> last >>
step;
451 unsigned int index=1;
452 if (
dacs_.size()>0) {
453 index=
dacs_.back().index()*
dacs_.back().getNPoints();
463 dacs_.push_back(dacrange);
467 while ((tmp==
"Set:")||(tmp==
"SetRelative:")){
473 unsigned int index=1;
474 if (
dacs_.size()>0) index=
dacs_.back().index()*
dacs_.back().getNPoints();
476 if (tmp==
"SetRelative:") {
482 dacs_.push_back(dacrange);
487 assert(tmp==
"Repeat:");
494 bool buildROCListNow =
false;
495 if ( tmp==
"Rocs:" ) {
496 buildROCListNow =
true;
499 else { assert(tmp==
"ToCalibrate:"); buildROCListNow =
false; }
511 if( tmp==
"all" || tmp==
"+" || tmp==
"-" ){
512 buildROCListNow=
false;
516 if ( tmp==
"" )
continue;
523 if ( buildROCListNow )
525 std::set<PixelROCName> rocSet;
529 rocSet.insert(rocname);
537 std::ifstream inTmp(filename.c_str());
542 getline (inTmp, tmpString);
543 calibFileContent_ += tmpString +
"\n";
557 assert( translation != 0 );
558 assert( detconfig != 0 );
567 std::set<PixelROCName> rocSet;
569 const map<PixelROCName, PixelROCStatus>& iroclist=detconfig->
getROCsList();
572 std::string instruction = *rocListInstructions_itr;
574 if ( instruction ==
"+" )
579 if ( instruction ==
"-" )
585 if ( instruction ==
"all" )
590 for ( std::vector <PixelModuleName>::const_iterator moduleList_itr = moduleList.begin(); moduleList_itr != moduleList.end(); moduleList_itr++ )
592 std::vector<PixelROCName> ROCsOnThisModule = translation->
getROCsFromModule( *moduleList_itr );
593 for ( std::vector<PixelROCName>::const_iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin(); ROCsOnThisModule_itr != ROCsOnThisModule.end(); ROCsOnThisModule_itr++ ) {
594 map<PixelROCName, PixelROCStatus>::const_iterator it=
595 iroclist.find(*ROCsOnThisModule_itr);
596 assert(it!=iroclist.end());
599 rocSet.insert(*ROCsOnThisModule_itr);
623 std::vector<PixelROCName> ROCsOnThisModule = translation->
getROCsFromModule( modulename );
624 for ( std::vector<PixelROCName>::iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin(); ROCsOnThisModule_itr != ROCsOnThisModule.end(); ROCsOnThisModule_itr++ )
627 map<PixelROCName, PixelROCStatus>::const_iterator it= iroclist.find(*ROCsOnThisModule_itr);
628 assert(it!=iroclist.end());
632 else rocSet.erase( *ROCsOnThisModule_itr);
643 bool foundIt =
false;
644 std::list<const PixelROCName*> allROCs = translation->
getROCs();
645 for ( std::list<const PixelROCName*>::iterator allROCs_itr = allROCs.begin(); allROCs_itr != allROCs.end(); allROCs_itr++ )
647 if ( (*(*allROCs_itr)) == rocname )
654 map<PixelROCName, PixelROCStatus>::const_iterator it= iroclist.find(rocname);
655 assert(it!=iroclist.end());
662 rocSet.erase(rocname);
683 std::string mthn =
"[PixelCalibConfiguration::buildROCAndModuleListsFromROCSet()] " ;
685 for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin();
686 rocSet_itr != rocSet.end();
688 rocs_.push_back(*rocSet_itr);
696 std::map <PixelModuleName,unsigned int> countROC;
697 for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin(); rocSet_itr != rocSet.end(); rocSet_itr++ ){
703 countROC[modulename]++;
730 for (std::map<PixelModuleName,unsigned int>::iterator imodule=countROC.begin();imodule!=countROC.end();++imodule) {
731 if (imodule->second>maxROCs) maxROCs=imodule->second;
735 std::cout << __LINE__ <<
"]\t" << mthn <<
"Max ROCs on a module="<<
nROC_<<std::endl;
738 for(
unsigned int irocs=0;irocs<
rocs_.size();irocs++){
751 assert( aNameTranslation != 0 );
755 for (std::vector<PixelROCName>::const_iterator rocs_itr =
rocs_.begin(); rocs_itr !=
rocs_.end(); ++rocs_itr)
764 std::set<PixelROCName> tempROCs;
766 for(std::vector<PixelROCName>::const_iterator it=
rocs_.begin();it!=
rocs_.end();it++){
767 tempROCs.insert(*it);
771 for ( std::set<PixelChannel>::const_iterator channels_itr =
channels_.begin();
775 std::vector<PixelROCName> rocsOnChannel =
778 std::set<PixelROCName> foundROCs;
780 for ( std::vector<PixelROCName>::const_iterator rocsOnChannel_itr = rocsOnChannel.begin();
781 rocsOnChannel_itr != rocsOnChannel.end();
782 rocsOnChannel_itr++ ) {
784 if ( tempROCs.find(*rocsOnChannel_itr) != tempROCs.end() ){
786 foundROCs.insert(*rocsOnChannel_itr);
790 for ( std::set<PixelROCName>::const_iterator foundROCs_itr = foundROCs.begin();
791 foundROCs_itr != foundROCs.end();
803 for (
unsigned int i=0;
i<
dacs_.size();
i++){
807 std::cout << __LINE__ <<
"]\t[PixelCalibConfiguration::iScan()]\t\t could not find dac="
830 unsigned int ROCNumber,
831 unsigned int ROCsOnChannel)
const{
833 unsigned int i_threshold =
scanCounter(iscan, state);
836 if (
dacs_[iscan].mixValuesAcrossROCs() ) i_threshold = (i_threshold + (
nScanPoints(iscan)*ROCNumber)/ROCsOnChannel)%
nScanPoints(iscan);
859 return scanValue( iscan, state, ROCNumber, ROCsOnChannel );
867 return foundROC->second;
875 return foundROC->second;
879 unsigned int state)
const{
886 for(
unsigned int i=0;
i<iscan;
i++){
890 unsigned int i_threshold=i_scan%
nScanPoints(iscan);
899 assert(i_row<
rows_.size());
906 assert(i_col<
cols_.size());
913 std::map<pos::PixelModuleName,pos::PixelMaskBase*>*
masks,
914 std::map<pos::PixelModuleName,pos::PixelTrimBase*>* trims,
915 std::map<pos::PixelModuleName,pos::PixelDACSettings*>* dacs,
917 unsigned int state)
const {
919 std::string mthn =
"[PixelCalibConfiguration::nextFECState()]\t\t " ;
924 if (modeName==
"maskAllPixel") mode=0;
925 if (modeName==
"useAllPixel"||modeName==
"") mode=1;
926 if (modeName==
"default") mode=2;
928 static bool first=
true;
931 cout << __LINE__ <<
"]\t" << mthn <<
"mode="<<mode<<endl;
936 cout << __LINE__ <<
"]\t" << mthn <<
"ScanMode=" << modeName
937 <<
" not understood."<< endl;
943 for(
unsigned int i=0;
i<
rocs_.size();
i++){
950 std::map<pos::PixelModuleName,pos::PixelMaskBase*>::const_iterator foundMask = masks->find(module);
951 if (foundMask==masks->end()){
970 std::map<std::string, unsigned int> defaultDACValues;
973 for ( std::vector<PixelDACScanRange>::const_iterator dacs_itr =
dacs_.begin(); dacs_itr !=
dacs_.end(); dacs_itr++ )
975 std::map<std::string, unsigned int>::const_iterator foundThisDAC = defaultDACValues.find(dacs_itr->name());
976 assert( foundThisDAC != defaultDACValues.end() );
978 pair<unsigned int, unsigned int>
979 dacchannelAndValue(dacs_itr->dacchannel(),
980 foundThisDAC->second);
990 bool changedWBC=
false;
1012 unsigned int first_scan=
true;
1013 for (
unsigned int i=0;
i<
dacs_.size();
i++){
1018 if (state==0&&(mode==0||mode==1)) {
1020 for(
unsigned int i=0;
i<
rocs_.size();
i++){
1045 if (first_scan && state!=0 && mode!=2){
1047 unsigned int previousState=state-1;
1049 unsigned int i_row_previous=
rowCounter(previousState);
1051 unsigned int i_col_previous=
colCounter(previousState);
1053 for(
unsigned int i=0;
i<
rocs_.size();
i++){
1062 for (
unsigned int j=0;
j<
dacs_.size();
j++ ) {
1100 for(
unsigned int i=0;
i<
rocs_.size();
i++){
1132 if (
dacs_[
ii].negative()) dacvalue=-dacvalue;
1164 if (mode==1) rocMasks=0;
1182 unsigned int roccontrolword=(*dacs)[
module]->getDACSettings(
rocs_[i])->getControlRegister();
1188 else roccontrolword&=0xfb;
1209 unsigned int nrow=
rows_[i_row].size();
1210 unsigned int ncol=
cols_[i_col].size();
1211 unsigned int nmax=
std::max(nrow,ncol);
1212 if (nrow==0||ncol==0) nmax=0;
1213 for (
unsigned int n=0;
n<nmax;
n++){
1214 unsigned int irow=
n;
1215 unsigned int icol=
n;
1216 if (irow>=nrow) irow=nrow-1;
1217 if (icol>=ncol) icol=ncol-1;
1218 unsigned int row=
rows_[i_row][irow];
1219 unsigned int col=
cols_[i_col][icol];
1235 std::map<unsigned int, PixelFECConfigInterface*>::iterator iPixelFEC=pixelFECs.begin();
1236 for(;iPixelFEC!=pixelFECs.end();++iPixelFEC){
1237 iPixelFEC->second->qbufsend();
1242 for(
unsigned int i=0;
i<
rocs_.size();
i++){
1248 int tbmRegister = 14;
1250 string tbmChannel =
rocInfo_[
i].tbmChannel_;
1251 if( tbmChannel==
"B") tbmRegister = 15;
1272 assert(
rocs_.size()!=0);
1274 for(
unsigned int i=0;
i<
rocs_.size();
i++){
1293 std::vector<unsigned int>
tmp;
1295 std::pair<unsigned int, std::vector<unsigned int> > tmp2(hdw->
fednumber(),
tmp);
1302 for(
unsigned int k=0;
k<channels.size();
k++){
1308 if (found)
continue;
1322 std::map <unsigned int, std::set<unsigned int> > fedsChannels;
1323 assert(
rocs_.size()!=0);
1324 std::vector<PixelROCName>::iterator iroc=
rocs_.begin();
1326 for (;iroc!=
rocs_.end();++iroc){
1328 unsigned int fednumber=roc_hdwaddress->
fednumber();
1329 unsigned int fedchannel=roc_hdwaddress->
fedchannel();
1330 fedsChannels[fednumber].insert(fedchannel);
1333 return fedsChannels;
1340 std::set<unsigned int> fedcrates;
1342 std::set<PixelModuleName>::iterator imodule=
modules_.begin();
1344 for (;imodule!=
modules_.end();++imodule)
1347 for ( std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin(); channelsOnThisModule_itr != channelsOnThisModule.end(); channelsOnThisModule_itr++ )
1350 unsigned int fednumber=channel_hdwaddress.
fednumber();
1362 std::set<unsigned int> feccrates;
1364 std::set<PixelModuleName>::iterator imodule=
modules_.begin();
1366 for (;imodule!=
modules_.end();++imodule)
1369 for ( std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin(); channelsOnThisModule_itr != channelsOnThisModule.end(); channelsOnThisModule_itr++ )
1372 unsigned int fecnumber=channel_hdwaddress.
fecnumber();
1384 std::set<unsigned int> tkfeccrates;
1386 std::set<PixelModuleName>::iterator imodule=
modules_.begin();
1388 for (;imodule!=
modules_.end();++imodule)
1391 const std::set< std::string > portCards = portcardmap->
portcards(*imodule);
1392 for ( std::set< std::string >::const_iterator portCards_itr = portCards.begin(); portCards_itr != portCards.end(); ++portCards_itr)
1395 std::map<std::string,PixelPortCardConfig*>::const_iterator portcardconfig_itr = mapNamePortCard.find(portcardname);
1396 assert(portcardconfig_itr != mapNamePortCard.end());
1398 std::string TKFECID = portcardconfig->getTKFECID();
1409 s<<
"Parameters:"<<std::endl;
1410 for ( std::map<std::string, std::string>::const_iterator paramItr = calib.
parameters_.begin(); paramItr != calib.
parameters_.end(); ++paramItr )
1412 s<< paramItr->first <<
" " << paramItr->second << std::endl;
1416 s<<
"Rows:"<<std::endl;
1417 for (
unsigned int i=0;
i<calib.
rows_.size();
i++){
1418 for (
unsigned int j=0;
j<calib.
rows_[
i].size();
j++){
1419 s<<calib.
rows_[
i][
j]<<
" "<<std::endl;
1424 s<<
"Cols:"<<std::endl;
1425 for (
unsigned int i=0;
i<calib.
cols_.size();
i++){
1426 for (
unsigned int j=0;
j<calib.
cols_[
i].size();
j++){
1427 s<<calib.
cols_[
i][
j]<<
" "<<std::endl;
1432 s <<
"Vcal:"<<std::endl;
1436 s <<
"Vcthr:"<<std::endl;
1438 s << calib.
dacs_[0].first() <<
" " << calib.
dacs_[0].last()
1439 <<
" "<< calib.
dacs_[0].step()<<std::endl;
1441 s <<
"CalDel:"<<std::endl;
1443 s << calib.
dacs_[1].first() <<
" " << calib.
dacs_[0].last()
1444 <<
" "<< calib.
dacs_[1].step()<<std::endl;
1446 s <<
"Repeat:"<<std::endl;
1462 for (
unsigned int irow=0;irow<
rows_[irows].size();irow++){
1463 for (
unsigned int icol=0;icol<
cols_[icols].size();icol++){
1487 unsigned int irows,
unsigned int icols,
1491 for (
unsigned int irow=0;irow<
rows_[irows].size();irow++){
1492 for (
unsigned int icol=0;icol<
cols_[icols].size();icol++){
1517 for (
unsigned int row=0;row<80;row++){
1534 std::map<std::string, std::string>::const_iterator itr =
parameters_.find(parameterName);
1550 if (dir!=
"") dir+=
"/";
1552 std::ofstream
out(filename.c_str());
1557 out <<
"Parameters:"<<endl;
1558 std::map<std::string, std::string>::const_iterator it=
parameters_.begin();
1560 out << it->first <<
" " << it->second <<endl;
1563 out <<
"Rows:" <<endl;
1564 for (
unsigned int i=0;
i<
rows_.size();
i++){
1565 for (
unsigned int j=0;
j<
rows_[
i].size();
j++){
1571 out <<
"Cols:" <<endl;
1572 for (
unsigned int i=0;
i<
cols_.size();
i++){
1573 for (
unsigned int j=0;
j<
cols_[
i].size();
j++){
1581 out <<
"VcalHigh" << endl;
1584 out <<
"VcalLow" << endl;
1588 for (
unsigned int i=0;
i<
dacs_.size();
i++){
1589 if (
dacs_[
i].uniformSteps()) {
1602 out <<
"ScanValues: "<<
dacs_[
i].name()<<
" ";
1603 for(
unsigned int ival=0;ival<
dacs_[
i].getNPoints();ival++){
1610 out <<
"Repeat:" <<endl;
1614 out <<
"Rocs:"<< endl;
1617 out <<
"ToCalibrate:"<< endl;
1635 unsigned int returnValue = 0;
1636 for ( std::vector<std::vector<unsigned int> >::const_iterator rows_itr =
rows_.begin(); rows_itr !=
rows_.end(); rows_itr++ )
1638 for ( std::vector<std::vector<unsigned int> >::const_iterator cols_itr =
cols_.begin(); cols_itr !=
cols_.end(); cols_itr++ )
1640 unsigned int theSize = rows_itr->size()*cols_itr->size();
1641 returnValue =
max( returnValue, theSize );
1649 std::set< std::pair<unsigned int, unsigned int> > pixels;
1654 for ( std::vector<unsigned int>::const_iterator row_itr =
rows_[
rowCounter(state)].begin(); row_itr !=
rows_[
rowCounter(state)].end(); row_itr++ )
1656 pixels.insert( std::pair<unsigned int, unsigned int>( *col_itr, *row_itr ) );
1679 std::ofstream *outstream,
1680 std::ofstream *out1stream,
1681 std::ofstream *out2stream)
const
1683 std::string mthn =
"[PixelCalibConfiguration::writeXMLHeader()]\t\t " ;
1684 std::stringstream maskFullPath ;
1689 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl ;
1691 outstream->open(maskFullPath.str().c_str()) ;
1693 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
1694 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
1695 *outstream <<
"" << std::endl ;
1696 *outstream <<
" <!-- " << mthn <<
"-->" << std::endl ;
1697 *outstream <<
"" << std::endl ;
1698 *outstream <<
" <HEADER>" << std::endl ;
1699 *outstream <<
" <TYPE>" << std::endl ;
1700 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl ;
1701 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl ;
1702 *outstream <<
" </TYPE>" << std::endl ;
1703 *outstream <<
" <RUN>" << std::endl ;
1704 *outstream <<
" <RUN_TYPE>Gain Calibration</RUN_TYPE>" << std::endl ;
1705 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
1707 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl ;
1708 *outstream <<
" </RUN>" << std::endl ;
1709 *outstream <<
" </HEADER>" << std::endl ;
1710 *outstream <<
"" << std::endl ;
1711 *outstream <<
" <DATA_SET>" << std::endl ;
1712 *outstream <<
"" << std::endl ;
1713 *outstream <<
" <VERSION>" << version <<
"</VERSION>" << std::endl ;
1714 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl ;
1715 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl ;
1716 *outstream <<
"" << std::endl ;
1717 *outstream <<
" <PART>" << std::endl ;
1718 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
1719 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
1720 *outstream <<
" </PART>" << std::endl ;
1726 std::ofstream *out1stream,
1727 std::ofstream *out2stream)
const
1729 std::string mthn =
"[PixelCalibConfiguration::writeXML()]\t\t " ;
1732 *outstream <<
" " << std::endl ;
1733 *outstream <<
" <DATA>" << std::endl ;
1734 *outstream <<
" <CALIB_OBJ_DATA_FILE>./calib.dat</CALIB_OBJ_DATA_FILE>" << std::endl ;
1735 *outstream <<
" <CALIB_TYPE>calib</CALIB_TYPE>" << std::endl ;
1736 *outstream <<
" </DATA>" << std::endl ;
1737 *outstream <<
" " << std::endl ;
1742 std::ofstream *out1stream,
1743 std::ofstream *out2stream )
const
1745 std::string mthn =
"[PixelCalibConfiguration::writeXMLTrailer()]\t\t " ;
1747 *outstream <<
" </DATA_SET>" << std::endl ;
1748 *outstream <<
"</ROOT>" << std::endl ;
1750 outstream->close() ;
1751 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
const std::set< PixelModuleName > & moduleList() const
unsigned int portaddress() const
void buildROCAndModuleLists(const PixelNameTranslation *translation, const PixelDetectorConfig *detconfig)
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
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
virtual void writeASCII(std::string dir="") 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="")
MVATrainerComputer * calib
std::vector< std::pair< unsigned int, unsigned int > > defaultDACs_
This class specifies which TKFEC boards are used and how they are addressed.
unsigned int iScan(std::string dac) const
const T & max(const T &a, const T &b)
std::map< unsigned int, std::set< unsigned int > > getFEDsAndChannels(PixelNameTranslation *translation)
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
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...
Store mfec, mfecchannel etc.
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
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_
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
std::vector< std::vector< double > > tmp
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_
std::vector< std::vector< unsigned int > > cols_
std::string calibFileContent_
const PixelChannel & getChannelForROC(const PixelROCName &aROC) const
virtual ~PixelCalibConfiguration()
void clear(ROCstatus stat)
This class implements the steps that are used in a scan over Threshold and CalDelay.
std::vector< int > old_icols
static const uint32_t masks[]