ATLAS Offline Software
CTPResult.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TRIGT1RESULT_CTPRESULT_H
7 #define TRIGT1RESULT_CTPRESULT_H
8 
9 // std include(s):
10 #include <stdint.h>
11 
12 // STL include(s):
13 #include <vector>
14 #include <bitset>
15 #include <string>
16 
17 // Local include(s):
18 #include "TrigT1Result/Header.h"
19 #include "TrigT1Result/Trailer.h"
20 #include "TrigT1Result/CTPRoI.h"
21 
22 #include "CTPfragment/CTPdataformatVersion.h"
23 
24 // Forward declaration(s):
25 class MsgStream;
26 
27 namespace ROIB {
28 
52  class CTPResult {
53 
54  public:
57  m_useRoIB(false),
58  m_l1aBunch(0) {}
59 
61  CTPResult(unsigned int ctpVersion, Header&&, Trailer&&, std::vector<CTPRoI>&& );
62 
64  CTPResult(unsigned int ctpVersion, Header&&, Trailer&&, const std::vector<uint32_t>& );
65 
66  /*
67  * Methods:
68  *
69  * */
70 
71  /* status information */
72 
74  bool isValid() const;
76  bool isComplete() const;
77 
78  /* raw data access */
79 
81  const Header& header() const;
83  const Trailer& trailer() const;
85  const std::vector<CTPRoI>& roIVec() const;
86 
87  /* access the trigger information */
88 
90  const std::vector<CTPRoI> TBP() const;
92  const std::vector<CTPRoI> TAP() const;
94  const std::vector<CTPRoI> TAV() const;
96  bool acceptBP() const;
98  bool acceptAP() const;
100  bool acceptAV() const;
102  bool accept() const { return acceptAV(); }
103 
104  /* debug object content */
105 
107 
108  const std::string dump() const;
110  const std::string print(const bool longFormat = false) const;
111 
113  void dumpData() const;
115  void dumpData(MsgStream&) const;
116 
117  private:
118 
119  /* Data members = header, trailer and RoI vector */
122  std::vector<CTPRoI> m_CTPResultRoIVec;
123 
124  //CTP version
125  //unsigned int m_ctpVersionNumber;
126  CTPdataformatVersion m_ctpDataformat;
127 
129  const std::string convert(const std::vector<CTPRoI>& data, const bool longFormat = false) const;
130 
131  // flag to tell if this is a RoIB result or a DAQ result
132  bool m_useRoIB;
133 
134  // the L1 accept bunch for the DAQ CTP result
135  unsigned int m_l1aBunch;
136 
137  }; // class CTPResult
138 
139  // converter functions
140 
142  std::bitset<512> convertToBitset(const std::vector<uint32_t>&);
144  std::bitset<512> convertToBitset(const std::vector<CTPRoI>&);
145 
146 } // namespace ROIB
147 
148 // include inline implementations
149 
151 
152 #endif // TRIGT1RESULT_CTPRESULT_H
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ROIB::CTPResult::TAP
const std::vector< CTPRoI > TAP() const
get trigger result after prescale
Trailer.h
ROIB::CTPResult::convert
const std::string convert(const std::vector< CTPRoI > &data, const bool longFormat=false) const
convert data content into string (used by dump and print)
Definition: CTPResult.cxx:84
ROIB::CTPResult::trailer
const Trailer & trailer() const
return trailer
ROIB::CTPResult::TBP
const std::vector< CTPRoI > TBP() const
get trigger result before prescale
ROIB::CTPResult::header
const Header & header() const
return header
ROIB::CTPResult::m_CTPResultRoIVec
std::vector< CTPRoI > m_CTPResultRoIVec
raw data content (RoIs)
Definition: CTPResult.h:122
ROIB::CTPResult
Class holding the LVL1 CTP result used by the RoIBuilder.
Definition: CTPResult.h:52
ROIB::CTPResult::dump
const std::string dump() const
dump raw object content to string
Definition: CTPResult.cxx:56
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
CTPResult.icc
ROIB::CTPResult::acceptBP
bool acceptBP() const
get trigger accept before prescale
ROIB::CTPResult::m_CTPResultTrailer
Trailer m_CTPResultTrailer
trailer fragment in LVL1 eformat
Definition: CTPResult.h:121
ROIB::CTPResult::m_l1aBunch
unsigned int m_l1aBunch
Definition: CTPResult.h:135
ROIB::Header
Header models the LVL1 ROD Header.
Definition: TrigT1Result/TrigT1Result/Header.h:37
ROIB::CTPResult::isValid
bool isValid() const
returns true if header and trailer exist, data can be empty
ROIB::CTPResult::m_useRoIB
bool m_useRoIB
Definition: CTPResult.h:132
ROIB::CTPResult::m_CTPResultHeader
Header m_CTPResultHeader
header fragment in LVL1 eformat
Definition: CTPResult.h:120
ROIB::CTPResult::CTPResult
CTPResult()
default constructor: empty object
Definition: CTPResult.h:56
Header.h
ROIB::CTPResult::acceptAV
bool acceptAV() const
get trigger accept after veto
ROIB::Trailer
ROIB::Trailer models the LVL1 ROD Trailer.
Definition: Trailer.h:37
ROIB::CTPResult::accept
bool accept() const
get standard trigger accept
Definition: CTPResult.h:102
ROIB::CTPResult::TAV
const std::vector< CTPRoI > TAV() const
get trigger result after veto
ROIB::convertToBitset
std::bitset< 512 > convertToBitset(const std::vector< uint32_t > &words)
convert vector of unsigned int into bitset
Definition: CTPResult.cxx:181
ROIB::CTPResult::m_ctpDataformat
CTPdataformatVersion m_ctpDataformat
Definition: CTPResult.h:126
CTPRoI.h
ROIB::CTPResult::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition: CTPResult.cxx:71
ROIB::CTPResult::dumpData
void dumpData() const
print object content to default message stream
Definition: CTPResult.cxx:156
ROIB::CTPResult::roIVec
const std::vector< CTPRoI > & roIVec() const
return the RoI vector *‍/
ROIB::CTPResult::acceptAP
bool acceptAP() const
get trigger accept after prescale
ROIB::CTPResult::isComplete
bool isComplete() const
returns true if object isValid() and data has the expected length