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 <boost/io/ios_state.hpp>
#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 > &vec)
 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 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}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
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