16 for (
size_t fragIndex=0; fragIndex < Fragments.size(); ++fragIndex ) {
18 const artdaq::Fragment &singleFragment = Fragments[fragIndex];
19 lbne::TpcMilliSliceFragment millisliceFragment(singleFragment);
20 auto numMicroSlices = millisliceFragment.microSliceCount();
21 for (
unsigned int i_micro=0;i_micro<numMicroSlices;i_micro++) {
22 std::unique_ptr <const lbne::TpcMicroSlice> microSlice = millisliceFragment.microSlice(i_micro);
23 auto numNanoSlices = microSlice->nanoSliceCount();
26 ThisADCcount += numNanoSlices;
36 if ( fragIndex==0 && i_micro==0 ) {
38 uint64_t timestamp = microSlice->software_message() & (((
long int)0x1 << 56) - 1);
39 if ( microSlice->nanoSliceCount() ) {
40 RCETime = microSlice->nanoSlice(0)->nova_timestamp();
47 if ( fragIndex == 0 ) {
48 NumADCs = ThisADCcount;
50 if ( ThisADCcount != NumADCs ) ConsistRCE = 0;
59 if ( Fragments.size() ) {
60 const auto& frag(Fragments[0]);
61 const SSPDAQ::MillisliceHeader* meta=0;
62 if(frag.hasMetadata()) {
65 meta = &(frag.metadata<lbne::SSPFragment::Metadata>()->sliceHeader);
67 SSPTime = meta->startTime;
76 if (PTBrawFragments.size()) {
78 lbne::PennMicroSlice::Payload_Header *word_header =
nullptr;
79 lbne::PennMicroSlice::Payload_Timestamp *FirstTimestamp =
nullptr;
82 uint8_t* payload_data =
nullptr;
85 const artdaq::Fragment frag = PTBrawFragments[0];
86 lbne::PennMilliSliceFragment msf(frag);
88 payloadCount = msf.payloadCount(counter, trigger, timestamp);
90 while (payload_index <
uint32_t(payloadCount-1) && FirstTimestamp ==
nullptr) {
91 payload_data = msf.get_next_payload(payload_index,word_header);
92 switch(word_header->data_packet_type) {
93 case lbne::PennMicroSlice::DataTypeTimestamp:
94 FirstTimestamp =
reinterpret_cast<lbne::PennMicroSlice::Payload_Timestamp*
>(payload_data);
100 PTBTime = FirstTimestamp->nova_timestamp;
void GetSSPFirstTimestamp(artdaq::Fragments const &Fragments, int &nSSPPayloads, long long &SSPTime)
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
unsigned __int64 uint64_t
void GetPTBFirstTimestamp(artdaq::Fragments const &PTBrawFragments, int &nPTBPayloads, long long &PTBTime)
void GetRCEFirstTimestamp(artdaq::Fragments const &Fragments, int &ConsistRCE, int &NumADCs, long long &RCETime)