Belle II Software
release-08-00-10
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
x
z
Typedefs
a
b
c
d
e
g
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
e
f
g
n
p
s
v
z
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
Typedefs
Macros
eventsampler.cc
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
9
#include <cstring>
10
#include <string>
11
#include <vector>
12
13
#include <stdio.h>
14
#include <stdlib.h>
15
16
#include "daq/expreco/EventSampler.h"
17
#include "daq/rfarm/manager/RFConf.h"
18
19
using namespace
Belle2
;
20
using namespace
std;
21
22
int
main
(
int
argc,
char
** argv)
23
{
24
// Retrieve RingBuffer name[1], port number[2], Shmname[3], and id[4]
25
if
(argc < 2) {
26
printf(
"syntax : eventsampler configfile\n"
);
27
exit(-1);
28
}
29
30
RFConf
* conf =
new
RFConf
(argv[1]);
31
32
int
nnodes = 0;
33
int
maxnodes = conf->getconfi(
"processor"
,
"nnodes"
);
34
int
idbase = conf->getconfi(
"processor"
,
"idbase"
);
35
char
* hostbase = conf->getconf(
"processor"
,
"ctlhostbase"
);
36
char
* badlist = conf->getconf(
"processor"
,
"badlist"
);
37
38
vector<string> nodelist;
39
char
hostname[512], idname[3], shmid[3];
40
for
(
int
i = 0; i < maxnodes; i++) {
41
sprintf(idname,
"%2.2d"
, idbase + i);
42
sprintf(shmid,
"%2.2d"
, i);
43
if
(badlist == NULL ||
44
strstr(badlist, idname) == 0) {
45
sprintf(hostname,
"%s%2.2d"
, hostbase, idbase + i);
46
nodelist.push_back(
string
(hostname));
47
nnodes++;
48
}
49
}
50
51
int
port = conf->getconfi(
"processor"
,
"eventserver"
,
"port"
);
52
53
char
* rbuf = conf->getconf(
"eventsampler"
,
"ringbufout"
);
54
int
interval = conf->getconfi(
"eventsampler"
,
"interval"
);
55
56
EventSampler
es(nodelist, port, rbuf, interval);
57
58
es.server();
59
}
60
61
62
Belle2::EventSampler
Definition:
EventSampler.h:25
Belle2::RFConf
Definition:
RFConf.h:24
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:17
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:91
daq
expreco
tools
eventsampler.cc
Generated on Fri Aug 9 2024 00:49:36 for Belle II Software by
1.9.1