Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
EventFilter
CastorRawToDigi
interface
CastorCTDCHeader.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
#ifndef CastorCTDCHeader_H
3
#define CastorCTDCHeader_H
4
5
#include <iostream>
6
class
CastorCORData
;
7
class
CastorMergerData
;
8
19
class
CastorCTDCHeader
{
20
public
:
21
static
const
int
SPIGOT_COUNT
;
22
23
CastorCTDCHeader
();
24
26
unsigned
int
getTotalLengthBytes
()
const
;
27
29
30
inline
bool
thereIsASecondCDFHeaderWord
()
const
{
return
((
commondataformat0
>>3) & 0x0001); }
32
inline
short
getCDFversionNumber
()
const
{
return
((
commondataformat0
>>4) & 0x0F); }
34
inline
int
getSourceId
()
const
{
return
(
commondataformat0
>>8)&0xFFF; }
36
inline
int
getBunchId
()
const
{
return
(
commondataformat0
>>20)&0xFFF; }
38
inline
unsigned
long
getDCCEventNumber
()
const
{
return
(
commondataformat1
& 0x00FFFFFF); }
40
inline
unsigned
short
getCDFEventType
()
const
{
return
( (
commondataformat1
>>24) & 0x0F ); }
42
inline
unsigned
short
BOEshouldBe5Always
()
const
{
return
( (
commondataformat1
>>28) & 0x0F ); }
43
45
46
inline
bool
thereIsAThirdCDFHeaderWord
()
const
{
return
((
commondataformat2
>>3) & 0x0001); }
48
inline
unsigned
int
getOrbitNumber
()
const
{
return
(
commondataformat2
>>4); }
50
inline
unsigned
int
getSlink64ReservedBits
()
const
{
return
( (
commondataformat3
>>4)&0x00FFFFFF ); }
52
inline
short
BOEshouldBeZeroAlways
()
const
{
return
( (
commondataformat3
>>28) & 0x0F); }
53
55
inline
short
getDCCDataFormatVersion
()
const
{
return
(
ctdch0
& 0xFF); }
56
inline
int
getAcceptTimeTTS
()
const
{
return
((
ctdch0
>>8)& 0x0000000F); }
57
inline
int
getByte1Zeroes
()
const
{
return
((
ctdch0
>>12)& 0x00000003); }
58
inline
int
getHTRStatusBits
()
const
{
return
((
ctdch0
>>14)& 0x00007FFF); }
59
inline
int
getByte3Zeroes
()
const
{
return
((
ctdch0
>>29)& 0x00000007); }
60
inline
int
getDCCStatus
()
const
{
return
(
ctdch1
& 0x000003FF);}
61
inline
int
getByte567Zeroes
()
const
{
return
(
ctdch1
& 0xFF00FC00); }
62
64
inline
bool
getSpigotErrorFlag
(
int
nspigot)
const
{
65
return
((
ctdch0
>>(14+nspigot) )&0x0001); }
66
68
inline
bool
SawTTS_OFW
()
const
{
return
((
getDCCStatus
()>>0) & 0x00000001);}
69
inline
bool
SawTTS_BSY
()
const
{
return
((
getDCCStatus
()>>1) & 0x00000001);}
70
inline
bool
SawTTS_SYN
()
const
{
return
((
getDCCStatus
()>>2) & 0x00000001);}
71
inline
bool
SawL1A_EvN_MxMx
()
const
{
return
((
getDCCStatus
()>>3) & 0x00000001);}
72
inline
bool
SawL1A_BcN_MxMx
()
const
{
return
((
getDCCStatus
()>>4) & 0x00000001);}
73
inline
bool
SawCT_EvN_MxMx
()
const
{
return
((
getDCCStatus
()>>5) & 0x00000001);}
74
inline
bool
SawCT_BcN_MxMx
()
const
{
return
((
getDCCStatus
()>>6) & 0x00000001);}
75
inline
bool
SawOrbitLengthErr
()
const
{
return
((
getDCCStatus
()>>7) & 0x00000001);}
76
inline
bool
SawTTC_SingErr
()
const
{
return
((
getDCCStatus
()>>8) & 0x00000001);}
77
inline
bool
SawTTC_DoubErr
()
const
{
return
((
getDCCStatus
()>>9) & 0x00000001);}
78
80
inline
int
getSpigotSummary
(
int
nspigot)
const
{
return
spigotInfo
[nspigot]; }
81
86
int
getSpigotData
(
int
nspigot,
CastorCORData
& decodeTool,
int
validSize)
const
;
87
89
inline
unsigned
int
getSpigotDataLength
(
int
nspigot)
const
{
return
(nspigot>=3)?(0):(
spigotInfo
[nspigot]&0x3ff); }
90
92
inline
bool
getSpigotEnabled
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(
false
):(
spigotInfo
[nspigot]&0x8000); }
94
inline
bool
getSpigotPresent
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(
false
):(
spigotInfo
[nspigot]&0x4000); }
96
inline
bool
getBxMismatchWithDCC
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(
false
):(
spigotInfo
[nspigot]&0x2000); }
98
inline
bool
getSpigotValid
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(
false
):(
spigotInfo
[nspigot]&0x1000); }
100
inline
bool
getSpigotDataTruncated
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(
false
):(
spigotInfo
[nspigot]&0x0800); }
102
inline
bool
getSpigotCRCError
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(
false
):(
spigotInfo
[nspigot]&0x0400); }
104
inline
unsigned
char
getSpigotErrorBits
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(0):((
unsigned
char
)(
spigotInfo
[nspigot]>>24)); }
106
inline
unsigned
char
getLRBErrorBits
(
unsigned
int
nspigot)
const
{
return
(nspigot>=3)?(0):((
unsigned
char
)(
spigotInfo
[nspigot]>>16)); }
107
108
/* (for packing only) */
115
void
copySpigotData
(
unsigned
int
spigot_id,
const
CastorCORData
&
data
,
bool
valid
=
true
,
unsigned
char
LRB_error_word=0);
116
117
void
copyMergerData
(
const
CastorMergerData
&
data
,
bool
valid
) ;
118
120
void
clear
();
122
void
setHeader
(
int
sourceid,
int
bcn,
int
l1aN,
int
orbN);
123
124
private
:
125
// CURRENTLY VALID FOR LITTLE-ENDIAN (LINUX/x86) ONLY
126
unsigned
int
commondataformat0
;
127
unsigned
int
commondataformat1
;
128
unsigned
int
commondataformat2
;
129
unsigned
int
commondataformat3
;
130
unsigned
int
ctdch0
;
131
unsigned
int
ctdch1
;
132
unsigned
int
spigotInfo
[4];
//The last of these 32bit words should be "end header pattern"
133
134
};
135
136
std::ostream&
operator<<
(std::ostream&,
const
CastorCTDCHeader
& head);
137
138
#endif
TrackValidation_HighPurity_cff.valid
tuple valid
Definition:
TrackValidation_HighPurity_cff.py:20
CastorCTDCHeader::getSpigotData
int getSpigotData(int nspigot, CastorCORData &decodeTool, int validSize) const
Definition:
CastorCTDCHeader.cc:24
CastorCTDCHeader::SawL1A_EvN_MxMx
bool SawL1A_EvN_MxMx() const
Definition:
CastorCTDCHeader.h:71
CastorCTDCHeader::getSpigotValid
bool getSpigotValid(unsigned int nspigot) const
Read the "VALID" bit for this spigot; TTC EvN matched HTR EvN.
Definition:
CastorCTDCHeader.h:98
CastorCTDCHeader::getSpigotCRCError
bool getSpigotCRCError(unsigned int nspigot) const
Read the "CRC-Mismatch" bit for this spigot.
Definition:
CastorCTDCHeader.h:102
CastorCTDCHeader::getBunchId
int getBunchId() const
Definition:
CastorCTDCHeader.h:36
CastorCTDCHeader::getSpigotEnabled
bool getSpigotEnabled(unsigned int nspigot) const
Read the "ENABLED" bit for this spigot.
Definition:
CastorCTDCHeader.h:92
CastorCTDCHeader::getTotalLengthBytes
unsigned int getTotalLengthBytes() const
Definition:
CastorCTDCHeader.cc:17
CastorCTDCHeader::CastorCTDCHeader
CastorCTDCHeader()
Definition:
CastorCTDCHeader.cc:15
CastorMergerData
Definition:
CastorMergerData.h:16
CastorCTDCHeader::getByte3Zeroes
int getByte3Zeroes() const
Definition:
CastorCTDCHeader.h:59
CastorCTDCHeader::setHeader
void setHeader(int sourceid, int bcn, int l1aN, int orbN)
Definition:
CastorCTDCHeader.cc:50
CastorCTDCHeader::getLRBErrorBits
unsigned char getLRBErrorBits(unsigned int nspigot) const
Access the Link Receiver Board error bits (decoding tbd)
Definition:
CastorCTDCHeader.h:106
CastorCTDCHeader::getByte567Zeroes
int getByte567Zeroes() const
Definition:
CastorCTDCHeader.h:61
operator<<
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition:
ALILine.cc:187
CastorCTDCHeader::SPIGOT_COUNT
static const int SPIGOT_COUNT
Definition:
CastorCTDCHeader.h:21
CastorCTDCHeader::SawL1A_BcN_MxMx
bool SawL1A_BcN_MxMx() const
Definition:
CastorCTDCHeader.h:72
CastorCTDCHeader::commondataformat0
unsigned int commondataformat0
Definition:
CastorCTDCHeader.h:126
CastorCTDCHeader::SawTTS_OFW
bool SawTTS_OFW() const
Definition:
CastorCTDCHeader.h:68
CastorCTDCHeader::copySpigotData
void copySpigotData(unsigned int spigot_id, const CastorCORData &data, bool valid=true, unsigned char LRB_error_word=0)
Add the given CastorCORData as the given spigot's data. This should be done in increasing spigot orde...
Definition:
CastorCTDCHeader.cc:55
CastorCTDCHeader::commondataformat3
unsigned int commondataformat3
Definition:
CastorCTDCHeader.h:129
CastorCTDCHeader::getSpigotErrorFlag
bool getSpigotErrorFlag(int nspigot) const
Definition:
CastorCTDCHeader.h:64
CastorCTDCHeader::SawTTS_BSY
bool SawTTS_BSY() const
Definition:
CastorCTDCHeader.h:69
CastorCTDCHeader::thereIsAThirdCDFHeaderWord
bool thereIsAThirdCDFHeaderWord() const
Definition:
CastorCTDCHeader.h:46
CastorCTDCHeader::clear
void clear()
Definition:
CastorCTDCHeader.cc:37
CastorCTDCHeader::getSlink64ReservedBits
unsigned int getSlink64ReservedBits() const
Definition:
CastorCTDCHeader.h:50
CastorCTDCHeader::getDCCStatus
int getDCCStatus() const
Definition:
CastorCTDCHeader.h:60
CastorCTDCHeader::copyMergerData
void copyMergerData(const CastorMergerData &data, bool valid)
Definition:
CastorCTDCHeader.cc:76
CastorCTDCHeader::getDCCEventNumber
unsigned long getDCCEventNumber() const
Definition:
CastorCTDCHeader.h:38
CastorCTDCHeader::spigotInfo
unsigned int spigotInfo[4]
Definition:
CastorCTDCHeader.h:132
CastorCTDCHeader::getSpigotDataLength
unsigned int getSpigotDataLength(int nspigot) const
Definition:
CastorCTDCHeader.h:89
CastorCTDCHeader::BOEshouldBeZeroAlways
short BOEshouldBeZeroAlways() const
Definition:
CastorCTDCHeader.h:52
CastorCTDCHeader::commondataformat2
unsigned int commondataformat2
Definition:
CastorCTDCHeader.h:128
CastorCTDCHeader::SawCT_BcN_MxMx
bool SawCT_BcN_MxMx() const
Definition:
CastorCTDCHeader.h:74
CastorCTDCHeader::getCDFversionNumber
short getCDFversionNumber() const
Definition:
CastorCTDCHeader.h:32
CastorCTDCHeader::getCDFEventType
unsigned short getCDFEventType() const
Definition:
CastorCTDCHeader.h:40
CastorCTDCHeader::getOrbitNumber
unsigned int getOrbitNumber() const
Definition:
CastorCTDCHeader.h:48
CastorCTDCHeader::SawOrbitLengthErr
bool SawOrbitLengthErr() const
Definition:
CastorCTDCHeader.h:75
CastorCTDCHeader::getSpigotDataTruncated
bool getSpigotDataTruncated(unsigned int nspigot) const
Read the "TRUNCATED" bit for this spigot; LRB truncated data (took too long)
Definition:
CastorCTDCHeader.h:100
CastorCTDCHeader::commondataformat1
unsigned int commondataformat1
Definition:
CastorCTDCHeader.h:127
CastorCTDCHeader::getAcceptTimeTTS
int getAcceptTimeTTS() const
Definition:
CastorCTDCHeader.h:56
CastorCTDCHeader::getHTRStatusBits
int getHTRStatusBits() const
Definition:
CastorCTDCHeader.h:58
CastorCTDCHeader::thereIsASecondCDFHeaderWord
bool thereIsASecondCDFHeaderWord() const
Definition:
CastorCTDCHeader.h:30
CastorCTDCHeader::SawTTC_SingErr
bool SawTTC_SingErr() const
Definition:
CastorCTDCHeader.h:76
CastorCORData
Definition:
CastorCORData.h:16
CastorCTDCHeader::getBxMismatchWithDCC
bool getBxMismatchWithDCC(unsigned int nspigot) const
Read the "BxID FAILS TO MATCH WITH DCC" bit for this spigot.
Definition:
CastorCTDCHeader.h:96
CastorCTDCHeader::getSpigotPresent
bool getSpigotPresent(unsigned int nspigot) const
Read the "PRESENT" bit for this spigot.
Definition:
CastorCTDCHeader.h:94
CastorCTDCHeader::getSpigotSummary
int getSpigotSummary(int nspigot) const
Definition:
CastorCTDCHeader.h:80
CastorCTDCHeader::SawCT_EvN_MxMx
bool SawCT_EvN_MxMx() const
Definition:
CastorCTDCHeader.h:73
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
CastorCTDCHeader::ctdch1
unsigned int ctdch1
Definition:
CastorCTDCHeader.h:131
CastorCTDCHeader::getByte1Zeroes
int getByte1Zeroes() const
Definition:
CastorCTDCHeader.h:57
CastorCTDCHeader::SawTTC_DoubErr
bool SawTTC_DoubErr() const
Definition:
CastorCTDCHeader.h:77
CastorCTDCHeader::getSpigotErrorBits
unsigned char getSpigotErrorBits(unsigned int nspigot) const
Access the HTR error bits (decoding tbd)
Definition:
CastorCTDCHeader.h:104
CastorCTDCHeader
Definition:
CastorCTDCHeader.h:19
CastorCTDCHeader::getDCCDataFormatVersion
short getDCCDataFormatVersion() const
Definition:
CastorCTDCHeader.h:55
CastorCTDCHeader::BOEshouldBe5Always
unsigned short BOEshouldBe5Always() const
Definition:
CastorCTDCHeader.h:42
CastorCTDCHeader::SawTTS_SYN
bool SawTTS_SYN() const
Definition:
CastorCTDCHeader.h:70
CastorCTDCHeader::ctdch0
unsigned int ctdch0
Definition:
CastorCTDCHeader.h:130
CastorCTDCHeader::getSourceId
int getSourceId() const
Definition:
CastorCTDCHeader.h:34
Generated for CMSSW Reference Manual by
1.8.5