CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTTPGLutFile.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTTPGLutFile
4 //
5 // Description: Auxiliary class for
6 // Look-up table files
7 //
8 //
9 // $Date: 2007/10/23 13:44:23 $
10 // $Revision: 1.1 $
11 //
12 // Author :
13 // N. Neumeister CERN EP
14 //
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
20 
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 #include <iostream>
28 
29 using namespace std;
30 
31 //-------------------------------
32 // Collaborating Class Headers --
33 //-------------------------------
34 
35 // --------------------------------
36 // class DTTPGLutFile
37 //---------------------------------
38 
39 //----------------
40 // Constructors --
41 //----------------
42 
43 DTTPGLutFile::DTTPGLutFile(const string name) : m_file(name) {}
44 
45 DTTPGLutFile::DTTPGLutFile(const DTTPGLutFile& in) : m_file(in.m_file) {}
46 
47 
48 //--------------
49 // Destructor --
50 //--------------
51 
53 
54 //--------------
55 // Operations --
56 //--------------
57 
59 
60  m_file = lut.m_file;
61  return *this;
62 
63 }
64 
65 
67 
68  const char* file_name = m_file.c_str();
69  m_fin.open(file_name,ios::in);
70  if ( !m_fin ) {
71  cout << "can not open file : " << file_name << endl;
72  return -1;
73  }
74  else {
75  return 0;
76  }
77 
78 }
79 
80 
82 
83  char buf[256];
84  for ( int i = 0; i < n; i++ ) m_fin.getline(buf,256);
85 
86 }
87 
88 
90 
91  int tmp = 0;
92  m_fin >> tmp;
93  return tmp;
94 
95 }
96 
97 
99 
100  int tmp = 0;
101  m_fin >> hex >> tmp;
102  return tmp;
103 
104 }
105 
106 
108 
109  string tmp;
110  m_fin >> tmp;
111  return tmp;
112 
113 }
int i
Definition: DBlmapReader.cc:9
virtual ~DTTPGLutFile()
destructor
Definition: DTTPGLutFile.cc:52
void ignoreLines(int n)
read and ignore n lines from file
Definition: DTTPGLutFile.cc:81
std::string readString()
read one string from file
std::string m_file
Definition: DTTPGLutFile.h:83
tuple lut
Definition: lumiPlot.py:244
DTTPGLutFile & operator=(const DTTPGLutFile &)
assignment operator
Definition: DTTPGLutFile.cc:58
DTTPGLutFile(const std::string name="")
constructor
int readHex()
read one hex from file
Definition: DTTPGLutFile.cc:98
std::ifstream m_fin
Definition: DTTPGLutFile.h:82
int readInteger()
read one integer from file
Definition: DTTPGLutFile.cc:89
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int open()
open file
Definition: DTTPGLutFile.cc:66
tuple cout
Definition: gather_cfg.py:121