File indexing completed on 2023-03-17 10:47:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "CondFormats/L1TObjects/interface/L1TriggerLutFile.h"
0023
0024
0025
0026
0027
0028 #include <iostream>
0029
0030
0031
0032
0033
0034 using namespace std;
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 L1TriggerLutFile::L1TriggerLutFile(const string name) : m_file(name) {}
0045
0046 L1TriggerLutFile::L1TriggerLutFile(const L1TriggerLutFile& in) : m_file(in.m_file) {}
0047
0048
0049
0050
0051 L1TriggerLutFile::~L1TriggerLutFile() {}
0052
0053
0054
0055
0056
0057
0058
0059
0060 L1TriggerLutFile& L1TriggerLutFile::operator=(const L1TriggerLutFile& lut) {
0061 m_file = lut.m_file;
0062 return *this;
0063 }
0064
0065
0066
0067
0068 int L1TriggerLutFile::open() {
0069 const char* file_name = m_file.c_str();
0070 m_fin.open(file_name, ios::in);
0071 if (!m_fin) {
0072 cout << "can not open file : " << file_name << endl;
0073 return -1;
0074 } else {
0075 return 0;
0076 }
0077 }
0078
0079
0080
0081
0082 void L1TriggerLutFile::ignoreLines(int n) {
0083 char buf[256];
0084 for (int i = 0; i < n; i++)
0085 m_fin.getline(buf, 256);
0086 }
0087
0088
0089
0090
0091 int L1TriggerLutFile::readInteger() {
0092 int tmp = 0;
0093 m_fin >> tmp;
0094 return tmp;
0095 }
0096
0097
0098
0099
0100 int L1TriggerLutFile::readHex() {
0101 int tmp = 0;
0102 m_fin >> hex >> tmp;
0103 return tmp;
0104 }
0105
0106
0107
0108
0109 string L1TriggerLutFile::readString() {
0110 string tmp;
0111 m_fin >> tmp;
0112 return tmp;
0113 }