CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
vpp_lib.h
Go to the documentation of this file.
1 
2 void readmemh(std::string fname, ULLONG* mem, ULLONG astart, ULLONG afinish)
3 {
4  std::ifstream ifs (fname.c_str() , std::ifstream::in);
5  ULLONG val;
6  for (ULLONG i = astart; i <= afinish; i++)
7  {
8  if (ifs >> std::hex >> val)
9  {
10  mem[i] = val;
11  }
12  else
13  {
14  std::cerr << "Cannot read file: " << fname << ", addr: " << i << std::endl;
15  ifs.close();
16  return;
17  }
18  }
19  ifs.close();
20  //std::cout << "LUT file: " << fname << " read out successfully." << std::endl;
21 }
int i
Definition: DBlmapReader.cc:9
unsigned long long ULLONG
Definition: vpp_generated.h:13
uint16_t mem[nChs][nEvts]
void readmemh(std::string fname, ULLONG *mem, ULLONG astart, ULLONG afinish)
Definition: vpp_lib.h:2
string fname
main script