46 my_sectcollmap.clear();
47 my_trigunitmap.clear();
49 my_tsthetamap.clear();
60 BtiMap::const_iterator biter1 = my_btimap.find(chambid);
61 if (biter1 == my_btimap.end()) {
62 std::cout <<
"DTConfigManager::getConfigBti : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
63 << chambid.
station() <<
") not found, return 0" << std::endl;
67 innerBtiMap::const_iterator biter2 = (*biter1).second.find(btiid);
68 if (biter2 == (*biter1).second.end()) {
69 std::cout <<
"DTConfigManager::getConfigBti : BTI (" << btiid.
wheel() <<
"," << btiid.
sector() <<
","
74 return &(*biter2).second;
78 BtiMap::const_iterator biter = my_btimap.find(chambid);
79 if (biter == my_btimap.end()) {
80 std::cout <<
"DTConfigManager::getConfigBtiMap : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
81 << chambid.
station() <<
") not found, return a reference to the end of the map" << std::endl;
84 return (*biter).second;
89 TracoMap::const_iterator titer1 = my_tracomap.find(chambid);
90 if (titer1 == my_tracomap.end()) {
91 std::cout <<
"DTConfigManager::getConfigTraco : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
92 << chambid.
station() <<
") not found, return 0" << std::endl;
96 innerTracoMap::const_iterator titer2 = (*titer1).second.find(tracoid);
97 if (titer2 == (*titer1).second.end()) {
98 std::cout <<
"DTConfigManager::getConfigTraco : TRACO (" << tracoid.
wheel() <<
"," << tracoid.
sector() <<
","
99 << tracoid.
station() <<
"," << tracoid.
traco() <<
") not found, return a reference to the end of the map"
103 return &(*titer2).second;
107 TracoMap::const_iterator titer = my_tracomap.find(chambid);
108 if (titer == my_tracomap.end()) {
109 std::cout <<
"DTConfigManager::getConfigTracoMap : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
110 << chambid.
station() <<
") not found, return 0" << std::endl;
113 return (*titer).second;
117 TSThetaMap::const_iterator thiter = my_tsthetamap.find(chambid);
118 if (thiter == my_tsthetamap.end()) {
119 std::cout <<
"DTConfigManager::getConfigTSTheta : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
120 << chambid.
station() <<
") not found, return 0" << std::endl;
124 return &(*thiter).second;
128 TSPhiMap::const_iterator phiter = my_tsphimap.find(chambid);
129 if (phiter == my_tsphimap.end()) {
130 std::cout <<
"DTConfigManager::getConfigTSPhi : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
131 << chambid.
station() <<
") not found, return 0" << std::endl;
135 return &(*phiter).second;
139 TrigUnitMap::const_iterator tuiter = my_trigunitmap.find(chambid);
140 if (tuiter == my_trigunitmap.end()) {
141 std::cout <<
"DTConfigManager::getConfigTrigUnit : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
142 << chambid.
station() <<
") not found, return 0" << std::endl;
146 return &(*tuiter).second;
150 LUTMap::const_iterator lutiter = my_lutmap.find(chambid);
151 if (lutiter == my_lutmap.end()) {
152 std::cout <<
"DTConfigManager::getConfigLUTs : Chamber (" << chambid.
wheel() <<
"," << chambid.
sector() <<
","
153 << chambid.
station() <<
") not found, return 0" << std::endl;
157 return &(*lutiter).second;
161 SectCollMap::const_iterator sciter = my_sectcollmap.find(scid);
162 if (sciter == my_sectcollmap.end()) {
163 std::cout <<
"DTConfigManager::getConfigSectColl : SectorCollector (" << scid.
wheel() <<
"," << scid.
sector()
164 <<
") not found, return 0" << std::endl;
168 return &(*sciter).second;
174 int ST = static_cast<int>(getDTConfigBti(
DTBtiId(1, 1, 1, 1, 1))->ST());
175 return (ST / 2 + ST % 2);
180 my_btimap[chambid][btiid] = conf;
185 my_tracomap[chambid][tracoid] = conf;
190 string name =
"Lut_from_param";
194 fout.open(
name.c_str(), ofstream::app);
197 int wh = chambid.
wheel();
199 int se = chambid.
sector();
209 const DTConfigLUTs* _confLUTs = getDTConfigLUTs(chambid);
210 short int btic = getDTConfigTraco(
DTTracoId(wh, st, se, 1))->BTIC();
211 float d = _confLUTs->
D();
212 float xcn = _confLUTs->
Xcn();
218 short int Low_byte = (btic & 0x00FF);
219 short int High_byte = (btic >> 8 & 0x00FF);
220 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
223 short int DSPmantissa = 0;
224 short int DSPexp = 0;
228 Low_byte = (DSPmantissa & 0x00FF);
229 High_byte = (DSPmantissa >> 8 & 0x00FF);
230 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
231 Low_byte = (DSPexp & 0x00FF);
232 High_byte = (DSPexp >> 8 & 0x00FF);
233 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
239 Low_byte = (DSPmantissa & 0x00FF);
240 High_byte = (DSPmantissa >> 8 & 0x00FF);
241 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
242 Low_byte = (DSPexp & 0x00FF);
243 High_byte = (DSPexp >> 8 & 0x00FF);
244 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
247 short int xcn_sign = _confLUTs->
Wheel();
248 Low_byte = (xcn_sign & 0x00FF);
249 High_byte = (xcn_sign >> 8 & 0x00FF);
250 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte <<
dec <<
"\n";