CMS 3D CMS Logo

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

This class implements.. More...

#include <PixelTrimCommon.h>

Inheritance diagram for pos::PixelTrimCommon:
pos::PixelTrimBase pos::PixelConfigBase

Public Member Functions

void generateConfiguration (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans, const PixelMaskBase &pixelMask) const override
 
 PixelTrimCommon (std::string filename)
 
void writeASCII (std::string filename) const override
 
void writeBinary (std::string filename) const override
 
void writeXML (pos::PixelConfigKey key, int version, std::string path) const override
 
void writeXML (std::ofstream *out) const override
 
void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const override
 
void writeXMLTrailer (std::ofstream *out) const override
 
- Public Member Functions inherited from pos::PixelTrimBase
virtual PixelROCTrimBits getTrimBits (int ROCId) const =0
 
virtual PixelROCTrimBitsgetTrimBits (PixelROCName name)=0
 
 PixelTrimBase (std::string description, std::string creator, std::string date)
 
void setOverride (PixelTrimOverrideBase *trimOverride)
 
void writeXML (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLTrailer (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
 ~PixelTrimBase () override
 
- Public Member Functions inherited from pos::PixelConfigBase
std::string creator ()
 
std::string date ()
 
std::string description ()
 
std::string getAuthor () const
 
std::string getComment () const
 
 PixelConfigBase (std::string description, std::string creator, std::string date)
 
void setAuthor (std::string author)
 
void setComment (std::string comment)
 
virtual ~PixelConfigBase ()
 

Private Attributes

std::vector< PixelROCNamerocname_
 
std::vector< unsigned int > trimbits_
 

Detailed Description

This class implements..

" " " "

A longer explanation will be placed here later

Definition at line 30 of file PixelTrimCommon.h.

Constructor & Destructor Documentation

PixelTrimCommon::PixelTrimCommon ( std::string  filename)

Definition at line 19 of file PixelTrimCommon.cc.

References HltBtagPostValidation_cff::c, mps_fire::i, recoMuon::in, AlCaHLTBitMon_QueryRunRegistry::string, and trimbits_.

19  : PixelTrimBase("", "", "") {
20  if (filename[filename.size() - 1] == 't') {
21  std::ifstream in(filename.c_str());
22 
23  std::string s1;
24  in >> s1;
25 
26  trimbits_.clear();
27 
28  while (!in.eof()) {
29  //std::cout << "PixelTrimCommon::PixelTrimCommon read s1:"<<s1<<std::endl;
30 
31  PixelROCName rocid(in);
32 
33  //std::cout << "PixelTrimCommon::PixelTrimCommon read rocid:"<<rocid<<std::endl;
34 
35  unsigned int trimbits;
36 
37  in >> trimbits;
38 
39  trimbits_.push_back(trimbits);
40 
41  in >> s1;
42  }
43 
44  in.close();
45 
46  } else {
47  std::ifstream in(filename.c_str(), std::ios::binary);
48 
49  char nchar;
50 
51  in.read(&nchar, 1);
52 
53  std::string s1;
54 
55  //wrote these lines of code without ref. needs to be fixed
56  for (int i = 0; i < nchar; i++) {
57  char c;
58  in >> c;
59  s1.push_back(c);
60  }
61 
62  //std::cout << "READ ROC name:"<<s1<<std::endl;
63 
64  trimbits_.clear();
65 
66  while (!in.eof()) {
67  //std::cout << "PixelTrimCommon::PixelTrimCommon read s1:"<<s1<<std::endl;
68 
69  PixelROCName rocid(s1);
70 
71  //std::cout << "PixelTrimCommon::PixelTrimCommon read rocid:"<<rocid<<std::endl;
72 
73  unsigned int trimbits;
74 
75  in >> trimbits;
76 
77  trimbits_.push_back(trimbits);
78 
79  in.read(&nchar, 1);
80 
81  s1.clear();
82 
83  if (in.eof())
84  continue;
85 
86  //wrote these lines of code without ref. needs to be fixed
87  for (int i = 0; i < nchar; i++) {
88  char c;
89  in >> c;
90  s1.push_back(c);
91  }
92  }
93 
94  in.close();
95  }
96 
97  //std::cout << "Read trimbits for "<<trimbits_.size()<<" ROCs"<<std::endl;
98 }
std::vector< unsigned int > trimbits_
This class implements..
Definition: PixelROCName.h:23
PixelTrimBase(std::string description, std::string creator, std::string date)

Member Function Documentation

void PixelTrimCommon::generateConfiguration ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans,
const PixelMaskBase pixelMask 
) const
overridevirtual

Implements pos::PixelTrimBase.

Definition at line 113 of file PixelTrimCommon.cc.

References cuy::col, pos::PixelNameTranslation::getHdwAddress(), pos::PixelMaskBase::getMaskBits(), mps_fire::i, pos::PixelROCMaskBits::mask(), rocname_, pos::PixelFECConfigInterface::setMaskAndTrimAll(), createJobs::tmp, and trimbits_.

115  {
116  for (unsigned int i = 0; i < trimbits_.size(); i++) {
117  std::vector<unsigned char> trimAndMasks(4160);
118 
119  const PixelROCMaskBits& maskbits = pixelMask.getMaskBits(i);
120 
121  for (unsigned int col = 0; col < 52; col++) {
122  for (unsigned int row = 0; row < 80; row++) {
123  unsigned char tmp = trimbits_[i];
124  if (maskbits.mask(col, row) != 0)
125  tmp |= 0x80;
126  trimAndMasks[col * 80 + row] = tmp;
127  }
128  }
129 
130  pixelFEC->setMaskAndTrimAll(*(trans->getHdwAddress(rocname_[i])), trimAndMasks);
131  }
132 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
std::vector< unsigned int > trimbits_
virtual void setMaskAndTrimAll(const PixelHdwAddress &theROC, const std::vector< unsigned char > &allPixels, const bool buffermode=false)=0
std::vector< PixelROCName > rocname_
virtual const PixelROCMaskBits & getMaskBits(int ROCId) const =0
This class implements..
unsigned int mask(unsigned int col, unsigned int row) const
col
Definition: cuy.py:1010
tmp
align.sh
Definition: createJobs.py:716
void PixelTrimCommon::writeASCII ( std::string  filename) const
overridevirtual

Implements pos::PixelTrimBase.

Definition at line 143 of file PixelTrimCommon.cc.

References mps_fire::i, MillePedeFileConverter_cfg::out, and trimbits_.

143  {
144  std::ofstream out(filename.c_str());
145 
146  for (unsigned int i = 0; i < trimbits_.size(); i++) {
147  assert(0);
148  //trimbits_[i].writeASCII(out);
149  }
150 }
std::vector< unsigned int > trimbits_
void PixelTrimCommon::writeBinary ( std::string  filename) const
overridevirtual

Implements pos::PixelTrimBase.

Definition at line 134 of file PixelTrimCommon.cc.

References mps_fire::i, MillePedeFileConverter_cfg::out, and trimbits_.

134  {
135  std::ofstream out(filename.c_str(), std::ios::binary);
136 
137  for (unsigned int i = 0; i < trimbits_.size(); i++) {
138  assert(0);
139  //trimbits_[i].writeBinary(out);
140  }
141 }
std::vector< unsigned int > trimbits_
void pos::PixelTrimCommon::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual
void pos::PixelTrimCommon::writeXML ( std::ofstream *  out) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 49 of file PixelTrimCommon.h.

49 { ; }
void pos::PixelTrimCommon::writeXMLHeader ( pos::PixelConfigKey  key,
int  version,
std::string  path,
std::ofstream *  out 
) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 48 of file PixelTrimCommon.h.

48 { ; }
void pos::PixelTrimCommon::writeXMLTrailer ( std::ofstream *  out) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 50 of file PixelTrimCommon.h.

50 { ; }

Member Data Documentation

std::vector<PixelROCName> pos::PixelTrimCommon::rocname_
private

Definition at line 53 of file PixelTrimCommon.h.

Referenced by generateConfiguration().

std::vector<unsigned int> pos::PixelTrimCommon::trimbits_
private

Definition at line 54 of file PixelTrimCommon.h.

Referenced by generateConfiguration(), PixelTrimCommon(), writeASCII(), and writeBinary().