CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TriggerLutFile Class Reference

#include <L1TriggerLutFile.h>

Public Member Functions

bool bad ()
 return status of file stream More...
 
void close ()
 close file More...
 
const std::string & getName () const
 return filename More...
 
bool good ()
 return status of file stream More...
 
void ignoreLines (int n)
 read and ignore n lines from file More...
 
 L1TriggerLutFile (const L1TriggerLutFile &)
 copy constructor More...
 
 L1TriggerLutFile (const std::string name="")
 constructor More...
 
int open ()
 open file More...
 
L1TriggerLutFileoperator= (const L1TriggerLutFile &)
 assignment operator More...
 
int readHex ()
 read one hex from file More...
 
int readInteger ()
 read one integer from file More...
 
std::string readString ()
 read one string from file More...
 
virtual ~L1TriggerLutFile ()
 destructor More...
 

Private Attributes

std::string m_file
 
std::ifstream m_fin
 

Detailed Description

Auxiliary class to handle Look-up table files

Date
2007/03/30 07:48:02
Revision
1.1

N. Neumeister CERN EP

Definition at line 37 of file L1TriggerLutFile.h.

Constructor & Destructor Documentation

◆ L1TriggerLutFile() [1/2]

L1TriggerLutFile::L1TriggerLutFile ( const std::string  name = "")

constructor

◆ L1TriggerLutFile() [2/2]

L1TriggerLutFile::L1TriggerLutFile ( const L1TriggerLutFile in)

copy constructor

Definition at line 46 of file L1TriggerLutFile.cc.

46 : m_file(in.m_file) {}

◆ ~L1TriggerLutFile()

L1TriggerLutFile::~L1TriggerLutFile ( )
virtual

destructor

Definition at line 51 of file L1TriggerLutFile.cc.

51 {}

Member Function Documentation

◆ bad()

bool L1TriggerLutFile::bad ( )
inline

return status of file stream

Definition at line 61 of file L1TriggerLutFile.h.

61 { return m_fin.bad(); }

References m_fin.

◆ close()

void L1TriggerLutFile::close ( void  )
inline

close file

Definition at line 64 of file L1TriggerLutFile.h.

64 { m_fin.close(); }

References m_fin.

Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().

◆ getName()

const std::string& L1TriggerLutFile::getName ( ) const
inline

return filename

Definition at line 52 of file L1TriggerLutFile.h.

52 { return m_file; }

References m_file.

Referenced by plotting.Plot::draw().

◆ good()

bool L1TriggerLutFile::good ( )
inline

return status of file stream

Definition at line 58 of file L1TriggerLutFile.h.

58 { return m_fin.good(); }

References m_fin.

◆ ignoreLines()

void L1TriggerLutFile::ignoreLines ( int  n)

read and ignore n lines from file

Definition at line 82 of file L1TriggerLutFile.cc.

82  {
83  char buf[256];
84  for (int i = 0; i < n; i++)
85  m_fin.getline(buf, 256);
86 }

References visDQMUpload::buf, mps_fire::i, m_fin, and dqmiodumpmetadata::n.

◆ open()

int L1TriggerLutFile::open ( )

open file

Definition at line 68 of file L1TriggerLutFile.cc.

68  {
69  const char* file_name = m_file.c_str();
70  m_fin.open(file_name, ios::in);
71  if (!m_fin) {
72  cout << "can not open file : " << file_name << endl;
73  return -1;
74  } else {
75  return 0;
76  }
77 }

References gather_cfg::cout, contentValuesCheck::file_name, recoMuon::in, m_file, and m_fin.

◆ operator=()

L1TriggerLutFile & L1TriggerLutFile::operator= ( const L1TriggerLutFile lut)

assignment operator

Definition at line 60 of file L1TriggerLutFile.cc.

60  {
61  m_file = lut.m_file;
62  return *this;
63 }

References m_file.

◆ readHex()

int L1TriggerLutFile::readHex ( )

read one hex from file

Definition at line 100 of file L1TriggerLutFile.cc.

100  {
101  int tmp = 0;
102  m_fin >> hex >> tmp;
103  return tmp;
104 }

References m_fin, and createJobs::tmp.

◆ readInteger()

int L1TriggerLutFile::readInteger ( )

read one integer from file

Definition at line 91 of file L1TriggerLutFile.cc.

91  {
92  int tmp = 0;
93  m_fin >> tmp;
94  return tmp;
95 }

References m_fin, and createJobs::tmp.

◆ readString()

string L1TriggerLutFile::readString ( )

read one string from file

Definition at line 109 of file L1TriggerLutFile.cc.

109  {
110  string tmp;
111  m_fin >> tmp;
112  return tmp;
113 }

References m_fin, and createJobs::tmp.

Member Data Documentation

◆ m_file

std::string L1TriggerLutFile::m_file
private

Definition at line 80 of file L1TriggerLutFile.h.

Referenced by getName(), open(), and operator=().

◆ m_fin

std::ifstream L1TriggerLutFile::m_fin
private

Definition at line 79 of file L1TriggerLutFile.h.

Referenced by bad(), close(), good(), ignoreLines(), open(), readHex(), readInteger(), and readString().

mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TriggerLutFile::m_fin
std::ifstream m_fin
Definition: L1TriggerLutFile.h:79
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
contentValuesCheck.file_name
file_name
Definition: contentValuesCheck.py:38
recoMuon::in
Definition: RecoMuonEnumerators.h:6
L1TriggerLutFile::m_file
std::string m_file
Definition: L1TriggerLutFile.h:80
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154