26 #include "eformat/SourceIdentifier.h"
30 using eformat::helper::SourceIdentifier;
34 bool inRange(
const int var,
const int lo,
const int hi) {
35 return not ((lo >
var) or (hi <
var));
38 const int invalidInput{-1};
39 const int maxPossiblePhiModule{9};
40 const int maxPossibleModule{3};
41 const int maxPossibleBufferLocation{2000};
44 static const InterfaceID IID_ITRT_FillCablingData_TB04
45 (
"TRT_FillCablingData_TB04", 1, 0);
52 declareInterface< TRT_FillCablingData_TB04 >(
this );
62 {
return IID_ITRT_FillCablingData_TB04; }
75 return StatusCode::FAILURE;
85 ATH_MSG_INFO(
"TRT_FillCablingData_TB04::initializiation finished" );
87 return StatusCode::SUCCESS;
122 int numberOfStrawsInLayersA[] = {15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18,
123 18, 18, 18, 18, 19, 19, 19, 18};
125 int numberOfStrawsInLayersB[] = {19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21,
126 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 23};
128 int numberOfStrawsInLayersC[] = {23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26,
129 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 28};
131 std::vector<int> ncol0 (
std::begin(numberOfStrawsInLayersA),
133 std::vector<int> ncol1 (
std::begin(numberOfStrawsInLayersB),
135 std::vector<int> ncol2 (
std::begin(numberOfStrawsInLayersC),
156 int phiModuleId, moduleId, strawLayerId, strawInLayerId,
157 strawNumberInModule,BufferLocation;
164 std::vector<Identifier> tempbuff;
165 std::vector<IdentifierHash> tempbuff2;
166 for (
int i = 0;
i < 8*13*16;
i++){
168 tempbuff.push_back(
id);
169 tempbuff2.emplace_back(0);
174 std::ostringstream ssFile;
176 std::string
dataFile =
"TRT_TB04_IdMapping_ROD" + ssFile.str() +
".dat";
201 inputFile >> phiModuleId >> moduleId >> strawNumberInModule
205 const bool validPhi =
inRange(phiModuleId, invalidInput, maxPossiblePhiModule);
206 const bool validModule =
inRange(moduleId, invalidInput, maxPossibleModule);
208 const bool validBuffer =
inRange(BufferLocation, invalidInput, maxPossibleBufferLocation);
209 if (not (validPhi and validModule and validStrawNumber and validBuffer)) {
210 ATH_MSG_WARNING(
"One of the following is out of range: " << phiModuleId <<
", " << moduleId
211 <<
", " << strawNumberInModule <<
", " << BufferLocation);
217 if (phiModuleId == 0)
241 strawNumberInModule--;
242 if (strawNumberInModule < 0) {
243 ATH_MSG_WARNING(
"Straw number in module became negative: " << strawNumberInModule);
249 strawInLayerId=strawNumberInModule;
251 while(strawInLayerId>=0){
253 strawInLayerId -=
m_ncol[moduleId][strawLayerId];
258 strawInLayerId +=
m_ncol[moduleId][strawLayerId];
266 strawLayerId, strawInLayerId);
273 BufferLocation, hashId);
275 ATH_MSG_DEBUG(
"defineTables: unable to get hash for IdLayer " << IdLayer );
296 std::vector<IdentifierHash> * vectID =
new std::vector<IdentifierHash>();
311 std::vector<IdentifierHash> &
ids)
319 eformat::helper::SourceIdentifier
id (rob_id);
347 ids.push_back(idHash);
367 ids.push_back(idHash);
379 ids.push_back(idHash);
391 ids.push_back(idHash);
409 std::vector<uint32_t>
v;
424 if (id_barrel_ec == -1)
433 v.push_back( 0x310001 );
437 " TRT_FillCablingData_TB04 --> Couldn't get RobID for given Identifier " \