From 7bab6efd4549b9f85c6037bbe9a1b6086107e089 Mon Sep 17 00:00:00 2001 From: murat Date: Thu, 6 Feb 2025 11:08:42 -0600 Subject: [PATCH] - minor update --- otsdaq-mu2e-tracker/Gui/DtcGui_threads.cc | 8 ++++--- otsdaq-mu2e-tracker/Ui/DtcInterface.cc | 4 ++-- scripts/daq.C | 27 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/otsdaq-mu2e-tracker/Gui/DtcGui_threads.cc b/otsdaq-mu2e-tracker/Gui/DtcGui_threads.cc index f93111e..f1be809 100644 --- a/otsdaq-mu2e-tracker/Gui/DtcGui_threads.cc +++ b/otsdaq-mu2e-tracker/Gui/DtcGui_threads.cc @@ -105,11 +105,11 @@ void* DtcGui::ReaderThread(void* Context) { char* roc_data = data+0x30; - ushort rs[6]; + ushort rs[6], rnb[6]; for (int roc=0; roc<6; roc++) { - int nb = *((ushort*) roc_data); + rnb[roc] = *((ushort*) roc_data); rs[roc] = *((ushort*)(roc_data+0x0c)); - roc_data += nb; + roc_data += rnb[roc]; } if (tstamp % print_freq == 0) { @@ -119,6 +119,7 @@ void* DtcGui::ReaderThread(void* Context) { timer.Continue(); cout << Form("%8.2f %8.2f %10lu %1i %10lu %6i %13li",ct,rt,tstamp,i,ew_tag,nbytes,nbytes_tot) << Form(" 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x",rs[0],rs[1],rs[2],rs[3],rs[4],rs[5]) + << Form(" %5i %5i %5i %5i %5i %5i",rnb[0],rnb[1],rnb[2],rnb[3],rnb[4],rnb[5]) << Form(" %3i %5i\n",nerr,nerr_tot); if (tc->fPrintLevel > 10) { dtc_i->PrintBuffer(dtc_block->GetRawBufferPointer(),dtc_block->GetSubEventByteCount()/2); @@ -132,6 +133,7 @@ void* DtcGui::ReaderThread(void* Context) { timer.Continue(); cout << Form("%8.2f %8.2f %10lu %1i %10lu %6i %13li",ct,rt,tstamp,i,ew_tag,nbytes,nbytes_tot) << Form(" 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x",rs[0],rs[1],rs[2],rs[3],rs[4],rs[5]) + << Form(" %5i %5i %5i %5i %5i %5i",rnb[0],rnb[1],rnb[2],rnb[3],rnb[4],rnb[5]) << Form(" %3i %5i %5i %5i %5i %5i %5i %5i \n",nerr,nerr_tot, nerr_roc_tot[0],nerr_roc_tot[1],nerr_roc_tot[2],nerr_roc_tot[3],nerr_roc_tot[4],nerr_roc_tot[5]); } diff --git a/otsdaq-mu2e-tracker/Ui/DtcInterface.cc b/otsdaq-mu2e-tracker/Ui/DtcInterface.cc index 9a55198..e9e4cbb 100644 --- a/otsdaq-mu2e-tracker/Ui/DtcInterface.cc +++ b/otsdaq-mu2e-tracker/Ui/DtcInterface.cc @@ -127,7 +127,7 @@ namespace trkdaq { // this is fully tracker-specific //----------------------------------------------------------------------------- void DtcInterface::InitRocReadoutMode() { - TLOG(TLVL_DEBUG) << Form("START : fRocReadoutMode=%i\n",fRocReadoutMode); + TLOG(TLVL_DEBUG) << Form("-- START: fRocReadoutMode=%i\n",fRocReadoutMode); //----------------------------------------------------------------------------- // this should be the only place where we reset the ROC // ROC readout mode (fixed_length << 4) | readout_mode @@ -154,7 +154,7 @@ namespace trkdaq { else { TLOG(TLVL_DEBUG) << "unknown mode:" << fRocReadoutMode << "> BAIL OUT"; } - TLOG(TLVL_DEBUG) << Form("END : fRocReadoutMode=%i\n",fRocReadoutMode); + TLOG(TLVL_DEBUG) << Form("-- END: fRocReadoutMode=%i\n",fRocReadoutMode); } //----------------------------------------------------------------------------- diff --git a/scripts/daq.C b/scripts/daq.C index a650259..1d2931e 100644 --- a/scripts/daq.C +++ b/scripts/daq.C @@ -233,6 +233,33 @@ int dtc_control_roc_read(int Version, dtc_i->ControlRoc_Read(&par,LinkMask,print_level); return 0; } +//----------------------------------------------------------------------------- +// test of the 'READ' command implementation over the fiber +// if LinkMask != -1, operate on the specified links only +//----------------------------------------------------------------------------- +int dtc_control_roc_digi_rw(int Link, + int Rw + int HvCal, + int Address, + int NumTrig) { + + DtcInterface* dtc_i = DtcInterface::Instance(PcieAddr); + + ControlRoc_DigiRW_Input_t par; + ControlRoc_DigiRW_Output_t pout; + + par.rw = Rw; + par.hvcal = HvCal; // -a + par.address = Address; // -t + par.data[0] = NumTrig & 0xffff; + par.data[1] = (NumTrig >> 16) & 0xffff; + + // printf("dtc_i->fLinkMask: 0x%04x\n",dtc_i->fLinkMask); + int print_level(3); + + dtc_i->ControlRoc_DigiRW(&par,&out,Link,Mask,print_level); + return 0; +} //----------------------------------------------------------------------------- // EW length : in units of 25 ns (clock)