Commit b24d66b1 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau Committed by Pierre-Alain Loizeau
Browse files

Add TOF CRI unpacker in new scheme. Include temp fix for strange epoch offset.

Changed severity for large amount of LOG statements

Changed default from info to debug for a larger amount of tof log messages. Otherwise, it makes info reading with all subsystems almost impossible.
parent 30c60e3e
......@@ -34,6 +34,8 @@ public:
ULong64_t GetNDigisTrd(ULong64_t) { return fNDigisTrd; }
/** @brief Get the number of digis in this Ts */
ULong64_t GetNDigisTrd2D(ULong64_t) { return fNDigisTrd2D; }
/** @brief Get the number of digis in this Ts */
ULong64_t GetNDigisTof(ULong64_t) { return fNDigisTof; }
/** @brief Set the Ts Start Time @param value Start time of the TS */
void SetTsStartTime(uint64_t value) { fTsStartTime = value; }
......@@ -48,6 +50,8 @@ public:
void SetNDigisTrd(ULong64_t value) { fNDigisTrd = value; }
/** @brief Set the number of digis in this Ts */
void SetNDigisTrd2D(ULong64_t value) { fNDigisTrd2D = value; }
/** @brief Set the number of digis in this Ts */
void SetNDigisTof(ULong64_t value) { fNDigisTof = value; }
protected:
......@@ -59,6 +63,7 @@ protected:
ULong64_t fNDigisSts = 0;
ULong64_t fNDigisTrd = 0;
ULong64_t fNDigisTrd2D = 0;
ULong64_t fNDigisTof = 0;
ClassDef(CbmTsEventHeader, 3)
......
......@@ -166,7 +166,10 @@ void critof001::Message::printDataCout(unsigned kind, uint32_t epoch) const { pr
* documentation.
*/
void critof001::Message::printDataLog(unsigned kind, uint32_t epoch) const { printData(msg_print_FairLog, kind, epoch); }
void critof001::Message::printDataLog(unsigned kind, uint32_t epoch) const
{
printData(msg_print_FairLog, kind, epoch);
}
//----------------------------------------------------------------------------
//! Print message in binary or human readable format to a stream.
......@@ -207,9 +210,8 @@ void critof001::Message::printData(unsigned outType, unsigned kind, uint32_t epo
arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[7], arr[6], arr[5], arr[4], arr[3],
arr[2], arr[1], arr[0]);
*/
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]);
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;
......@@ -234,8 +236,8 @@ 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, getGet4Idx(), getGdpbEpEpochNb(), getGdpbEpEpochNb(), getGdpbEpSync(),
getGdpbEpDataLoss(), getGdpbEpEpochLoss(), getGdpbEpMissmatch());
timeInSec, getGet4Idx(), getGdpbEpEpochNb(), getGdpbEpEpochNb(), getGdpbEpSync(), getGdpbEpDataLoss(),
getGdpbEpEpochLoss(), getGdpbEpMissmatch());
if (msg_print_Cout == outType) std::cout << buf << std::endl;
else if (msg_print_File == outType)
......@@ -275,7 +277,7 @@ 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: {
snprintf(buf, sizeof(buf),
"Get4 32 bits, Get4:%3d Channel %1d Ts:0x%03x Ft:0x%02x "
......
......@@ -39,7 +39,7 @@ 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!
const double kuEpochInNs = static_cast<uint64_t>(kdEpochInNs); /// Works as epoch integer in ns!
// Epoch counter size in epoch
const uint32_t kuEpochCounterSz = 0xFFFFFF;
......@@ -65,10 +65,10 @@ namespace critof001
enum MessageTypes
{
MSG_HIT = 0,
MSG_EPOCH = 1,
MSG_SLOWC = 2,
MSG_SYST = 3
MSG_HIT = 0,
MSG_EPOCH = 1,
MSG_SLOWC = 2,
MSG_SYST = 3
};
enum SysMessageTypes
......
......@@ -9,6 +9,9 @@
#include "CbmMcbm2018TofPar.h"
#include "CbmTofAddress.h"
#include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
#include "FairDetParIo.h"
#include "FairParIo.h"
#include "FairParamList.h"
......@@ -17,8 +20,6 @@
#include "TString.h"
#include "gDpbMessv100.h"
#include "CbmTofAddress.h"
#include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
// ----- Standard constructor ------------------------------------------
CbmMcbm2018TofPar::CbmMcbm2018TofPar(const char* name, const char* title, const char* context)
......@@ -205,8 +206,8 @@ Double_t CbmMcbm2018TofPar::GetPadiThresholdVal(UInt_t uCode)
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMap()
{
UInt_t uNrOfGbtx = fiNrOfGbtx;
UInt_t uNrOfGet4 = fiNrOfGdpb * fiNrOfFeesPerGdpb * fiNrOfGet4PerFee;
UInt_t uNrOfGbtx = fiNrOfGbtx;
UInt_t uNrOfGet4 = fiNrOfGdpb * fiNrOfFeesPerGdpb * fiNrOfGet4PerFee;
UInt_t uNrOfChannels = uNrOfGet4 * fiNrOfChannelsPerGet4;
fviRpcChUId.resize(uNrOfChannels);
......@@ -258,18 +259,17 @@ void CbmMcbm2018TofPar::BuildChannelsUidMap()
default: {
LOG(error) << "Invalid Tof Type specifier ";
}
} // switch (fiRpcType[uGbtx])
} // for (UInt_t uGbtx = 0; uGbtx < uNrOfGbtx; ++uGbtx)
} // switch (fiRpcType[uGbtx])
} // for (UInt_t uGbtx = 0; uGbtx < uNrOfGbtx; ++uGbtx)
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapCbm(UInt_t & uCh, UInt_t uGbtx)
void CbmMcbm2018TofPar::BuildChannelsUidMapCbm(UInt_t& uCh, UInt_t uGbtx)
{
if (fiRpcSide[uGbtx] < 2) { // mTof modules
LOG(info) << " Map mTof box " << fiModuleId[uGbtx] << " at GBTX - uCh = " << uCh;
const Int_t RpcMap[5] = {4, 2, 0, 3, 1};
for (Int_t iRpc = 0; iRpc < fiNrOfRpc[uGbtx]; iRpc++) {
Int_t iStrMax = 32;
Int_t iStrMax = 32;
UInt_t uChNext = 1;
for (Int_t iStr = 0; iStr < iStrMax; iStr++) {
......@@ -278,18 +278,18 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapCbm(UInt_t & uCh, UInt_t uGbtx)
if (fiRpcSide[uGbtx] == 0) iStrMap = 31 - iStr;
if (fiModuleId[uGbtx] > -1)
fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], iRpcMap, iStrMap,
fiRpcSide[uGbtx], fiRpcType[uGbtx]);
fviRpcChUId[uCh] =
CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], iRpcMap, iStrMap, fiRpcSide[uGbtx], fiRpcType[uGbtx]);
else
fviRpcChUId[uCh] = 0;
// LOG(debug)<<Form("Map Ch %d to Address 0x%08x",uCh,fviRpcChUId[uCh]);
uCh += uChNext;
} // for (Int_t iStr = 0; iStr < iStrMax; iStr++)
} // for (Int_t iRpc = 0; iRpc < fiNrOfRpc[uGbtx]; iRpc++)
} // if (fiRpcSide[uGbtx] < 2)
} // for (Int_t iStr = 0; iStr < iStrMax; iStr++)
} // for (Int_t iRpc = 0; iRpc < fiNrOfRpc[uGbtx]; iRpc++)
} // if (fiRpcSide[uGbtx] < 2)
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapStar(UInt_t & uCh, UInt_t uGbtx)
void CbmMcbm2018TofPar::BuildChannelsUidMapStar(UInt_t& uCh, UInt_t uGbtx)
{
if (fiRpcSide[uGbtx] < 2) {
// mTof modules
......@@ -305,8 +305,8 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapStar(UInt_t & uCh, UInt_t uGbtx)
if (fiRpcSide[uGbtx] == 0) iStrMap = 31 - iStr;
if (fiModuleId[uGbtx] > -1)
fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], iRpcMap, iStrMap,
fiRpcSide[uGbtx], fiRpcType[uGbtx]);
fviRpcChUId[uCh] =
CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], iRpcMap, iStrMap, fiRpcSide[uGbtx], fiRpcType[uGbtx]);
else
fviRpcChUId[uCh] = 0;
// LOG(DEBUG)<<Form("Map Ch %d to Address 0x%08x",uCh,fviRpcChUId[uCh]);
......@@ -317,7 +317,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapStar(UInt_t & uCh, UInt_t uGbtx)
uCh += 64;
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapT0(UInt_t & uCh, UInt_t uGbtx)
void CbmMcbm2018TofPar::BuildChannelsUidMapT0(UInt_t& uCh, UInt_t uGbtx)
{
LOG(info) << " Map diamond at GBTX - uCh = " << uCh;
for (UInt_t uFee = 0; uFee < kuNbFeePerGbtx; ++uFee) {
......@@ -333,8 +333,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapT0(UInt_t & uCh, UInt_t uGbtx)
/// => 1 T0 channel per GET4
/// => 1-2 eLinks per GET4 => GET4 ID = GET4 * 2 (+ 1)
UInt_t uChannelT0 = uFeeCh / 8 + 4 * fiRpcSide[uGbtx];
fviRpcChUId[uCh] =
CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], 0, uChannelT0, 0, fiRpcType[uGbtx]);
fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], 0, uChannelT0, 0, fiRpcType[uGbtx]);
LOG(info) << Form("T0 channel: %u from GBTx %2u Fee %2u "
"Channel %2u, indx %d address %08x",
uChannelT0, uGbtx, uFeeCh, uCh, uCh, fviRpcChUId[uCh]);
......@@ -351,7 +350,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapT0(UInt_t & uCh, UInt_t uGbtx)
} // for( UInt_t uFee = 0; uFee < kuNbChannelsPerFee; ++uFee )
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapCern(UInt_t & uCh, UInt_t /*uGbtx*/)
void CbmMcbm2018TofPar::BuildChannelsUidMapCern(UInt_t& uCh, UInt_t /*uGbtx*/)
{
LOG(info) << " Map CERN 20 gap at GBTX - uCh = " << uCh;
// clang-format off
......@@ -376,7 +375,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapCern(UInt_t & uCh, UInt_t /*uGbtx*/)
LOG(info) << " Map end CERN 20 gap at GBTX - uCh = " << uCh;
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapCera(UInt_t & uCh, UInt_t /*uGbtx*/)
void CbmMcbm2018TofPar::BuildChannelsUidMapCera(UInt_t& uCh, UInt_t /*uGbtx*/)
{
Int_t iModuleId = 0;
Int_t iModuleType = 8;
......@@ -388,7 +387,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapCera(UInt_t & uCh, UInt_t /*uGbtx*/)
LOG(info) << " Map end ceramics box at GBTX - uCh = " << uCh;
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapStar2(UInt_t & uCh, UInt_t uGbtx)
void CbmMcbm2018TofPar::BuildChannelsUidMapStar2(UInt_t& uCh, UInt_t uGbtx)
{
LOG(info) << " Map Star2 box " << fiModuleId[uGbtx] << " at GBTX - uCh = " << uCh;
const Int_t iRpc[5] = {1, -1, 1, 0, 0};
......@@ -429,11 +428,11 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapStar2(UInt_t & uCh, UInt_t uGbtx)
}
}
// -------------------------------------------------------------------------
void CbmMcbm2018TofPar::BuildChannelsUidMapBuc(UInt_t & uCh, UInt_t uGbtx)
void CbmMcbm2018TofPar::BuildChannelsUidMapBuc(UInt_t& uCh, UInt_t uGbtx)
{
LOG(info) << " Map Buc box at GBTX - uCh = " << uCh;
Int_t iModuleIdMap = fiModuleId[uGbtx];
Int_t iModuleIdMap = fiModuleId[uGbtx];
const Int_t iRpc[5] = {0, -1, 0, 1, 1};
const Int_t iSide[5] = {1, -1, 0, 1, 0};
for (Int_t iFeet = 0; iFeet < 5; iFeet++) {
......@@ -517,20 +516,19 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapBuc(UInt_t & uCh, UInt_t uGbtx)
}
iModuleIdMap = fiModuleId[uGbtx];
LOG(info) << "Buc of GBTX " << uGbtx << " Ch " << uCh
<< Form(", Feet %1d, Str %2d, Ind %3d, i %3d, FeetInd %1d, Rpc %1d, Side %1d, Str %2d ",
iFeet, iStr, iInd, i, iFeetInd, iRpcMap, iSideMap, iStrMap);
<< Form(", Feet %1d, Str %2d, Ind %3d, i %3d, FeetInd %1d, Rpc %1d, Side %1d, Str %2d ", iFeet,
iStr, iInd, i, iFeetInd, iRpcMap, iSideMap, iStrMap);
} break;
default:;
} // switch (fiRpcSide[uGbtx])
} // switch (fiRpcSide[uGbtx])
if (iSideMap > -1)
fviRpcChUId[uCh] =
CbmTofAddress::GetUniqueAddress(iModuleIdMap, iRpcMap, iStrMap, iSideMap, fiRpcType[uGbtx]);
fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(iModuleIdMap, iRpcMap, iStrMap, iSideMap, fiRpcType[uGbtx]);
else
fviRpcChUId[uCh] = 0;
uCh++;
} // for (Int_t iStr = 0; iStr < 32; iStr++)
} // for (Int_t iFeet = 0; iFeet < 5; iFeet++)
} // for (Int_t iStr = 0; iStr < 32; iStr++)
} // for (Int_t iFeet = 0; iFeet < 5; iFeet++)
}
// -------------------------------------------------------------------------
......
......@@ -72,7 +72,7 @@ public:
inline Int_t GetRpcType(Int_t i) { return fiRpcType[i]; }
inline Int_t GetRpcSide(Int_t i) { return fiRpcSide[i]; }
inline Int_t GetModuleId(Int_t i) { return fiModuleId[i]; }
inline std::vector< Int_t > GetRpcChUidMap() { return fviRpcChUId; }
inline std::vector<Int_t> GetRpcChUidMap() { return fviRpcChUId; }
inline Int_t GetNbMsTot() { return fiNbMsTot; }
inline Int_t GetNbMsOverlap() { return fiNbMsOverlap; }
......@@ -85,13 +85,13 @@ public:
private:
void BuildChannelsUidMap();
void BuildChannelsUidMapCbm(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapStar(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapT0(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapCern(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapCera(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapStar2(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapBuc(UInt_t & uCh, UInt_t uGbtx);
void BuildChannelsUidMapCbm(UInt_t& uCh, UInt_t uGbtx);
void BuildChannelsUidMapStar(UInt_t& uCh, UInt_t uGbtx);
void BuildChannelsUidMapT0(UInt_t& uCh, UInt_t uGbtx);
void BuildChannelsUidMapCern(UInt_t& uCh, UInt_t uGbtx);
void BuildChannelsUidMapCera(UInt_t& uCh, UInt_t uGbtx);
void BuildChannelsUidMapStar2(UInt_t& uCh, UInt_t uGbtx);
void BuildChannelsUidMapBuc(UInt_t& uCh, UInt_t uGbtx);
/// Constants
/// Data format
......@@ -146,12 +146,12 @@ private:
Int_t fiNrOfGet4PerFee; // Number of GET4 chips which are connected to one FEB
Int_t fiNrOfChannelsPerGet4; // Number of channels per GET4
Int_t fiNrOfGbtx; // Total number of Gbtx links
Int_t fiNrOfModule; // Total number of Modules
TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5
TArrayI fiRpcType; // type of Rpcs connected to Gbtx link
TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1
TArrayI fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry
Int_t fiNrOfGbtx; // Total number of Gbtx links
Int_t fiNrOfModule; // Total number of Modules
TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5
TArrayI fiRpcType; // type of Rpcs connected to Gbtx link
TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1
TArrayI fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry
std::vector<Int_t> fviRpcChUId = {}; // UID/address for each channel, build from type, side and module
Int_t fiNbMsTot; // Total number of MS per link in TS
......
......@@ -44,10 +44,7 @@ Bool_t CbmCriGet4RawPrint::Init()
return kTRUE;
}
void CbmCriGet4RawPrint::SetParContainers()
{
LOG(info) << "Setting parameter containers for " << GetName();
}
void CbmCriGet4RawPrint::SetParContainers() { LOG(info) << "Setting parameter containers for " << GetName(); }
Bool_t CbmCriGet4RawPrint::InitContainers()
{
......@@ -80,7 +77,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
{
static const uint8_t NGET4 = 80;
static const uint8_t NERROR = 0x16;
// static const uint8_t NERROR = 0x16;
char buf[256];
......@@ -88,11 +85,11 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
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 pErrorCnt[NGET4] = {0};
// static uint32_t pHitsCnt[NGET4] = {0};
// static uint32_t pTotCnt[NGET4] = {0};
static uint32_t pErrorCntMatrix[NGET4][NERROR];
// static uint32_t pErrorCntMatrix[NGET4][NERROR];
static uint32_t procEpochUntilError = 0;
......@@ -162,74 +159,66 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
//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;
epoch &= 0xFFFFFF;
errorCode = (ulData>>4) & 0x7F;
/*snprintf(buf, sizeof(buf),
nGet4 = (ulData >> 40) & 0xFF;
epoch = (ulData >> 8) & 0xFFFFFF;
epoch &= 0xFFFFFF;
errorCode = (ulData >> 4) & 0x7F;
/*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)
{
}
//------------------- 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;
}
}
else{
snprintf(buf, sizeof(buf),
"Global epoch overflow, last epoch, current epoch 0x%06x 0x%06x",
lastGlobalEpoch, 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;
}
}
/*
//if (fuCurrentEquipmentId == 0xabc0)
{
//------------------- TLAST ----------------------------//
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;
}
}
else {
snprintf(buf, sizeof(buf), "Global epoch overflow, last epoch, current epoch 0x%06x 0x%06x",
lastGlobalEpoch, 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;
}
}
/*
//------------------- CTRL ----------------------------//
else if (msgType == 0x02)
{
......@@ -269,12 +258,12 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
pHitsCnt[nGet4]=pHitsCnt[nGet4]+1;
}
*/
/*snprintf(buf, sizeof(buf),
/*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 ++ )
......@@ -282,7 +271,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
if (0 == fulCurrentTsIdx % 10000) LOG(info) << "Processed TS " << fulCurrentTsIdx;
/*
/*
uint32_t nPulses = 4*10000;
float effi;
for(uint32_t i =0; i < NGET4 ; i++)
......@@ -307,9 +296,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
return kTRUE;
}
void CbmCriGet4RawPrint::Reset()
{
}
void CbmCriGet4RawPrint::Reset() {}
void CbmCriGet4RawPrint::Finish() {}
......
.root_hist
.rootrc
rootlogon.C
*.root
/* Copyright (C) 2020 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
void check_timing_any(TString fileName, UInt_t uRunId = 0, Int_t nEvents = 0, TString outDir = "data/")
{
// ========================================================================
// Adjust this part according to your requirements
// Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
Int_t iVerbose = 1;
// MC file
TString srcDir = gSystem->Getenv("VMCWORKDIR");
// ----- Timer --------------------------------------------------------
TStopwatch timer;
timer.Start();
// ------------------------------------------------------------------------
// ----- Analysis run --------------------------------------------------
FairRunOnline* fRun = new FairRunOnline();
fRun->ActivateHttpServer(100, 8080); // refresh each 100 events
fRun->SetSink(new FairRootFileSink("SinkFile.root"));
FairFileSource* inputSource = new FairFileSource(fileName);
fRun->SetSource(inputSource);
// Define output file for FairMonitor histograms
// TString monitorFile{outFile};
// monitorFile.ReplaceAll("qa","qa.monitor");
FairMonitor::GetMonitor()->EnableMonitor(kFALSE);
// ------------------------------------------------------------------------
CbmMcbmCheckTimingTask* timeChecker = new CbmMcbmCheckTimingTask();
/// Default is using T0 as reference
/// With Pulser rejection
/*
timeChecker->SetReferenceDetector( ECbmModuleId::kT0, "T0",
-1000., 1000., 320.,
182, 190 );
*/
/// With pulser selection
/*
timeChecker->SetReferenceDetector( ECbmModuleId::kT0, "T0",
-1000., 1000., 320.,
190, 182 );
*/
/// Here swapping with TOF
timeChecker->SetReferenceDetector(ECbmModuleId::kPsd, "Psd", -300000, 300000, 320 * 300);
timeChecker->RemoveCheckDetector(ECbmModuleId::kPsd);
//timeChecker->AddCheckDetector(ECbmModuleId::kT0, "T0");
/// Here swapping with MUCH
/*
timeChecker->SetReferenceDetector(ECbmModuleId::kMuch, "Much");
timeChecker->RemoveCheckDetector(ECbmModuleId::kMuch);
timeChecker->AddCheckDetector(ECbmModuleId::kT0, "T0");
*/
/// Remove detectors not present in 2021
timeChecker->RemoveCheckDetector(ECbmModuleId::kT0);
timeChecker->RemoveCheckDetector(ECbmModuleId::kMuch);
/// Remove detectors not yet in common unpacker
timeChecker->RemoveCheckDetector(ECbmModuleId::kSts);
timeChecker->RemoveCheckDetector(ECbmModuleId::kRich);
/// Add detectors with wider range
timeChecker->RemoveCheckDetector(ECbmModuleId::kSts);
timeChecker->AddCheckDetector(ECbmModuleId::kSts, "Sts");
timeChecker->RemoveCheckDetector(ECbmModuleId::kTrd);
timeChecker->AddCheckDetector(ECbmModuleId::kTrd, "Trd");
timeChecker->RemoveCheckDetector(ECbmModuleId::kTof);
//timeChecker->AddCheckDetector(ECbmModuleId::kTof, "Tof", -150000, 150000, 320*150);