ATLAS Offline Software
Namespaces | Functions
Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/Helpers.h File Reference
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <sstream>
#include <iostream>
#include <cstdint>
Include dependency graph for Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/Helpers.h:

Go to the source code of this file.

Namespaces

 L1Topo
 

Functions

std::ostream & operator<< (std::ostream &, const L1TopoRDO &)
 This file contains some static helper functions to help users of L1TopoRDO. More...
 
uint32_t L1Topo::decode (const uint32_t &word, const uint32_t &offset, const uint32_t &size)
 Helper function to decode word based on offset and size. More...
 
std::string L1Topo::formatHex8 (uint32_t word)
 Helper function to format a 32-bit integer as an 8-digit hex number for printing. More...
 
std::string L1Topo::formatHex4 (uint32_t word)
 Helper function to format a 32-bit integer as a 4-digit hex number for printing. More...
 
const std::string L1Topo::formatVecHex8 (const std::vector< uint32_t > &vec)
 Helper function to format a vector of 32-bit integers as 8-digit hex numbers for printing. More...
 
unsigned int L1Topo::triggerBitIndex (uint32_t moduleId, const L1Topo::L1TopoTOB &)
 OUT OF DATE DO NOT USE Helper to calculate the index needed to pack trigger bits into the full 128-bit decision. See 4-bit part of L1Topo TOB definition in https://twiki.cern.ch/twiki/pub/Atlas/L1CaloUpgrade/ROD_data_format_v1.0.4.xlsx. More...
 
unsigned int L1Topo::triggerBitIndexNew (uint32_t moduleId, const L1Topo::L1TopoTOB &, unsigned int bitIdx)
 Helper to calculate the index needed to pack trigger bits into the full 128-bit decision. See 4-bit part of L1Topo TOB definition in https://twiki.cern.ch/twiki/pub/Atlas/L1CaloUpgrade/ROD_data_format_v1.0.4.xlsx ; same as TriggerLine::calcCounter()? More...
 
unsigned int L1Topo::triggerBitIndexPhase1 (uint32_t topo, uint32_t fpga, size_t bitIdx)
 
std::pair< std::bitset< 128 >, std::bitset< 128 > > L1Topo::getDecisionAndOverflowBits (const L1TopoRDOCollection &)
 Get the trigger decision and overflow bits from the L1Topo ROI data block 'L1Topo TOB' and order them correctly in a bitset. Reference needed for layout. More...
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  ,
const L1TopoRDO  
)

This file contains some static helper functions to help users of L1TopoRDO.

Print helper function for L1TopoRDO

Definition at line 24 of file Trigger/TrigT1/L1Topo/L1TopoRDO/src/Helpers.cxx.

24  {
25  // save ostream state; destructor will restore state when it goes out of scope
26  boost::io::ios_all_saver ias(os);
27  os << "L1TopoRDO:\n";
28  os << " SourceID: " << L1Topo::formatHex8(rdo.getSourceID());
29  if (rdo.isDAQModule()){
30  os << " DAQ";
31  }
32  else if (rdo.isROIModule()){
33  os << " ROI";
34  }
35  os << "\n";
36  os << " Errors: " << rdo.getErrors() << "\n";
37  os << " Status words:\n";
38  std::vector<uint32_t> status = rdo.getStatusWords();
39  for(auto & word: status){
40  os << " " << L1Topo::formatHex8(word) << "\n";
41  }
42  os << " Data words:\n";
43  std::vector<uint32_t> data = rdo.getDataWords();
44  for(const uint32_t word: data){
45  os << " " << L1Topo::formatHex8(word) << " ";
46  switch (L1Topo::blockType(word)){
48  {
49  os << L1Topo::Header(word) << "\n";
50  break;
51  }
53  {
54  os << L1Topo::Fibre(word) << "\n";
55  break;
56  }
58  {
59  os << L1Topo::Status(word) << "\n";
60  break;
61  }
63  {
64  os << " EM TOB\n";
65  break;
66  }
68  {
69  os << " TAU TOB\n";
70  break;
71  }
73  {
74  os << " MUON TOB\n";
75  break;
76  }
78  {
79  os << " JET TOB crate 1\n";
80  break;
81  }
83  {
84  os << " JET TOB crate 2\n";
85  break;
86  }
88  {
89  os << " Energy TOB\n";
90  break;
91  }
93  {
94  os << L1Topo::L1TopoTOB(word);
95  break;
96  }
97  default:
98  os << "\n";
99  break;
100  }
101  }
102  return os;
103 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
L1Topo::L1TopoTOB
Represents the L1Topo TOB word of the L1Topo ROI data, with decode and encoder.
Definition: L1TopoTOB.h:17
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
L1Topo::Status
Represents the L1Topo status word of the L1Topo DAQ header, with decoder and encoder.
Definition: Status.h:19
L1Topo::blockType
L1Topo::BlockTypes blockType(const uint32_t word, uint32_t offset=28, uint32_t size=0x0f)
Function to return the block type of a data word from L1Topo
Definition: BlockTypes.cxx:9
L1Topo::BlockTypes::JET2_TOB
@ JET2_TOB
L1Topo::BlockTypes::JET1_TOB
@ JET1_TOB
L1Topo::BlockTypes::MUON_TOB
@ MUON_TOB
L1Topo::BlockTypes::FIBRE
@ FIBRE
L1Topo::BlockTypes::ENERGY_TOB
@ ENERGY_TOB
L1Topo::BlockTypes::STATUS
@ STATUS
L1Topo::Header
Represents the L1Topo header word of the L1Topo DAQ data, with decoder and encoder.
Definition: L1Topo/L1TopoRDO/L1TopoRDO/Header.h:18
L1Topo::BlockTypes::EM_TOB
@ EM_TOB
L1Topo::BlockTypes::TAU_TOB
@ TAU_TOB
L1Topo::BlockTypes::L1TOPO_TOB
@ L1TOPO_TOB
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
L1Topo::formatHex8
std::string formatHex8(uint32_t word)
Helper function to format a 32-bit integer as an 8-digit hex number for printing.
Definition: Trigger/TrigT1/L1Topo/L1TopoRDO/src/Helpers.cxx:111
L1Topo::Fibre
Represents the L1Topo fibre word of the L1Topo DAQ header, with decoder and encoder.
Definition: Fibre.h:22
L1Topo::BlockTypes::HEADER
@ HEADER
merge.status
status
Definition: merge.py:17