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 std::string name="")
 constructor More...
 
 L1TriggerLutFile (const L1TriggerLutFile &)
 copy 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::L1TriggerLutFile ( const std::string  name = "")

constructor

L1TriggerLutFile::L1TriggerLutFile ( const L1TriggerLutFile in)

copy constructor

Definition at line 46 of file L1TriggerLutFile.cc.

46 : m_file(in.m_file) {}
std::string m_file
L1TriggerLutFile::~L1TriggerLutFile ( )
virtual

destructor

Definition at line 52 of file L1TriggerLutFile.cc.

52 {}

Member Function Documentation

bool L1TriggerLutFile::bad ( )
inline

return status of file stream

Definition at line 63 of file L1TriggerLutFile.h.

References m_fin.

63 { return m_fin.bad(); }
std::ifstream m_fin
void L1TriggerLutFile::close ( void  )
inline
const std::string& L1TriggerLutFile::getName ( ) const
inline

return filename

Definition at line 54 of file L1TriggerLutFile.h.

References m_file, and open().

Referenced by plotting.Plot::draw().

54 { return m_file; }
std::string m_file
bool L1TriggerLutFile::good ( )
inline
void L1TriggerLutFile::ignoreLines ( int  n)

read and ignore n lines from file

Definition at line 90 of file L1TriggerLutFile.cc.

References mps_fire::i, m_fin, and gen::n.

Referenced by close(), L1MuDTEtaPatternLut::load(), and L1MuDTQualPatternLut::load().

90  {
91 
92  char buf[256];
93  for ( int i = 0; i < n; i++ ) m_fin.getline(buf,256);
94 
95 }
std::ifstream m_fin
int L1TriggerLutFile::open ( )
L1TriggerLutFile & L1TriggerLutFile::operator= ( const L1TriggerLutFile lut)

assignment operator

Definition at line 61 of file L1TriggerLutFile.cc.

References m_file.

61  {
62 
63  m_file = lut.m_file;
64  return *this;
65 
66 }
std::string m_file
int L1TriggerLutFile::readHex ( )

read one hex from file

Definition at line 113 of file L1TriggerLutFile.cc.

References m_fin, and tmp.

Referenced by close().

113  {
114 
115  int tmp = 0;
116  m_fin >> hex >> tmp;
117  return tmp;
118 
119 }
std::ifstream m_fin
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int L1TriggerLutFile::readInteger ( )

read one integer from file

Definition at line 101 of file L1TriggerLutFile.cc.

References m_fin, and tmp.

Referenced by close(), L1MuDTPhiLut::load(), L1MuDTPtaLut::load(), L1MuDTEtaPatternLut::load(), L1MuDTQualPatternLut::load(), L1MuDTExtLut::load(), L1TMuonBarrelParamsHelper::load_ext(), L1TMuonBarrelParamsHelper::load_phi(), and L1TMuonBarrelParamsHelper::load_pt().

101  {
102 
103  int tmp = 0;
104  m_fin >> tmp;
105  return tmp;
106 
107 }
std::ifstream m_fin
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
string L1TriggerLutFile::readString ( )

read one string from file

Definition at line 125 of file L1TriggerLutFile.cc.

References m_fin, and tmp.

Referenced by close(), and L1MuDTEtaPatternLut::load().

125  {
126 
127  string tmp;
128  m_fin >> tmp;
129  return tmp;
130 
131 }
std::ifstream m_fin
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100

Member Data Documentation

std::string L1TriggerLutFile::m_file
private

Definition at line 83 of file L1TriggerLutFile.h.

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

std::ifstream L1TriggerLutFile::m_fin
private

Definition at line 82 of file L1TriggerLutFile.h.

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