FACT++  1.0
bool PixelMap::Read ( const std::string &  fname)
inline

Definition at line 56 of file PixelMap.h.

References PixelMapEntry::cbpx, PixelMapEntry::gapd, PixelMapEntry::hv_board, PixelMapEntry::hv_channel, PixelMapEntry::index, and str.

Referenced by RawDataViewer::assignPixelMapFile(), StateMachineRateControl::EvalOptions(), StateMachineFeedback::EvalOptions(), StateMachineSmartFACT::EvalOptions(), and FactGui::FactGui().

57  {
58  std::ifstream fin(fname);
59 
60  int l = 0;
61 
62  std::string buf;
63  while (getline(fin, buf, '\n'))
64  {
65  if (l>1439)
66  break;
67 
68  buf.erase(buf.find_last_not_of(' ')+1); //surfixing spaces
69  buf.erase(0, buf.find_first_not_of(' ')); //prefixing spaces
70 
71  if (buf.empty() || buf[0]=='#')
72  continue;
73 
74  std::stringstream str(buf);
75 
76  int idummy;
77  float fdummy;
78 
79  PixelMapEntry entry;
80 
81  str >> entry.index;
82  str >> entry.cbpx;
83  str >> idummy;
84  str >> idummy;
85  str >> entry.gapd;
86  str >> fdummy; //entry.Vgapd;
87  str >> entry.hv_board;
88  str >> entry.hv_channel;
89  //str >> fdummy;
90  //str >> fdummy;
91  //str >> fdummy;
92 
93  if (entry.hv_channel+32*entry.hv_board>=416/*BIAS::kNumChannels*/)
94  {
95 #ifdef DEBUG
96  cerr << "Invalid board/channel read from FACTmapV5.txt." << endl;
97 #endif
98  return false;
99  }
100 
101  (*this)[l++] = entry;
102  }
103 
104  return l==1440;
105  }
int gapd
Hardware index as CBPX.
Definition: PixelMap.h:28
char str[80]
Definition: test_client.c:7
int hv_board
gAPD index
Definition: PixelMap.h:30
int cbpx
Software index.
Definition: PixelMap.h:27
int hv_channel
Bias suppply board.
Definition: PixelMap.h:31

+ Here is the caller graph for this function: