Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mehulkumar Shiroya
cbmroot
Commits
464a4fa3
Commit
464a4fa3
authored
Jul 19, 2021
by
Pierre-Alain Loizeau
Committed by
Pierre-Alain Loizeau
Jul 22, 2021
Browse files
Start cleanup of TOF CRI message class
parent
358fdb23
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
220 deletions
+81
-220
core/data/raw/CriGet4Mess001.cxx
core/data/raw/CriGet4Mess001.cxx
+21
-123
core/data/raw/CriGet4Mess001.h
core/data/raw/CriGet4Mess001.h
+25
-62
fles/mcbm2018/unpacker/CbmCriGet4RawPrint.cxx
fles/mcbm2018/unpacker/CbmCriGet4RawPrint.cxx
+35
-35
No files found.
core/data/raw/CriGet4Mess001.cxx
View file @
464a4fa3
...
...
@@ -99,21 +99,14 @@ double critof001::Message::getMsgFullTimeD(uint64_t epoch) const
{
switch
(
getMessageType
())
{
case
MSG_HIT
:
{
if
(
getGdpbHitIs24b
())
return
(
static_cast
<
double_t
>
(
FullTimeStamp
(
epoch
,
(
getGdpbHitCoarse
()
<<
7
)))
+
(
static_cast
<
double_t
>
(
getGdpbHitFineTs
()
-
8.
)
*
critof001
::
kdFtSize
/
critof001
::
kdFtBinsNb
))
*
(
critof001
::
kdClockCycleSizeNs
/
critof001
::
kdFtSize
);
else
return
(
critof001
::
kdEpochInNs
*
static_cast
<
double_t
>
(
epoch
)
+
static_cast
<
double_t
>
(
getGdpbHitFullTs
())
*
critof001
::
kdClockCycleSizeNs
/
critof001
::
kdFtBinsNb
);
return
(
critof001
::
kdEpochInNs
*
static_cast
<
double_t
>
(
epoch
)
+
static_cast
<
double_t
>
(
getGdpbHitFullTs
())
*
critof001
::
kdClockCycleSizeNs
/
critof001
::
kdFtBinsNb
);
}
// case MSG_HIT:
case
MSG_EPOCH
:
return
critof001
::
kdEpochInNs
*
static_cast
<
double_t
>
(
getGdpbEpEpochNb
());
case
MSG_EPOCH
:
{
return
critof001
::
kdEpochInNs
*
static_cast
<
double_t
>
(
getGdpbEpEpochNb
());
}
case
MSG_SLOWC
:
case
MSG_SYST
:
case
MSG_STAR_TRI_A
:
case
MSG_STAR_TRI_B
:
case
MSG_STAR_TRI_C
:
case
MSG_STAR_TRI_D
:
return
critof001
::
kdEpochInNs
*
static_cast
<
double_t
>
(
epoch
);
default:
return
0.0
;
}
// switch( getMessageType() )
...
...
@@ -217,7 +210,7 @@ void critof001::Message::printData(unsigned outType, unsigned kind, uint32_t epo
snprintf
(
buf
,
sizeof
(
buf
),
"LE= %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X "
,
arr
[
7
],
arr
[
6
],
arr
[
5
],
arr
[
4
],
arr
[
3
],
arr
[
2
],
arr
[
1
],
arr
[
0
]);
if
(
msg_print_Cout
==
outType
)
std
::
cout
<<
buf
;
else
if
(
msg_print_File
==
outType
)
...
...
@@ -241,7 +234,7 @@ void critof001::Message::printData(unsigned outType, unsigned kind, uint32_t epo
snprintf
(
buf
,
sizeof
(
buf
),
"EPOCH @%17.11f Get4:%2d Epoche2:%10u 0x%08x Sync:%x "
"Dataloss:%x Epochloss:%x Epochmissmatch:%x"
,
timeInSec
,
getG
dpbGenChip
Id
(),
getGdpbEpEpochNb
(),
getGdpbEpEpochNb
(),
getGdpbEpSync
(),
timeInSec
,
getG
et4
Id
x
(),
getGdpbEpEpochNb
(),
getGdpbEpEpochNb
(),
getGdpbEpSync
(),
getGdpbEpDataLoss
(),
getGdpbEpEpochLoss
(),
getGdpbEpMissmatch
());
if
(
msg_print_Cout
==
outType
)
std
::
cout
<<
buf
<<
std
::
endl
;
...
...
@@ -255,14 +248,8 @@ void critof001::Message::printData(unsigned outType, unsigned kind, uint32_t epo
else
if
(
msg_print_File
==
outType
)
os
<<
buf
;
if
(
getGdpbHitIs24b
())
{
snprintf
(
buf
,
sizeof
(
buf
),
"Get4 24b @%17.11f Get4:%2d Chn:%3d Edge:%1d Ts:%7d"
,
timeInSec
,
getGdpbGenChipId
(),
getGdpbHitChanId
(),
getGdpbHit24Edge
(),
getGdpbHitFullTs
());
}
// if( getGdpbHitIs24b() )
else
{
snprintf
(
buf
,
sizeof
(
buf
),
"Get4 24b @%17.11f Get4:%2d Chn:%3d Dll:%1d Ts:%7d"
,
timeInSec
,
getGdpbGenChipId
(),
getGdpbHitChanId
(),
getGdpbHit32DllLck
(),
getGdpbHitFullTs
());
}
// else of if( getGdpbHitIs24b() )
snprintf
(
buf
,
sizeof
(
buf
),
"Get4 24b @%17.11f Get4:%2d Chn:%3d Dll:%1d Ts:%7d"
,
timeInSec
,
getGet4Idx
(),
getGdpbHitChanId
(),
getGdpbHit32DllLck
(),
getGdpbHitFullTs
());
if
(
msg_print_Cout
==
outType
)
std
::
cout
<<
buf
<<
std
::
endl
;
else
if
(
msg_print_File
==
outType
)
...
...
@@ -288,31 +275,20 @@ void critof001::Message::printData(unsigned outType, unsigned kind, uint32_t epo
if
(
kind
&
msg_print_Data
)
{
// const uint8_t* arr = reinterpret_cast<const uint8_t*> ( &data );
switch
(
getMessageType
())
{
/*
case MSG_HIT: {
if
(
getGdpbHitIs24b
())
{
snprintf
(
buf
,
sizeof
(
buf
),
"Get4 24 bits, Get4:%3d Chn:%1x Edge:%1x Ts:0x%03x"
,
getGdpbGenChipId
(),
getGdpbHitChanId
(),
getGdpbHit24Edge
(),
getGdpbHitFullTs
());
}
// if( getGdpbHitIs24b() )
else
{
snprintf
(
buf
,
sizeof
(
buf
),
"Get4 32 bits, Get4:%3d Channel %1d Ts:0x%03x Ft:0x%02x "
"Tot:0x%02x Dll %1d"
,
getGdpbGenChipId
(),
getGdpbHitChanId
(),
getGdpbHitCoarse
(),
getGdpbHitFineTs
(),
getGdpbHit32Tot
(),
getGdpbHit32DllLck
());
}
// else of if( getGdpbHitIs24b() )
snprintf(buf, sizeof(buf),
"Get4 32 bits, Get4:%3d Channel %1d Ts:0x%03x Ft:0x%02x "
"Tot:0x%02x Dll %1d",
getGet4Idx(), getGdpbHitChanId(), getGdpbHitCoarse(), getGdpbHitFineTs(), getGdpbHit32Tot(),
getGdpbHit32DllLck());
break;
} // case MSG_HIT:
case MSG_EPOCH: {
/*snprintf(buf, sizeof(buf),
"Get4:%3d Link: %1u Epoch:0x%08x Sync:%x Dataloss:%x "
"Epochloss:%x Epochmissmatch:%x",
getGdpbGenChipId(), getGdpbEpLinkId(), getGdpbEpEpochNb(), getGdpbEpSync(), getGdpbEpDataLoss(),
getGdpbEpEpochLoss(), getGdpbEpMissmatch());
*/
snprintf(buf, sizeof(buf),
"Get4:%3d Link: %1u Epoch:0x%08x Sync:%x",
getG
dpbGenChip
Id
(),
getGdpbEpLinkId
(),
getGdpbEpEpochNb
(),
getGdpbEpSync
());
getG
et4
Id
x
(), getGdpbEpLinkId(), getGdpbEpEpochNb(), getGdpbEpSync());
break;
} // case MSG_EPOCH:
case MSG_SLOWC: {
...
...
@@ -320,92 +296,14 @@ void critof001::Message::printData(unsigned outType, unsigned kind, uint32_t epo
snprintf(buf, sizeof(buf),
"Get4 Slow control, Get4:%3d => Chan:%01d Edge:%01d "
"Type:%01x Data:0x%06x",
getG
dpbGenChip
Id
(),
0x0
,
0x0
,
0x0
,
getGdpbSlcData
());
getG
et4
Id
x
(), 0x0, 0x0, 0x0, getGdpbSlcData());
break;
} // case MSG_SLOWC:
case
MSG_SYST
:
{
// GET4 system message, new "true" ROC support
char
sysbuf
[
256
];
switch
(
getGdpbSysSubType
())
{
case
SYS_GET4_ERROR
:
{
snprintf
(
sysbuf
,
sizeof
(
sysbuf
),
"Get4:%3d Ch:0x%01x Edge:%01x Unused:%06x "
"ErrCode:0x%02x - GET4 V1 Error Event"
,
getGdpbGenChipId
(),
getGdpbSysErrChanId
(),
getGdpbSysErrEdge
(),
getGdpbSysErrUnused
(),
getGdpbSysErrData
());
break
;
}
//
case
SYS_GDPB_UNKWN
:
snprintf
(
sysbuf
,
sizeof
(
sysbuf
),
"Unknown GET4 message, data: 0x%08x"
,
getGdpbSysUnkwData
());
break
;
case
SYS_GET4_SYNC_MISS
:
if
(
getGdpbSysFwErrResync
())
snprintf
(
sysbuf
,
sizeof
(
sysbuf
),
"GET4 Resynchronization: Get4:0x%04x"
,
getGdpbGenChipId
());
else
snprintf
(
sysbuf
,
sizeof
(
sysbuf
),
"GET4 SYNC synchronization error"
);
break
;
case
SYS_PATTERN
:
snprintf
(
sysbuf
,
sizeof
(
sysbuf
),
"Pattern message => Type %d, Index %2d, Pattern 0x%08X"
,
getGdpbSysPattType
(),
getGdpbSysPattIndex
(),
getGdpbSysPattPattern
());
break
;
default:
snprintf
(
sysbuf
,
sizeof
(
sysbuf
),
"unknown system message type %u"
,
getGdpbSysSubType
());
}
// switch( getGdpbSysSubType() )
snprintf
(
buf
,
sizeof
(
buf
),
"%s"
,
sysbuf
);
case MSG_ERROR: {
// GET4 Error message, new "true" ROC support
break;
} // case MSG_SYST:
case
MSG_STAR_TRI_A
:
case
MSG_STAR_TRI_B
:
case
MSG_STAR_TRI_C
:
case
MSG_STAR_TRI_D
:
{
// STAR trigger token, spread over 4 messages
switch
(
getStarTrigMsgIndex
())
{
case
0
:
{
snprintf
(
buf
,
sizeof
(
buf
),
// "STAR token A, gDPB TS MSB bits: 0x%010llx000000",
// getGdpbTsMsbStarA() );
"STAR token A, gDPB TS MSB bits: 0x%s000000"
,
FormatHexPrintout
(
getGdpbTsMsbStarA
(),
10
,
'0'
).
c_str
());
break
;
}
// case 1st message:
case
1
:
{
snprintf
(
buf
,
sizeof
(
buf
),
// "STAR token B, gDPB TS LSB bits: 0x0000000000%06llx, STAR TS MSB bits: 0x%04llx000000000000",
// getGdpbTsLsbStarB(), getStarTsMsbStarB() );
"STAR token B, gDPB TS LSB bits: 0x0000000000%s, STAR TS MSB "
"bits: 0x%s000000000000"
,
FormatHexPrintout
(
getGdpbTsLsbStarB
(),
6
,
'0'
).
c_str
(),
FormatHexPrintout
(
getStarTsMsbStarB
(),
4
,
'0'
).
c_str
());
break
;
}
// case 2nd message:
case
2
:
{
snprintf
(
buf
,
sizeof
(
buf
),
// "STAR token C, , STAR TS Mid bits: 0x0000%010llx00",
// getStarTsMidStarC() );
"STAR token C, , STAR TS Mid "
"bits: 0x0000%s00"
,
FormatHexPrintout
(
getStarTsMidStarC
(),
10
,
'0'
).
c_str
());
break
;
}
// case 3rd message:
case
3
:
{
snprintf
(
buf
,
sizeof
(
buf
),
// "STAR token D, , STAR TS LSB bits: 0x00000000000000%02llx"
"STAR token D, , STAR TS LSB "
"bits: 0x00000000000000%s"
", Token: %03x, DAQ: %1x; TRG:%1x"
,
// getStarTsLsbStarD(),
FormatHexPrintout
(
getStarTsLsbStarD
(),
2
,
'0'
).
c_str
(),
getStarTokenStarD
(),
getStarDaqCmdStarD
(),
getStarTrigCmdStarD
());
break
;
}
// case 4th message:
}
// switch( getStarTrigMsgIndex() )
break
;
}
// case MSG_STAR_TRI_A || MSG_STAR_TRI_B || MSG_STAR_TRI_C || MSG_STAR_TRI_D:
*/
default:
snprintf
(
buf
,
sizeof
(
buf
),
"Error - unexpected MessageType: %1x, full data %08X::%08X"
,
getMessageType
(),
getField
(
32
,
32
),
getField
(
0
,
32
));
...
...
core/data/raw/CriGet4Mess001.h
View file @
464a4fa3
...
...
@@ -39,11 +39,16 @@ namespace critof001
// alternatively: (kiCoarseTime>>kiCtShift + 1)*kdClockCycleSize
const
double
kdEpochInPs
=
static_cast
<
double
>
(
kuCoarseCounterSize
)
*
kdClockCycleSize
;
const
double
kdEpochInNs
=
kdEpochInPs
/
1000.0
;
const
double
kuEpochInNs
=
static_cast
<
uint64_t
>
(
kdEpochInNs
);
/// Works as epoch integer in ns!
// Epoch counter size in epoch
const
uint32_t
kuEpochCounterSz
=
0x7FFFFFFF
;
const
uint32_t
kuEpochCounterSz
=
0xFFFFFF
;
// Epoch counter size in epoch
const
uint64_t
kulEpochCycleEp
=
static_cast
<
uint64_t
>
(
kuEpochCounterSz
+
1
);
// Epoch counter size in bin
const
uint64_t
kulEpochCycleBins
=
static_cast
<
uint64_t
>
(
kuEpochCounterSz
+
1
)
*
kuEpochInBins
;
const
uint64_t
kulEpochCycleBins
=
kulEpochCycleEp
*
kuEpochInBins
;
// Epoch counter size in ns (fits in 64b unsigned as epoch is an integer in ns)
const
uint64_t
kulEpochCycleInNs
=
kulEpochCycleBins
*
kuEpochInNs
;
// Epoch counter size in s
const
double
kdEpochCycleInS
=
static_cast
<
double
>
(
kuEpochCounterSz
+
1
)
*
(
kdEpochInNs
/
1e9
);
...
...
@@ -55,16 +60,15 @@ namespace critof001
const
uint32_t
kuFeePulserChannel
=
3
;
// Channel where a pulser can be set ON at 20 ns 500 Hz
const
uint32_t
kuFeePulserChannelDiam
=
0
;
// Channel where a pulser can be set ON at 20 ns 500 Hz
const
uint64_t
kuEndOfMsMask
=
0xFFFFFFFFFFFF
;
const
uint64_t
kuEndOfMsMarker
=
0xdeadbeeeeeef
;
enum
MessageTypes
{
MSG_HIT
=
0
,
MSG_EPOCH
=
1
,
MSG_SLOWC
=
2
,
MSG_SYST
=
3
,
MSG_STAR_TRI_A
=
4
,
MSG_STAR_TRI_B
=
5
,
MSG_STAR_TRI_C
=
6
,
MSG_STAR_TRI_D
=
7
MSG_SYST
=
3
};
enum
SysMessageTypes
...
...
@@ -205,32 +209,25 @@ namespace critof001
// --------------------------- common fields ---------------------------------
//! Returns the message type. Valid for all message types. 2 bit
inline
uint8_t
getMessageType
()
const
{
return
getField
(
0
,
3
);
}
inline
uint8_t
getMessageType
()
const
{
return
getField
(
0
,
4
);
}
//! Sets the message type field in the current message
inline
void
setMessageType
(
uint8_t
v
)
{
setField
(
0
,
3
,
v
);
}
inline
void
setMessageType
(
uint8_t
v
)
{
setField
(
0
,
4
,
v
);
}
// ----------
Get4 gDPB 24b/32b ALL
access methods ------------------------
inline
uint16_t
get
GdpbGenGdpbId
()
const
{
return
getField
(
48
,
16
);
}
inline
void
set
GdpbGenGdpbId
(
uint32_t
v
)
{
setField
(
48
,
16
,
v
);
}
inline
uint16_t
getG
dpbGenChip
Id
()
const
{
return
getField
(
40
,
8
);
}
inline
void
setG
dpbGenChip
Id
(
uint32_t
v
)
{
setField
(
40
,
8
,
v
);
}
// ----------
All types
access methods ------------------------
------------
inline
uint16_t
get
DebugTimer
()
const
{
return
getField
(
48
,
16
);
}
inline
void
set
DebugTimer
(
uint32_t
v
)
{
setField
(
48
,
16
,
v
);
}
inline
uint16_t
getG
et4
Id
x
()
const
{
return
getField
(
40
,
8
);
}
inline
void
setG
et4
Id
(
uint32_t
v
)
{
setField
(
40
,
8
,
v
);
}
// ---------- Get4 gDPB 24b/32b Hit access methods ------------------------
inline
uint16_t
getGdpbHitIs24b
()
const
{
return
getBit
(
39
);
}
// ---------- Get4 Hit access methods -------------------------------------
inline
uint16_t
getGdpbHitChanId
()
const
{
return
getField
(
32
,
2
);
}
inline
uint32_t
getGdpbHitFullTs
()
const
{
return
getField
(
13
,
19
);
}
inline
uint16_t
getGdpbHitCoarse
()
const
{
return
getField
(
20
,
12
);
}
inline
uint16_t
getGdpbHitFineTs
()
const
{
return
getField
(
13
,
7
);
}
// ---------- Get4 gDPB 24b Hit access methods ----------------------------
inline
bool
getGdpbHit24Edge
()
const
{
return
getBit
(
34
);
}
// ---------- Get4 gDPB 32b Hit access methods ----------------------------
inline
bool
getGdpbHit32DllLck
()
const
{
return
getBit
(
12
);
}
inline
uint16_t
getGdpbHit32Tot
()
const
{
return
getField
(
4
,
8
);
}
// ---------- Get4 gDPB 24b/32b Epoch access methods ----------------------
inline
bool
getGdpbEpLinkId
()
const
{
return
getBit
(
39
);
}
inline
uint32_t
getGdpbEpEpochNb
()
const
{
return
getField
(
8
,
31
);
}
// ---------- Get4 Epoch access methods ----------------------------------
inline
uint32_t
getGdpbEpEpochNb
()
const
{
return
getField
(
8
,
24
);
}
inline
bool
getGdpbEpSync
()
const
{
return
getBit
(
7
);
}
inline
bool
getGdpbEpDataLoss
()
const
{
return
getBit
(
6
);
}
inline
bool
getGdpbEpEpochLoss
()
const
{
return
getBit
(
5
);
}
...
...
@@ -262,23 +259,6 @@ namespace critof001
inline
uint16_t
getGdpbSysPattIndex
()
const
{
return
getField
(
40
,
4
);
}
inline
uint32_t
getGdpbSysPattPattern
()
const
{
return
getField
(
4
,
32
);
}
// ---------- STAR Trigger messages access methods ------------------------
inline
uint16_t
getStarTrigMsgIndex
()
const
{
return
getField
(
0
,
2
);
}
//++++//
inline
uint64_t
getGdpbTsMsbStarA
()
const
{
return
getFieldLong
(
4
,
40
);
}
//++++//
inline
uint64_t
getGdpbTsLsbStarB
()
const
{
return
getFieldLong
(
20
,
24
);
}
inline
uint64_t
getStarTsMsbStarB
()
const
{
return
getFieldLong
(
4
,
16
);
}
//++++//
inline
uint64_t
getStarTsMidStarC
()
const
{
return
getFieldLong
(
4
,
40
);
}
//++++//
inline
uint64_t
getStarTsLsbStarD
()
const
{
return
getFieldLong
(
36
,
8
);
}
/// 12 bits in between are set to 0
inline
uint32_t
getStarFillerD
()
const
{
return
getField
(
24
,
12
);
}
// Should be always 0
inline
uint32_t
getStarTrigCmdStarD
()
const
{
return
getField
(
20
,
4
);
}
inline
uint32_t
getStarDaqCmdStarD
()
const
{
return
getField
(
16
,
4
);
}
inline
uint32_t
getStarTokenStarD
()
const
{
return
getField
(
4
,
12
);
}
// ---------- Get4 gDPB 24b/32b Epoch setter methods ----------------------
inline
void
setGdpbEpEpochNb
(
uint32_t
v
)
{
setField
(
8
,
31
,
v
);
}
...
...
@@ -289,23 +269,6 @@ namespace critof001
inline
void
setGdpbSysPattIndex
(
uint16_t
v
)
{
setField
(
40
,
4
,
v
);
}
inline
void
setGdpbSysPattPattern
(
uint32_t
v
)
{
setField
(
4
,
32
,
v
);
}
// ---------- STAR Trigger messages setter methods ------------------------
inline
void
setStarTrigMsgIndex
(
uint8_t
v
)
{
setField
(
0
,
2
,
v
);
}
//++++//
inline
void
setGdpbTsMsbStarA
(
uint64_t
fullGdpbTs
)
{
setFieldLong
(
4
,
40
,
(
fullGdpbTs
>>
24
));
}
//++++//
inline
void
setGdpbTsLsbStarB
(
uint64_t
fullGdpbTs
)
{
setFieldLong
(
20
,
24
,
(
fullGdpbTs
));
}
inline
void
setStarTsMsbStarB
(
uint64_t
fullStarTs
)
{
setFieldLong
(
4
,
16
,
(
fullStarTs
>>
48
));
}
//++++//
inline
void
setStarTsMidStarC
(
uint64_t
fullStarTs
)
{
setFieldLong
(
4
,
40
,
(
fullStarTs
>>
8
));
}
//++++//
inline
void
setStarTsLsbStarD
(
uint64_t
fullStarTs
)
{
setFieldLong
(
36
,
8
,
(
fullStarTs
));
}
/// 12 bits in between are set to 0
inline
void
setStarFillerD
()
{
setField
(
24
,
12
,
0
);
}
// Should be always 0
inline
void
setStarTrigCmdStarD
(
uint8_t
v
)
{
setField
(
20
,
4
,
v
);
}
inline
void
setStarDaqCmdStarD
(
uint8_t
v
)
{
setField
(
16
,
4
,
v
);
}
inline
void
setStarTokenStarD
(
uint16_t
v
)
{
setField
(
4
,
12
,
v
);
}
// ---------- Common functions -----------------------
//! Returns \a true is message type is #MSG_HIT (Get4 hit data)
inline
bool
isHitMsg
()
const
{
return
getMessageType
()
==
MSG_HIT
;
}
...
...
@@ -313,10 +276,10 @@ namespace critof001
inline
bool
isEpochMsg
()
const
{
return
getMessageType
()
==
MSG_EPOCH
;
}
//! Returns \a true is message type is #MSG_SLOWC (GET4 Slow Control)
inline
bool
isGet4SlCtrMsg
()
const
{
return
getMessageType
()
==
MSG_SLOWC
;
}
//! Returns \a true is message type is #MSG_
SYST (system
message)
inline
bool
isSys
Msg
()
const
{
return
getMessageType
()
==
MSG_SYST
;
}
//! Returns \a true is message type is
#MSG_STAR_TRI_A, _B, _C, _D (STAR Trigger message)
inline
bool
is
StarTrigger
()
const
{
return
MSG_STAR_TRI_A
<=
getMessageType
(
);
}
//! Returns \a true is message type is #MSG_
ERROR (error
message)
inline
bool
isSys
tem
()
const
{
return
getMessageType
()
==
MSG_SYST
;
}
//! Returns \a true is message type is
an EndOfMs marker
inline
bool
is
EndOfMs
()
const
{
return
kuEndOfMsMarker
==
(
data
&
kuEndOfMsMask
);
}
void
printDataCout
(
unsigned
kind
=
msg_print_Prefix
|
msg_print_Data
,
uint32_t
epoch
=
0
)
const
;
void
printDataLog
(
unsigned
kind
=
msg_print_Prefix
|
msg_print_Data
,
uint32_t
epoch
=
0
)
const
;
...
...
fles/mcbm2018/unpacker/CbmCriGet4RawPrint.cxx
View file @
464a4fa3
...
...
@@ -78,24 +78,24 @@ void CbmCriGet4RawPrint::AddMsComponentToList(size_t component, UShort_t usDetec
Bool_t
CbmCriGet4RawPrint
::
DoUnpack
(
const
fles
::
Timeslice
&
ts
,
size_t
/*component*/
)
{
static
const
uint8_t
NGET4
=
80
;
static
const
uint8_t
NERROR
=
0x16
;
char
buf
[
256
];
static
uint32_t
lastGlobalEpoch
=
0
;
uint32_t
nGet4
,
epoch
,
msgType
,
errorCode
;
static
uint32_t
lastGlobalEpoch
=
0
;
uint32_t
nGet4
,
epoch
,
msgType
,
errorCode
;
static
int32_t
pEpochDiff
[
NGET4
];
int32_t
epochDiff
;
static
uint32_t
pErrorCnt
[
NGET4
]
=
{
0
};
static
uint32_t
pHitsCnt
[
NGET4
]
=
{
0
};
static
uint32_t
pTotCnt
[
NGET4
]
=
{
0
};
static
uint32_t
pErrorCntMatrix
[
NGET4
][
NERROR
];
static
uint32_t
procEpochUntilError
=
0
;
fulCurrentTsIdx
=
ts
.
index
();
fdTsStartTime
=
static_cast
<
Double_t
>
(
ts
.
descriptor
(
0
,
0
).
idx
);
...
...
@@ -160,7 +160,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
/// TODOD: pick the options!!!
//mess.printDataCout( critof001::msg_print_Hex );
//mess.printDataCout( critof001::msg_print_Hex | critof001::msg_print_Prefix | critof001::msg_print_Data );
msgType
=
ulData
&
0xF
;
nGet4
=
(
ulData
>>
40
)
&
0xFF
;
epoch
=
(
ulData
>>
8
)
&
0xFFFFFF
;
...
...
@@ -169,28 +169,28 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
/*snprintf(buf, sizeof(buf),
"Data: 0x%016lx - %d - 0x06%X ",
ulData, nGet4, epoch);
std::cout << buf << std::endl;
*/
//if (fuCurrentEquipmentId == 0xabc0)
{
//------------------- TLAST ----------------------------//
if
((
ulData
&
0xFFFFFFFFFFFF
)
==
0xdeadbeeeeeef
)
if
((
ulData
&
0xFFFFFFFFFFFF
)
==
0xdeadbeeeeeef
)
{
}
//------------------- EPOCH ----------------------------//
else
if
(
msgType
==
0x01
)
{
if
(
nGet4
==
0xFF
)
{
procEpochUntilError
++
;
if
(
lastGlobalEpoch
!=
0xFFFFFF
){
if
((
lastGlobalEpoch
+
1
)
!=
epoch
){
snprintf
(
buf
,
sizeof
(
buf
),
"Error global epoch, last epoch, current epoch, diff 0x%06x 0x%06x %d 0x%016lx %d"
,
lastGlobalEpoch
,
epoch
,
lastGlobalEpoch
-
epoch
,
ulData
,
procEpochUntilError
);
std
::
cout
<<
buf
<<
std
::
endl
;
procEpochUntilError
=
0
;
}
...
...
@@ -199,34 +199,34 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
snprintf
(
buf
,
sizeof
(
buf
),
"Global epoch overflow, last epoch, current epoch 0x%06x 0x%06x"
,
lastGlobalEpoch
,
epoch
);
std
::
cout
<<
buf
<<
std
::
endl
;
std
::
cout
<<
buf
<<
std
::
endl
;
}
lastGlobalEpoch
=
epoch
;
snprintf
(
buf
,
sizeof
(
buf
),
"Global epoch %d"
,
epoch
);
std
::
cout
<<
buf
<<
std
::
endl
;
lastGlobalEpoch
=
epoch
;
snprintf
(
buf
,
sizeof
(
buf
),
"Global epoch %d"
,
epoch
);
std
::
cout
<<
Form
(
"%5d/%5d "
,
uIdx
,
uNbMessages
)
<<
buf
<<
std
::
endl
;
}
else
if
(
nGet4
<=
120
){
if
(
lastGlobalEpoch
>
epoch
)
epochDiff
=
lastGlobalEpoch
-
epoch
;
else
epochDiff
=
0xFFFFFF
+
lastGlobalEpoch
-
epoch
;
if
(
epochDiff
!=
pEpochDiff
[
nGet4
]){
snprintf
(
buf
,
sizeof
(
buf
),
"eTime %d - Error epoch drift Get4 %3d , last epoch diff, current epoch diff 0x%06x 0x%06x %d"
,
lastGlobalEpoch
,
nGet4
,
pEpochDiff
[
nGet4
],
epochDiff
,
pEpochDiff
[
nGet4
]
-
epochDiff
);
std
::
cout
<<
buf
<<
std
::
endl
;
mess
.
printDataCout
(
critof001
::
msg_print_Hex
|
critof001
::
msg_print_Prefix
|
critof001
::
msg_print_Data
);
}
pEpochDiff
[
nGet4
]
=
epochDiff
;
}
}
/*
...
...
@@ -247,7 +247,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
lastGlobalEpoch, ulData, nGet4, errorCode);
std::cout << buf << std::endl;
mess.printDataCout( critof001::msg_print_Hex | critof001::msg_print_Prefix | critof001::msg_print_Data );
if (nGet4 < NGET4)
pErrorCnt[nGet4] = pErrorCnt[nGet4] +1;
if (errorCode == 0x12)
...
...
@@ -255,7 +255,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
pTotCnt[nGet4]=pTotCnt[nGet4]+1;
if ( (nGet4 < NGET4) && (errorCode<NERROR) )
pErrorCntMatrix[nGet4][errorCode]=pErrorCntMatrix[nGet4][errorCode]+1;
}
//------------------- HITS ----------------------------//
else if (msgType == 0x0)
...
...
@@ -272,10 +272,10 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
/*snprintf(buf, sizeof(buf),
"Data: 0x%016lx",
ulData);
std::cout << buf << std::endl;*/
}
}
}
// for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
}
// for( fuMsIndex = 0; fuMsIndex < uNbMsLoop; fuMsIndex ++ )
}
// for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
...
...
@@ -286,7 +286,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
uint32_t nPulses = 4*10000;
float effi;
for(uint32_t i =0; i < NGET4 ; i++)
{
{
effi = float(pHitsCnt[i])/float(nPulses) * 100.0;
snprintf(buf, sizeof(buf),
"Hit counter %d: Hits: %d Errors: %d ErrTot: %d Effi: %f",
...
...
@@ -301,8 +301,8 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
}
}
}
*/
*/
return
kTRUE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment