Real-life example… PDAQ
virtual int max_length(int etype)=0;
virtual int put_data(int, int *,int) =0;
1998 Drift chamber definition file (used @ Stony Brook):
daq_create_readoutdevice ("LC2249W",1,1005,0,1,9,0)
daq_create_readoutdevice ("Gminus2",1,1010,0xe0000000)
the maximum amount of data this device can produce (worst-case, if no zero-suppression is possible)
have the device initialize “itself” (the object does whatever it takes to initialize the hardware properly)
the readout: ask the device to put its data to the address specified. We tell it how much data it is allowed to put there at most (safeguard), and it returns the amount it actually put there.
Once we have created the proper device object (which matches the hardware) with the proper parameters, for most purposes we don’t need to know anymore what the hardware is in detail.
We know we can ask any device to initialize, readout, tell us its max length, etc.
(… there are many more functions which aren’t shown here)
Latest addition: The packet_dcm0 class, which reads out the PHENIX data collection modules (“DCM”) through the so-called “semaphore” readout.