fixed scalar display bug, numEventDecode zero when clearTrigger()

This commit is contained in:
carina@hades 2023-12-12 17:52:32 -05:00
parent d254bb9d2d
commit fb06ea3098
2 changed files with 12 additions and 8 deletions

View File

@ -84,7 +84,7 @@ class Data{
void DecodeDualBlock(char * &buffer, unsigned int size, int DPPType, int chMask, bool fastDecode, int verbose = 0); // for outside data void DecodeDualBlock(char * &buffer, unsigned int size, int DPPType, int chMask, bool fastDecode, int verbose = 0); // for outside data
void PrintStat(bool skipEmpty = true) const; void PrintStat(bool skipEmpty = true);
void PrintAllData(bool tableMode = true, unsigned int maxRowDisplay = 0) const; void PrintAllData(bool tableMode = true, unsigned int maxRowDisplay = 0) const;
//^================= Saving data //^================= Saving data
@ -293,7 +293,7 @@ inline void Data::CloseSaveFile(){
//^####################################################### //^#######################################################
//^####################################################### Print //^####################################################### Print
inline void Data::PrintStat(bool skipEmpty) const{ inline void Data::PrintStat(bool skipEmpty) {
printf("============================= Print Stat. Digi-%d\n", boardSN); printf("============================= Print Stat. Digi-%d\n", boardSN);
if( !IsNotRollOverFakeAgg ) { if( !IsNotRollOverFakeAgg ) {
@ -307,6 +307,9 @@ inline void Data::PrintStat(bool skipEmpty) const{
printf("%2d | %6d | %9.2f | %9.2f | %6lu | %6d(%2d)\n", ch, NumEventsDecoded[ch], TriggerRate[ch], NonPileUpRate[ch], TotNumNonPileUpEvents[ch], DataIndex[ch], LoopIndex[ch]); printf("%2d | %6d | %9.2f | %9.2f | %6lu | %6d(%2d)\n", ch, NumEventsDecoded[ch], TriggerRate[ch], NonPileUpRate[ch], TotNumNonPileUpEvents[ch], DataIndex[ch], LoopIndex[ch]);
} }
printf("---+--------+-----------+-----------+----------\n"); printf("---+--------+-----------+-----------+----------\n");
ClearTriggerRate();
} }
inline void Data::PrintAllData(bool tableMode, unsigned int maxRowDisplay) const{ inline void Data::PrintAllData(bool tableMode, unsigned int maxRowDisplay) const{
@ -379,10 +382,10 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
return; return;
} }
for( int ch = 0; ch < MaxNChannels; ch ++) { //for( int ch = 0; ch < MaxNChannels; ch ++) {
NumEventsDecoded[ch] = 0; // NumEventsDecoded[ch] = 0;
NumNonPileUpDecoded[ch] = 0; // NumNonPileUpDecoded[ch] = 0;
} //}
if( nByte == 0 ) return; if( nByte == 0 ) return;
nw = 0; nw = 0;
@ -523,7 +526,7 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
} }
NonPileUpRate[ch] = (nEvent - pileUpCount)/sec; NonPileUpRate[ch] = (nEvent - pileUpCount)/sec;
//printf("%2d | %10llu %10llu, %.0f = %f sec, rate = %f, nEvent %d pileUp %d \n", ch, tList.front() ,tList.back(), tick2ns, sec, nEvent / sec, nEvent, pileUpCount); //printf("%2d | %10llu %10llu, %.0f = %f sec, rate = %f, nEvent %d pileUp %d \n", ch, t1, t0, tick2ns, sec, nEvent / sec, nEvent, pileUpCount);
} }
} }

View File

@ -965,15 +965,16 @@ void MainWindow::UpdateScalar(){
leTrigger[iDigi][i]->setText(a); leTrigger[iDigi][i]->setText(a);
leAccept[iDigi][i]->setText(b); leAccept[iDigi][i]->setText(b);
digi[iDigi]->GetData()->ClearTriggerRate();
if( influx && a != "inf" ){ if( influx && a != "inf" ){
influx->AddDataPoint("Rate,Bd="+std::to_string(digi[iDigi]->GetSerialNumber()) + ",Ch=" + QString::number(i).rightJustified(2, '0').toStdString() + " value=" + a.toStdString()); influx->AddDataPoint("Rate,Bd="+std::to_string(digi[iDigi]->GetSerialNumber()) + ",Ch=" + QString::number(i).rightJustified(2, '0').toStdString() + " value=" + a.toStdString());
} }
} }
} }
digi[iDigi]->GetData()->ClearTriggerRate();
digiMTX[iDigi].unlock(); digiMTX[iDigi].unlock();
} }