ClassData.h, fine_time = -1 as default

This commit is contained in:
Ryan Tang 2024-09-03 15:49:15 -04:00
parent e79f93e9ab
commit 540f967d70
2 changed files with 11 additions and 5 deletions

View File

@ -311,7 +311,7 @@ inline void Data::ClearData(){
if( ch >= numInputCh) break;
for( int j = 0; j < dataSize; j++){
Timestamp[ch][j] = 0;
fineTime[ch][j] = 0;
fineTime[ch][j] = -1;
Energy[ch][j] = 0;
Energy2[ch][j] = 0;
Waveform1[ch][j].clear();
@ -897,7 +897,11 @@ inline int Data::DecodePHADualChannelBlock(unsigned int ChannelMask, bool fastDe
Energy[channel][DataIndex[channel]] = energy;
Timestamp[channel][DataIndex[channel]] = timeStamp * tick2ns;
if(extra2Option == 2 ) fineTime[channel][DataIndex[channel]] = (extra2 & 0x03FF ) * tick2ns; // in ps, the tick2ns is a conversion factor
if(extra2Option == 2 ) {
fineTime[channel][DataIndex[channel]] = (extra2 & 0x03FF ) * tick2ns; // in ps, the tick2ns is a conversion factor
}else{
fineTime[channel][DataIndex[channel]] = -1;
}
PileUp[channel][DataIndex[channel]] = pileUp;
NumEventsDecoded[channel] ++;
@ -1100,7 +1104,11 @@ inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDe
Energy2[channel][DataIndex[channel]] = Qshort;
Energy[channel][DataIndex[channel]] = Qlong;
Timestamp[channel][DataIndex[channel]] = timeStamp * tick2ns;
if( extraOption == 2 ) fineTime[channel][DataIndex[channel]] = (extra & 0x3FF) * tick2ns; //in ps, tick2ns is justa conversion factor
if( extraOption == 2 ) {
fineTime[channel][DataIndex[channel]] = (extra & 0x3FF) * tick2ns; //in ps, tick2ns is justa conversion factor
}else{
fineTime[channel][DataIndex[channel]] = -1; //in ps, tick2ns is justa conversion factor
}
NumEventsDecoded[channel] ++;
if( !pileup){

View File

@ -183,7 +183,6 @@ int Digitizer::OpenDigitizer(int boardID, int portID, bool program, bool verbose
/// change address 0xEF08 (5 bits), this will reflected in the 2nd word of the Board Agg. header.
ret = CAEN_DGTZ_WriteRegister(handle, DPP::BoardID, (DPPType & 0xF));
//TODO somehow the bdInfo does not work, use DPPType to set it
uint32_t bdInfo = GetSettingFromMemory(DPP::BoardInfo_R);
uint32_t haha = ((bdInfo >> 8 ) & 0xFF);
@ -287,7 +286,6 @@ int Digitizer::CloseDigitizer(){
return ret;
}
void Digitizer::SetRegChannelMask(uint32_t mask){
DebugPrint("%s", "Digitizer");
if( softwareDisable ) return;