Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
example_plugin.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file example_plugin.cc
1
#include "
example_plugin.h
"
2
#include <
daq_device_pluginexample.h
>
3
4
#include <strings.h>
5
6
int
example_plugin::create_device
(deviceblock *
db
)
7
{
8
9
//std::cout << __LINE__ << " " << __FILE__ << " " << db->argv0 << std::endl;
10
11
if
( strcasecmp(db->argv0,
"device_pluginexample"
) == 0 )
12
{
13
// we need at least 4 params
14
if
( db->npar <4 )
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 == 4)
20
{
21
22
add_readoutdevice
(
new
daq_device_pluginexample
( eventtype,
23
subid,
24
atoi ( db->argv3)));
25
return
0;
// say "we handled this request"
26
}
27
else
28
{
29
30
add_readoutdevice
(
new
daq_device_pluginexample
( eventtype,
31
subid,
32
atoi ( db->argv3),
33
atoi ( db->argv4)));
34
return
0;
// say "we handled this request"
35
}
36
}
37
38
return
-1;
// say " this is not out device"
39
}
40
41
void
example_plugin::identify
(std::ostream&
os
,
const
int
flag)
const
42
{
43
44
if
( flag <=2 )
45
{
46
os <<
" - Example Plugin"
<< std::endl;
47
}
48
else
49
{
50
os <<
" - Example Plugin, provides - "
<< std::endl;
51
os <<
" - device_pluginexample (evttype, subid, nwords [,triggerenable]) - readout a silly plugin example device"
<< std::endl;
52
53
}
54
55
}
56
57
example_plugin
_ep
;
58
rcdaq
blob
master
example_plugin.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:47
using
1.8.2 with
sPHENIX GitHub integration