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  for(unsigned int i=tobIndex; i>tobIndex-n_xjLJ; i--) {
463  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jLJ xTOB");
464  jLJContainer->push_back( std::make_unique<xAOD::jFexLRJetRoI>() );
465  jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),0, m_jLJRes, eta, phi);
466  }
467  //removing xjLJ counter from TOBs
468  tobIndex -= n_xjLJ;
469 
470  //saving xjJ into the EDM container
471  for(unsigned int i=tobIndex; i>tobIndex-n_xjJ; i--) {
472  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jJ xTOB");
473  jJContainer->push_back( std::make_unique<xAOD::jFexSRJetRoI>() );
474  jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),0, m_jJRes, eta, phi);
475  }
476  //removing xjJ counter from TOBs
477  tobIndex -= n_xjJ;
478 
479  // skipping TOBs to jump to the next set of data
480  tobIndex -= n_tobs;
481 
482  }
483  else {
484  /************************************************** DECODING TOBS **************************************************/
485 
486  // skipping extended-TOBs
487  tobIndex -= n_xtobs;
488 
489  //saving jXE into the EDM container
490  //Only FPGA U1 and U4 are sent to L1Topo, it cover the full phi
491  if(fpga == jBits::FPGA_U1 || fpga == jBits::FPGA_U4 ){
492  for(unsigned int i=tobIndex; i>tobIndex-n_jXE; i--) {
493  jXEContainer->push_back( std::make_unique<xAOD::jFexMETRoI>() );
494  jXEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), m_jXERes);
495  }
496  }
497  //removing jXE counter from TOBs
498  tobIndex -= n_jXE;
499 
500  //saving jTE into the EDM container
501  //Only FPGA U1 and U4 are sent to L1Topo, it cover the full phi
502  if(fpga == jBits::FPGA_U1 || fpga == jBits::FPGA_U4 ) {
503  for(unsigned int i=tobIndex; i>tobIndex-n_jTE; i--) {
504  jTEContainer->push_back( std::make_unique<xAOD::jFexSumETRoI>() );
505  jTEContainer->back()->initialize(jfex, fpga, vec_words.at(i-1), m_jTERes);
506  }
507  }
508  //removing jTE counter from TOBs
509  tobIndex -= n_jTE;
510 
511  //saving jEM into the EDM container
512  for(unsigned int i=tobIndex; i>tobIndex-n_jEM; i--) {
513  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jEM TOB");
514  jEMContainer->push_back( std::make_unique<xAOD::jFexFwdElRoI>() );
515  jEMContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jEMRes, eta, phi);
516  }
517  //removing jEM counter from TOBs
518  tobIndex -= n_jEM;
519 
520  //saving jTau into the EDM container
521  for(unsigned int i=tobIndex; i>tobIndex-n_jTau; i--) {
522  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jTau TOB");
523  jTauContainer->push_back( std::make_unique<xAOD::jFexTauRoI>() );
524  jTauContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jTauRes, eta, phi);
525  }
526  //removing jTau counter from TOBs
527  tobIndex -= n_jTau;
528 
529  //saving jLJ into the EDM container
530  for(unsigned int i=tobIndex; i>tobIndex-n_jLJ; i--) {
531  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jLJ TOB");
532  jLJContainer->push_back( std::make_unique<xAOD::jFexLRJetRoI>() );
533  jLJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jLJRes, eta, phi);
534  }
535  //removing jLJ counter from TOBs
536  tobIndex -= n_jLJ;
537 
538  //saving jJ into the EDM container
539  for(unsigned int i=tobIndex; i>tobIndex-n_jJ; i--) {
540  const auto [eta, phi ] = getEtaPhi(jfex, fpga, vec_words.at(i-1),"jJ TOB");
541  jJContainer->push_back( std::make_unique<xAOD::jFexSRJetRoI>() );
542  jJContainer->back()->initialize(jfex, fpga, vec_words.at(i-1),1, m_jJRes, eta, phi);
543  }
544  //removing jJ counter from TOBs
545  tobIndex -= n_jJ;
546  }
547  //moving trailer position index to the next jFEX data block
548  trailers_pos -= (payload + jBits::jFEX2ROD_WORDS);
549 
550  if(trailers_pos != tobIndex){
551  std::stringstream sdetail;
552  sdetail << "Something went wrong decoding jFEX BS data. Trailer position: " << trailers_pos << " should match the TOB index position:" << tobIndex ;
553  std::stringstream slocation;
554  slocation << "jFEX "<< jfex << " FPGA "<< fpga << " in 0x"<< std::hex << rob->rob_source_id();
555  std::stringstream stitle;
556  stitle << "Wrong amount of words" ;
557 
558  printError(slocation.str(),stitle.str(),MSG::ERROR,sdetail.str());
559 
560  return StatusCode::FAILURE;
561  }
562 
563 
564  if(trailers_pos == 0){
565  READ_TOBS = false;
566  }
567  }
568  }
569 
570  return StatusCode::SUCCESS;
571 }
572 
573 
574 // Unpack number of TOBs in Trailer "TOB,XTOB Counter Trailer"
575 std::array<uint32_t,6> jFexRoiByteStreamTool::TOBCounterTrailer (uint32_t word) const {
576 
577  uint32_t jJ = ((word >> jBits::jJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
578  uint32_t jLJ = ((word >> jBits::jLJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
579  uint32_t jTau = ((word >> jBits::jTau_TOB_COUNTS) & jBits::TOB_COUNTS_6b);
580  uint32_t jEM = ((word >> jBits::jEM_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
581  uint32_t jTE = ((word >> jBits::jTE_TOB_COUNTS ) & jBits::TOB_COUNTS_1b);
582  uint32_t jXE = ((word >> jBits::jXE_TOB_COUNTS ) & jBits::TOB_COUNTS_1b);
583  //uint32_t TSM = ((word ) & jBits::TOB_COUNTS_1b); // Trigger Safe Mode. Not used for now, maybe is needed in the future
584 
585  std::stringstream sdetail;
586  sdetail << "TOB Counter Trailer. Word: 0x"<< std::hex <<word << std::dec << std::endl;
587  sdetail << "jJ Item : "<< jJ << std::endl;
588  sdetail << "jLJ Item : "<< jLJ << std::endl;
589  sdetail << "jTau Item : "<< jTau << std::endl;
590  sdetail << "jEM Item : "<< jEM << std::endl;
591  sdetail << "jTE Item : "<< jTE << std::endl;
592  sdetail << "jXE Item : "<< jXE << std::endl;
593  ATH_MSG_DEBUG(sdetail.str());
594 
595  return {jJ,jLJ,jTau,jEM,jTE,jXE};
596 
597 }
598 
599 // Unpack number of xTOBs in Trailer "TOB,XTOB Counter Trailer"
600 std::array<uint32_t,4> jFexRoiByteStreamTool::xTOBCounterTrailer (uint32_t word) const {
601 
602  uint32_t xjJ = ((word >> jBits::jJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
603  uint32_t xjLJ = ((word >> jBits::jLJ_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
604  uint32_t xjTau = ((word >> jBits::jTau_TOB_COUNTS) & jBits::TOB_COUNTS_6b);
605  uint32_t xjEM = ((word >> jBits::jEM_TOB_COUNTS ) & jBits::TOB_COUNTS_6b);
606 
607  std::stringstream sdetail;
608  sdetail << "xTOB Counter Trailer. Word: 0x"<< std::hex <<word << std::dec << std::endl;
609  sdetail << "xjJ Item : "<< xjJ << std::endl;
610  sdetail << "xjLJ Item : "<< xjLJ << std::endl;
611  sdetail << "xjTau Item : "<< xjTau << std::endl;
612  sdetail << "xjEM Item : "<< xjEM << std::endl;
613  ATH_MSG_DEBUG(sdetail.str());
614 
615  return {xjJ,xjLJ,xjTau,xjEM};
616 
617 }
618 
619 // Unpack jFEX to ROD Trailer
620 std::array<uint32_t,4> jFexRoiByteStreamTool::jFEXtoRODTrailer (uint32_t word0, uint32_t word1) const {
621 
622  uint32_t payload = ((word0 >> jBits::PAYLOAD_ROD_TRAILER ) & jBits::ROD_TRAILER_16b);
623  uint32_t fpga = ((word0 >> jBits::FPGA_ROD_TRAILER ) & jBits::ROD_TRAILER_2b );
624  uint32_t jfex = ((word0 >> jBits::jFEX_ROD_TRAILER ) & jBits::ROD_TRAILER_4b );
625  uint32_t ROslice = ((word0 >> jBits::RO_ROD_TRAILER ) & jBits::ROD_TRAILER_4b );
626  uint32_t TSN = ((word0 >> jBits::TSN_ROD_TRAILER ) & jBits::ROD_TRAILER_4b );
627 
628  uint32_t error = ((word1 >> jBits::ERROR_ROD_TRAILER ) & jBits::ROD_TRAILER_6b );
629  uint32_t CRC = ((word1 >> jBits::CRC_ROD_TRAILER ) & jBits::ROD_TRAILER_20b);
630 
631 
632  std::stringstream sdetail;
633  sdetail << "jFEX to ROD Trailer. Word0: 0x"<< std::hex <<word0 << " and Word1: 0x"<< word1 << std::endl;
634  sdetail << "Payload (from word0): "<< payload << std::endl;
635  sdetail << "FPGA (from word0): "<< fpga << std::endl;
636  sdetail << "jFEX (from word0): "<< jfex << std::endl;
637  sdetail << "RO slice (from word0): "<< ROslice << std::endl;
638  sdetail << "TSN (from word0): "<< TSN << std::endl;
639  sdetail << "Error (from word1): "<< error << std::endl;
640  sdetail << "CRC (from word1): "<< CRC << std::dec << std::endl;
641 
642  ATH_MSG_DEBUG(sdetail.str());
643 
644  return {payload, fpga, jfex, error};
645 
646 }
647 
648 // Unpack ROD Trailer
649 std::array<uint32_t,1> jFexRoiByteStreamTool::RODTrailer (uint32_t /*word0*/, uint32_t word1) const {
650 
651  uint32_t error = ((word1 >> jBits::ERROR_ROD_TRAILER ) & jBits::ROD_TRAILER_7b );
652 
653  //return an array since we can implement more features in the future
654  return {error};
655 
656 }
657 
658 
659 // Unpack jFEX to ROD Header
660 void jFexRoiByteStreamTool::jFEXtoRODHeader (uint32_t /*word0*/, uint32_t /*word1*/) const {
661 
662  //std::cout << "jFEXtoRODHeader: word0 0x" << std::hex << word0 << std::dec << std::endl;
663  //std::cout << "jFEXtoRODHeader: word1 0x" << std::hex << word1 << std::dec << std::endl;
664 
665  //std::cout << "\tWord0 : " << std::bitset<32>(word0) << std::endl;
666  //std::cout << "\tWord1 : " << std::bitset<32>(word1) << std::endl;
667 
668 
669  //std::cout << "\tWord0 L1Calo: " << ((word0 >> jBits::L1CALO_STREAM_ID_ROD_HEADER ) & jBits::ROD_HEADER_8b ) << std::endl;
670  //std::cout << "\t\t L1Calo SLOT: " << ((word0 >> (jBits::L1CALO_STREAM_ID_ROD_HEADER + jBits::L1CALO_STREAM_ID_SLOT_ROD_HEADER) ) & 4 ) << std::endl;
671  //std::cout << "\t\t L1Calo FPGA: " << ((word0 >> (jBits::L1CALO_STREAM_ID_ROD_HEADER + jBits::L1CALO_STREAM_ID_FPGA_ROD_HEADER) ) & 2 ) << std::endl;
672  //std::cout << "\t\t L1Calo INFO: " << ((word0 >> (jBits::L1CALO_STREAM_ID_ROD_HEADER + jBits::L1CALO_STREAM_ID_INFO_ROD_HEADER) ) & 2 ) << std::endl;
673  //std::cout << "\tWord0 BCN : " << ((word0 >> jBits::BCN_ROD_HEADER ) & jBits::ROD_HEADER_12b ) << std::endl;
674  //std::cout << "\tWord0 CRC : " << ((word0 >> jBits::CRC_ROD_HEADER ) & jBits::ROD_HEADER_9b ) << std::endl;
675  //std::cout << "\tWord0 Vers : " << ((word0 >> jBits::VERS_ROD_HEADER ) & jBits::ROD_HEADER_3b ) << std::endl;
676 
677  //std::cout << "\tWord1 L1ID : " << ((word1 >> jBits::L1ID_ROD_HEADER ) & jBits::ROD_HEADER_24b ) << std::endl;
678  //std::cout << "\tWord1 ECRID : " << ((word1 >> jBits::ECRID_ROD_HEADER ) & jBits::ROD_HEADER_8b ) << std::endl;
679 
680 
681 
682 }
683 
684 
686 
687  std::string myline;
688 
689  //openning file with ifstream
690  std::ifstream myfile(fileName);
691 
692  if ( !myfile.is_open() ){
693  ATH_MSG_ERROR("Could not open file:" << fileName);
694  return StatusCode::FAILURE;
695  }
696 
697  //loading the mapping information
698  while ( std::getline (myfile, myline) ) {
699 
700  //removing the header of the file (it is just information!)
701  if(myline[0] == '#') continue;
702 
703  //Splitting myline in different substrings
704  std::stringstream oneLine(myline);
705 
706  //reading elements
707  std::vector<float> elements;
708  std::string element;
709  while(std::getline(oneLine, element, ' '))
710  {
711  elements.push_back(std::stof(element));
712  }
713 
714  // It should have 6 elements
715  // ordered as: jfex fpga localEta localPhi eta phi
716  if(elements.size() != 6){
717  ATH_MSG_ERROR("Unexpected number of elemennts (6 expected) in file: "<< fileName);
718  myfile.close();
719  return StatusCode::FAILURE;
720  }
721  // building array of < eta, phi >
722  std::array<float,2> aux_arr{ {elements.at(4),elements.at(5)} };
723 
724  //filling the map with the hash given by mapIndex()
725  m_TobPos_map[ mapIndex(elements.at(0),elements.at(1),elements.at(2),elements.at(3)) ] = aux_arr;
726 
727  }
728  myfile.close();
729 
730  return StatusCode::SUCCESS;
731 }
732 
733 constexpr unsigned int jFexRoiByteStreamTool::mapIndex(unsigned int jfex, unsigned int fpga, unsigned int iEta, unsigned int iPhi) {
734  // values from hardware: jfex=[0,5] 4 bits, fpga=[0,3] 4 bits, ieta=[0,24] 8 bits, iphi=[0,15] 4 bits
735  return (jfex << 16) | (fpga << 12) | (iEta << 4) | iPhi;
736 }
737 
738 std::array<uint8_t,2> jFexRoiByteStreamTool::unpackLocalCoords (uint32_t word) const{
739 
740  uint8_t iEta = (word >> s_etaBit) & s_etaMask;
741  uint8_t iPhi = (word >> s_phiBit) & s_phiMask;
742 
743  return {iEta, iPhi};
744 
745 }
746 
747 std::array<float,2> jFexRoiByteStreamTool::getEtaPhi (unsigned int jfex, unsigned int fpga, uint32_t word, const char* obj = "") const{
748 
749  const auto [iEta, iPhi] = unpackLocalCoords(word);
750  unsigned int index = mapIndex(jfex, fpga, iEta, iPhi);
751 
752  auto it = m_TobPos_map.find(index);
753  if(it == m_TobPos_map.end()){
754  //This should be a WARNING.. masked until jFEX firmware bug is fixed
755  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);
756  return {-99, -99};
757  }
758 
759  //returns an std::array<float,2> {eta, phi}
760  return it->second;
761 
762 }
763 
765 StatusCode jFexRoiByteStreamTool::convertToBS(std::vector<WROBF*>& /*vrobf*/, const EventContext& /*eventContext*/) {
766 
767 /*
768  // Retrieve the RoI container
769  auto muonRoIs = SG::makeHandle(m_roiReadKey, eventContext);
770  ATH_CHECK(muonRoIs.isValid());
771 
772  // Clear BS data cache
773  clearCache(eventContext);
774 
775  // Create raw ROD data words
776  ATH_MSG_DEBUG("Converting " << muonRoIs->size() << " L1 Muon RoIs to ByteStream");
777  uint32_t* data = newRodData(eventContext, muonRoIs->size());
778  for (size_t i=0; i<muonRoIs->size(); ++i) {
779  data[i] = muonRoIs->at(i)->roiWord();
780  }
781 
782  // Create ROBFragment containing the ROD words
783  const eformat::helper::SourceIdentifier sid(eformat::TDAQ_MUON_CTP_INTERFACE, m_muCTPIModuleID.value());
784  vrobf.push_back(newRobFragment(
785  eventContext,
786  sid.code(),
787  muonRoIs->size(),
788  data,
789  eformat::STATUS_BACK // status_position is system-specific
790  ));
791 */
792  return StatusCode::SUCCESS;
793 }
794 
795 
796 void jFexRoiByteStreamTool::printError(const std::string& location, const std::string& title, MSG::Level type, const std::string& detail) const{
797 
798  if(m_UseMonitoring){
800  Monitored::Scalar("jfexDecoderErrorLocation",location.empty() ? std::string("UNKNOWN") : location),
801  Monitored::Scalar("jfexDecoderErrorTitle" ,title.empty() ? std::string("UNKNOWN") : title)
802  );
803  }
804  else {
805  msg() << type << detail << endmsg;
806  }
807 }
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:384
jFexRoiByteStreamTool::ReadfromFile
StatusCode ReadfromFile(const std::string &)
Definition: jFexRoiByteStreamTool.cxx:685
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
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
jFexRoiByteStreamTool::mapIndex
constexpr static unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int iEta, unsigned int iPhi)
Definition: jFexRoiByteStreamTool.cxx:733
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:82
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
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:79
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
TrigConf::L1ThrExtraInfo_jTE
Definition: L1ThrExtraInfo.h:543
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:423
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:600
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:575
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:620
color::B_BLUE
std::string B_BLUE
Definition: jFexInputByteStreamTool.cxx:33
jFexRoiByteStreamTool.h
C
struct color C
TrigConf::L1ThrExtraInfo_jXE
Definition: L1ThrExtraInfo.h:531
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:765
jFexRoiByteStreamTool::RODTrailer
std::array< uint32_t, 1 > RODTrailer(uint32_t word0, uint32_t word1) const
Definition: jFexRoiByteStreamTool.cxx:649
jFexRoiByteStreamTool::m_jLJWriteKey
SG::WriteHandleKey< xAOD::jFexLRJetRoIContainer > m_jLJWriteKey
Definition: jFexRoiByteStreamTool.h:86
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
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:747
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
python.sizes.location
string location
Definition: sizes.py:11
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:796
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:738
covarianceTool.title
title
Definition: covarianceTool.py:542
jFexRoiByteStreamTool::start
virtual StatusCode start() override
Definition: jFexRoiByteStreamTool.cxx:118
calibdata.exception
exception
Definition: calibdata.py:496
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:660
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:195
TrigConf::L1ThrExtraInfo_jTAU
Definition: L1ThrExtraInfo.h:296
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:53
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
color::B_RED
std::string B_RED
Definition: jFexInputByteStreamTool.cxx:37
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:424
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigConf::L1ThrExtraInfo_jEM
Definition: L1ThrExtraInfo.h:189
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:135
jFexRoiByteStreamTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: jFexRoiByteStreamTool.h:69
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
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
jFexRoiByteStreamTool::m_jXERes
int m_jXERes
Definition: jFexRoiByteStreamTool.h:120
TrigConf::L1ThrExtraInfo_jJ
Definition: L1ThrExtraInfo.h:390
jFexRoiByteStreamTool::jFexRoiByteStreamTool
jFexRoiByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: jFexRoiByteStreamTool.cxx:41