ATLAS Offline Software
Loading...
Searching...
No Matches
ALFA_RawDataReadOut.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_H
6#define ALFARAWDATAREADOUT_H
7
8#include "ALFA_ReadOut.h"
9#include <stdint.h>
10
12
13#include "eformat/SourceIdentifier.h"
14#include "eformat/Version.h"
16
20
21
22// Decoding methods for raw data words
23// S. Diglio Sept 2009
24
25
27
28 private:
29
30 // Raw data word
31 uint32_t m_dataWord;
32 // Data word header
33 uint16_t m_wordHeader;
34
35 // Header info: event counter, bunch crossing ID and tdc number: EOT and BOT
36 uint16_t m_SlotId; // bit 28-24 BOT
37 uint16_t m_LsbTdcId; // bit 25-24 EOT
38 uint16_t m_ecnt_BOT; // bit 23-12 BOT(event counter, counted by TDC)
39 uint16_t m_ecnt_EOT; // bit 23-12 BOT(event counter, counted by TDC)
40 uint16_t m_bcId; // bit 11-0 BOT (bunch crossing Id)
41
42 // Footer info: words counter
43 uint16_t m_wcnt; // bit 11-0 EOT (numer of word in TDC data block counting itself)
44
45 // Data info TSM:
46
47 uint16_t m_MBId; // bit 15-0 MB number PMF0 Word1
48
49 uint16_t m_bit26_27;
50 uint16_t m_bit24_27;
51
52 uint16_t m_WordId; // bit 25-24 (word number from 0 to3)
53 uint16_t m_PMFId; // bit 23-19 (PMF number from 1 to 23--> PMF0 also)
54 uint16_t m_fiber; // bit 15-0 (number of fiber)
55 uint16_t m_ADC; // bit 12-0 (ADC counter for 3rd and 4th word corresponding to PMF24)
56 std::vector<bool> m_pattern; // bit 15-12 (trigger type for 1st word corresponding to PMF24: bit 15->O2, bit14-> M2, bit 13-> O1, bit 12-> M1)
57 uint16_t m_scaler; // bit 15-0 (trigger counter (in 1 ms) for 2nd word corresponding to PMF24)
58 bool m_bit16;
60 bool m_bit18;
61
62 std::vector<uint32_t> m_MarocChan;
63
64 // Define the data structure and the word header values
65
66 // Word 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
78 static constexpr uint16_t s_TSMvalue = 0x3;
79
80 public:
81
82 // constructor and destructor
85
86 // Methods for decoding and encoding dataWords
87 void decodeWord(uint32_t dataWord);
88
89 //StatusCode encodeWord(uint16_t headerVal);
90
91 // Methods to identify the word type
92 // Beginning of TDC
93 bool is_BOT() const {return (m_wordHeader == s_BOTvalue);};
94 // End of TDC
95 bool is_EOT() const{return (m_wordHeader == s_EOTvalue);};
96 // TDC single measurement
97 bool is_TDCt()const {return (m_wordHeader == s_TSMvalue);};
98
99 // Methods to retrieve the decoded word content (Get)
100
101 uint16_t MBId() const {return m_MBId;}
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 uint16_t WordId() const {return m_WordId;}
109 uint16_t PMFId() const {return m_PMFId;}
110 uint16_t fiber() const {return m_fiber;}
111 uint16_t ADC() const {return m_ADC;}
112 const std::vector<bool>& pattern() const {return m_pattern;}
113 uint16_t scaler() const {return m_scaler;}
114 bool bit16() const {return m_bit16;}
115 bool error_bit17() const{return m_error_bit17;}
116 bool bit18() const {return m_bit18;}
117 bool isError()const {return m_error_bit17;}
118 uint16_t bit26_27() const {return m_bit26_27;}
119 uint16_t bit24_27() const {return m_bit24_27;}
120
121 const std::vector<uint32_t>& HitChan() const {return m_MarocChan;}
122
123 private:
124
125 void setZero();
126
127 // Methods for the decoding
128 //ALFA_RawDataReadOut * m_ALFA_RawDataReadOut;
129
130};
131
132#endif // ALFARAWDATAREADOUT_H
uint16_t bit24_27() const
void decodeWord(uint32_t dataWord)
const std::vector< uint32_t > & HitChan() const
uint16_t ecnt_EOT() const
static constexpr uint16_t s_TSMvalue
static constexpr uint16_t s_BOTvalue
static constexpr uint16_t s_headerPos
uint16_t ecnt_BOT() const
std::vector< uint32_t > m_MarocChan
static constexpr uint16_t s_headerBits
uint16_t bit26_27() const
uint16_t LsbTdcId() const
const std::vector< bool > & pattern() const
static constexpr uint16_t s_EOTvalue
std::vector< bool > m_pattern