File indexing completed on 2024-04-06 12:02:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "CondFormats/L1TObjects/interface/L1MuDTEtaPatternLut.h"
0022
0023
0024
0025
0026
0027 #include <iostream>
0028 #include <iomanip>
0029 #include <string>
0030
0031
0032
0033
0034
0035 #include "FWCore/Utilities/interface/FileInPath.h"
0036 #include "CondFormats/L1TObjects/interface/L1TriggerLutFile.h"
0037
0038 using namespace std;
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 L1MuDTEtaPatternLut::L1MuDTEtaPatternLut() {
0049
0050
0051
0052
0053
0054 }
0055
0056
0057
0058
0059
0060 L1MuDTEtaPatternLut::~L1MuDTEtaPatternLut() { m_lut.clear(); }
0061
0062
0063
0064
0065
0066
0067
0068
0069 void L1MuDTEtaPatternLut::reset() { m_lut.clear(); }
0070
0071
0072
0073
0074 int L1MuDTEtaPatternLut::load() {
0075
0076 string defaultPath = "L1TriggerConfig/DTTrackFinder/parameters/";
0077 string eau_dir = "L1TriggerData/DTTrackFinder/Eau/";
0078
0079
0080 edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + eau_dir + "ETFPatternList.lut"));
0081 string etf_file = lut_f.fullPath();
0082
0083
0084 L1TriggerLutFile file(etf_file);
0085 if (file.open() != 0)
0086 return -1;
0087
0088
0089
0090
0091 file.ignoreLines(16);
0092
0093
0094 while (file.good()) {
0095 int id = file.readInteger();
0096 if (!file.good())
0097 break;
0098 string pat = file.readString();
0099 if (!file.good())
0100 break;
0101 int qual = file.readInteger();
0102 if (!file.good())
0103 break;
0104 int eta = file.readInteger();
0105 if (!file.good())
0106 break;
0107 L1MuDTEtaPattern pattern(id, pat, eta, qual);
0108
0109 m_lut[pattern.id()] = pattern;
0110
0111 if (!file.good()) {
0112 file.close();
0113 break;
0114 }
0115 }
0116
0117 file.close();
0118
0119 return 0;
0120 }
0121
0122
0123
0124
0125 void L1MuDTEtaPatternLut::print() const {
0126 cout << endl;
0127 cout << "L1 barrel Track Finder ETA Pattern look-up table :" << endl;
0128 cout << "==================================================" << endl;
0129 cout << endl;
0130
0131 cout << "ETF Patterns : " << m_lut.size() << endl;
0132 cout << "======================" << endl;
0133 cout << endl;
0134
0135 LUT::const_iterator iter = m_lut.begin();
0136 while (iter != m_lut.end()) {
0137 cout << (*iter).second << endl;
0138 iter++;
0139 }
0140
0141 cout << endl;
0142 }
0143
0144
0145
0146
0147 L1MuDTEtaPattern L1MuDTEtaPatternLut::getPattern(int id) const {
0148 LUT::const_iterator it = m_lut.find(id);
0149 if (it == m_lut.end()) {
0150 cerr << "Error: L1MuDTEtaPatternLut: pattern not found : " << id << endl;
0151
0152 }
0153 return (*it).second;
0154 }