ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonMDT_CnvTools
src
MdtHptdcReadOut.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUONBYTESTREAM_MDTHPTDCREADOUT_H
6
#define MUONBYTESTREAM_MDTHPTDCREADOUT_H
7
8
#include <stdint.h>
9
10
#include "
MdtReadOut.h
"
11
12
// Decoding methods for MDT Hptdc raw data words
13
// S. Rosati, J. Meyer Apr 2017
14
15
class
MdtHptdcReadOut
:
public
MdtReadOut
{
16
private
:
17
// Raw data word
18
uint32_t
m_dataWord
;
19
// Data word header
20
uint16_t
m_wordHeader
;
21
22
// Header info: event counter, bunch crossing ID and tdc number
23
uint16_t
m_tdcId
;
24
uint16_t
m_ecnt
;
25
uint16_t
m_bcId
;
26
27
// Footer info: words counter
28
uint16_t
m_wcnt
;
29
30
// Data info:
31
uint16_t
m_channel
;
32
uint16_t
m_coarse
;
33
uint16_t
m_fine
;
34
uint16_t
m_width
;
35
bool
m_errflag
;
36
37
bool
m_leading
;
38
39
// Define the data structure and the word header values
40
41
// Word header Position and values
42
// The word header occupies the 4 highest bits of each TDC data word
43
static
constexpr
uint16_t
HEADERPOS
= 28;
44
static
constexpr
uint16_t
HEADERBITS
= 0xf;
45
46
// Beginning of TDC: two possible header values
47
// for channels 00-15 and 16-17 respectively
48
static
constexpr
uint16_t
BOTVALUE1
= 0xa;
49
static
constexpr
uint16_t
BOTVALUE2
= 0xb;
50
51
// End of TDC
52
static
constexpr
uint16_t
EOTVALUE
= 0xc;
53
54
// TDC single measurement
55
static
constexpr
uint16_t
TSMVALUE_LEAD
= 0x4;
56
static
constexpr
uint16_t
TSMVALUE_TAIL
= 0x5;
57
58
// TDC combined measurement
59
static
constexpr
uint16_t
TCMVALUE
= 0x9;
60
61
// TDC error status
62
static
constexpr
uint16_t
TESVALUE
= 0x6;
63
64
public
:
65
// Constructor and destructor
66
MdtHptdcReadOut
();
67
~MdtHptdcReadOut
() =
default
;
68
69
// Methods for decoding and encoding dataWords
70
void
decodeWord
(uint32_t dataWord);
71
void
encodeWord
(uint16_t headerVal);
72
73
// Methods to identify the word type
74
// Beginning of TDC
75
bool
is_BOT
()
const
{
return
((
m_wordHeader
==
BOTVALUE1
) || (
m_wordHeader
==
BOTVALUE2
)); };
76
// End of TDC
77
bool
is_EOT
()
const
{
return
(
m_wordHeader
==
EOTVALUE
); };
78
// TDC single measurement
79
bool
is_TSM
()
const
{
return
((
m_wordHeader
==
TSMVALUE_LEAD
) || (
m_wordHeader
==
TSMVALUE_TAIL
)); };
80
// TDC combined measurement
81
bool
is_TCM
()
const
{
return
(
m_wordHeader
==
TCMVALUE
); };
82
// TDC error status
83
bool
is_TES
()
const
{
return
(
m_wordHeader
==
TESVALUE
); };
84
85
// Methods to retrieve the decoded word content
86
uint16_t
tdcId
()
const
{
return
m_tdcId
; }
87
uint16_t
ecnt
()
const
{
return
m_ecnt
; }
88
uint16_t
bcId
()
const
{
return
m_bcId
; }
89
90
uint16_t
channel
()
const
{
return
m_channel
; }
91
uint16_t
coarse
()
const
{
return
m_coarse
; }
92
uint16_t
fine
()
const
{
return
m_fine
; }
93
uint16_t
width
()
const
{
return
m_width
; }
94
bool
errflag
()
const
{
return
m_errflag
; }
95
bool
isLeading
()
const
{
return
m_leading
; }
96
97
// Methods to encode data in 32 bits words
98
99
uint32_t
makeBOT
(uint16_t
tdcId
, uint16_t
ecnt
, uint16_t bcid);
100
uint32_t
makeEOT
(uint16_t
tdcId
, uint16_t
ecnt
, uint16_t wcnt);
101
uint32_t
makeTSM
(uint16_t
tdcId
, uint16_t
channel
,
bool
leading, uint16_t
coarse
, uint16_t
fine
);
102
103
uint32_t
makeTCM
(uint16_t
tdcId
, uint16_t
channel
, uint16_t
width
, uint16_t
coarse
, uint16_t
fine
);
104
105
private
:
106
void
setZero
();
107
};
108
109
#endif
// MUONBYTESTREAM_MDTHPTDCREADOUT_H
MdtReadOut.h
width
const double width
Definition
TTileTripReader.cxx:24
MdtHptdcReadOut::TESVALUE
static constexpr uint16_t TESVALUE
Definition
MdtHptdcReadOut.h:62
MdtHptdcReadOut::m_ecnt
uint16_t m_ecnt
Definition
MdtHptdcReadOut.h:24
MdtHptdcReadOut::encodeWord
void encodeWord(uint16_t headerVal)
MdtHptdcReadOut::~MdtHptdcReadOut
~MdtHptdcReadOut()=default
MdtHptdcReadOut::makeTSM
uint32_t makeTSM(uint16_t tdcId, uint16_t channel, bool leading, uint16_t coarse, uint16_t fine)
Definition
MdtHptdcReadOut.cxx:104
MdtHptdcReadOut::BOTVALUE1
static constexpr uint16_t BOTVALUE1
Definition
MdtHptdcReadOut.h:48
MdtHptdcReadOut::m_channel
uint16_t m_channel
Definition
MdtHptdcReadOut.h:31
MdtHptdcReadOut::coarse
uint16_t coarse() const
Definition
MdtHptdcReadOut.h:91
MdtHptdcReadOut::TSMVALUE_TAIL
static constexpr uint16_t TSMVALUE_TAIL
Definition
MdtHptdcReadOut.h:56
MdtHptdcReadOut::isLeading
bool isLeading() const
Definition
MdtHptdcReadOut.h:95
MdtHptdcReadOut::m_coarse
uint16_t m_coarse
Definition
MdtHptdcReadOut.h:32
MdtHptdcReadOut::width
uint16_t width() const
Definition
MdtHptdcReadOut.h:93
MdtHptdcReadOut::is_TCM
bool is_TCM() const
Definition
MdtHptdcReadOut.h:81
MdtHptdcReadOut::tdcId
uint16_t tdcId() const
Definition
MdtHptdcReadOut.h:86
MdtHptdcReadOut::HEADERBITS
static constexpr uint16_t HEADERBITS
Definition
MdtHptdcReadOut.h:44
MdtHptdcReadOut::makeBOT
uint32_t makeBOT(uint16_t tdcId, uint16_t ecnt, uint16_t bcid)
Definition
MdtHptdcReadOut.cxx:75
MdtHptdcReadOut::BOTVALUE2
static constexpr uint16_t BOTVALUE2
Definition
MdtHptdcReadOut.h:49
MdtHptdcReadOut::m_wcnt
uint16_t m_wcnt
Definition
MdtHptdcReadOut.h:28
MdtHptdcReadOut::m_leading
bool m_leading
Definition
MdtHptdcReadOut.h:37
MdtHptdcReadOut::is_TSM
bool is_TSM() const
Definition
MdtHptdcReadOut.h:79
MdtHptdcReadOut::is_BOT
bool is_BOT() const
Definition
MdtHptdcReadOut.h:75
MdtHptdcReadOut::errflag
bool errflag() const
Definition
MdtHptdcReadOut.h:94
MdtHptdcReadOut::EOTVALUE
static constexpr uint16_t EOTVALUE
Definition
MdtHptdcReadOut.h:52
MdtHptdcReadOut::m_wordHeader
uint16_t m_wordHeader
Definition
MdtHptdcReadOut.h:20
MdtHptdcReadOut::MdtHptdcReadOut
MdtHptdcReadOut()
Definition
MdtHptdcReadOut.cxx:7
MdtHptdcReadOut::m_errflag
bool m_errflag
Definition
MdtHptdcReadOut.h:35
MdtHptdcReadOut::is_TES
bool is_TES() const
Definition
MdtHptdcReadOut.h:83
MdtHptdcReadOut::TSMVALUE_LEAD
static constexpr uint16_t TSMVALUE_LEAD
Definition
MdtHptdcReadOut.h:55
MdtHptdcReadOut::m_fine
uint16_t m_fine
Definition
MdtHptdcReadOut.h:33
MdtHptdcReadOut::m_width
uint16_t m_width
Definition
MdtHptdcReadOut.h:34
MdtHptdcReadOut::fine
uint16_t fine() const
Definition
MdtHptdcReadOut.h:92
MdtHptdcReadOut::channel
uint16_t channel() const
Definition
MdtHptdcReadOut.h:90
MdtHptdcReadOut::makeEOT
uint32_t makeEOT(uint16_t tdcId, uint16_t ecnt, uint16_t wcnt)
Definition
MdtHptdcReadOut.cxx:95
MdtHptdcReadOut::m_dataWord
uint32_t m_dataWord
Definition
MdtHptdcReadOut.h:18
MdtHptdcReadOut::m_tdcId
uint16_t m_tdcId
Definition
MdtHptdcReadOut.h:23
MdtHptdcReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition
MdtHptdcReadOut.cxx:21
MdtHptdcReadOut::bcId
uint16_t bcId() const
Definition
MdtHptdcReadOut.h:88
MdtHptdcReadOut::ecnt
uint16_t ecnt() const
Definition
MdtHptdcReadOut.h:87
MdtHptdcReadOut::m_bcId
uint16_t m_bcId
Definition
MdtHptdcReadOut.h:25
MdtHptdcReadOut::TCMVALUE
static constexpr uint16_t TCMVALUE
Definition
MdtHptdcReadOut.h:59
MdtHptdcReadOut::makeTCM
uint32_t makeTCM(uint16_t tdcId, uint16_t channel, uint16_t width, uint16_t coarse, uint16_t fine)
Definition
MdtHptdcReadOut.cxx:116
MdtHptdcReadOut::HEADERPOS
static constexpr uint16_t HEADERPOS
Definition
MdtHptdcReadOut.h:43
MdtHptdcReadOut::setZero
void setZero()
Definition
MdtHptdcReadOut.cxx:60
MdtHptdcReadOut::is_EOT
bool is_EOT() const
Definition
MdtHptdcReadOut.h:77
MdtReadOut::MdtReadOut
MdtReadOut()
Definition
MdtReadOut.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0