CMS 3D CMS Logo

L1TriggerLutFile Class Reference

Auxiliary class to handle Look-up table files. More...

#include <CondFormats/L1TObjects/interface/L1TriggerLutFile.h>

List of all members.

Public Member Functions

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

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.

00046 : m_file(in.m_file) {}

L1TriggerLutFile::~L1TriggerLutFile (  )  [virtual]

destructor

Definition at line 52 of file L1TriggerLutFile.cc.

00052 {}


Member Function Documentation

bool L1TriggerLutFile::bad (  )  [inline]

return status of file stream

Definition at line 63 of file L1TriggerLutFile.h.

References m_fin.

00063 { return m_fin.bad(); }

void L1TriggerLutFile::close ( void   )  [inline]

close file

Definition at line 66 of file L1TriggerLutFile.h.

References m_fin.

Referenced by L1MuDTPtaLut::load(), L1MuDTEtaPatternLut::load(), L1MuDTExtLut::load(), L1MuDTPhiLut::load(), and L1MuDTQualPatternLut::load().

00066 { m_fin.close(); }

std::string L1TriggerLutFile::getName (  )  const [inline]

return filename

Definition at line 54 of file L1TriggerLutFile.h.

References m_file.

00054 { return m_file; }

bool L1TriggerLutFile::good (  )  [inline]

return status of file stream

Definition at line 60 of file L1TriggerLutFile.h.

References m_fin.

Referenced by L1MuDTPtaLut::load(), L1MuDTEtaPatternLut::load(), L1MuDTExtLut::load(), L1MuDTPhiLut::load(), and L1MuDTQualPatternLut::load().

00060 { return m_fin.good(); }

void L1TriggerLutFile::ignoreLines ( int  n  ) 

read and ignore n lines from file

Definition at line 90 of file L1TriggerLutFile.cc.

References i, and m_fin.

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

00090                                         {
00091 
00092   char buf[256];
00093   for ( int i = 0; i < n; i++ ) m_fin.getline(buf,256);
00094 
00095 }

int L1TriggerLutFile::open (  ) 

open file

Definition at line 72 of file L1TriggerLutFile.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), in, m_file, and m_fin.

Referenced by L1MuDTPtaLut::load(), L1MuDTEtaPatternLut::load(), L1MuDTExtLut::load(), L1MuDTPhiLut::load(), and L1MuDTQualPatternLut::load().

00072                            {
00073 
00074   const char* file_name = m_file.c_str();
00075   m_fin.open(file_name,ios::in);
00076   if ( !m_fin ) {
00077     cout << "can not open file : " << file_name << endl;
00078     return -1;
00079   }
00080   else  {
00081     return 0;
00082   }
00083 
00084 }

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

assignment operator

Definition at line 61 of file L1TriggerLutFile.cc.

References m_file.

00061                                                                          {
00062 
00063   m_file = lut.m_file;
00064   return *this;
00065 
00066 }

int L1TriggerLutFile::readHex (  ) 

read one hex from file

Definition at line 113 of file L1TriggerLutFile.cc.

References m_fin, and tmp.

00113                               { 
00114 
00115   int tmp = 0;
00116   m_fin >> hex >> tmp; 
00117   return tmp;
00118     
00119 }

int L1TriggerLutFile::readInteger (  ) 

read one integer from file

Definition at line 101 of file L1TriggerLutFile.cc.

References m_fin, and tmp.

Referenced by L1MuDTPtaLut::load(), L1MuDTEtaPatternLut::load(), L1MuDTExtLut::load(), L1MuDTPhiLut::load(), and L1MuDTQualPatternLut::load().

00101                                   { 
00102 
00103   int tmp = 0;
00104   m_fin >> tmp; 
00105   return tmp;
00106 
00107 }

string L1TriggerLutFile::readString (  ) 

read one string from file

Definition at line 125 of file L1TriggerLutFile.cc.

References m_fin, and tmp.

Referenced by L1MuDTEtaPatternLut::load().

00125                                     {
00126 
00127   string tmp;
00128   m_fin >> tmp;
00129   return tmp;
00130 
00131 }


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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:07 2009 for CMSSW by  doxygen 1.5.4