This class implements..
More...
#include "interface/PixelFEDTestDAC.h"
|
std::vector< unsigned int > | dacs () |
|
std::string | mode () |
|
| PixelFEDTestDAC (std::string filename) |
|
| PixelFEDTestDAC (std::vector< std::vector< std::string > > &) |
|
virtual void | writeXML (std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
virtual void | writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
virtual void | writeXMLTrailer (std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
virtual std::string | mode () const |
|
| PixelCalibBase () |
|
virtual void | writeXMLHeader (pos::PixelConfigKey &key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
virtual | ~PixelCalibBase () |
|
|
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::PixelFEDTestDAC |
( |
std::string |
filename | ) |
|
Definition at line 171 of file PixelFEDTestDAC.cc.
References DeDxDiscriminatorTools::charge(), gather_cfg::cout, groupFilesInBlocks::fin, i, geometryCSVtoXML::line, evf::evtn::offset(), and errorMatrix2Lands_multiChannel::start.
174 std::string mthn =
"[PixelFEDTestDAC::PixelFEDTestDAC()]\t\t\t\t " ;
175 const unsigned long int UB=200;
176 const unsigned long int B=500;
177 const unsigned long int offset=0;
178 vector <unsigned int> pulseTrain(256), pixelDCol(1), pixelPxl(2), pixelTBMHeader(3), pixelTBMTrailer(3);
179 unsigned int DCol, LorR,
start=15;
182 unsigned long int npos=std::string::npos;
186 for (
unsigned int i=0;i<pulseTrain.size();++
i)
188 pulseTrain[
i]=offset+
B;
197 assert(
mode_==
"EmulatedPhysics"||
198 mode_==
"FEDBaselineWithTestDACs"||
199 mode_==
"FEDAddressLevelWithTestDACs");
205 if (line.find(
"TBMHeader")!=npos)
207 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMHeader.\n";
break;}
208 loc2=line.find(
")", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMHeader.\n";
break;}
209 int TBMHeader=atoi(line.substr(loc1+1,loc2-loc1-1).c_str());
211 pulseTrain[
i]=UB;++
i;
212 pulseTrain[
i]=UB;++
i;
213 pulseTrain[
i]=UB;++
i;
223 else if (line.find(
"ROCHeader")!=std::string::npos)
225 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after ROCHeader.\n";
break;}
226 loc2=line.find(
")", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after ROCHeader.\n";
break;}
227 int LastDAC=atoi(line.substr(loc1+1,loc2-loc1-1).c_str());
231 pulseTrain[
i]=UB;++
i;
235 else if (line.find(
"PixelHit")!=std::string::npos) {
237 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after PixelHit.\n";
break;}
238 loc2=line.find(
",", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"',' not found after the first argument of PixelHit.\n";
break;}
239 loc3=line.find(
",", loc2+1);
if (loc3==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'.' not found after the second argument of PixelHit.\n";
break;}
240 loc4=line.find(
")", loc3+1);
if (loc4==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after the third argument of PixelHit.\n";
break;}
241 int column=atoi(line.substr(loc1+1, loc2-loc1-1).c_str());
242 int row=atoi(line.substr(loc2+1, loc3-loc2-1).c_str());
243 int charge=atoi(line.substr(loc3+1, loc4-loc3-1).c_str());
246 LorR=int(column-DCol*2);
250 std::cout<<
"Pxl = "<<pixelPxl[2]<<pixelPxl[1]<<pixelPxl[0]<<
", DCol= "<<pixelDCol[1]<<pixelDCol[0]<<std::endl;
260 else if (line.find(
"TBMTrailer")!=std::string::npos)
262 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMTrailer.\n";
break;}
263 loc2=line.find(
")", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMTrailer.\n";
break;}
264 int TBMTrailer=atoi(line.substr(loc1+1,loc2-loc1-1).c_str());
266 pulseTrain[
i]=UB;++
i;
267 pulseTrain[
i]=UB;++
i;
268 pulseTrain[
i]=
B; ++
i;
269 pulseTrain[
i]=
B; ++
i;
std::vector< unsigned int > dacs_
unsigned int offset(bool)
unsigned int levelEncoder(int level)
std::vector< unsigned int > decimalToBaseX(unsigned int a, unsigned int x, unsigned int length)
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.
References trackerHits::c, dtNoiseDBValidation_cfg::cerr, DeDxDiscriminatorTools::charge(), gather_cfg::cout, groupFilesInBlocks::fin, i, geometryCSVtoXML::line, n, evf::evtn::offset(), and errorMatrix2Lands_multiChannel::start.
15 std::string mthn =
"[PixelFEDTestDAC::PixelFEDTestDAC()]\t\t\t " ;
16 const unsigned long int UB=200;
17 const unsigned long int B=500;
18 const unsigned long int offset=0;
19 vector <unsigned int> pulseTrain(256), pixelDCol(1), pixelPxl(2), pixelTBMHeader(3), pixelTBMTrailer(3);
20 unsigned int DCol, LorR,
start=15;
23 unsigned long int npos=std::string::npos;
26 std::map<std::string , int > colM;
27 std::vector<std::string > colNames;
42 colNames.push_back(
"CONFIG_KEY" );
43 colNames.push_back(
"KEY_TYPE" );
44 colNames.push_back(
"KEY_ALIAS" );
45 colNames.push_back(
"VERSION" );
46 colNames.push_back(
"KIND_OF_COND" );
47 colNames.push_back(
"CALIB_TYPE" );
48 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
49 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
51 for(
unsigned int c = 0 ;
c < tableMat[0].size() ;
c++)
53 for(
unsigned int n=0;
n<colNames.size();
n++)
55 if(tableMat[0][
c] == colNames[
n])
57 colM[colNames[
n]] =
c;
62 for(
unsigned int n=0;
n<colNames.size();
n++)
64 if(colM.find(colNames[
n]) == colM.end())
66 std::cerr << __LINE__ <<
"]\t" << mthn <<
"Couldn't find in the database the column with name " << colNames[
n] << std::endl;
72 std::istringstream
fin ;
73 fin.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]) ;
76 for (
unsigned int i=0;i<pulseTrain.size();++
i)
78 pulseTrain[
i]=offset+
B;
85 assert(
mode_==
"EmulatedPhysics"||
86 mode_==
"FEDBaselineWithTestDACs"||
87 mode_==
"FEDAddressLevelWithTestDACs");
93 if (line.find(
"TBMHeader")!=npos)
95 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMHeader.\n";
break;}
96 loc2=line.find(
")", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMHeader.\n";
break;}
97 int TBMHeader=atoi(line.substr(loc1+1,loc2-loc1-1).c_str());
100 pulseTrain[
i]=UB;++
i;
101 pulseTrain[
i]=UB;++
i;
111 else if (line.find(
"ROCHeader")!=std::string::npos)
113 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after ROCHeader.\n";
break;}
114 loc2=line.find(
")", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after ROCHeader.\n";
break;}
115 int LastDAC=atoi(line.substr(loc1+1,loc2-loc1-1).c_str());
119 pulseTrain[
i]=UB;++
i;
123 else if (line.find(
"PixelHit")!=std::string::npos) {
125 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after PixelHit.\n";
break;}
126 loc2=line.find(
",", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"',' not found after the first argument of PixelHit.\n";
break;}
127 loc3=line.find(
",", loc2+1);
if (loc3==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'.' not found after the second argument of PixelHit.\n";
break;}
128 loc4=line.find(
")", loc3+1);
if (loc4==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after the third argument of PixelHit.\n";
break;}
129 int column=atoi(line.substr(loc1+1, loc2-loc1-1).c_str());
130 int row=atoi(line.substr(loc2+1, loc3-loc2-1).c_str());
131 int charge=atoi(line.substr(loc3+1, loc4-loc3-1).c_str());
134 LorR=int(column-DCol*2);
138 std::cout<<
"Pxl = "<<pixelPxl[2]<<pixelPxl[1]<<pixelPxl[0]<<
", DCol= "<<pixelDCol[1]<<pixelDCol[0]<<std::endl;
148 else if (line.find(
"TBMTrailer")!=std::string::npos)
150 loc1=line.find(
"(");
if (loc1==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"'(' not found after TBMTrailer.\n";
break;}
151 loc2=line.find(
")", loc1+1);
if (loc2==npos) {
cout<< __LINE__ <<
"]\t" << mthn <<
"')' not found after TBMTrailer.\n";
break;}
152 int TBMTrailer=atoi(line.substr(loc1+1,loc2-loc1-1).c_str());
154 pulseTrain[
i]=UB;++
i;
155 pulseTrain[
i]=UB;++
i;
156 pulseTrain[
i]=
B; ++
i;
157 pulseTrain[
i]=
B; ++
i;
std::vector< unsigned int > dacs_
unsigned int offset(bool)
unsigned int levelEncoder(int level)
std::vector< unsigned int > decimalToBaseX(unsigned int a, unsigned int x, unsigned int length)
std::vector<unsigned int> pos::PixelFEDTestDAC::dacs |
( |
| ) |
|
|
inline |
vector< unsigned int > PixelFEDTestDAC::decimalToBaseX |
( |
unsigned int |
a, |
|
|
unsigned int |
x, |
|
|
unsigned int |
length |
|
) |
| |
|
private |
Definition at line 303 of file PixelFEDTestDAC.cc.
References i, and x.
305 vector<unsigned int> ans(100,0);
316 if (length>0) ans.resize(length);
else ans.resize(i);
unsigned int PixelFEDTestDAC::levelEncoder |
( |
int |
level | ) |
|
|
private |
Definition at line 283 of file PixelFEDTestDAC.cc.
289 case 0: pulse=450;
break;
290 case 1: pulse=500;
break;
291 case 2: pulse=550;
break;
292 case 3: pulse=600;
break;
293 case 4: pulse=650;
break;
294 case 5: pulse=700;
break;
295 default: assert(0);
break;
std::string pos::PixelFEDTestDAC::mode |
( |
| ) |
|
|
inline |
void PixelFEDTestDAC::writeXML |
( |
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = NULL , |
|
|
std::ofstream * |
out2 = NULL |
|
) |
| const |
|
virtual |
Reimplemented from pos::PixelCalibBase.
Definition at line 369 of file PixelFEDTestDAC.cc.
373 std::string mthn =
"[PixelFEDTestDAC::writeXML()]\t\t\t " ;
376 *outstream <<
" " << std::endl ;
377 *outstream <<
" <DATA>" << std::endl ;
378 *outstream <<
" <CALIB_OBJ_DATA_FILE>./fedtestdac.dat</CALIB_OBJ_DATA_FILE>" << std::endl ;
379 *outstream <<
" <CALIB_TYPE>fedtestdac</CALIB_TYPE>" << std::endl ;
380 *outstream <<
" </DATA>" << std::endl ;
381 *outstream <<
" " << std::endl ;
void PixelFEDTestDAC::writeXMLHeader |
( |
pos::PixelConfigKey |
key, |
|
|
int |
version, |
|
|
std::string |
path, |
|
|
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = NULL , |
|
|
std::ofstream * |
out2 = NULL |
|
) |
| const |
|
virtual |
Definition at line 322 of file PixelFEDTestDAC.cc.
References gather_cfg::cout, and edm::service::getTime().
329 std::string mthn =
"[PixelFEDTestDAC::writeXMLHeader()]\t\t\t " ;
330 std::stringstream maskFullPath ;
335 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl ;
337 outstream->open(maskFullPath.str().c_str()) ;
339 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
340 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
341 *outstream <<
"" << std::endl ;
342 *outstream <<
" <HEADER>" << std::endl ;
343 *outstream <<
" <TYPE>" << std::endl ;
344 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl ;
345 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl ;
346 *outstream <<
" </TYPE>" << std::endl ;
347 *outstream <<
" <RUN>" << std::endl ;
348 *outstream <<
" <RUN_TYPE>PixelFEDTestDAC</RUN_TYPE>" << std::endl ;
349 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
351 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl ;
352 *outstream <<
" </RUN>" << std::endl ;
353 *outstream <<
" </HEADER>" << std::endl ;
354 *outstream <<
"" << std::endl ;
355 *outstream <<
" <DATA_SET>" << std::endl ;
356 *outstream <<
"" << std::endl ;
357 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl ;
358 *outstream <<
" <COMMENT_DESCRIPTION>No comment defined: this class does NOT inherit from PixelCalibBase</COMMENT_DESCRIPTION>" << std::endl ;
359 *outstream <<
" <CREATED_BY_USER>Unknown user</CREATED_BY_USER>" << std::endl ;
360 *outstream <<
"" << std::endl ;
361 *outstream <<
" <PART>" << std::endl ;
362 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
363 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
364 *outstream <<
" </PART>" << std::endl ;
void PixelFEDTestDAC::writeXMLTrailer |
( |
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = NULL , |
|
|
std::ofstream * |
out2 = NULL |
|
) |
| const |
|
virtual |
Reimplemented from pos::PixelCalibBase.
Definition at line 386 of file PixelFEDTestDAC.cc.
References gather_cfg::cout.
390 std::string mthn =
"[PixelFEDTestDAC::writeXMLTrailer()]\t\t\t " ;
392 *outstream <<
" </DATA_SET>" << std::endl ;
393 *outstream <<
"</ROOT>" << std::endl ;
396 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl ;
std::vector<unsigned int> pos::PixelFEDTestDAC::dacs_ |
|
private |