ATLAS Offline Software
Loading...
Searching...
No Matches
Helpers.cxx File Reference
#include <vector>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdint>
#include "L1TopoRDO/L1TopoRDO.h"
#include "L1TopoRDO/L1TopoRDOCollection.h"
#include "L1TopoRDO/Helpers.h"
#include "L1TopoRDO/Header.h"
#include "L1TopoRDO/Fibre.h"
#include "L1TopoRDO/Status.h"
#include "L1TopoRDO/L1TopoTOB.h"
#include "L1TopoRDO/BlockTypes.h"

Go to the source code of this file.

Namespaces

namespace  L1Topo

Functions

std::ostream & operator<< (std::ostream &os, const L1TopoRDO &rdo)
 This file contains some static helper functions to help users of L1TopoRDO.
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.
std::string L1Topo::formatHex8 (uint32_t word)
 Helper function to format a 32-bit integer as an 8-digit hex number for printing.
std::string L1Topo::formatHex4 (uint32_t word)
 Helper function to format a 32-bit integer as a 4-digit hex number for printing.
const std::string L1Topo::formatVecHex8 (const std::vector< uint32_t > &vecvec)
 Helper function to format a vector of 32-bit integers as 8-digit hex numbers for printing.
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.
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()?
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.

Function Documentation

◆ operator<<()

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

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

Print helper function for L1TopoRDO

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

23 {
24 os << "L1TopoRDO:\n";
25 os << " SourceID: " << L1Topo::formatHex8(rdo.getSourceID());
26 if (rdo.isDAQModule()){
27 os << " DAQ";
28 }
29 else if (rdo.isROIModule()){
30 os << " ROI";
31 }
32 os << "\n";
33 os << " Errors: " << rdo.getErrors() << "\n";
34 os << " Status words:\n";
35 std::vector<uint32_t> status = rdo.getStatusWords();
36 for(auto & word: status){
37 os << " " << L1Topo::formatHex8(word) << "\n";
38 }
39 os << " Data words:\n";
40 std::vector<uint32_t> data = rdo.getDataWords();
41 for(const uint32_t word: data){
42 os << " " << L1Topo::formatHex8(word) << " ";
43 switch (L1Topo::blockType(word)){
45 {
46 os << L1Topo::Header(word) << "\n";
47 break;
48 }
50 {
51 os << L1Topo::Fibre(word) << "\n";
52 break;
53 }
55 {
56 os << L1Topo::Status(word) << "\n";
57 break;
58 }
60 {
61 os << " EM TOB\n";
62 break;
63 }
65 {
66 os << " TAU TOB\n";
67 break;
68 }
70 {
71 os << " MUON TOB\n";
72 break;
73 }
75 {
76 os << " JET TOB crate 1\n";
77 break;
78 }
80 {
81 os << " JET TOB crate 2\n";
82 break;
83 }
85 {
86 os << " Energy TOB\n";
87 break;
88 }
90 {
91 os << L1Topo::L1TopoTOB(word);
92 break;
93 }
94 default:
95 os << "\n";
96 break;
97 }
98 }
99 return os;
100}
std::vector< L1Topo::Error > getErrors() const
get a vector of Errors found during RAW to RDO conversion; see enum and
Definition L1TopoRDO.cxx:35
bool isDAQModule() const
check the module type, derived from the source ID and the L1Topo module
Definition L1TopoRDO.cxx:67
uint32_t getSourceID() const
get the source identifier, i.e. the word representing the subdet type and
Definition L1TopoRDO.cxx:57
const std::vector< uint32_t > & getStatusWords() const
get the status words
Definition L1TopoRDO.cxx:25
bool isROIModule() const
check the module type, derived from the source ID and the L1Topo module
Definition L1TopoRDO.cxx:72
const std::vector< uint32_t > & getDataWords() const
get the data words
Definition L1TopoRDO.cxx:15
Represents the L1Topo fibre word of the L1Topo DAQ header, with decoder and encoder.
Definition Fibre.h:22
Represents the L1Topo header word of the L1Topo DAQ data, with decoder and encoder.
Represents the L1Topo TOB word of the L1Topo ROI data, with decode and encoder.
Definition L1TopoTOB.h:17
Represents the L1Topo status word of the L1Topo DAQ header, with decoder and encoder.
Definition Status.h:19
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
std::string formatHex8(uint32_t word)
Helper function to format a 32-bit integer as an 8-digit hex number for printing.
status
Definition merge.py:16