ATLAS Offline Software
Loading...
Searching...
No Matches
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
33 uint32_t m_dataWord;
34 // Data word header
35 uint16_t m_wordHeader;
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
58 uint16_t m_bit24_27;
59 uint16_t m_bit27_24;
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;}
112 uint16_t ChannelNumId() const {return m_ChannelNumId;}
113 uint16_t ChargeChanId() const {return m_ChargeChanId;}
114 uint16_t FiberFirmwareId() const {return m_FiberFirmwareId;};
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
static constexpr uint16_t s_BOTvalue
static constexpr uint16_t s_headerBits
static constexpr uint16_t s_headerPos
static constexpr uint16_t s_EOTvalue
static constexpr uint16_t s_TSMvalue_charge