ATLAS Offline Software
jFexRoiByteStreamTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // jFexRoiByteStreamTool - This tool decodes Run3 jFEX RoI data!
7 // -------------------
8 // begin : 01 01 2022
9 // email : Sergi.Rodriguez@cern.ch
10 // ***************************************************************************/
11 
12 #include "jFexRoiByteStreamTool.h"
13 #include "jFexBits.h"
14 #include "eformat/SourceIdentifier.h"
15 #include "eformat/Status.h"
16 
17 #include <fstream>
18 #include <span>
19 
22 
23 namespace jBits = LVL1::jFEXBits;
24 
25 struct color {
26  std::string RED ="\033[1;31m";
27  std::string ORANGE ="\033[1;38;5;208m";
28  std::string YELLOW ="\033[1;33m";
29  std::string GREEN ="\033[1;32m";
30  std::string BLUE ="\033[1;34m";
31  std::string PURPLE ="\033[1;35m";
32  std::string END ="\033[0m";
33  std::string B_BLUE ="\033[1;44m";
34  std::string B_PURPLE ="\033[1;45m";
35  std::string B_ORANGE ="\033[1;48;5;208;30m";
36  std::string B_GRAY ="\033[1;100m";
37  std::string B_RED ="\033[1;41m";
38  std::string B_GREEN ="\033[1;42m";
39 } const C;
40 
42  const std::string& name,
43  const IInterface* parent)
44  : base_class(type, name, parent) {}
45 
47  // Conversion mode for jJ TOBs
48  ConversionMode jJmode = getConversionMode(m_jJReadKey, m_jJWriteKey, msg());
50  ATH_CHECK(m_jJWriteKey.initialize(jJmode==ConversionMode::Decoding));
51  ATH_CHECK(m_jJReadKey.initialize(jJmode==ConversionMode::Encoding));
52  ATH_MSG_DEBUG((jJmode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jJ ROB IDs: "
53  << MSG::hex << m_robIds.value() << MSG::dec);
54 
55  // Conversion mode for jLJ TOBs
56  ConversionMode jLJmode = getConversionMode(m_jLJReadKey, m_jLJWriteKey, msg());
58  ATH_CHECK(m_jLJWriteKey.initialize(jLJmode==ConversionMode::Decoding));
59  ATH_CHECK(m_jLJReadKey.initialize(jLJmode==ConversionMode::Encoding));
60  ATH_MSG_DEBUG((jLJmode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jLJ ROB IDs: "
61  << MSG::hex << m_robIds.value() << MSG::dec);
62 
63  // Conversion mode for jTau TOBs
64  ConversionMode jTaumode = getConversionMode(m_jTauReadKey, m_jTauWriteKey, msg());
66  ATH_CHECK(m_jTauWriteKey.initialize(jTaumode==ConversionMode::Decoding));
67  ATH_CHECK(m_jTauReadKey.initialize(jTaumode==ConversionMode::Encoding));
68  ATH_MSG_DEBUG((jTaumode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jTau ROB IDs: "
69  << MSG::hex << m_robIds.value() << MSG::dec);
70 
71  // Conversion mode for jEM TOBs
72  ConversionMode jEMmode = getConversionMode(m_jEMReadKey, m_jEMWriteKey, msg());
74  ATH_CHECK(m_jEMWriteKey.initialize(jEMmode==ConversionMode::Decoding));
75  ATH_CHECK(m_jEMReadKey.initialize(jEMmode==ConversionMode::Encoding));
76  ATH_MSG_DEBUG((jEMmode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jEM ROB IDs: "
77  << MSG::hex << m_robIds.value() << MSG::dec);
78 
79  // Conversion mode for jTE TOBs
80  ConversionMode jTEmode = getConversionMode(m_jTEReadKey, m_jTEWriteKey, msg());
82  ATH_CHECK(m_jTEWriteKey.initialize(jTEmode==ConversionMode::Decoding));
83  ATH_CHECK(m_jTEReadKey.initialize(jTEmode==ConversionMode::Encoding));
84  ATH_MSG_DEBUG((jTEmode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jTE ROB IDs: "
85  << MSG::hex << m_robIds.value() << MSG::dec);
86 
87  // Conversion mode for jXE TOBs
88  ConversionMode jXEmode = getConversionMode(m_jXEReadKey, m_jXEWriteKey, msg());
90  ATH_CHECK(m_jXEWriteKey.initialize(jXEmode==ConversionMode::Decoding));
91  ATH_CHECK(m_jXEReadKey.initialize(jXEmode==ConversionMode::Encoding));
92  ATH_MSG_DEBUG((jXEmode==ConversionMode::Encoding ? "Encoding" : "Decoding") << " jXE ROB IDs: "
93  << MSG::hex << m_robIds.value() << MSG::dec);
94 
95  //checking all Conversion modes.. avoid misconfigurations
96  const std::array<ConversionMode,5> modes{jLJmode,jTaumode,jEMmode,jTEmode,jXEmode};
97  if (std::any_of(modes.begin(),modes.end(),[&jJmode](ConversionMode m) { return m!=jJmode; } )) {
98  ATH_MSG_ERROR("Inconsistent conversion modes");
99  return StatusCode::FAILURE;
100  }
101 
103 
104 
105  //Reading from CVMFS TOB mapping
107 
108  // Initialize monitoring tool if not empty
109  if (!m_monTool.empty()) {
110  ATH_CHECK(m_monTool.retrieve());
111  ATH_MSG_INFO("Logging errors to " << m_monTool.name() << " monitoring tool");
112  m_UseMonitoring = true;
113  }
114 
115  return StatusCode::SUCCESS;
116 }
117 
119 
120  // Retrieve the L1 menu configuration
122  ATH_CHECK(l1Menu.isValid());
123 
124  try {
125  const auto& thrExtraInfo = l1Menu->thrExtraInfo();
126  const TrigConf::L1ThrExtraInfo_jTAU & thr_jTAU = thrExtraInfo.jTAU();
127  const TrigConf::L1ThrExtraInfo_jJ & thr_jJ = thrExtraInfo.jJ();
128  const TrigConf::L1ThrExtraInfo_jLJ & thr_jLJ = thrExtraInfo.jLJ();
129  const TrigConf::L1ThrExtraInfo_jEM & thr_jEM = thrExtraInfo.jEM();
130  const TrigConf::L1ThrExtraInfo_jTE & thr_jTE = thrExtraInfo.jTE();
131  const TrigConf::L1ThrExtraInfo_jXE & thr_jXE = thrExtraInfo.jXE();
132 
133  ATH_CHECK(thr_jTAU.isValid());
134  ATH_CHECK(thr_jJ.isValid() );
135  ATH_CHECK(thr_jLJ.isValid() );
136  ATH_CHECK(thr_jEM.isValid() );
137  ATH_CHECK(thr_jTE.isValid() );
138  ATH_CHECK(thr_jXE.isValid() );
139 
140  m_jTauRes = thr_jTAU.resolutionMeV();
141  m_jJRes = thr_jJ.resolutionMeV();
142  m_jLJRes = thr_jLJ.resolutionMeV();
143  m_jEMRes = thr_jEM.resolutionMeV();
144  m_jXERes = thr_jXE.resolutionMeV();
145  m_jTERes = thr_jTE.resolutionMeV();
146 
147  } catch (const std::exception& e) {
148  ATH_MSG_ERROR("Exception reading L1Menu: " << e.what());
149  return StatusCode::FAILURE;
150  }
151 
152  return StatusCode::SUCCESS;
153 
154 }
155 
156 
157 // BS->xAOD conversion
158 StatusCode jFexRoiByteStreamTool::convertFromBS(const std::vector<const ROBF*>& vrobf, const EventContext& ctx) const {
159 
160  //WriteHandle for jFEX EDMs
161 
162  //---SRJet EDM
164  ATH_CHECK(jJContainer.record(std::make_unique<xAOD::jFexSRJetRoIContainer>(), std::make_unique<xAOD::jFexSRJetRoIAuxContainer>()));
165  ATH_MSG_DEBUG("Recorded jFexSRJetRoIContainer with key " << jJContainer.key());
166 
167  //---LRJet EDM
169  ATH_CHECK(jLJContainer.record(std::make_unique<xAOD::jFexLRJetRoIContainer>(), std::make_unique<xAOD::jFexLRJetRoIAuxContainer>()));
170  ATH_MSG_DEBUG("Recorded jFexLRJetRoIContainer with key " << jLJContainer.key());
171 
172  //---Tau EDM
174  ATH_CHECK(jTauContainer.record(std::make_unique<xAOD::jFexTauRoIContainer>(), std::make_unique<xAOD::jFexTauRoIAuxContainer>()));
175  ATH_MSG_DEBUG("Recorded jFexTauRoIContainer with key " << jTauContainer.key());
176 
177  //---EM EDM
179  ATH_CHECK(jEMContainer.record(std::make_unique<xAOD::jFexFwdElRoIContainer>(), std::make_unique<xAOD::jFexFwdElRoIAuxContainer>()));
180  ATH_MSG_DEBUG("Recorded jFexFwdElRoIContainer with key " << jEMContainer.key());
181 
182  //---SumET EDM
184  ATH_CHECK(jTEContainer.record(std::make_unique<xAOD::jFexSumETRoIContainer>(), std::make_unique<xAOD::jFexSumETRoIAuxContainer>()));
185  ATH_MSG_DEBUG("Recorded jFexSumETRoIContainer with key " << jTEContainer.key());
186 
187  //---MET EDM
189  ATH_CHECK(jXEContainer.record(std::make_unique<xAOD::jFexMETRoIContainer>(), std::make_unique<xAOD::jFexMETRoIAuxContainer>()));
190  ATH_MSG_DEBUG("Recorded jFexMETRoIContainer with key " << jXEContainer.key());
191 
192 
193 
194 
195  // Iterate over ROBFragments to decode
196  for (const ROBF* rob : vrobf) {
197  // Iterate over ROD words and decode
198 
199  ATH_MSG_DEBUG("Starting to decode " << rob->rod_ndata() << " ROD words from ROB 0x" << std::hex << rob->rob_source_id() << std::dec);
200 
201  //There is no data to decode.. not even the ROD trailers
202  if(rob->rod_ndata() <= 0){
203  std::stringstream sdetail;
204  sdetail << "Not enough ROB words to read: "<<rob->rod_ndata() ;
205  std::stringstream slocation;
206  slocation << "0x"<< std::hex << rob->rob_source_id();
207  std::stringstream stitle;
208  stitle << "Invalid amount of ROB words" ;
209  printError(slocation.str(),stitle.str(),MSG::WARNING,sdetail.str());
210 
211  continue;
212  }
213 
214  const auto dataArray = std::span{rob->rod_data(), rob->rod_ndata()};
215  std::vector<uint32_t> vec_words(dataArray.begin(),dataArray.end());
216 
217  std::stringstream myPrint;
218 
219  myPrint << "jFEX TOB words to decode:"<< std::endl;
220  int aux = 1;
221  for (const uint32_t word : vec_words) {
222  myPrint << aux << " raw word ---> 0x"<< std::hex << word << std::dec << std::endl;
223  aux++;
224  }
225  ATH_MSG_DEBUG(myPrint.str());
226 
227  // Starting to loop over the different jFEX blocks
228  bool READ_TOBS = true;
229  // jFEX to ROD trailer position after the ROD trailer
230  unsigned int trailers_pos = rob->rod_ndata() - jBits::ROD_WORDS;
231 
232  if(vec_words.size() < (jBits::ROD_WORDS+jBits::jFEX2ROD_WORDS) || trailers_pos < (jBits::ROD_WORDS+jBits::jFEX2ROD_WORDS) ){
233  std::stringstream sdetail;
234  sdetail << "Not enough jFEX TOB words to decode (<4). Number of word to decode: "<<vec_words.size()<< ". Position within the vector: "<<trailers_pos ;
235  std::stringstream slocation;
236  slocation << "0x"<< std::hex << rob->rob_source_id();
237  std::stringstream stitle;
238  stitle << "Less than 4 trailers" ;
239  printError(slocation.str(),stitle.str(),MSG::WARNING,sdetail.str());
240 
241  continue;
242  }
243 
244  //check ROD error
245  const auto [RODerror] = RODTrailer ( vec_words.at(rob->rod_ndata()-2), vec_words.at(rob->rod_ndata()-1) );
246 
247  // if ROD errors return gracefully
248  if(RODerror != 0){
249  bool corTrailer = ((RODerror >> jBits::ROD_ERROR_CORR_TRAILER ) & jBits::ROD_TRAILER_1b);
250  bool payloadCRC = ((RODerror >> jBits::ROD_ERROR_PAYLOAD_CRC ) & jBits::ROD_TRAILER_1b);
251  bool headerCRC = ((RODerror >> jBits::ROD_ERROR_HEADER_CRC ) & jBits::ROD_TRAILER_1b);
252  bool reserved = ((RODerror >> jBits::ROD_ERROR_RESERVED ) & jBits::ROD_TRAILER_1b);
253  bool lenerror = ((RODerror >> jBits::ROD_ERROR_LENGTH_MISMATCH ) & jBits::ROD_TRAILER_1b);
254  bool headmismatch = ((RODerror >> jBits::ROD_ERROR_HEADER_MISMATCH ) & jBits::ROD_TRAILER_1b);
255  bool processerror = ((RODerror >> jBits::ROD_ERROR_PROC_TIMEOUT ) & jBits::ROD_TRAILER_1b);
256 
257  std::stringstream sdetail;
258  sdetail << "ROD Trailer Error bits set - 7-bits error word: 0x"<< std::hex <<RODerror << std::dec<< std::endl;
259  sdetail << "Corrective Trailer: "<< corTrailer << std::endl;
260  sdetail << "Payload CRC : "<< payloadCRC << std::endl;
261  sdetail << "Header CRC : "<< headerCRC << std::endl;
262  sdetail << "Reserved (=0) : "<< reserved << std::endl;
263  sdetail << "Length Mismatch : "<< lenerror << std::endl;
264  sdetail << "Header Mismatch : "<< headmismatch << std::endl;
265  sdetail << "Processor timeout : "<< processerror << std::endl;
266  std::stringstream slocation;
267  slocation << "ROD Error";
268 
269  //Returning Status code failure, it needs to go to debug stream
270  if( corTrailer ){
271  std::stringstream stitle;
272  stitle << "Corrective Trailer" ;
273  printError(slocation.str(),stitle.str(),MSG::ERROR,stitle.str() + " - "+ sdetail.str());
274  return StatusCode::FAILURE;
275  }
276  if( payloadCRC ){
277  std::stringstream stitle;
278  stitle << "Payload CRC" ;
279  printError(slocation.str(),stitle.str(),MSG::ERROR,stitle.str() + " - "+ sdetail.str());
280  return StatusCode::FAILURE;
281  }
282  if( headerCRC ){
283  std::stringstream stitle;
284  stitle << "Header CRC" ;
285  printError(slocation.str(),stitle.str(),MSG::ERROR,stitle.str() + " - "+ sdetail.str());
286  return StatusCode::FAILURE;
287  }
288  if( lenerror ){
289  std::stringstream stitle;
290  stitle << "Length mismatch" ;
291  printError(slocation.str(),stitle.str(),MSG::ERROR,stitle.str() + " - "+ sdetail.str());
292  return StatusCode::FAILURE;
293  }
294  if( headmismatch ){
295  std::stringstream stitle;
296  stitle << "Header mismatch" ;
297  printError(slocation.str(),stitle.str(),MSG::ERROR,stitle.str() + " - "+ sdetail.str());
298  return StatusCode::FAILURE;
299  }
300  if( processerror ){
301  std::stringstream stitle;
302  stitle << "Processor Timeout" ;
303  printError(slocation.str(),stitle.str(),MSG::ERROR,stitle.str() + " - "+ sdetail.str());
304  return StatusCode::FAILURE;
305  }
306 
307  return StatusCode::FAILURE;
308  }
309 
310  while(READ_TOBS){
311 
312  const auto [payload, fpga, jfex, error] = jFEXtoRODTrailer ( vec_words.at(trailers_pos-2), vec_words.at(trailers_pos-1) );
313  const auto [n_xjJ, n_xjLJ, n_xjTau, n_xjEM] = xTOBCounterTrailer( vec_words.at(trailers_pos-3) );
314  const auto [n_jJ, n_jLJ, n_jTau, n_jEM, n_jTE, n_jXE] = TOBCounterTrailer ( vec_words.at(trailers_pos-4) );
315  unsigned int n_tobs = n_jJ + n_jLJ + n_jTau + n_jEM + n_jTE + n_jXE;
316  unsigned int n_xtobs = n_xjJ + n_xjLJ + n_xjTau + n_xjEM;
317  unsigned int total_tobs = n_tobs+n_xtobs;
318  //printf("----------> trailer_pos:%3d payload:%3d N.Words:%3d fpga:%3d jfex:%3d\n",trailers_pos,payload,total_tobs+jBits::TOB_TRAILERS,fpga,jfex);
319  //printf(" TOBs(0x%08x): jJ:%3d jLJ:%3d jTau:%3d jEM:%3d jTE:%3d jXE:%3d\n",vec_words.at(trailers_pos-4),n_jJ,n_jLJ,n_jTau,n_jEM,n_jTE,n_jXE);
320  //printf("xTOBs(0x%08x): xjJ:%3d xjLJ:%3d xjTau:%3d xjEM:%3d\n",vec_words.at(trailers_pos-3),n_xjJ,n_xjLJ,n_xjTau,n_xjEM);
321 
322  // First we need to check if there is a padding word.
323  //Padding wordis when there is an even number in the payload, but odd number of xTOB and TOB.. need to check and remove the extra word.
324  unsigned int paddingWord = 0;
325  if(total_tobs % 2){
326  ATH_MSG_DEBUG("Odd number of TOBs + xTOBs:"<< total_tobs<<", there is a padding word!");
327  paddingWord = 1;
328  }
329 
330  if(error != 0){
331 
332  bool corTrailer = ((error >> jBits::ERROR_CORR_TRAILER ) & jBits::ROD_TRAILER_1b);
333  bool safemode = ((error >> jBits::ERROR_SAFE_MODE ) & jBits::ROD_TRAILER_1b);
334  bool proterror = ((error >> jBits::ERROR_PROTOCOL_ERROR ) & jBits::ROD_TRAILER_1b);
335  bool lenerror = ((error >> jBits::ERROR_LENGTH_MISMATCH ) & jBits::ROD_TRAILER_1b);
336  bool headmismatch = ((error >> jBits::ERROR_HEADER_MISMATCH ) & jBits::ROD_TRAILER_1b);
337  bool processerror = ((error >> jBits::ERROR_PROC_TIMEOUT ) & jBits::ROD_TRAILER_1b);
338 
339  std::stringstream sdetail;
340  sdetail << "jFEX to ROD Trailer Error bits set - 6-bits error word: 0x"<< std::hex <<error << std::dec<< std::endl;
341  sdetail << "Corrective Trailer: "<< corTrailer << std::endl;
342  sdetail << "Safe Mode : "<< safemode << std::endl;
343  sdetail << "Protocol error : "<< proterror << std::endl;
344  sdetail << "Length Mismatch : "<< lenerror << std::endl;
345  sdetail << "Header Mismatch : "<< headmismatch << std::endl;
346  sdetail << "Processor timeout : "<< processerror << std::endl;
347  std::stringstream slocation;
348  slocation << "Error bit set";
349 
350  if( corTrailer ){
351  std::stringstream stitle;
352  stitle << "Corrective Trailer" ;
353  printError(slocation.str(),stitle.str(),MSG::ERROR,sdetail.str());
354 
355  //Returning Status code failure needs to go to debug stream
356  return StatusCode::FAILURE;
357  }
358  if( safemode ){
359  std::stringstream stitle;
360  stitle << "Safe Mode" ;
361  printError(slocation.str(),stitle.str(),MSG::WARNING,sdetail.str());
362  }
363  if( proterror ){
364  std::stringstream stitle;
365  stitle << "Protocol error" ;
366  printError(slocation.str(),stitle.str(),MSG::WARNING,sdetail.str());
367  }
368  if( lenerror ){
369  std::stringstream stitle;
370  stitle << "Length mismatch" ;
371  printError(slocation.str(),stitle.str(),MSG::DEBUG,sdetail.str());
372  }
373  if( headmismatch ){
374  std::stringstream stitle;
375  stitle << "Header mismatch" ;
376  printError(slocation.str(),stitle.str(),MSG::DEBUG,sdetail.str());
377  }
378  if( processerror ){
379  std::stringstream stitle;
380  stitle << "Processor Timeout" ;
381  printError(slocation.str(),stitle.str(),MSG::DEBUG,sdetail.str());
382  }
383 
384  }
385 
386  if(payload != (total_tobs + jBits::TOB_TRAILERS + paddingWord)){
387  std::stringstream sdetail;
388  sdetail << "Payload="<< payload<<" is different from TOBs+Trailers+padding words="<< total_tobs + jBits::TOB_TRAILERS + paddingWord <<" in FPGA: "<< fpga << " and jFEX: "<< jfex <<". SKIPPED!" ;
389  std::stringstream slocation;
390  slocation << "jFEX "<< jfex << " FPGA "<< fpga << " in 0x"<< std::hex << rob->rob_source_id();
391  std::stringstream stitle;
392  stitle << "Wrong payload" ;
393  printError(slocation.str(),stitle.str(),MSG::WARNING,sdetail.str());
394 
395  //Checking if we can continue decoding data for the rest of FPGAs. No negative positions
396  int neg_positions = trailers_pos - (payload + jBits::TOB_TRAILERS);
397  //If negative, whole event must be discarded!
398  if(neg_positions < 0){
399  std::stringstream sdetail;
400  sdetail << "jFEX TOB decoder has discarded the whole event. Due to a wrong payload cannot continue decoding" ;
401  std::stringstream slocation;
402  slocation << "jFEX "<< jfex << " FPGA "<< fpga << " in 0x"<< std::hex << rob->rob_source_id();
403  std::stringstream stitle;
404  stitle << "Event discarded" ;
405 
406  printError(slocation.str(),stitle.str(),MSG::DEBUG,sdetail.str());
407  break;
408  }
409 
410  //Jumping to next FPGA
411  trailers_pos -= (payload+jBits::TOB_TRAILERS);
412 
413  //Is it 0? then we finish the loop, next event
414  if(trailers_pos == 0) {
415  READ_TOBS = false;
416  }
417  continue;
418  }
419 
420  //The minimum number for the payload should be 2 (The TOB/xTOB counters). If lower send an error message
421  if(payload < jBits::TOB_TRAILERS){
422  std::stringstream sdetail;
423  sdetail << "Payload: "<< payload<<" is lower than the expected size (at least" << jBits::TOB_TRAILERS << "trailers)" ;
424  std::stringstream slocation;
425  slocation << "jFEX "<< jfex << " FPGA "<< fpga << " in 0x"<< std::hex << rob->rob_source_id();
426  std::stringstream stitle;
427  stitle << "Event discarded" ;
428 
429  printError(slocation.str(),stitle.str(),MSG::WARNING,sdetail.str());
430  break;
431  }
432 
433  //removing jFEX to ROD, TOB and xTOB Trailers from trailers_pos (4 positions), possible padding word added on the data to get even number of 32bit words
434  unsigned int tobIndex = trailers_pos - (jBits::jFEX2ROD_WORDS + jBits::TOB_TRAILERS + paddingWord);
435 
436  if(paddingWord == 1){
437  ATH_MSG_DEBUG("Padding word: "<< std::hex << vec_words.at(tobIndex) <<std::dec);
438  }
439 
441  /************************************************** DECODING xTOBS **************************************************/
442 
443  //saving xjEM into the EDM container
444  for(unsigned int i=tobIndex; i>tobIndex-n_xjEM; i--) {
445  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jEM xTOB");
446  jEMContainer->push_back( std::make_unique<xAOD::jFexFwdElRoI>() );
447  jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),0, m_jEMRes, eta, phi);
448  }
449  //removing xjEM counter from TOBs
450  tobIndex -= n_xjEM;
451 
452  //saving xjTau into the EDM container
453  for(unsigned int i=tobIndex; i>tobIndex-n_xjTau; i--) {
454  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jTau xTOB");
455  jTauContainer->push_back( std::make_unique<xAOD::jFexTauRoI>() );
456  jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),0, m_jTauRes, eta, phi);
457  }
458  //removing xjTau counter from TOBs
459  tobIndex -= n_xjTau;
460 
461  //saving xjLJ into the EDM container
462  /* Aug 2025 - commented out so that we no longer fill jLJ collections. May be resurrected for run4
463  * so am leaving this code commented
464  for(unsigned int i=tobIndex; i>tobIndex-n_xjLJ; i--) {
465  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jLJ xTOB");
466  jLJContainer->push_back( std::make_unique<xAOD::jFexLRJetRoI>() );
467  jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),0, m_jLJRes, eta, phi);
468  } */
469  //removing xjLJ counter from TOBs
470  tobIndex -= n_xjLJ;
471 
472  //saving xjJ into the EDM container
473  for(unsigned int i=tobIndex; i>tobIndex-n_xjJ; i--) {
474  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jJ xTOB");
475  jJContainer->push_back( std::make_unique<xAOD::jFexSRJetRoI>() );
476  jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),0, m_jJRes, eta, phi);
477  }
478  //removing xjJ counter from TOBs
479  tobIndex -= n_xjJ;
480 
481  // skipping TOBs to jump to the next set of data
482  tobIndex -= n_tobs;
483 
484  }
485  else {
486  /************************************************** DECODING TOBS **************************************************/
487 
488  // skipping extended-TOBs
489  tobIndex -= n_xtobs;
490 
491  //saving jXE into the EDM container
492  //Only FPGA U1 and U4 are sent to L1Topo, it cover the full phi
493  if(fpga == jBits::FPGA_U1 || fpga == jBits::FPGA_U4 ){
494  for(unsigned int i=tobIndex; i>tobIndex-n_jXE; i--) {
495  jXEContainer->push_back( std::make_unique<xAOD::jFexMETRoI>() );
496  jXEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), m_jXERes);
497  }
498  }
499  //removing jXE counter from TOBs
500  tobIndex -= n_jXE;
501 
502  //saving jTE into the EDM container
503  //Only FPGA U1 and U4 are sent to L1Topo, it cover the full phi
504  if(fpga == jBits::FPGA_U1 || fpga == jBits::FPGA_U4 ) {
505  for(unsigned int i=tobIndex; i>tobIndex-n_jTE; i--) {
506  jTEContainer->push_back( std::make_unique<xAOD::jFexSumETRoI>() );
507  jTEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), m_jTERes);
508  }
509  }
510  //removing jTE counter from TOBs
511  tobIndex -= n_jTE;
512 
513  //saving jEM into the EDM container
514  for(unsigned int i=tobIndex; i>tobIndex-n_jEM; i--) {
515  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jEM TOB");
516  jEMContainer->push_back( std::make_unique<xAOD::jFexFwdElRoI>() );
517  jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jEMRes, eta, phi);
518  }
519  //removing jEM counter from TOBs
520  tobIndex -= n_jEM;
521 
522  //saving jTau into the EDM container
523  for(unsigned int i=tobIndex; i>tobIndex-n_jTau; i--) {
524  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jTau TOB");
525  jTauContainer->push_back( std::make_unique<xAOD::jFexTauRoI>() );
526  jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jTauRes, eta, phi);
527  }
528  //removing jTau counter from TOBs
529  tobIndex -= n_jTau;
530 
531  //saving jLJ into the EDM container
532  for(unsigned int i=tobIndex; i>tobIndex-n_jLJ; i--) {
533  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jLJ TOB");
534  jLJContainer->push_back( std::make_unique<xAOD::jFexLRJetRoI>() );
535  jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jLJRes, eta, phi);
536  }
537  //removing jLJ counter from TOBs
538  tobIndex -= n_jLJ;
539 
540  //saving jJ into the EDM container
541  for(unsigned int i=tobIndex; i>tobIndex-n_jJ; i--) {
542  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jJ TOB");
543  jJContainer->push_back( std::make_unique<xAOD::jFexSRJetRoI>() );
544  jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jJRes, eta, phi);
545  }
546  //removing jJ counter from TOBs
547  tobIndex -= n_jJ;
548  }
549  //moving trailer position index to the next jFEX data block
550  trailers_pos -= (payload + jBits::jFEX2ROD_WORDS);
551 
552  if(trailers_pos != tobIndex){
553  std::stringstream sdetail;
554  sdetail << "Something went wrong decoding jFEX BS data. Trailer position: " << trailers_pos << " should match the TOB index position:" << tobIndex ;
555  std::stringstream slocation;
556  slocation << "jFEX "<< jfex << " FPGA "<< fpga << " in 0x"<< std::hex << rob->rob_source_id();
557  std::stringstream stitle;
558  stitle << "Wrong amount of words" ;
559 
560  printError(slocation.str(),stitle.str(),MSG::ERROR,sdetail.str());
561 
562  return StatusCode::FAILURE;
563  }
564 
565 
566  if(trailers_pos == 0){
567  READ_TOBS = false;
568  }
569  }
570  }
571 
572  return StatusCode::SUCCESS;
573 }
574 
575 
576 // Unpack number of TOBs in Trailer "TOB,XTOB Counter Trailer"
577 std::array<uint32_t,6> jFexRoiByteStreamTool::TOBCounterTrailer (uint32_t word) const {
578 
579  uint32_t jJ = ((word >> jBits::jJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
580  uint32_t jLJ = ((word >> jBits::jLJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
581  uint32_t jTau = ((word >> jBits::jTau_TOB_COUNTS) & jBits::TOB_COUNTS_6b);
582  uint32_t jEM = ((word >> jBits::jEM_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
583  uint32_t jTE = ((word >> jBits::jTE_TOB_COUNTS ) & jBits::TOB_COUNTS_1b);
584  uint32_t jXE = ((word >> jBits::jXE_TOB_COUNTS ) & jBits::TOB_COUNTS_1b);
585  //uint32_t TSM = ((word ) & jBits::TOB_COUNTS_1b); // Trigger Safe Mode. Not used for now, maybe is needed in the future
586 
587  std::stringstream sdetail;
588  sdetail << "TOB Counter Trailer. Word: 0x"<< std::hex <<word << std::dec << std::endl;
589  sdetail << "jJ Item : "<< jJ << std::endl;
590  sdetail << "jLJ Item : "<< jLJ << std::endl;
591  sdetail << "jTau Item : "<< jTau << std::endl;
592  sdetail << "jEM Item : "<< jEM << std::endl;
593  sdetail << "jTE Item : "<< jTE << std::endl;
594  sdetail << "jXE Item : "<< jXE << std::endl;
595  ATH_MSG_DEBUG(sdetail.str());
596 
597  return {jJ,jLJ,jTau,jEM,jTE,jXE};
598 
599 }
600 
601 // Unpack number of xTOBs in Trailer "TOB,XTOB Counter Trailer"
602 std::array<uint32_t,4> jFexRoiByteStreamTool::xTOBCounterTrailer (uint32_t word) const {
603 
604  uint32_t xjJ = ((word >> jBits::jJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
605  uint32_t xjLJ = ((word >> jBits::jLJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
606  uint32_t xjTau = ((word >> jBits::jTau_TOB_COUNTS) & jBits::TOB_COUNTS_6b);
607  uint32_t xjEM = ((word >> jBits::jEM_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
608 
609  std::stringstream sdetail;
610  sdetail << "xTOB Counter Trailer. Word: 0x"<< std::hex <<word << std::dec << std::endl;
611  sdetail << "xjJ Item : "<< xjJ << std::endl;
612  sdetail << "xjLJ Item : "<< xjLJ << std::endl;
613  sdetail << "xjTau Item : "<< xjTau << std::endl;
614  sdetail << "xjEM Item : "<< xjEM << std::endl;
615  ATH_MSG_DEBUG(sdetail.str());
616 
617  return {xjJ,xjLJ,xjTau,xjEM};
618 
619 }
620 
621 // Unpack jFEX to ROD Trailer
622 std::array<uint32_t,4> jFexRoiByteStreamTool::jFEXtoRODTrailer (uint32_t word0, uint32_t word1) const {
623 
624  uint32_t payload = ((word0 >> jBits::PAYLOAD_ROD_TRAILER ) & jBits::ROD_TRAILER_16b);
625  uint32_t fpga = ((word0 >> jBits::FPGA_ROD_TRAILER ) & jBits::ROD_TRAILER_2b );
626  uint32_t jfex = ((word0 >> jBits::jFEX_ROD_TRAILER ) & jBits::ROD_TRAILER_4b );
627  uint32_t ROslice = ((word0 >> jBits::RO_ROD_TRAILER ) & jBits::ROD_TRAILER_4b );
628  uint32_t TSN = ((word0 >> jBits::TSN_ROD_TRAILER ) & jBits::ROD_TRAILER_4b );
629 
630  uint32_t error = ((word1 >> jBits::ERROR_ROD_TRAILER ) & jBits::ROD_TRAILER_6b );
631  uint32_t CRC = ((word1 >> jBits::CRC_ROD_TRAILER ) & jBits::ROD_TRAILER_20b);
632 
633 
634  std::stringstream sdetail;
635  sdetail << "jFEX to ROD Trailer. Word0: 0x"<< std::hex <<word0 << " and Word1: 0x"<< word1 << std::endl;
636  sdetail << "Payload (from word0): "<< payload << std::endl;
637  sdetail << "FPGA (from word0): "<< fpga << std::endl;
638  sdetail << "jFEX (from word0): "<< jfex << std::endl;
639  sdetail << "RO slice (from word0): "<< ROslice << std::endl;
640  sdetail << "TSN (from word0): "<< TSN << std::endl;
641  sdetail << "Error (from word1): "<< error << std::endl;
642  sdetail << "CRC (from word1): "<< CRC << std::dec << std::endl;
643 
644  ATH_MSG_DEBUG(sdetail.str());
645 
646  return {payload, fpga, jfex, error};
647 
648 }
649 
650 // Unpack ROD Trailer
651 std::array<uint32_t,1> jFexRoiByteStreamTool::RODTrailer (uint32_t /*word0*/, uint32_t word1) const {
652 
653  uint32_t error = ((word1 >> jBits::ERROR_ROD_TRAILER ) & jBits::ROD_TRAILER_7b );
654 
655  //return an array since we can implement more features in the future
656  return {error};
657 
658 }
659 
660 
661 // Unpack jFEX to ROD Header
662 void jFexRoiByteStreamTool::jFEXtoRODHeader (uint32_t /*word0*/, uint32_t /*word1*/) const {
663 
664  //std::cout << "jFEXtoRODHeader: word0 0x" << std::hex << word0 << std::dec << std::endl;
665  //std::cout << "jFEXtoRODHeader: word1 0x" << std::hex << word1 << std::dec << std::endl;
666 
667  //std::cout << "\tWord0 : " << std::bitset<32>(word0) << std::endl;
668  //std::cout << "\tWord1 : " << std::bitset<32>(word1) << std::endl;
669 
670 
671  //std::cout << "\tWord0 L1Calo: " << ((word0 >> jBits::L1CALO_STREAM_ID_ROD_HEADER ) & jBits::ROD_HEADER_8b ) << std::endl;
672  //std::cout << "\t\t L1Calo SLOT: " << ((word0 >> (jBits::L1CALO_STREAM_ID_ROD_HEADER + jBits::L1CALO_STREAM_ID_SLOT_ROD_HEADER) ) & 4 ) << std::endl;
673  //std::cout << "\t\t L1Calo FPGA: " << ((word0 >> (jBits::L1CALO_STREAM_ID_ROD_HEADER + jBits::L1CALO_STREAM_ID_FPGA_ROD_HEADER) ) & 2 ) << std::endl;
674  //std::cout << "\t\t L1Calo INFO: " << ((word0 >> (jBits::L1CALO_STREAM_ID_ROD_HEADER + jBits::L1CALO_STREAM_ID_INFO_ROD_HEADER) ) & 2 ) << std::endl;
675  //std::cout << "\tWord0 BCN : " << ((word0 >> jBits::BCN_ROD_HEADER ) & jBits::ROD_HEADER_12b ) << std::endl;
676  //std::cout << "\tWord0 CRC : " << ((word0 >> jBits::CRC_ROD_HEADER ) & jBits::ROD_HEADER_9b ) << std::endl;
677  //std::cout << "\tWord0 Vers : " << ((word0 >> jBits::VERS_ROD_HEADER ) & jBits::ROD_HEADER_3b ) << std::endl;
678 
679  //std::cout << "\tWord1 L1ID : " << ((word1 >> jBits::L1ID_ROD_HEADER ) & jBits::ROD_HEADER_24b ) << std::endl;
680  //std::cout << "\tWord1 ECRID : " << ((word1 >> jBits::ECRID_ROD_HEADER ) & jBits::ROD_HEADER_8b ) << std::endl;
681 
682 
683 
684 }
685 
686 
688 
689  std::string myline;
690 
691  //openning file with ifstream
692  std::ifstream myfile(fileName);
693 
694  if ( !myfile.is_open() ){
695  ATH_MSG_ERROR("Could not open file:" << fileName);
696  return StatusCode::FAILURE;
697  }
698 
699  //loading the mapping information
700  while ( std::getline (myfile, myline) ) {
701 
702  //removing the header of the file (it is just information!)
703  if(myline[0] == '#') continue;
704 
705  //Splitting myline in different substrings
706  std::stringstream oneLine(myline);
707 
708  //reading elements
709  std::vector<float> elements;
710  std::string element;
711  while(std::getline(oneLine, element, ' '))
712  {
713  elements.push_back(std::stof(element));
714  }
715 
716  // It should have 6 elements
717  // ordered as: jfex fpga localEta localPhi eta phi
718  if(elements.size() != 6){
719  ATH_MSG_ERROR("Unexpected number of elemennts (6 expected) in file: "<< fileName);
720  myfile.close();
721  return StatusCode::FAILURE;
722  }
723  // building array of < eta, phi >
724  std::array<float,2> aux_arr{ {elements.at(4),elements.at(5)} };
725 
726  //filling the map with the hash given by mapIndex()
727  m_TobPos_map[ mapIndex(elements.at(0),elements.at(1),elements.at(2),elements.at(3)) ] = aux_arr;
728 
729  }
730  myfile.close();
731 
732  return StatusCode::SUCCESS;
733 }
734 
735 constexpr unsigned int jFexRoiByteStreamTool::mapIndex(unsigned int jfex, unsigned int fpga, unsigned int iEta, unsigned int iPhi) {
736  // values from hardware: jfex=[0,5] 4 bits, fpga=[0,3] 4 bits, ieta=[0,24] 8 bits, iphi=[0,15] 4 bits
737  return (jfex << 16) | (fpga << 12) | (iEta << 4) | iPhi;
738 }
739 
740 std::array<uint8_t,2> jFexRoiByteStreamTool::unpackLocalCoords (uint32_t word) const{
741 
742  uint8_t iEta = (word >> s_etaBit) & s_etaMask;
743  uint8_t iPhi = (word >> s_phiBit) & s_phiMask;
744 
745  return {iEta, iPhi};
746 
747 }
748 
749 std::array<float,2> jFexRoiByteStreamTool::getEtaPhi (unsigned int jfex, unsigned int fpga, uint32_t word, const char* obj = "") const{
750 
751  const auto [iEta, iPhi] = unpackLocalCoords(word);
752  unsigned int index = mapIndex(jfex, fpga, iEta, iPhi);
753 
754  auto it = m_TobPos_map.find(index);
755  if(it == m_TobPos_map.end()){
756  //This should be a WARNING.. masked until jFEX firmware bug is fixed
757  ATH_MSG_DEBUG("No index found for "<< obj <<" word, jFex:"<<jfex << " Fpga:"<<fpga<< " iEta:"<<+iEta<< " iPhi:"<<+iPhi<< " for 32-bit word: 0x"<<std::hex<<word<<std::dec);
758  return {-99, -99};
759  }
760 
761  //returns an std::array<float,2> {eta, phi}
762  return it->second;
763 
764 }
765 
767 StatusCode jFexRoiByteStreamTool::convertToBS(std::vector<WROBF*>& /*vrobf*/, const EventContext& /*eventContext*/) {
768 
769 /*
770  // Retrieve the RoI container
771  auto muonRoIs = SG::makeHandle(m_roiReadKey, eventContext);
772  ATH_CHECK(muonRoIs.isValid());
773 
774  // Clear BS data cache
775  clearCache(eventContext);
776 
777  // Create raw ROD data words
778  ATH_MSG_DEBUG("Converting " << muonRoIs->size() << " L1 Muon RoIs to ByteStream");
779  uint32_t* data = newRodData(eventContext, muonRoIs->size());
780  for (size_t i=0; i<muonRoIs->size(); ++i) {
781  data[i] = muonRoIs->at(i)->roiWord();
782  }
783 
784  // Create ROBFragment containing the ROD words
785  const eformat::helper::SourceIdentifier sid(eformat::TDAQ_MUON_CTP_INTERFACE, m_muCTPIModuleID.value());
786  vrobf.push_back(newRobFragment(
787  eventContext,
788  sid.code(),
789  muonRoIs->size(),
790  data,
791  eformat::STATUS_BACK // status_position is system-specific
792  ));
793 */
794  return StatusCode::SUCCESS;
795 }
796 
797 
798 void jFexRoiByteStreamTool::printError(const std::string& location, const std::string& title, MSG::Level type, const std::string& detail) const{
799 
800  if(m_UseMonitoring){
802  Monitored::Scalar("jfexDecoderErrorLocation",location.empty() ? std::string("UNKNOWN") : location),
803  Monitored::Scalar("jfexDecoderErrorTitle" ,title.empty() ? std::string("UNKNOWN") : title)
804  );
805  }
806  else {
807  msg() << type << detail << endmsg;
808  }
809 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:235
jFexRoiByteStreamTool::ReadfromFile
StatusCode ReadfromFile(const std::string &)
Definition: jFexRoiByteStreamTool.cxx:687
jFexRoiByteStreamTool::s_etaBit
static const int s_etaBit
Definition: jFexRoiByteStreamTool.h:111
jFexRoiByteStreamTool::m_jTEWriteKey
SG::WriteHandleKey< xAOD::jFexSumETRoIContainer > m_jTEWriteKey
Definition: jFexRoiByteStreamTool.h:88
CxxUtils::span
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
color::B_GRAY
std::string B_GRAY
Definition: jFexInputByteStreamTool.cxx:36
color
Definition: jFexInputByteStreamTool.cxx:25
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
Undefined
@ Undefined
Definition: MaterialTypes.h:8
jFexBits.h
jFexRoiByteStreamTool::m_jTERes
int m_jTERes
Definition: jFexRoiByteStreamTool.h:121
jFexRoiByteStreamTool::mapIndex
constexpr static unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int iEta, unsigned int iPhi)
Definition: jFexRoiByteStreamTool.cxx:735
jFexRoiByteStreamTool::m_TobPos_map
std::unordered_map< unsigned int, std::array< float, 2 > > m_TobPos_map
Definition: jFexRoiByteStreamTool.h:130
xAOD::word1
word1
Definition: eFexEMRoI_v1.cxx:87
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
LVL1::jFEXBits
Definition: jFexBits.h:13
jFexRoiByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: jFexRoiByteStreamTool.cxx:46
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
color::GREEN
std::string GREEN
Definition: jFexInputByteStreamTool.cxx:29
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
TrigConf::L1ThrExtraInfo_jTE
Definition: L1ThrExtraInfo.h:556
color::B_GREEN
std::string B_GREEN
Definition: jFexInputByteStreamTool.cxx:38
TrigConf::L1Menu::thrExtraInfo
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition: L1Menu.cxx:307
skel.it
it
Definition: skel.GENtoEVGEN.py:407
color::END
std::string END
Definition: jFexInputByteStreamTool.cxx:32
color::PURPLE
std::string PURPLE
Definition: jFexInputByteStreamTool.cxx:31
jFexRoiByteStreamTool::xTOBCounterTrailer
std::array< uint32_t, 4 > xTOBCounterTrailer(uint32_t word) const
Definition: jFexRoiByteStreamTool.cxx:602
jFexRoiByteStreamTool::m_jTEReadKey
SG::ReadHandleKey< xAOD::jFexSumETRoIContainer > m_jTEReadKey
Definition: jFexRoiByteStreamTool.h:96
detail
Definition: extract_histogram_tag.cxx:14
jFexRoiByteStreamTool::TOBCounterTrailer
std::array< uint32_t, 6 > TOBCounterTrailer(uint32_t word) const
Definition: jFexRoiByteStreamTool.cxx:577
PixelByteStreamErrors::Decoding
@ Decoding
Definition: PixelByteStreamErrors.h:14
jFexRoiByteStreamTool::jFEXtoRODTrailer
std::array< uint32_t, 4 > jFEXtoRODTrailer(uint32_t word0, uint32_t word1) const
Definition: jFexRoiByteStreamTool.cxx:622
color::B_BLUE
std::string B_BLUE
Definition: jFexInputByteStreamTool.cxx:33
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
jFexRoiByteStreamTool.h
C
struct color C
TrigConf::L1ThrExtraInfo_jXE
Definition: L1ThrExtraInfo.h:544
TrigConf::DataStructure::isValid
bool isValid() const
Definition: DataStructure.h:215
ROBF
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment ROBF
Definition: ByteStreamMergeOutputSvc.cxx:16
jFexRoiByteStreamTool::convertToBS
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
xAOD->BS conversion
Definition: jFexRoiByteStreamTool.cxx:767
jFexRoiByteStreamTool::RODTrailer
std::array< uint32_t, 1 > RODTrailer(uint32_t word0, uint32_t word1) const
Definition: jFexRoiByteStreamTool.cxx:651
jFexRoiByteStreamTool::m_jLJWriteKey
SG::WriteHandleKey< xAOD::jFexLRJetRoIContainer > m_jLJWriteKey
Definition: jFexRoiByteStreamTool.h:86
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
jFexRoiByteStreamTool::m_jJRes
int m_jJRes
Definition: jFexRoiByteStreamTool.h:117
jFexRoiByteStreamTool::m_jXEWriteKey
SG::WriteHandleKey< xAOD::jFexMETRoIContainer > m_jXEWriteKey
Definition: jFexRoiByteStreamTool.h:89
jFexRoiByteStreamTool::m_jXEReadKey
SG::ReadHandleKey< xAOD::jFexMETRoIContainer > m_jXEReadKey
Definition: jFexRoiByteStreamTool.h:97
jFexRoiByteStreamTool::m_jJReadKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jJReadKey
Definition: jFexRoiByteStreamTool.h:93
jFexRoiByteStreamTool::m_jEMReadKey
SG::ReadHandleKey< xAOD::jFexFwdElRoIContainer > m_jEMReadKey
Definition: jFexRoiByteStreamTool.h:98
jFexRoiByteStreamTool::getEtaPhi
std::array< float, 2 > getEtaPhi(unsigned int jfex, unsigned int fpga, uint32_t word, const char *obj) const
Definition: jFexRoiByteStreamTool.cxx:749
lumiFormat.i
int i
Definition: lumiFormat.py:85
jFexRoiByteStreamTool::m_jEMRes
int m_jEMRes
Definition: jFexRoiByteStreamTool.h:119
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
jFexRoiByteStreamTool::printError
void printError(const std::string &location, const std::string &title, MSG::Level type, const std::string &detail) const
{map index, {eta,phi}}
Definition: jFexRoiByteStreamTool.cxx:798
color::RED
std::string RED
Definition: jFexInputByteStreamTool.cxx:26
jFexRoiByteStreamTool::s_phiBit
static const int s_phiBit
Definition: jFexRoiByteStreamTool.h:112
jFexRoiByteStreamTool::m_l1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition: jFexRoiByteStreamTool.h:81
jFexRoiByteStreamTool::unpackLocalCoords
std::array< uint8_t, 2 > unpackLocalCoords(uint32_t word) const
Definition: jFexRoiByteStreamTool.cxx:740
covarianceTool.title
title
Definition: covarianceTool.py:542
jFexRoiByteStreamTool::start
virtual StatusCode start() override
Definition: jFexRoiByteStreamTool.cxx:118
calibdata.exception
exception
Definition: calibdata.py:495
jFexRoiByteStreamTool::s_phiMask
static const int s_phiMask
Definition: jFexRoiByteStreamTool.h:114
test_pyathena.parent
parent
Definition: test_pyathena.py:15
jFexRoiByteStreamTool::m_robIds
Gaudi::Property< std::vector< uint32_t > > m_robIds
Definition: jFexRoiByteStreamTool.h:75
jFexRoiByteStreamTool::m_UseMonitoring
bool m_UseMonitoring
Definition: jFexRoiByteStreamTool.h:70
jFexRoiByteStreamTool::s_etaMask
static const int s_etaMask
Definition: jFexRoiByteStreamTool.h:113
color::BLUE
std::string BLUE
Definition: jFexInputByteStreamTool.cxx:30
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
jFexRoiByteStreamTool::m_TobMapping
Gaudi::Property< std::string > m_TobMapping
Definition: jFexRoiByteStreamTool.h:78
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
jFexRoiByteStreamTool::jFEXtoRODHeader
void jFEXtoRODHeader(uint32_t word0, uint32_t word1) const
Definition: jFexRoiByteStreamTool.cxx:662
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
jFexRoiByteStreamTool::m_jJWriteKey
SG::WriteHandleKey< xAOD::jFexSRJetRoIContainer > m_jJWriteKey
Definition: jFexRoiByteStreamTool.h:85
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
color::B_PURPLE
std::string B_PURPLE
Definition: jFexInputByteStreamTool.cxx:34
jFexRoiByteStreamTool::m_convertExtendedTOBs
Gaudi::Property< bool > m_convertExtendedTOBs
Definition: jFexRoiByteStreamTool.h:76
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrigConf::L1ThrExtraInfo_jTAU
Definition: L1ThrExtraInfo.h:298
TrigConf::L1ThrExtraInfoBase::resolutionMeV
unsigned int resolutionMeV() const
Definition: L1ThresholdBase.h:101
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
color::B_RED
std::string B_RED
Definition: jFexInputByteStreamTool.cxx:37
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment
eformat::write::ROBFragment ROBFragment
Definition: RawEvent.h:33
color::YELLOW
std::string YELLOW
Definition: jFexInputByteStreamTool.cxx:28
WROBF
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment WROBF
Definition: eFexByteStreamTool.cxx:27
DEBUG
#define DEBUG
Definition: page_access.h:11
jFexRoiByteStreamTool::m_jEMWriteKey
SG::WriteHandleKey< xAOD::jFexFwdElRoIContainer > m_jEMWriteKey
Definition: jFexRoiByteStreamTool.h:90
jFexRoiByteStreamTool::m_jLJRes
int m_jLJRes
Definition: jFexRoiByteStreamTool.h:118
jFexRoiByteStreamTool::convertFromBS
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
Definition: jFexRoiByteStreamTool.cxx:158
jFexRoiByteStreamTool::m_jLJReadKey
SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jLJReadKey
Definition: jFexRoiByteStreamTool.h:94
jFexRoiByteStreamTool::m_jTauRes
int m_jTauRes
Definition: jFexRoiByteStreamTool.h:116
TrigConf::L1ThrExtraInfo_jLJ
Definition: L1ThrExtraInfo.h:437
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigConf::L1ThrExtraInfo_jEM
Definition: L1ThrExtraInfo.h:191
get_generator_info.error
error
Definition: get_generator_info.py:40
jFexRoiByteStreamTool::m_jTauWriteKey
SG::WriteHandleKey< xAOD::jFexTauRoIContainer > m_jTauWriteKey
Definition: jFexRoiByteStreamTool.h:87
python.PyAthena.obj
obj
Definition: PyAthena.py:132
jFexRoiByteStreamTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: jFexRoiByteStreamTool.h:69
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:77
color::ORANGE
std::string ORANGE
Definition: jFexInputByteStreamTool.cxx:27
error
Definition: IImpactPoint3dEstimator.h:70
color::B_ORANGE
std::string B_ORANGE
Definition: jFexInputByteStreamTool.cxx:35
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
jFexRoiByteStreamTool::m_jTauReadKey
SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jTauReadKey
Definition: jFexRoiByteStreamTool.h:95
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
jFexRoiByteStreamTool::m_jXERes
int m_jXERes
Definition: jFexRoiByteStreamTool.h:120
TrigConf::L1ThrExtraInfo_jJ
Definition: L1ThrExtraInfo.h:392
jFexRoiByteStreamTool::jFexRoiByteStreamTool
jFexRoiByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: jFexRoiByteStreamTool.cxx:41