Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gauss_plugin.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file gauss_plugin.cc
1 #include "gauss_plugin.h"
2 #include <daq_device_gauss.h>
3 
4 #include <strings.h>
5 
6 int gauss_plugin::create_device(deviceblock *db)
7 {
8 
9  //std::cout << __LINE__ << " " << __FILE__ << " " << db->argv0 << std::endl;
10 
11  if ( strcasecmp(db->argv0,"device_gauss") == 0 )
12  {
13  // we need at least 3 params
14  if ( db->npar <3 ) return 1; // indicate wrong params
15 
16  int eventtype = atoi ( db->argv1); // event type
17  int subid = atoi ( db->argv2); // subevent id
18 
19  if ( db->npar == 3)
20  {
21 
22  add_readoutdevice ( new daq_device_gauss( eventtype,
23  subid));
24  return 0; // say "we handled this request"
25  }
26  else
27  {
28 
29  add_readoutdevice ( new daq_device_gauss( eventtype,
30  subid,
31  atoi ( db->argv3) ));
32  return 0; // say "we handled this request"
33  }
34  }
35 
36  return -1; // say " this is not out device"
37 }
38 
39 void gauss_plugin::identify(std::ostream& os, const int flag) const
40 {
41 
42  if ( flag <=2 )
43  {
44  os << " - Gaussian distribution Plugin" << std::endl;
45  }
46  else
47  {
48  os << " - Gaussian distribution Plugin, provides - " << std::endl;
49  os << " - device_gauss (evttype, subid [,triggerenable]) - fake device making gaussian distributed data" << std::endl;
50  os << " used for the examples in the pmonitor manual" << std::endl;
51 
52  }
53 
54 }
55 
57