CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
pos::PixelROCMaskBits Class Reference

This class implements.. More...

#include "interface/PixelROCMaskBits.h"

Public Member Functions

unsigned int mask (unsigned int col, unsigned int row) const
 
PixelROCName name () const
 
 PixelROCMaskBits ()
 
int read (const PixelROCName &rocid, std::string in)
 
int read (const PixelROCName &rocid, std::ifstream &in)
 
int read (const PixelROCName &rocid, std::istringstream &in)
 
int readBinary (const PixelROCName &rocid, std::ifstream &in)
 
void setMask (unsigned int col, unsigned int row, unsigned int mask)
 
void setROCMaskBits (PixelROCName &rocid, std::string bits)
 
void writeASCII (std::ofstream &out) const
 
void writeBinary (std::ofstream &out) const
 
void writeXML (std::ofstream *out) const
 

Private Attributes

unsigned char bits_ [520]
 
PixelROCName rocid_
 

Friends

std::ostream & operator<< (std::ostream &s, const PixelROCMaskBits &maskbits)
 

Detailed Description

This class implements..

A longer explanation will be placed here later

Definition at line 24 of file PixelROCMaskBits.h.

Constructor & Destructor Documentation

PixelROCMaskBits::PixelROCMaskBits ( )

Definition at line 18 of file PixelROCMaskBits.cc.

18  {
19 }

Member Function Documentation

unsigned int PixelROCMaskBits::mask ( unsigned int  col,
unsigned int  row 
) const

Definition at line 166 of file PixelROCMaskBits.cc.

References bits_, and tmp.

Referenced by pos::PixelCalibConfiguration::enablePixels(), pos::PixelTrimCommon::generateConfiguration(), pos::PixelTrimAllPixels::generateConfiguration(), and writeASCII().

166  {
167 
168  unsigned int tmp=bits_[col*10+row/8];
169 // std::cout << "c = " << col << "\tr = " << row << "\tbits_[" << (col*10+row/8) << "]=" << bits_[col*10+row/8] << std::endl ;
170 // std::cout << "[PixelROCMaskBits::mask()] tmp iniziale " << tmp << std::endl ;
171  tmp=tmp>>(row%8);
172 // std::cout << "[PixelROCMaskBits::mask()] tmp finale " << tmp << std::endl ;
173 // unsigned int res = tmp&0x01 ;
174 // std::cout << "[PixelROCMaskBits::mask()] return value " << res << std::endl ;
175  return tmp&0x01;
176 
177 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
unsigned char bits_[520]
col
Definition: cuy.py:1010
PixelROCName pos::PixelROCMaskBits::name ( ) const
inline
int PixelROCMaskBits::read ( const PixelROCName rocid,
std::string  in 
)
int PixelROCMaskBits::read ( const PixelROCName rocid,
std::ifstream &  in 
)

Definition at line 50 of file PixelROCMaskBits.cc.

References bits_, data, mps_fire::i, rocid_, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

50  {
51 
52  rocid_=rocid;
53 
55 
56  for (int i=0;i<52;i++){
57 
58  in >> tag;
59 
60  //std::cout << "Now reading col:"<<tag<<std::endl;
61 
63 
64  in >> data;
65 
66  //std::cout <<"data.size()" <<data.size()<<std::endl;
67 
68  unsigned char byte=0;
69 
70  for(int j=0;j<80;j++){
71 
72  if (data[j]=='1') byte+=128;
73 
74  if ((j+1)%8==0) {
75  //std::cout << "Writing byte:"<<(int)byte<<std::endl;
76  bits_[i*10+(j+1)/8-1]=byte;
77  byte=0;
78  }
79  else{
80  byte/=2;
81  }
82 
83 
84  }
85 
86  }
87 
88  return 1;
89 
90 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned char bits_[520]
int PixelROCMaskBits::read ( const PixelROCName rocid,
std::istringstream &  in 
)

Definition at line 94 of file PixelROCMaskBits.cc.

References bits_, data, mps_fire::i, rocid_, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

95 {
96  rocid_=rocid;
98  for (int i=0;i<52;i++)
99  {
100  in >> tag;
101  //std::cout << "Now reading col:"<<tag<<std::endl;
103  in >> data;
104  //std::cout <<"data.size()" <<data.size()<<std::endl;
105  unsigned char byte=0;
106  for(int j=0;j<80;j++)
107  {
108  if (data[j]=='1') byte+=128;
109  if ((j+1)%8==0)
110  {
111  //std::cout << "Writing byte:"<<(int)byte<<std::endl;
112  bits_[i*10+(j+1)/8-1]=byte;
113  byte=0;
114  }
115  else
116  {
117  byte/=2;
118  }
119  }
120  }
121  return 1;
122 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned char bits_[520]
int PixelROCMaskBits::readBinary ( const PixelROCName rocid,
std::ifstream &  in 
)

Definition at line 125 of file PixelROCMaskBits.cc.

References bits_, and rocid_.

Referenced by pos::PixelMaskAllPixels::PixelMaskAllPixels().

125  {
126 
127  rocid_=rocid;
128 
129 
130  in.read((char*)bits_,520);
131 
132 
133  return 1;
134 }
unsigned char bits_[520]
void PixelROCMaskBits::setMask ( unsigned int  col,
unsigned int  row,
unsigned int  mask 
)

Definition at line 180 of file PixelROCMaskBits.cc.

References bits_.

180  {
181 
182  assert(mask==0||mask==1);
183 
184  unsigned int bit=1<<(row%8);
185  if (mask) bits_[col*10+row/8]=bits_[col*10+row/8]|bit;
186  if (!mask) bits_[col*10+row/8]=bits_[col*10+row/8]&(0xff^bit);
187 
188 }
unsigned char bits_[520]
unsigned int mask(unsigned int col, unsigned int row) const
col
Definition: cuy.py:1010
void PixelROCMaskBits::setROCMaskBits ( PixelROCName rocid,
std::string  bits 
)

Definition at line 23 of file PixelROCMaskBits.cc.

References bits_, mps_fire::i, rocid_, and AlCaHLTBitMon_QueryRunRegistry::string.

24 {
25  std::string mthn = "[PixelROCMaskBits::setROCMaskBits()]\t\t\t " ;
26  rocid_=rocid;
27  char cpt[520] ;
28  bits.copy( cpt , 520);
29  for(unsigned int i = 0 ; i < bits.size(); i++)
30  {
31  bits_[i] = static_cast<unsigned char>(cpt[i]);
32  // std::cout<< "bits_[" << i << "]\t" << bits_[i] <<std::endl;
33  // std::cout<<rocid_<<std::endl;
34  // std::cout.flags(std::ios::hex)
35  }
36 }
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
unsigned char bits_[520]
void PixelROCMaskBits::writeASCII ( std::ofstream &  out) const

Definition at line 149 of file PixelROCMaskBits.cc.

References cuy::col, mask(), rocid_, and pos::PixelROCName::rocname().

149  {
150 
151  out << "ROC: "<<rocid_.rocname()<<std::endl;
152 
153  for(unsigned int col=0;col<52;col++){
154  out << "col";
155  if (col<10) out << "0";
156  out <<col<<": ";
157  for (int row=0;row<80;row++){
158  out << mask(col,row);
159  }
160  out << std::endl;
161  }
162 
163 }
std::string rocname() const
unsigned int mask(unsigned int col, unsigned int row) const
col
Definition: cuy.py:1010
void PixelROCMaskBits::writeBinary ( std::ofstream &  out) const

Definition at line 137 of file PixelROCMaskBits.cc.

References bits_, mps_fire::i, rocid_, and pos::PixelROCName::rocname().

137  {
138 
139  out << (char)rocid_.rocname().size();
140  out.write(rocid_.rocname().c_str(),rocid_.rocname().size());
141 
142  for(unsigned int i=0;i<520;i++){
143  out << bits_[i];
144  }
145 
146 }
std::string rocname() const
unsigned char bits_[520]
void PixelROCMaskBits::writeXML ( std::ofstream *  out) const

Definition at line 218 of file PixelROCMaskBits.cc.

References base64_encode(), bits_, rocid_, pos::PixelROCName::rocname(), and AlCaHLTBitMon_QueryRunRegistry::string.

219 {
220  std::string mthn = "[PixelROCMaskBits::writeXML()]\t\t\t\t" ;
221 
222  std::string encoded = base64_encode(bits_, sizeof(bits_));
223 
224  *out << " <DATA>" << std::endl ;
225  *out << " <ROC_NAME>" << rocid_.rocname() << "</ROC_NAME>" << std::endl ;
226  *out << " <KILL_MASK>" << encoded << "</KILL_MASK>" << std::endl ;
227  *out << " </DATA>" << std::endl ;
228  *out << " " << std::endl ;
229 
230 }
std::string rocname() const
std::string base64_encode(unsigned char const *, unsigned int len)
Definition: PixelBase64.cc:41
unsigned char bits_[520]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const PixelROCMaskBits maskbits 
)
friend

Referenced by name().

Member Data Documentation

unsigned char pos::PixelROCMaskBits::bits_[520]
private
PixelROCName pos::PixelROCMaskBits::rocid_
private