1 #ifndef CALOBASE_RAWTOWERDEFS_H
2 #define CALOBASE_RAWTOWERDEFS_H
13 namespace RawTowerDefs
56 const unsigned int tower_index_2)
60 if (tower_index_1 < 0xFFF && tower_index_2 < 0xFFF)
66 std::cout <<
"too large index1 and/or index2; index1: "
67 << tower_index_1 <<
" (max val " << 0xFFF <<
")"
69 << tower_index_2 <<
" (max val " << 0xFFF <<
")" << std::endl;
83 if (tower_index < 0xFFFFFF)
89 std::cout <<
"too large index; index: " << tower_index
90 <<
" (max val " << 0xFFFFFF <<
")" << std::endl;
110 return (calo_tower_id) &0xFFFFFF;
126 return calo_tower_id & 0xFFF;
135 static unsigned int bitsIndex2 = 10;
136 static unsigned int bitsIndex3 = 4;
139 return (calo_tower_id >> (bitsIndex2 + bitsIndex3)) & 0x3FF;
147 static unsigned int bitsIndex3 = 4;
149 return (calo_tower_id >> (bitsIndex3)) & 0x3FF;
158 return calo_tower_id & 0xF;
165 const unsigned int tower_index_2,
const unsigned int tower_index_3)
170 static unsigned int bitsIndex2 = 10;
171 static unsigned int bitsIndex3 = 4;
173 if (tower_index_1 < 0x3FF && tower_index_2 < 0x3FF && tower_index_3 < 0xF)
175 calo_tower_id = (calo_id <<
RawTowerDefs::tower_idbits) + (tower_index_1 << (bitsIndex2 + bitsIndex3)) + (tower_index_2 << bitsIndex3) + tower_index_3;
179 std::cout <<
"too large index1 and/or index2; index1: "
180 << tower_index_1 <<
" (max val " << 0x3FF <<
")"
182 << tower_index_2 <<
" (max val " << 0x3FF <<
")"
184 << tower_index_3 <<
" (max val " << 0xF <<
")" << std::endl;
191 return calo_tower_id;
242 return "EEMC_crystal";
283 <<
"Invalid calorimeter ID passed to RawTowerDefs::convert_caloid_to_name"
294 if (caloname ==
"NONE")
297 else if (caloname ==
"CEMC")
300 else if (caloname ==
"DRCALO")
303 else if (caloname ==
"HCALIN")
306 else if (caloname ==
"HCALOUT")
309 else if (caloname ==
"EEMC")
312 else if (caloname ==
"EHCAL")
315 else if (caloname ==
"FEMC")
318 else if (caloname ==
"FHCAL")
321 else if (caloname ==
"EEMC_crystal")
324 else if (caloname ==
"EEMC_glass")
327 else if (caloname ==
"LFHCAL")
330 else if (caloname ==
"BECAL")
333 else if (caloname ==
"ZDC")
336 else if (caloname ==
"B0ECAL")
339 else if (caloname ==
"BWD_0")
342 else if (caloname ==
"BWD_1")
345 else if (caloname ==
"BWD_2")
348 else if (caloname ==
"BWD_3")
351 else if (caloname ==
"BWD_4")
356 std::cout <<
"Invalid calorimeter name " << caloname
357 <<
" passed to RawTowerDefs::convert_name_to_caloid" << std::endl;