ATLAS Offline Software
CTP_RDO.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // TO DO: encapsulate logic from raw data words! And fill the data
6 
7 #ifndef TRIGT1RESULT_CTP_RDO_H
8 #define TRIGT1RESULT_CTP_RDO_H
9 
10 // std includes
11 #include <cstdint>
12 
13 // STL includes
14 #include <vector>
15 #include <string>
16 
17 
18 #include "CTPfragment/CTPdataformatVersion.h"
19 
20 class CTP_RDO {
21 
22  enum WordType {/*PIT, FPI,*/ TIP, TBP, TAP, TAV, EXTRA};
23  typedef enum WordType WordType;
24 
25  public:
26 
28  CTP_RDO() = default;
29 
31  CTP_RDO(unsigned int ctpVersionNumber, const uint32_t nBCs = 1, uint32_t nExtraWords=0);
32 
34  CTP_RDO(unsigned int ctpVersionNumber, std::vector<uint32_t>&& data, uint32_t nExtraWords=0);
35 
37  ~CTP_RDO();
38 
39  const std::vector<uint32_t> & getDataWords () const {
40  return m_dataWords;
41  }
42 
43  void setTimeSec(const uint32_t sec);
44  void setTimeNanoSec(const uint32_t nano);
45 
46  uint32_t getTimeSec() const;
47  uint32_t getTimeNanoSec() const;
52  uint32_t getTurnCounter() const;
53 
54  //std::vector<uint32_t> getPITWords() const;
55  //std::vector<uint32_t> getFPIWords() const;
56  std::vector<uint32_t> getTIPWords() const;
57  std::vector<uint32_t> getTBPWords() const;
58  std::vector<uint32_t> getTAPWords() const;
59  std::vector<uint32_t> getTAVWords() const;
60  std::vector<uint32_t> getEXTRAWords() const;
61 
62  const CTPdataformatVersion & getCTPVersion() const;
63  void setCTPVersionNumber( unsigned int ctpVersion );
64  unsigned int getCTPVersionNumber() const { return m_ctpVersionNumber; }
65 
66  //void setPITWord(const unsigned int i, const uint32_t word);
67  //void setFPIWord(const unsigned int i, const uint32_t word);
68  void setTIPWord(const unsigned int i, const uint32_t word);
69  void setTBPWord(const unsigned int i, const uint32_t word);
70  void setTAPWord(const unsigned int i, const uint32_t word);
71  void setTAVWord(const unsigned int i, const uint32_t word);
72 
73  void selectBunch(const uint32_t iBC);
74  void selectNextBunch();
75  void setNumberOfBunches(const uint32_t nBCs);
77  void setTurnCounter(const uint32_t);
78  void setNumberOfAdditionalWords(const uint32_t nExtraWords);
79 
80 
81  // helper functions
82 
84  const std::string dump() const;
86  const std::string print(const bool longFormat = false) const;
87 
88  // constants
89 
90  static constexpr unsigned int SIZEOF_WORDS = 32;
91 
92  private:
93 
94  // data members
95 
96  unsigned int m_ctpVersionNumber {0};
97  CTPdataformatVersion m_ctpDataFormat {0} ;
98  std::vector<uint32_t> m_dataWords;
104 
105  // helper functions
106 
107  void setWord(const unsigned int i, const uint32_t word);
108  std::vector<uint32_t> getWords(WordType type) const;
109 
110 }; // class CTP_RDO
111 
112 #include "AthenaKernel/CLASS_DEF.h"
113 CLASS_DEF( CTP_RDO, 6014, 0 )
114 
115 #endif // TRIGT1RESULT_CTP_RDO_H
CTP_RDO::setNumberOfBunches
void setNumberOfBunches(const uint32_t nBCs)
Definition: CTP_RDO.cxx:133
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CTP_RDO::getEXTRAWords
std::vector< uint32_t > getEXTRAWords() const
Definition: CTP_RDO.cxx:221
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CTP_RDO::m_ctpVersionNumber
unsigned int m_ctpVersionNumber
number of the CTP version to be used
Definition: CTP_RDO.h:96
CTP_RDO::getTimeSinceLastL1A
uint32_t getTimeSinceLastL1A() const
Definition: CTP_RDO.cxx:99
CTP_RDO::selectBunch
void selectBunch(const uint32_t iBC)
Definition: CTP_RDO.cxx:118
CTP_RDO::m_ctpDataFormat
CTPdataformatVersion m_ctpDataFormat
CTP data format for a specified version.
Definition: CTP_RDO.h:97
CTP_RDO::setTIPWord
void setTIPWord(const unsigned int i, const uint32_t word)
Definition: CTP_RDO.cxx:171
CTP_RDO::SIZEOF_WORDS
static constexpr unsigned int SIZEOF_WORDS
number of bits in one data word (32)
Definition: CTP_RDO.h:90
CTP_RDO::setWord
void setWord(const unsigned int i, const uint32_t word)
Definition: CTP_RDO.cxx:226
CTP_RDO::getCTPVersionNumber
unsigned int getCTPVersionNumber() const
Definition: CTP_RDO.h:64
CTP_RDO::CTP_RDO
CTP_RDO()=default
Default constructor needed for pool converters.
CTP_RDO::getWords
std::vector< uint32_t > getWords(WordType type) const
Definition: CTP_RDO.cxx:238
CTP_RDO::getDataWords
const std::vector< uint32_t > & getDataWords() const
Definition: CTP_RDO.h:39
CTP_RDO::setTAVWord
void setTAVWord(const unsigned int i, const uint32_t word)
Definition: CTP_RDO.cxx:186
CTP_RDO::getNumberOfBunches
uint32_t getNumberOfBunches() const
Definition: CTP_RDO.cxx:89
CTP_RDO::TAV
@ TAV
Definition: CTP_RDO.h:22
CTP_RDO::EXTRA
@ EXTRA
Definition: CTP_RDO.h:22
CTP_RDO::m_dataWords
std::vector< uint32_t > m_dataWords
raw data words
Definition: CTP_RDO.h:98
CTP_RDO::getNumberOfAdditionalWords
uint32_t getNumberOfAdditionalWords() const
Definition: CTP_RDO.cxx:113
CTP_RDO::TIP
@ TIP
Definition: CTP_RDO.h:22
CTP_RDO::TBP
@ TBP
Definition: CTP_RDO.h:22
CTP_RDO::m_activeBunch
uint32_t m_activeBunch
active bunch, for book keepting (transient)
Definition: CTP_RDO.h:102
lumiFormat.i
int i
Definition: lumiFormat.py:85
CTP_RDO::TAP
@ TAP
Definition: CTP_RDO.h:22
CTP_RDO::selectNextBunch
void selectNextBunch()
Definition: CTP_RDO.cxx:127
CTP_RDO::setTimeNanoSec
void setTimeNanoSec(const uint32_t nano)
Definition: CTP_RDO.cxx:69
CTP_RDO::setL1AcceptBunchPosition
void setL1AcceptBunchPosition(const uint8_t)
Definition: CTP_RDO.cxx:141
CTP_RDO::m_numberOfAdditionalWords
uint32_t m_numberOfAdditionalWords
number of configurable extra words in the fragment
Definition: CTP_RDO.h:103
CTP_RDO::m_turnCounter
uint32_t m_turnCounter
turn counter
Definition: CTP_RDO.h:100
CTP_RDO::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition: CTP_RDO.cxx:302
CTP_RDO::setTurnCounter
void setTurnCounter(const uint32_t)
Definition: CTP_RDO.cxx:148
CTP_RDO::WordType
WordType
Definition: CTP_RDO.h:22
CTP_RDO::getL1AcceptBunchPosition
uint32_t getL1AcceptBunchPosition() const
Definition: CTP_RDO.cxx:94
CTP_RDO
Definition: CTP_RDO.h:20
CTP_RDO::~CTP_RDO
~CTP_RDO()
empty default destructor
Definition: CTP_RDO.cxx:45
CTP_RDO::getTAVWords
std::vector< uint32_t > getTAVWords() const
Definition: CTP_RDO.cxx:216
CTP_RDO::getTurnCounter
uint32_t getTurnCounter() const
Definition: CTP_RDO.cxx:106
CTP_RDO::getTBPWords
std::vector< uint32_t > getTBPWords() const
Definition: CTP_RDO.cxx:206
CTP_RDO::setTAPWord
void setTAPWord(const unsigned int i, const uint32_t word)
Definition: CTP_RDO.cxx:181
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
CTP_RDO::setTBPWord
void setTBPWord(const unsigned int i, const uint32_t word)
Definition: CTP_RDO.cxx:176
CTP_RDO::getCTPVersion
const CTPdataformatVersion & getCTPVersion() const
Definition: CTP_RDO.cxx:48
CTP_RDO::dump
const std::string dump() const
dump raw object content to string
Definition: CTP_RDO.cxx:293
CTP_RDO::m_numberOfBunches
uint32_t m_numberOfBunches
number of bunches in raw data (transient)
Definition: CTP_RDO.h:101
CTP_RDO::m_l1AcceptPosition
uint8_t m_l1AcceptPosition
bunch position, from which the level1 accept was calculated
Definition: CTP_RDO.h:99
CTP_RDO::getTIPWords
std::vector< uint32_t > getTIPWords() const
Definition: CTP_RDO.cxx:201
CTP_RDO::getTimeNanoSec
uint32_t getTimeNanoSec() const
Definition: CTP_RDO.cxx:83
CLASS_DEF.h
macros to associate a CLID to a type
CTP_RDO::setNumberOfAdditionalWords
void setNumberOfAdditionalWords(const uint32_t nExtraWords)
Definition: CTP_RDO.cxx:153
CTP_RDO::setTimeSec
void setTimeSec(const uint32_t sec)
Definition: CTP_RDO.cxx:62
CTP_RDO::setCTPVersionNumber
void setCTPVersionNumber(unsigned int ctpVersion)
Definition: CTP_RDO.cxx:58
CTP_RDO::getTAPWords
std::vector< uint32_t > getTAPWords() const
Definition: CTP_RDO.cxx:211
CTP_RDO::getTimeSec
uint32_t getTimeSec() const
Definition: CTP_RDO.cxx:77