small bug fix for Filling Historgam when trigge rate > 10k
This commit is contained in:
parent
3f007cebbd
commit
921580a6c6
|
@ -275,6 +275,7 @@ void SingleSpectra::FillHistograms(){
|
||||||
std::vector<int> digiChList; // (digi*1000 + ch)
|
std::vector<int> digiChList; // (digi*1000 + ch)
|
||||||
std::vector<int> digiChLastIndex; // lastIndex
|
std::vector<int> digiChLastIndex; // lastIndex
|
||||||
std::vector<int> digiChLoopIndex; // loopIndex
|
std::vector<int> digiChLoopIndex; // loopIndex
|
||||||
|
std::vector<int> digiChAvalibleData;
|
||||||
std::vector<bool> digiChFilled;
|
std::vector<bool> digiChFilled;
|
||||||
|
|
||||||
for( int ID = 0; ID < nDigi; ID++){
|
for( int ID = 0; ID < nDigi; ID++){
|
||||||
|
@ -289,6 +290,7 @@ void SingleSpectra::FillHistograms(){
|
||||||
digiChList.push_back( ID*1000 + ch ) ;
|
digiChList.push_back( ID*1000 + ch ) ;
|
||||||
digiChLastIndex.push_back(lastIndex);
|
digiChLastIndex.push_back(lastIndex);
|
||||||
digiChLoopIndex.push_back(loopIndex);
|
digiChLoopIndex.push_back(loopIndex);
|
||||||
|
digiChAvalibleData.push_back(temp1-temp2);
|
||||||
digiChFilled.push_back(false);
|
digiChFilled.push_back(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,7 +334,7 @@ void SingleSpectra::FillHistograms(){
|
||||||
if( temp1 - temp2 > digi[ID]->GetData()->GetDataSize() ) { //DefaultDataSize = 10k
|
if( temp1 - temp2 > digi[ID]->GetData()->GetDataSize() ) { //DefaultDataSize = 10k
|
||||||
temp2 = temp1 - digi[ID]->GetData()->GetDataSize();
|
temp2 = temp1 - digi[ID]->GetData()->GetDataSize();
|
||||||
lastFilledIndex[ID][ch] = lastIndex;
|
lastFilledIndex[ID][ch] = lastIndex;
|
||||||
lastFilledIndex[ID][ch] = loopIndex - 1;
|
loopFilledIndex[ID][ch] = loopIndex - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastFilledIndex[ID][ch] ++;
|
lastFilledIndex[ID][ch] ++;
|
||||||
|
@ -351,7 +353,7 @@ void SingleSpectra::FillHistograms(){
|
||||||
hist2D[ID]->Fill(ch, data);
|
hist2D[ID]->Fill(ch, data);
|
||||||
|
|
||||||
clock_gettime(CLOCK_REALTIME, &tb);
|
clock_gettime(CLOCK_REALTIME, &tb);
|
||||||
}while( (tb.tv_nsec - ta.tv_nsec)/1e6 + (tb.tv_sec - ta.tv_sec)*1e3 < maxFillTimeinMilliSec );
|
}while( isFillingHistograms || (tb.tv_nsec - ta.tv_nsec)/1e6 + (tb.tv_sec - ta.tv_sec)*1e3 < maxFillTimeinMilliSec );
|
||||||
|
|
||||||
//*--------------- generate fillign report
|
//*--------------- generate fillign report
|
||||||
for( size_t i = 0; i < digiChFilled.size() ; i++){
|
for( size_t i = 0; i < digiChFilled.size() ; i++){
|
||||||
|
@ -366,7 +368,7 @@ void SingleSpectra::FillHistograms(){
|
||||||
int temp1 = lastIndex + loopIndex * digi[ID]->GetData()->GetDataSize();
|
int temp1 = lastIndex + loopIndex * digi[ID]->GetData()->GetDataSize();
|
||||||
int temp2 = lastFilledIndex[ID][ch] + loopFilledIndex[ID][ch] * digi[ID]->GetData()->GetDataSize() + 1;
|
int temp2 = lastFilledIndex[ID][ch] + loopFilledIndex[ID][ch] * digi[ID]->GetData()->GetDataSize() + 1;
|
||||||
|
|
||||||
printf("Digi-%2d ch-%2d | event unfilled %d\n", ID, ch, temp1 - temp2 );
|
printf("Digi-%2d ch-%2d | event unfilled %d / %d\n", ID, ch, temp1 - temp2, digiChAvalibleData[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
clock_gettime(CLOCK_REALTIME, &tb);
|
clock_gettime(CLOCK_REALTIME, &tb);
|
||||||
|
|
|
@ -55,6 +55,7 @@ public slots:
|
||||||
void stopTimer(){
|
void stopTimer(){
|
||||||
// printf("timer stop\n");
|
// printf("timer stop\n");
|
||||||
timer->stop();
|
timer->stop();
|
||||||
|
isFillingHistograms = false; // this will also break the FillHistogram do-loop
|
||||||
ClearInternalDataCount();
|
ClearInternalDataCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user