ATLAS Offline Software
L1TopoRDO.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "L1TopoRDO/L1TopoRDO.h"
6 
7 #include <cstdint>
8 #include <vector>
9 #include <sstream>
10 #include <iomanip>
11 #include <string>
12 #include "L1TopoRDO/ModuleID.h"
13 
14 
15 const std::vector<uint32_t>& L1TopoRDO::getDataWords () const
16 {
17  return m_dataWords;
18 }
19 
20 void L1TopoRDO::setDataWords (std::vector<uint32_t> &&dataWords) noexcept
21 {
22  m_dataWords = std::move(dataWords);
23 }
24 
25 const std::vector<uint32_t>& L1TopoRDO::getStatusWords () const
26 {
27  return m_statusWords;
28 }
29 
30 void L1TopoRDO::setStatusWords (std::vector<uint32_t> &&statusWords) noexcept
31 {
32  m_statusWords = std::move(statusWords);
33 }
34 
35 std::vector<L1Topo::Error> L1TopoRDO::getErrors() const
36 {
37  std::vector<L1Topo::Error> errors;
38  // bit of a hack: use the map of error enum to string as a way to iterate over all the errors that are defined
39  for (auto it : L1Topo::errorText){
40  auto e = it.first;
41  if (checkError(e)){
42  errors.push_back(e);
43  }
44  }
45  return errors;
46 }
47 
48 
50  return (m_error>>static_cast<unsigned int>(e) & 1);
51 }
52 
54  m_error |= (1 << static_cast<unsigned int>(e));
55 }
56 
58 {
59  return m_sourceID;
60 }
61 
63 {
64  m_sourceID=id;
65 }
66 
68 {
69  return L1Topo::ModuleID(static_cast<uint16_t>(m_sourceID)).isDAQ();
70 }
71 
73 {
74  return L1Topo::ModuleID(static_cast<uint16_t>(m_sourceID)).isROI();
75 }
76 
77 const std::string L1TopoRDO::dump() const
78 {
79  std::ostringstream s;
80  s << " ";
81  for (auto & word: m_dataWords){
82  s << std::hex << std::showbase << std::setfill('0') << std::setw(8)
83  << word << " " << std::dec << std::noshowbase;
84  }
85  return s.str();
86 }
87 
L1Topo::ModuleID::isDAQ
bool isDAQ() const
True if this is a DAQ module.
Definition: ModuleID.cxx:25
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
L1TopoRDO::getDataWords
const std::vector< uint32_t > & getDataWords() const
get the data words
Definition: L1TopoRDO.cxx:15
L1TopoRDO.h
ModuleID.h
L1TopoRDO::isDAQModule
bool isDAQModule() const
check the module type, derived from the source ID and the L1Topo module
Definition: L1TopoRDO.cxx:67
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
L1TopoRDO::setError
void setError(L1Topo::Error)
set a flag to record an error
Definition: L1TopoRDO.cxx:53
skel.it
it
Definition: skel.GENtoEVGEN.py:423
L1Topo::ModuleID::isROI
bool isROI() const
True if this is a ROI module.
Definition: ModuleID.cxx:29
L1TopoRDO::dump
const std::string dump() const
terse printout method used by RoIBResult
Definition: L1TopoRDO.cxx:77
L1TopoRDO::m_statusWords
std::vector< uint32_t > m_statusWords
Definition: L1TopoRDO.h:76
L1TopoRDO::checkError
bool checkError(L1Topo::Error) const
check if a certain error flag has been set
Definition: L1TopoRDO.cxx:49
L1TopoRDO::getSourceID
uint32_t getSourceID() const
get the source identifier, i.e. the word representing the subdet type and
Definition: L1TopoRDO.cxx:57
L1TopoRDO::setDataWords
void setDataWords(std::vector< uint32_t > &&) noexcept
set the data words
Definition: L1TopoRDO.cxx:20
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
L1TopoRDO::setSourceID
void setSourceID(const uint32_t)
set the source identifier
Definition: L1TopoRDO.cxx:62
L1TopoRDO::getStatusWords
const std::vector< uint32_t > & getStatusWords() const
get the status words
Definition: L1TopoRDO.cxx:25
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
L1TopoRDO::isROIModule
bool isROIModule() const
check the module type, derived from the source ID and the L1Topo module
Definition: L1TopoRDO.cxx:72
L1TopoRDO::getErrors
std::vector< L1Topo::Error > getErrors() const
get a vector of Errors found during RAW to RDO conversion; see enum and
Definition: L1TopoRDO.cxx:35
L1Topo::ModuleID
Represents the L1Topo module ID, with decoder and encoder.
Definition: ModuleID.h:28
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
L1TopoRDO::m_dataWords
std::vector< uint32_t > m_dataWords
Definition: L1TopoRDO.h:75
L1TopoRDO::m_error
uint32_t m_error
Definition: L1TopoRDO.h:78
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
L1TopoRDO::setStatusWords
void setStatusWords(std::vector< uint32_t > &&) noexcept
set the status words
Definition: L1TopoRDO.cxx:30
L1TopoRDO::m_sourceID
uint32_t m_sourceID
Definition: L1TopoRDO.h:79