Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-02 08:21:01

0001 #ifndef __DAQ_DEVICE_PLUGINEXAMPLE__
0002 #define __DAQ_DEVICE_PLUGINEXAMPLE__
0003 
0004 
0005 
0006 #include <daq_device.h>
0007 #include <pulserTriggerHandler.h>
0008 #include <iostream>
0009 
0010 
0011 
0012 // this is part of the example how to build a plugin.
0013 // It consists of a (silly) daq_device class (which creates a 
0014 // packet of type ID4EVT where channel i has the value i), and
0015 // the actual "plugin" part, a plugabble class called 
0016 // example_plugin, which inherits from RCDAQPlugin.
0017 
0018 // Also note that the plugin class can support more than one 
0019 // daq_device (here we have only one). 
0020 
0021 class daq_device_pluginexample : public  daq_device {
0022 
0023 public:
0024 
0025   daq_device_pluginexample (const int eventtype
0026     , const int subeventid
0027     , const int n_words=32
0028     , const int trigger_enabled=0);
0029 
0030 
0031   ~daq_device_pluginexample();
0032 
0033 
0034   void identify(std::ostream& os = std::cout) const;
0035 
0036   int max_length(const int etype) const;
0037 
0038   // functions to do the work
0039 
0040   int put_data(const int etype, int * adr, const int length);
0041 
0042   int init();
0043 
0044   int rearm( const int etype);
0045 
0046 protected:
0047   subevtdata_ptr sevt;
0048   unsigned int number_of_words;
0049   pulserTriggerHandler *th;
0050 
0051 };
0052 
0053 
0054 #endif