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

Fix some sign warnings

parent d2bd6210
......@@ -241,7 +241,7 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
LOG(info) << "CbmMqHistoServer::ReceiveConfigAndData => Received configuration for " << pairHeader.first
<< " histos and " << pairHeader.second << " canvases";
if (parts.Size() != 1 + pairHeader.first + pairHeader.second + 1) {
if (static_cast<size_t>(parts.Size()) != 1 + pairHeader.first + pairHeader.second + 1) {
LOG(fatal) << "CbmMqHistoServer::ReceiveConfigAndData => Number of parts not matching header: " << parts.Size()
<< " instead of " << 1 + pairHeader.first + pairHeader.second + 1;
} // if( parts.Size() != 1 + pairHeader.first + pairHeader.second )
......
......@@ -130,16 +130,16 @@ Bool_t CbmMcbm2018Source::Init()
switch (fuFlagSpillStart) {
case 0: {
/// 0 = Break begin
if (fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop) {
if (fvuSpillBreakBegTs.size() - 1 <= static_cast<UInt_t>(fiUnpSpillIdxStop)) {
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakBegTs.size() - 1;
if (fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1) {
if (static_cast<UInt_t>(fiUnpSpillIdxStart) < fvuSpillBreakBegTs.size() - 1) {
fiUnpSpillIdxStop = fvuSpillBreakBegTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
} // if( static_cast< UInt_t >(fiUnpSpillIdxStart) < fvuSpillBreakBegTs.size() - 1 )
else
LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop )
} // if( fvuSpillBreakBegTs.size() - 1 <= static_cast< UInt_t >(fiUnpSpillIdxStop) )
fuSpillBegTs = fvuSpillBreakBegTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakBegTs[fiUnpSpillIdxStop + 1]; //!
......@@ -147,16 +147,16 @@ Bool_t CbmMcbm2018Source::Init()
}
case 1: {
/// 1 = Break middle
if (fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop) {
if (fvuSpillBreakMidTs.size() - 1 <= static_cast<UInt_t>(fiUnpSpillIdxStop)) {
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakMidTs.size() - 1;
if (fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1) {
if (static_cast<UInt_t>(fiUnpSpillIdxStart) < fvuSpillBreakMidTs.size() - 1) {
fiUnpSpillIdxStop = fvuSpillBreakMidTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
} // if( static_cast< UInt_t >(fiUnpSpillIdxStart) < fvuSpillBreakMidTs.size() - 1 )
else
LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop )
} // if( fvuSpillBreakMidTs.size() - 1 <= static_cast< UInt_t >(fiUnpSpillIdxStop) )
fuSpillBegTs = fvuSpillBreakMidTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakMidTs[fiUnpSpillIdxStop + 1]; //!
......@@ -164,16 +164,16 @@ Bool_t CbmMcbm2018Source::Init()
}
case 2: {
/// 2 = Break end
if (fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop) {
if (fvuSpillBreakEndTs.size() - 1 <= static_cast<UInt_t>(fiUnpSpillIdxStop)) {
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakEndTs.size() - 1;
if (fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1) {
if (static_cast<UInt_t>(fiUnpSpillIdxStart) < fvuSpillBreakEndTs.size() - 1) {
fiUnpSpillIdxStop = fvuSpillBreakEndTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
} // if( static_cast< UInt_t >(fiUnpSpillIdxStart) < fvuSpillBreakEndTs.size() - 1 )
else
LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop )
} // if( fvuSpillBreakEndTs.size() - 1 <= static_cast< UInt_t >(fiUnpSpillIdxStop) )
fuSpillBegTs = fvuSpillBreakEndTs[fiUnpSpillIdxStart]; //!
fuSpillEndTs = fvuSpillBreakEndTs[fiUnpSpillIdxStop + 1]; //!
......
......@@ -80,17 +80,17 @@ public:
void SetDataReductionMuch(UInt_t uTsReduction = 15) { fuTsReduction = uTsReduction; }
void UnpackSingleSpill(Int_t uSpillIdx, UInt_t uSpillStart = 1)
void UnpackSingleSpill(Int_t iSpillIdx, UInt_t uSpillStart = 1)
{
fiUnpSpillIdxStart = uSpillIdx;
fiUnpSpillIdxStop = uSpillIdx;
fiUnpSpillIdxStart = iSpillIdx;
fiUnpSpillIdxStop = iSpillIdx;
fuFlagSpillStart = uSpillStart;
}
void UnpackSelectSpills(Int_t uSpillIdxStart, Int_t uSpillIdxStop, UInt_t uSpillStart = 1)
void UnpackSelectSpills(Int_t iSpillIdxStart, Int_t iSpillIdxStop, UInt_t uSpillStart = 1)
{
fiUnpSpillIdxStart = uSpillIdxStart;
fiUnpSpillIdxStop = uSpillIdxStop;
fiUnpSpillIdxStart = iSpillIdxStart;
fiUnpSpillIdxStop = iSpillIdxStop;
fuFlagSpillStart = uSpillStart;
}
......
......@@ -82,7 +82,7 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
char buf[256];
static uint32_t lastGlobalEpoch = 0;
uint32_t nGet4, epoch, msgType, errorCode;
uint32_t nGet4, epoch, msgType;
static int32_t pEpochDiff[NGET4];
int32_t epochDiff;
// static uint32_t pErrorCnt[NGET4] = {0};
......@@ -162,13 +162,12 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
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;
*/
std::cout << buf << std::endl;
*/
//if (fuCurrentEquipmentId == 0xabc0)
{
......@@ -221,50 +220,51 @@ Bool_t CbmCriGet4RawPrint::DoUnpack(const fles::Timeslice& ts, size_t /*componen
}
}
/*
//------------------- CTRL ----------------------------//
else if (msgType == 0x02)
{
snprintf(buf, sizeof(buf),
"eTime %d - Ctrl Msg: 0x%016lx, Get4 %3d" ,
lastGlobalEpoch, ulData, nGet4);
std::cout << buf << std::endl;
mess.printDataCout( critof001::msg_print_Hex | critof001::msg_print_Prefix | critof001::msg_print_Data );
}
//------------------- ERROR ----------------------------//
else if (msgType == 0x03)
{
snprintf(buf, sizeof(buf),
"eTime %d - Error Msg: 0x%016lx, Get4 %3d, Error code 0x%02x",
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)
if (nGet4 < NGET4)
pTotCnt[nGet4]=pTotCnt[nGet4]+1;
if ( (nGet4 < NGET4) && (errorCode<NERROR) )
pErrorCntMatrix[nGet4][errorCode]=pErrorCntMatrix[nGet4][errorCode]+1;
}
//------------------- HITS ----------------------------//
else if (msgType == 0x0)
{
snprintf(buf, sizeof(buf),
"eTime %d - Hit Msg: 0x%016lx, Get4 %3d",
lastGlobalEpoch, ulData, nGet4);
std::cout << buf << std::endl;
mess.printDataCout( critof001::msg_print_Hex | critof001::msg_print_Prefix | critof001::msg_print_Data );
if (nGet4 < NGET4)
pHitsCnt[nGet4]=pHitsCnt[nGet4]+1;
}
*/
//------------------- CTRL ----------------------------//
else if (msgType == 0x02)
{
snprintf(buf, sizeof(buf),
"eTime %d - Ctrl Msg: 0x%016lx, Get4 %3d" ,
lastGlobalEpoch, ulData, nGet4);
std::cout << buf << std::endl;
mess.printDataCout( critof001::msg_print_Hex | critof001::msg_print_Prefix | critof001::msg_print_Data );
}
//------------------- ERROR ----------------------------//
else if (msgType == 0x03)
{
uint32_t errorCode = (ulData >> 4) & 0x7F;
snprintf(buf, sizeof(buf),
"eTime %d - Error Msg: 0x%016lx, Get4 %3d, Error code 0x%02x",
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)
if (nGet4 < NGET4)
pTotCnt[nGet4]=pTotCnt[nGet4]+1;
if ( (nGet4 < NGET4) && (errorCode<NERROR) )
pErrorCntMatrix[nGet4][errorCode]=pErrorCntMatrix[nGet4][errorCode]+1;
}
//------------------- HITS ----------------------------//
else if (msgType == 0x0)
{
snprintf(buf, sizeof(buf),
"eTime %d - Hit Msg: 0x%016lx, Get4 %3d",
lastGlobalEpoch, ulData, nGet4);
std::cout << buf << std::endl;
mess.printDataCout( critof001::msg_print_Hex | critof001::msg_print_Prefix | critof001::msg_print_Data );
if (nGet4 < NGET4)
pHitsCnt[nGet4]=pHitsCnt[nGet4]+1;
}
*/
/*snprintf(buf, sizeof(buf),
"Data: 0x%016lx",
ulData);
"Data: 0x%016lx",
ulData);
std::cout << buf << std::endl;*/
std::cout << buf << std::endl;*/
}
} // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
......@@ -274,25 +274,25 @@ 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++)
{
effi = float(pHitsCnt[i])/float(nPulses) * 100.0;
snprintf(buf, sizeof(buf),
"Hit counter %d: Hits: %d Errors: %d ErrTot: %d Effi: %f",
i, pHitsCnt[i], pErrorCnt[i], pTotCnt[i], effi);
std::cout << buf << std::endl;
for(uint32_t j = 0; j<NERROR ; j++){
if (pErrorCntMatrix[i][j] != 0){
snprintf(buf, sizeof(buf),
"Error counter %d: error code: 0x%02x, times: %d",
i, j, pErrorCntMatrix[i][j]);
std::cout << buf << std::endl;
}
}
}
*/
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",
i, pHitsCnt[i], pErrorCnt[i], pTotCnt[i], effi);
std::cout << buf << std::endl;
for(uint32_t j = 0; j<NERROR ; j++){
if (pErrorCntMatrix[i][j] != 0){
snprintf(buf, sizeof(buf),
"Error counter %d: error code: 0x%02x, times: %d",
i, j, pErrorCntMatrix[i][j]);
std::cout << buf << std::endl;
}
}
}
*/
return kTRUE;
......
......@@ -39,7 +39,7 @@ class CbmRecoUnpack : public TObject {
public:
/** @brief Constructor
**
**
*/
CbmRecoUnpack();
......@@ -191,9 +191,9 @@ private:
// Check some numbers from this timeslice
size_t nDigis = digivec.size();
return nDigis;
LOG(debug) << "Component " << icomp << " connected to config " << config->GetName() << " n-Digis " << nDigis
<< " processed in this timeslice.";
return nDigis;
}
// ----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment