50 my_sectcollmap.clear();
51 my_trigunitmap.clear();
53 my_tsthetamap.clear();
66 BtiMap::const_iterator biter1 = my_btimap.find(chambid);
67 if (biter1 == my_btimap.end()){
68 std::cout <<
"DTConfigManager::getConfigBti : Chamber (" << chambid.
wheel()
71 <<
") not found, return 0" << std::endl;
75 innerBtiMap::const_iterator biter2 = (*biter1).second.find(btiid);
76 if (biter2 == (*biter1).second.end()){
77 std::cout <<
"DTConfigManager::getConfigBti : BTI (" << btiid.
wheel()
82 <<
") not found, return 0" << std::endl;
91 BtiMap::const_iterator biter = my_btimap.find(chambid);
92 if (biter == my_btimap.end()){
93 std::cout <<
"DTConfigManager::getConfigBtiMap : Chamber (" << chambid.
wheel()
96 <<
") not found, return a reference to the end of the map" << std::endl;
99 return (*biter).second;
106 TracoMap::const_iterator titer1 = my_tracomap.find(chambid);
107 if (titer1 == my_tracomap.end()){
108 std::cout <<
"DTConfigManager::getConfigTraco : Chamber (" << chambid.
wheel()
109 <<
"," << chambid.
sector()
111 <<
") not found, return 0" << std::endl;
115 innerTracoMap::const_iterator titer2 = (*titer1).second.find(tracoid);
116 if (titer2 == (*titer1).second.end()){
117 std::cout <<
"DTConfigManager::getConfigTraco : TRACO (" << tracoid.
wheel()
118 <<
"," << tracoid.
sector()
120 <<
"," << tracoid.
traco()
121 <<
") not found, return a reference to the end of the map" << std::endl;
130 TracoMap::const_iterator titer = my_tracomap.find(chambid);
131 if (titer == my_tracomap.end()){
132 std::cout <<
"DTConfigManager::getConfigTracoMap : Chamber (" << chambid.
wheel()
133 <<
"," << chambid.
sector()
135 <<
") not found, return 0" << std::endl;
138 return (*titer).second;
144 TSThetaMap::const_iterator thiter = my_tsthetamap.find(chambid);
145 if (thiter == my_tsthetamap.end()){
146 std::cout <<
"DTConfigManager::getConfigTSTheta : Chamber (" << chambid.
wheel()
147 <<
"," << chambid.
sector()
149 <<
") not found, return 0" << std::endl;
159 TSPhiMap::const_iterator phiter = my_tsphimap.find(chambid);
160 if (phiter == my_tsphimap.end()){
161 std::cout <<
"DTConfigManager::getConfigTSPhi : Chamber (" << chambid.
wheel()
162 <<
"," << chambid.
sector()
164 <<
") not found, return 0" << std::endl;
174 TrigUnitMap::const_iterator tuiter = my_trigunitmap.find(chambid);
175 if (tuiter == my_trigunitmap.end()){
176 std::cout <<
"DTConfigManager::getConfigTrigUnit : Chamber (" << chambid.
wheel()
177 <<
"," << chambid.
sector()
179 <<
") not found, return 0" << std::endl;
189 LUTMap::const_iterator lutiter = my_lutmap.find(chambid);
190 if (lutiter == my_lutmap.end()){
191 std::cout <<
"DTConfigManager::getConfigLUTs : Chamber (" << chambid.
wheel()
192 <<
"," << chambid.
sector()
194 <<
") not found, return 0" << std::endl;
204 SectCollMap::const_iterator sciter = my_sectcollmap.find(scid);
205 if (sciter == my_sectcollmap.end()){
206 std::cout <<
"DTConfigManager::getConfigSectColl : SectorCollector (" << scid.
wheel()
208 <<
") not found, return 0" << std::endl;
219 my_btimap[chambid][btiid] =
conf;
226 my_tracomap[chambid][tracoid] =
conf;
232 int ST =
static_cast<int>(getDTConfigBti(
DTBtiId(1,1,1,1,1))->ST());
233 int coarse = getDTConfigSectColl(
DTSectCollId(1,1))->CoarseSync(1);
234 return (ST/2 + ST%2 + coarse);
242 string name =
"Lut_from_param";
246 fout.open(name.c_str(),ofstream::app);
249 int wh = chambid.
wheel();
251 int se = chambid.
sector();
262 short int btic = getDTConfigTraco(
DTTracoId(wh,st,se,1))->BTIC();
263 float d = _confLUTs->
D();
264 float xcn = _confLUTs->
Xcn();
270 short int Low_byte = (btic & 0x00FF);
271 short int High_byte =( btic>>8 & 0x00FF);
272 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
275 short int DSPmantissa = 0;
276 short int DSPexp = 0;
280 Low_byte = (DSPmantissa & 0x00FF);
281 High_byte =( DSPmantissa>>8 & 0x00FF);
282 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
283 Low_byte = (DSPexp & 0x00FF);
284 High_byte =( DSPexp>>8 & 0x00FF);
285 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
291 Low_byte = (DSPmantissa & 0x00FF);
292 High_byte =( DSPmantissa>>8 & 0x00FF);
293 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
294 Low_byte = (DSPexp & 0x00FF);
295 High_byte =( DSPexp>>8 & 0x00FF);
296 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
299 short int xcn_sign = _confLUTs->
Wheel();
300 Low_byte = (xcn_sign & 0x00FF);
301 High_byte =( xcn_sign>>8 & 0x00FF);
302 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte << dec <<
"\n";
void dumpLUTParam(DTChamberId &chambid) const
SV 091111 Dump luts string commands from configuration parameters.
DTChamberId chamberId() const
Return the corresponding ChamberId.
DTConfigTSTheta * getDTConfigTSTheta(DTChamberId) const
Get desired Trigger Server Theta configuration.
void IEEE32toDSP(float f, short int &DSPmantissa, short int &DSPexp)
IEEE32 to DSP conversion.
int getBXOffset() const
Get BX Offset.
int Wheel() const
wheel sign (-1 or +1)
int sector() const
Returns sector number.
int traco() const
Returns the traco.
DTConfigSectColl * getDTConfigSectColl(DTSectCollId) const
Get desired SectorCollector configuration.
void setDTConfigTraco(DTTracoId, DTConfigTraco)
Set DTConfigTraco for desired chip.
int wheel() const
Returns wheel number.
int superlayer() const
Returns the superlayer.
int station() const
Returns station number.
int sector() const
Returns sector number.
DTChamberId ChamberId() const
Returns the chamber id.
void setDTConfigBti(DTBtiId, DTConfigBti)
Set DTConfigBti for desired chip.
int station() const
Returns station number.
DTConfigTrigUnit * getDTConfigTrigUnit(DTChamberId) const
Get desired Trigger Unit configuration.
const std::map< DTBtiId, DTConfigBti > & getDTConfigBtiMap(DTChamberId) const
Get desired BTI configuration map for a given DTChamber.
int wheel() const
Returns wheel number.
DTConfigLUTs * getDTConfigLUTs(DTChamberId) const
Get desired LUT configuration.
DTConfigTraco * getDTConfigTraco(DTTracoId) const
Get desired TRACO configuration.
const std::map< DTTracoId, DTConfigTraco > & getDTConfigTracoMap(DTChamberId) const
Get desired TRACO configuration map for a given DTChamber.
int bti() const
Returns the bti.
DTConfigManager()
Constructor.
float Xcn() const
Xcn: distance vertex to normal, unit cm.
~DTConfigManager()
Destructor.
int station() const
Return the station number.
int wheel() const
Return the wheel number.
float D() const
d: distance vertex to normal, unit cm.
DTConfigBti * getDTConfigBti(DTBtiId) const
Get desired BTI configuration.
DTSuperLayerId SLId() const
Returns the superlayer id.
DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.