Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
EventFilter
HcalRawToDigi
interface
HcalDCCHeader.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
#ifndef HcalDCCHeader_H
3
#define HcalDCCHeader_H
4
5
#include <iostream>
6
#include "
DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h
"
7
class
HcalHTRData
;
8
19
class
HcalDCCHeader
{
20
public
:
21
static
const
int
SPIGOT_COUNT
;
22
23
HcalDCCHeader
();
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
( ((
commondataformat3
&& 0xF) << 28) + (
commondataformat2
>>4) ); }
50
inline
unsigned
int
getSlink64ReservedBits
()
const
{
return
( (
commondataformat3
>>4)&0x00FFFFFF ); }
52
inline
short
BOEshouldBeZeroAlways
()
const
{
return
( (
commondataformat3
>>28) & 0x0F); }
53
55
inline
bool
isCalibType
()
const
{
return
( 0 !=
getCalibType
());}
56
inline
HcalCalibrationEventType
getCalibType
()
const
{
return
HcalCalibrationEventType
((
commondataformat3
>>24)&0x0000000F);}
57
59
inline
short
getDCCDataFormatVersion
()
const
{
return
(
dcch0
& 0xFF); }
60
inline
int
getAcceptTimeTTS
()
const
{
return
((
dcch0
>>8)& 0x0000000F); }
61
inline
int
getByte1Zeroes
()
const
{
return
((
dcch0
>>12)& 0x00000003); }
62
inline
int
getHTRStatusBits
()
const
{
return
((
dcch0
>>14)& 0x00007FFF); }
63
inline
int
getByte3Zeroes
()
const
{
return
((
dcch0
>>29)& 0x00000007); }
64
inline
int
getDCCStatus
()
const
{
return
(
dcch1
& 0x000003FF);}
65
inline
int
getByte567Zeroes
()
const
{
return
(
dcch1
& 0xFF00FC00); }
66
68
inline
bool
getSpigotErrorFlag
(
int
nspigot)
const
{
69
return
((
dcch0
>>(14+nspigot) )&0x0001); }
70
72
inline
bool
SawTTS_OFW
()
const
{
return
((
getDCCStatus
()>>0) & 0x00000001);}
73
inline
bool
SawTTS_BSY
()
const
{
return
((
getDCCStatus
()>>1) & 0x00000001);}
74
inline
bool
SawTTS_SYN
()
const
{
return
((
getDCCStatus
()>>2) & 0x00000001);}
75
inline
bool
SawL1A_EvN_MxMx
()
const
{
return
((
getDCCStatus
()>>3) & 0x00000001);}
76
inline
bool
SawL1A_BcN_MxMx
()
const
{
return
((
getDCCStatus
()>>4) & 0x00000001);}
77
inline
bool
SawCT_EvN_MxMx
()
const
{
return
((
getDCCStatus
()>>5) & 0x00000001);}
78
inline
bool
SawCT_BcN_MxMx
()
const
{
return
((
getDCCStatus
()>>6) & 0x00000001);}
79
inline
bool
SawOrbitLengthErr
()
const
{
return
((
getDCCStatus
()>>7) & 0x00000001);}
80
inline
bool
SawTTC_SingErr
()
const
{
return
((
getDCCStatus
()>>8) & 0x00000001);}
81
inline
bool
SawTTC_DoubErr
()
const
{
return
((
getDCCStatus
()>>9) & 0x00000001);}
82
84
inline
int
getSpigotSummary
(
int
nspigot)
const
{
return
spigotInfo
[nspigot]; }
85
90
int
getSpigotData
(
int
nspigot,
HcalHTRData
& decodeTool,
int
validSize)
const
;
91
95
void
getSpigotData
(
int
nspigot,
HcalHTRData
& decodeTool)
const
;
96
98
inline
unsigned
int
getSpigotDataLength
(
int
nspigot)
const
{
return
(nspigot>=15)?(0):(
spigotInfo
[nspigot]&0x3ff); }
99
101
inline
bool
getSpigotEnabled
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(
false
):(
spigotInfo
[nspigot]&0x8000); }
103
inline
bool
getSpigotPresent
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(
false
):(
spigotInfo
[nspigot]&0x4000); }
105
inline
bool
getBxMismatchWithDCC
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(
false
):(
spigotInfo
[nspigot]&0x2000); }
107
inline
bool
getSpigotValid
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(
false
):(
spigotInfo
[nspigot]&0x1000); }
109
inline
bool
getSpigotDataTruncated
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(
false
):(
spigotInfo
[nspigot]&0x0800); }
111
inline
bool
getSpigotCRCError
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(
false
):(
spigotInfo
[nspigot]&0x0400); }
113
inline
unsigned
char
getSpigotErrorBits
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(0):((
unsigned
char
)(
spigotInfo
[nspigot]>>24)); }
115
inline
unsigned
char
getLRBErrorBits
(
unsigned
int
nspigot)
const
{
return
(nspigot>=15)?(0):((
unsigned
char
)(
spigotInfo
[nspigot]>>16)); }
116
117
/* (for packing only) */
124
void
copySpigotData
(
unsigned
int
spigot_id,
const
HcalHTRData
&
data
,
bool
valid
=
true
,
unsigned
char
LRB_error_word=0);
125
127
void
clear
();
129
void
setHeader
(
int
sourceid,
int
bcn,
int
l1aN,
int
orbN);
130
131
private
:
132
// CURRENTLY VALID FOR LITTLE-ENDIAN (LINUX/x86) ONLY
133
unsigned
int
commondataformat0
;
134
unsigned
int
commondataformat1
;
135
unsigned
int
commondataformat2
;
136
unsigned
int
commondataformat3
;
137
unsigned
int
dcch0
;
138
unsigned
int
dcch1
;
139
unsigned
int
spigotInfo
[18];
//The last three of these 32bit words should always be zero!
140
141
};
142
143
std::ostream&
operator<<
(std::ostream&,
const
HcalDCCHeader
& head);
144
145
#endif
TrackValidation_HighPurity_cff.valid
tuple valid
Definition:
TrackValidation_HighPurity_cff.py:20
HcalDCCHeader::commondataformat1
unsigned int commondataformat1
Definition:
HcalDCCHeader.h:134
HcalDCCHeader
Definition:
HcalDCCHeader.h:19
HcalDCCHeader::getSpigotSummary
int getSpigotSummary(int nspigot) const
Definition:
HcalDCCHeader.h:84
HcalDCCHeader::getDCCStatus
int getDCCStatus() const
Definition:
HcalDCCHeader.h:64
HcalDCCHeader::getSlink64ReservedBits
unsigned int getSlink64ReservedBits() const
Definition:
HcalDCCHeader.h:50
HcalDCCHeader::getSpigotErrorBits
unsigned char getSpigotErrorBits(unsigned int nspigot) const
Access the HTR error bits (decoding tbd)
Definition:
HcalDCCHeader.h:113
HcalDCCHeader::getSpigotDataLength
unsigned int getSpigotDataLength(int nspigot) const
Definition:
HcalDCCHeader.h:98
HcalDCCHeader::HcalDCCHeader
HcalDCCHeader()
Definition:
HcalDCCHeader.cc:14
HcalDCCHeader::commondataformat2
unsigned int commondataformat2
Definition:
HcalDCCHeader.h:135
HcalDCCHeader::getAcceptTimeTTS
int getAcceptTimeTTS() const
Definition:
HcalDCCHeader.h:60
HcalDCCHeader::SawTTS_SYN
bool SawTTS_SYN() const
Definition:
HcalDCCHeader.h:74
HcalDCCHeader::getSpigotCRCError
bool getSpigotCRCError(unsigned int nspigot) const
Read the "CRC-Mismatch" bit for this spigot.
Definition:
HcalDCCHeader.h:111
HcalDCCHeader::getByte567Zeroes
int getByte567Zeroes() const
Definition:
HcalDCCHeader.h:65
HcalDCCHeader::SawL1A_BcN_MxMx
bool SawL1A_BcN_MxMx() const
Definition:
HcalDCCHeader.h:76
HcalDCCHeader::getCalibType
HcalCalibrationEventType getCalibType() const
Definition:
HcalDCCHeader.h:56
HcalDCCHeader::SawTTC_DoubErr
bool SawTTC_DoubErr() const
Definition:
HcalDCCHeader.h:81
HcalHTRData
Definition:
HcalHTRData.h:18
HcalCalibrationEventType
HcalCalibrationEventType
Definition:
HcalCalibrationEventTypes.h:4
HcalDCCHeader::getByte1Zeroes
int getByte1Zeroes() const
Definition:
HcalDCCHeader.h:61
HcalDCCHeader::thereIsAThirdCDFHeaderWord
bool thereIsAThirdCDFHeaderWord() const
Definition:
HcalDCCHeader.h:46
operator<<
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition:
ALILine.cc:187
HcalDCCHeader::getSpigotData
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
Definition:
HcalDCCHeader.cc:29
HcalDCCHeader::getLRBErrorBits
unsigned char getLRBErrorBits(unsigned int nspigot) const
Access the Link Receiver Board error bits (decoding tbd)
Definition:
HcalDCCHeader.h:115
HcalDCCHeader::getTotalLengthBytes
unsigned int getTotalLengthBytes() const
Definition:
HcalDCCHeader.cc:16
HcalDCCHeader::dcch1
unsigned int dcch1
Definition:
HcalDCCHeader.h:138
HcalDCCHeader::getHTRStatusBits
int getHTRStatusBits() const
Definition:
HcalDCCHeader.h:62
HcalDCCHeader::isCalibType
bool isCalibType() const
Definition:
HcalDCCHeader.h:55
HcalDCCHeader::getOrbitNumber
unsigned int getOrbitNumber() const
Definition:
HcalDCCHeader.h:48
HcalDCCHeader::getBunchId
int getBunchId() const
Definition:
HcalDCCHeader.h:36
HcalDCCHeader::SawCT_BcN_MxMx
bool SawCT_BcN_MxMx() const
Definition:
HcalDCCHeader.h:78
HcalDCCHeader::copySpigotData
void copySpigotData(unsigned int spigot_id, const HcalHTRData &data, bool valid=true, unsigned char LRB_error_word=0)
Add the given HcalHTRData as the given spigot's data. This should be done in increasing spigot order!...
Definition:
HcalDCCHeader.cc:58
HcalDCCHeader::commondataformat3
unsigned int commondataformat3
Definition:
HcalDCCHeader.h:136
HcalDCCHeader::commondataformat0
unsigned int commondataformat0
Definition:
HcalDCCHeader.h:133
HcalDCCHeader::getBxMismatchWithDCC
bool getBxMismatchWithDCC(unsigned int nspigot) const
Read the "BxID FAILS TO MATCH WITH DCC" bit for this spigot.
Definition:
HcalDCCHeader.h:105
HcalCalibrationEventTypes.h
HcalDCCHeader::dcch0
unsigned int dcch0
Definition:
HcalDCCHeader.h:137
HcalDCCHeader::spigotInfo
unsigned int spigotInfo[18]
Definition:
HcalDCCHeader.h:139
HcalDCCHeader::setHeader
void setHeader(int sourceid, int bcn, int l1aN, int orbN)
Definition:
HcalDCCHeader.cc:53
HcalDCCHeader::SawCT_EvN_MxMx
bool SawCT_EvN_MxMx() const
Definition:
HcalDCCHeader.h:77
HcalDCCHeader::getSpigotPresent
bool getSpigotPresent(unsigned int nspigot) const
Read the "PRESENT" bit for this spigot.
Definition:
HcalDCCHeader.h:103
HcalDCCHeader::SawTTS_OFW
bool SawTTS_OFW() const
Definition:
HcalDCCHeader.h:72
HcalDCCHeader::getCDFEventType
unsigned short getCDFEventType() const
Definition:
HcalDCCHeader.h:40
HcalDCCHeader::getSpigotEnabled
bool getSpigotEnabled(unsigned int nspigot) const
Read the "ENABLED" bit for this spigot.
Definition:
HcalDCCHeader.h:101
HcalDCCHeader::getSourceId
int getSourceId() const
Definition:
HcalDCCHeader.h:34
HcalDCCHeader::getByte3Zeroes
int getByte3Zeroes() const
Definition:
HcalDCCHeader.h:63
HcalDCCHeader::getSpigotErrorFlag
bool getSpigotErrorFlag(int nspigot) const
Definition:
HcalDCCHeader.h:68
HcalDCCHeader::SawTTC_SingErr
bool SawTTC_SingErr() const
Definition:
HcalDCCHeader.h:80
HcalDCCHeader::BOEshouldBeZeroAlways
short BOEshouldBeZeroAlways() const
Definition:
HcalDCCHeader.h:52
HcalDCCHeader::getSpigotValid
bool getSpigotValid(unsigned int nspigot) const
Read the "VALID" bit for this spigot; TTC EvN matched HTR EvN.
Definition:
HcalDCCHeader.h:107
HcalDCCHeader::SawOrbitLengthErr
bool SawOrbitLengthErr() const
Definition:
HcalDCCHeader.h:79
HcalDCCHeader::SPIGOT_COUNT
static const int SPIGOT_COUNT
Definition:
HcalDCCHeader.h:21
HcalDCCHeader::SawL1A_EvN_MxMx
bool SawL1A_EvN_MxMx() const
Definition:
HcalDCCHeader.h:75
HcalDCCHeader::getSpigotDataTruncated
bool getSpigotDataTruncated(unsigned int nspigot) const
Read the "TRUNCATED" bit for this spigot; LRB truncated data (took too long)
Definition:
HcalDCCHeader.h:109
HcalDCCHeader::getCDFversionNumber
short getCDFversionNumber() const
Definition:
HcalDCCHeader.h:32
HcalDCCHeader::getDCCDataFormatVersion
short getDCCDataFormatVersion() const
Definition:
HcalDCCHeader.h:59
runTheMatrix.data
data
Definition:
runTheMatrix.py:756
HcalDCCHeader::BOEshouldBe5Always
unsigned short BOEshouldBe5Always() const
Definition:
HcalDCCHeader.h:42
HcalDCCHeader::thereIsASecondCDFHeaderWord
bool thereIsASecondCDFHeaderWord() const
Definition:
HcalDCCHeader.h:30
HcalDCCHeader::getDCCEventNumber
unsigned long getDCCEventNumber() const
Definition:
HcalDCCHeader.h:38
HcalDCCHeader::clear
void clear()
Definition:
HcalDCCHeader.cc:42
HcalDCCHeader::SawTTS_BSY
bool SawTTS_BSY() const
Definition:
HcalDCCHeader.h:73
Generated for CMSSW Reference Manual by
1.8.5