From 540f967d70c5397362bcabc0cda63edcdc5aa1ff Mon Sep 17 00:00:00 2001 From: "Ryan@SOLARIS_testStation" Date: Tue, 3 Sep 2024 15:49:15 -0400 Subject: [PATCH] ClassData.h, fine_time = -1 as default --- ClassData.h | 14 +++++++++++--- ClassDigitizer.cpp | 2 -- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ClassData.h b/ClassData.h index 0fdbe66..208f54f 100644 --- a/ClassData.h +++ b/ClassData.h @@ -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){ diff --git a/ClassDigitizer.cpp b/ClassDigitizer.cpp index 061b7e8..277b551 100644 --- a/ClassDigitizer.cpp +++ b/ClassDigitizer.cpp @@ -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;