CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
vpp_lib.h File Reference

Go to the source code of this file.

Functions

void readmemh (std::string fname, ULLONG *mem, ULLONG astart, ULLONG afinish)
 

Function Documentation

void readmemh ( std::string  fname,
ULLONG mem,
ULLONG  astart,
ULLONG  afinish 
)

Definition at line 2 of file vpp_lib.h.

References dtNoiseDBValidation_cfg::cerr, i, and recoMuon::in.

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]
string fname
main script