Skip to content

Commit 1780075

Browse files
Merge pull request #463 from SBNSoftware/trj64bittimestamp_April29_2024
increase precision of timestamp calculation to 64 bits -- was 32 bits
2 parents bd9fb48 + d210e60 commit 1780075

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

sbndcode/Decoders/TPC/SBNDTPCDecoder_module.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ tpcAnalysis::TPCDecodeAna daq::SBNDTPCDecoder::Fragment2TPCDecodeAna(art::Event
4949
ret.crate = (frag.fragmentID() >> 8) & 0xF;
5050
ret.slot = raw_header->getSlot();
5151
ret.event_number = raw_header->getEventNum();
52-
// ret.frame_number = raw_header->getFrameNum();
52+
//std::cout << "TPC decoder frame, sample: " << raw_header->getFrameNum() << " " << raw_header->get2mhzSample() << std::endl;
5353
ret.checksum = raw_header->getChecksum();
5454

5555
ret.adc_word_count = raw_header->getADCWordCount();
5656
// ret.trig_frame_number = raw_header->getTrigFrame();
5757

5858
// formula for getting unix timestamp from nevis frame number:
5959
// timestamp = frame_number * (timesize + 1) + trigger_sample
60-
ret.timestamp = (raw_header->getFrameNum() * (_config.timesize + 1) + raw_header->get2mhzSample()) * _config.frame_to_dt;
61-
60+
ret.timestamp = (raw_header->getFrameNum() * ( (ULong64_t) _config.timesize + 1) + raw_header->get2mhzSample()) * ( (double) _config.frame_to_dt);
61+
//std::cout << "timestamp: " << ret.timestamp << std::endl;
6262
ret.index = raw_header->getSlot() - _config.min_slot_no;
6363

6464
return ret;

sbndcode/Decoders/TPC/TPCDecodeAna.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TPCDecodeAna {
1818
uint8_t slot; //!< Index of "slot" of readout board
1919
uint32_t event_number; //!< Event number for this header
2020
uint32_t checksum; //!< checksum associated with header
21-
uint32_t timestamp; //!< timestamp for this header
21+
ULong64_t timestamp; //!< timestamp for this header
2222
uint32_t adc_word_count; //!< word count of ADC counts associated with this header
2323

2424
unsigned index; //!< Globally usable index for this header information.

sbndcode/Decoders/TPC/classes_def.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<lcgdict>
2-
<class name="tpcAnalysis::TPCDecodeAna" ClassVersion="10">
2+
<class name="tpcAnalysis::TPCDecodeAna" ClassVersion="11">
3+
<version ClassVersion="11" checksum="3638395479"/>
34
<version ClassVersion="10" checksum="3825172703"/>
45
</class>
56
<class name="std::vector<tpcAnalysis::TPCDecodeAna>"/>

0 commit comments

Comments
 (0)