Build and test your readout programModifying your code to port to the new frameworkEditing the MakefileModifying your program

Modifying your program

You will be using the production readout system to read a "traditional" event segment and scaler bank. Traditional event segments and scaler banks allow you to use existing code for the old readout system.

You must register a traditional event segment and scaler readout by editing Skeleton.cpp:

Locate the function MyExperiment::SetupReadout. It should look like this:

void
CMyExperiment::SetupReadout(CExperiment& rExperiment)
{
   CReadoutMain::SetupReadout(rExperiment);
   
   // Insert your code below this comment.

   rExperiment.AddEventSegment(new MySegment);
   
}

Modify the last executable line of this function to read:

...
   rExperiment.AddEventSegment(new CTraditionalEventSegment);

Locate the function CMyExperiment::SetupScalers and modify it to read:

void
CMyExperiment::SetupScalers(CExperiment& rExperiment)
{
   CReadoutMain::SetupScalers(rExperiment);

   // Insert your code below this comment.

   rExperiment.AddScalerModule(new CTraditionalScalerReadout);

}

In the production readout framework, scalers are counted difrerently. Scalers come in banks, and each scaler bank is expected to supply a count of the number of scalers it reads. To accomodate this, the daq_SetScalerCount function has been removed, and the old skeleton code needs to define and implement a new function named numscl() that returns this information.

In our sample, this means that gasN4_daq.cpp must be edited as follows:

Remove the call to daq_SetScalerCount from iniscl():


 Old code:
    ...
   daq\_SetScalerCount(32);
   INIT4434(SCALER\_B,SCALER\_C,SCALER\_N);
   ...
New code:
   ...
   INIT4434(SCALER\_B,SCALER\_C,SCALER\_N);
   ...

Add the definition and implementation of numscl:

/**
   numscl - return the number of scalers to be read:
**/
unsigned int numscl()
{
  return 32;
}

Since the production readout system does not manage the CAMAC system the same way, be sure to do a branchinit() and crateinit() on every branch and crate you reference.


Report documentation errors to Ron Fox (fox@nscl.msu.edu)or NSCL's Bugzilla page

Build and test your readout programModifying your code to port to the new frameworkEditing the MakefileModifying your program