Skip to content

Commit

Permalink
- minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
murat committed Feb 6, 2025
1 parent a084757 commit 7bab6ef
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
8 changes: 5 additions & 3 deletions otsdaq-mu2e-tracker/Gui/DtcGui_threads.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -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]);
}
Expand Down
4 changes: 2 additions & 2 deletions otsdaq-mu2e-tracker/Ui/DtcInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

//-----------------------------------------------------------------------------
Expand Down
27 changes: 27 additions & 0 deletions scripts/daq.C
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7bab6ef

Please sign in to comment.