29 std::string mthn =
"[PixelMaskAllPixels::PixelMaskAllPixels()]\t\t " ;
32 std::vector< std::string > ins = tableMat[0];
33 std::map<std::string , int > colM;
34 std::vector<std::string > colNames;
47 colNames.push_back(
"CONFIG_KEY" );
48 colNames.push_back(
"KEY_TYPE" );
49 colNames.push_back(
"KEY_ALIAS" );
50 colNames.push_back(
"VERSION" );
51 colNames.push_back(
"KIND_OF_COND");
52 colNames.push_back(
"ROC_NAME" );
53 colNames.push_back(
"KILL_MASK" );
55 for(
unsigned int c = 0 ;
c < ins.size() ;
c++)
57 for(
unsigned int n=0;
n<colNames.size();
n++)
59 if(tableMat[0][
c] == colNames[
n])
61 colM[colNames[
n]] =
c;
66 for(
unsigned int n=0;
n<colNames.size();
n++)
68 if(colM.find(colNames[
n]) == colM.end())
70 std::cerr << mthn <<
"Couldn't find in the database the column with name " << colNames[
n] << std::endl;
75 for(
unsigned int r = 1 ;
r < tableMat.size() ;
r++){
76 std::string currentRocName = tableMat[
r][colM[
"ROC_NAME"]] ;
98 std::string mthn =
"[PixelMaskAllPixels::PixelMaskAllPixels()]\t\t " ;
100 if (filename[filename.size()-1]==
't'){
103 std::ifstream
in(filename.c_str());
106 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " << filename << std::endl;
107 throw std::runtime_error(
"Failed to open file "+filename);
134 std::ifstream
in(filename.c_str(),std::ios::binary);
145 for(
int i=0;
i< nchar;
i++){
175 if (
in.eof())
continue;
180 for(
int i=0;
i< nchar;
i++){
224 std::ofstream
out(filename.c_str(),std::ios::binary);
236 if (dir!=
"") dir+=
"/";
240 std::ofstream
out(filename.c_str());
253 std::ofstream *outstream,
254 std::ofstream *out1stream,
255 std::ofstream *out2stream)
const
257 std::string mthn =
"[PixelMaskAllPixels::writeXMLHeader()]\t\t\t " ;
258 std::stringstream maskFullPath ;
261 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl ;
263 outstream->open(maskFullPath.str().c_str()) ;
265 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
266 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
267 *outstream <<
"" << std::endl ;
268 *outstream <<
" <HEADER>" << std::endl ;
269 *outstream <<
" <TYPE>" << std::endl ;
270 *outstream <<
" <EXTENSION_TABLE_NAME>ROC_MASKS</EXTENSION_TABLE_NAME>" << std::endl ;
271 *outstream <<
" <NAME>ROC Mask Bits</NAME>" << std::endl ;
272 *outstream <<
" </TYPE>" << std::endl ;
273 *outstream <<
" <RUN>" << std::endl ;
274 *outstream <<
" <RUN_TYPE>ROC Mask Bits</RUN_TYPE>" << std::endl ;
275 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
277 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl ;
278 *outstream <<
" </RUN>" << std::endl ;
279 *outstream <<
" </HEADER>" << std::endl ;
280 *outstream <<
"" << std::endl ;
281 *outstream <<
" <DATA_SET>" << std::endl ;
282 *outstream <<
"" << std::endl ;
283 *outstream <<
" <VERSION>" << version <<
"</VERSION>" << std::endl ;
284 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl ;
285 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl ;
286 *outstream <<
"" << std::endl ;
287 *outstream <<
" <PART>" << std::endl ;
288 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
289 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
290 *outstream <<
" </PART>" << std::endl ;
291 *outstream <<
" " << std::endl ;
296 std::ofstream *out1stream,
297 std::ofstream *out2stream)
const
299 std::string mthn =
"[PixelMaskAllPixels::writeXML()]\t\t\t " ;
307 std::ofstream *out1stream,
308 std::ofstream *out2stream )
const
310 std::string mthn =
"[PixelMaskAllPixels::writeXMLTrailer()]\t\t\t " ;
312 *outstream <<
" " << std::endl ;
313 *outstream <<
" </DATA_SET>" << std::endl ;
314 *outstream <<
"</ROOT>" << std::endl ;
317 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl ;
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
int read(const PixelROCName &rocid, std::string in)
#define base64_decode(in, inlen, out, outlen)
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
const PixelROCMaskBits & getMaskBits(int ROCId) const
void addROCMaskBits(PixelROCMaskBits)
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
std::string getComment() const
std::string getAuthor() const
void writeBinary(std::string filename) const
This is the documentation about PixelMaskBase...
std::string modulename() const
std::vector< PixelROCMaskBits > maskbits_
std::vector< std::vector< double > > tmp
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
void writeASCII(std::string dir) const
int readBinary(const PixelROCName &rocid, std::ifstream &in)