ATLAS Offline Software
ALFA_RawDataReadOut_charge.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ALFARAWDATAREADOUT_CHARGE_H
6 #define ALFARAWDATAREADOUT_CHARGE_H
7 
8 #include "ALFA_ReadOut.h"
9 #include <stdint.h>
10 
11 
13 
14 #include "eformat/SourceIdentifier.h"
15 #include "eformat/Version.h"
17 
21 
22 
23 
24 // Decoding methods for raw data words
25 // S. Diglio Sept 2009
26 
27 
29 
30  private:
31 
32  // Raw data word
34  // Data word header
36 
37  // Header info: event counter, bunch crossing ID and tdc number: EOT and BOT
38  uint16_t m_SlotId; // bit 28-24 BOT
39  uint16_t m_LsbTdcId; // bit 25-24 EOT
40  uint16_t m_ecnt_BOT; // bit 23-12 BOT(event counter, counted by TDC)
41  uint16_t m_ecnt_EOT; // bit 23-12 BOT(event counter, counted by TDC)
42  uint16_t m_bcId; // bit 11-0 BOT (bunch crossing Id)
43 
44  // Footer info: words counter
45  uint16_t m_wcnt; // bit 11-0 EOT (numer of word in TDC data block counting itself)
46 
47  // Data info TSM_charge:
48 
49  uint16_t m_MBId; // bit 7-0 MB number PMF0
50  uint16_t m_FiberFirmwareId; // bit 15-8 PMF0
51 
52  uint16_t m_PMFId; // bit 23-19
53  uint16_t m_ChannelNumId; // bit 18-13 PMF channel num
54  uint16_t m_ChargeChanId; // bit 11-0
55 
56  bool m_bit12;
57 
60 
61  std::vector<uint32_t> m_ChargeChan;
62 
63 
64  // Define the data structure and the word header values
65 
66  // PMF header Position and values
67  // The word header occupies the 4 highest bits of each TDC data word
68  static constexpr uint16_t s_headerPos = 28; // from bit 28 to 31
69  static constexpr uint16_t s_headerBits = 0xf;
70 
71  // Beginning of TDC
72  static constexpr uint16_t s_BOTvalue = 0xa;
73 
74  // End of TDC
75  static constexpr uint16_t s_EOTvalue = 0xc;
76 
77  // TDC single measurement charge
78  static constexpr uint16_t s_TSMvalue_charge = 0x4;
79 
80 
81  public:
82 
83  // Constructor and destructor
86 
87  // Methods for decoding and encoding dataWords
88  void decodeWord(uint32_t dataWord);
89 
90  //StatusCode encodePMF(uint16_t headerVal);
91 
92  // Methods to identify the word type
93  // Beginning of TDC
94  bool is_BOT() const {return (m_wordHeader == s_BOTvalue);};
95  // End of TDC
96  bool is_EOT() const {return (m_wordHeader == s_EOTvalue);};
97  // TDC single measurement
98  bool is_TDCch() const{return (m_wordHeader == s_TSMvalue_charge);};
99 
100 
101  // Methods to retrieve the decoded word content (Get)
102 
103  uint16_t SlotId() const {return m_SlotId;}
104  uint16_t LsbTdcId() const {return m_LsbTdcId;}
105  uint16_t ecnt_BOT() const {return m_ecnt_BOT;}
106  uint16_t ecnt_EOT()const {return m_ecnt_EOT;}
107  uint16_t bcId() const {return m_bcId;}
108 
109 
110  uint16_t MBId() const {return m_MBId;}
111  uint16_t PMFId() const {return m_PMFId;}
115  bool bit12() const {return m_bit12;}
116 
117  uint16_t bit27_24() const {return m_bit27_24;}
118  uint16_t bit24_27() const {return m_bit24_27;}
119 
120 
121  private:
122 
123  void setZero();
124 
125 
126 };
127 
128 #endif // ALFARAWDATAREADOUT_CHARGE_H
ALFA_RawDataContainer_charge.h
ALFA_RawDataReadOut_charge::is_EOT
bool is_EOT() const
Definition: ALFA_RawDataReadOut_charge.h:96
ALFA_RawDataReadOut_charge::ChargeChanId
uint16_t ChargeChanId() const
Definition: ALFA_RawDataReadOut_charge.h:113
ALFA_RawDataReadOut_charge::m_ChargeChan
std::vector< uint32_t > m_ChargeChan
Definition: ALFA_RawDataReadOut_charge.h:61
ALFA_RawDataReadOut_charge::m_PMFId
uint16_t m_PMFId
Definition: ALFA_RawDataReadOut_charge.h:52
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ALFA_RawDataReadOut_charge::m_ecnt_EOT
uint16_t m_ecnt_EOT
Definition: ALFA_RawDataReadOut_charge.h:41
ALFA_RawDataReadOut_charge::bcId
uint16_t bcId() const
Definition: ALFA_RawDataReadOut_charge.h:107
ALFA_RawDataReadOut_charge::s_headerBits
static constexpr uint16_t s_headerBits
Definition: ALFA_RawDataReadOut_charge.h:69
ALFA_RawDataReadOut_charge::s_headerPos
static constexpr uint16_t s_headerPos
Definition: ALFA_RawDataReadOut_charge.h:68
ALFA_RawDataReadOut_charge
Definition: ALFA_RawDataReadOut_charge.h:28
ALFA_RawDataReadOut_charge::s_TSMvalue_charge
static constexpr uint16_t s_TSMvalue_charge
Definition: ALFA_RawDataReadOut_charge.h:78
ALFA_RawDataReadOut_charge::is_TDCch
bool is_TDCch() const
Definition: ALFA_RawDataReadOut_charge.h:98
ALFA_RawDataReadOut_charge::ChannelNumId
uint16_t ChannelNumId() const
Definition: ALFA_RawDataReadOut_charge.h:112
ALFA_RawDataReadOut_charge::SlotId
uint16_t SlotId() const
Definition: ALFA_RawDataReadOut_charge.h:103
ALFA_RawDataReadOut_charge::m_SlotId
uint16_t m_SlotId
Definition: ALFA_RawDataReadOut_charge.h:38
ALFA_RawData_charge.h
ALFA_RawDataReadOut_charge::bit27_24
uint16_t bit27_24() const
Definition: ALFA_RawDataReadOut_charge.h:117
ALFA_RawDataReadOut_charge::s_BOTvalue
static constexpr uint16_t s_BOTvalue
Definition: ALFA_RawDataReadOut_charge.h:72
ALFA_RawDataReadOut_charge::m_bit27_24
uint16_t m_bit27_24
Definition: ALFA_RawDataReadOut_charge.h:59
ALFA_RawDataReadOut_charge::LsbTdcId
uint16_t LsbTdcId() const
Definition: ALFA_RawDataReadOut_charge.h:104
ALFA_RawDataReadOut_charge::m_dataWord
uint32_t m_dataWord
Definition: ALFA_RawDataReadOut_charge.h:33
ALFA_RawDataReadOut_charge::ecnt_BOT
uint16_t ecnt_BOT() const
Definition: ALFA_RawDataReadOut_charge.h:105
ALFA_RawDataReadOut_charge::~ALFA_RawDataReadOut_charge
~ALFA_RawDataReadOut_charge()
Definition: ALFA_RawDataReadOut_charge.cxx:27
ALFA_RawDataReadOut_charge::bit12
bool bit12() const
Definition: ALFA_RawDataReadOut_charge.h:115
ALFA_RawDataReadOut_charge::m_FiberFirmwareId
uint16_t m_FiberFirmwareId
Definition: ALFA_RawDataReadOut_charge.h:50
ALFA_RawDataReadOut_charge::m_bit24_27
uint16_t m_bit24_27
Definition: ALFA_RawDataReadOut_charge.h:58
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
ALFA_RawDataReadOut_charge::m_LsbTdcId
uint16_t m_LsbTdcId
Definition: ALFA_RawDataReadOut_charge.h:39
RawEvent.h
ALFA_RawDataReadOut_charge::m_wcnt
uint16_t m_wcnt
Definition: ALFA_RawDataReadOut_charge.h:45
ALFA_RawDataReadOut_charge::PMFId
uint16_t PMFId() const
Definition: ALFA_RawDataReadOut_charge.h:111
AthAlgTool.h
ALFA_RawDataReadOut_charge::m_ChargeChanId
uint16_t m_ChargeChanId
Definition: ALFA_RawDataReadOut_charge.h:54
ALFA_RawDataReadOut_charge::s_EOTvalue
static constexpr uint16_t s_EOTvalue
Definition: ALFA_RawDataReadOut_charge.h:75
ALFA_RawDataReadOut_charge::setZero
void setZero()
Definition: ALFA_RawDataReadOut_charge.cxx:76
ALFA_ReadOut
Definition: ALFA_ReadOut.h:14
ALFA_RawDataReadOut_charge::m_ChannelNumId
uint16_t m_ChannelNumId
Definition: ALFA_RawDataReadOut_charge.h:53
ALFA_RawDataReadOut_charge::m_MBId
uint16_t m_MBId
Definition: ALFA_RawDataReadOut_charge.h:49
ALFA_RawDataReadOut_charge::ecnt_EOT
uint16_t ecnt_EOT() const
Definition: ALFA_RawDataReadOut_charge.h:106
ALFA_RawDataReadOut_charge::m_bcId
uint16_t m_bcId
Definition: ALFA_RawDataReadOut_charge.h:42
ALFA_RawDataReadOut_charge::m_bit12
bool m_bit12
Definition: ALFA_RawDataReadOut_charge.h:56
ALFA_RawDataReadOut_charge::m_ecnt_BOT
uint16_t m_ecnt_BOT
Definition: ALFA_RawDataReadOut_charge.h:40
ALFA_RawDataReadOut_charge::m_wordHeader
uint16_t m_wordHeader
Definition: ALFA_RawDataReadOut_charge.h:35
ALFA_RawDataReadOut_charge::MBId
uint16_t MBId() const
Definition: ALFA_RawDataReadOut_charge.h:110
ALFA_RawDataReadOut_charge::ALFA_RawDataReadOut_charge
ALFA_RawDataReadOut_charge()
Definition: ALFA_RawDataReadOut_charge.cxx:7
ALFA_RawDataReadOut_charge::FiberFirmwareId
uint16_t FiberFirmwareId() const
Definition: ALFA_RawDataReadOut_charge.h:114
ALFA_RawDataReadOut_charge::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataReadOut_charge.cxx:30
ALFA_ReadOut.h
ALFA_RawDataCollection_charge.h
ALFA_RawDataReadOut_charge::bit24_27
uint16_t bit24_27() const
Definition: ALFA_RawDataReadOut_charge.h:118
ALFA_RawDataReadOut_charge::is_BOT
bool is_BOT() const
Definition: ALFA_RawDataReadOut_charge.h:94