Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
gen
src
TimeGatedDepos.cxx
Go to the documentation of this file.
1
#include "
WireCellGen/TimeGatedDepos.h
"
2
#include "
WireCellUtil/NamedFactory.h
"
3
#include "
WireCellUtil/Units.h
"
4
#include "
WireCellUtil/String.h
"
5
6
#include "
WireCellIface/IAnodePlane.h
"
7
#include "
WireCellIface/IAnodeFace.h
"
8
#include "
WireCellIface/IWirePlane.h
"
9
#include "
WireCellIface/SimpleDepo.h
"
10
11
#include <boost/range.hpp>
12
13
#include <sstream>
14
#include <iostream>
15
16
WIRECELL_FACTORY
(TimeGatedDepos,
WireCell::Gen::TimeGatedDepos
,
17
WireCell::IDrifter
,
WireCell::IConfigurable
)
18
19
using namespace
std
;
20
using namespace
WireCell
;
21
22
23
24
WireCell::
Configuration
Gen::
TimeGatedDepos
::default_configuration()
const
25
{
26
Configuration
cfg
;
27
cfg[
"accept"
] = m_accept;
28
cfg[
"period"
] = m_period;
29
cfg[
"start"
] = m_start;
30
cfg[
"duration"
] = m_duration;
31
return
cfg
;
32
}
33
34
35
36
Gen::TimeGatedDepos::TimeGatedDepos()
37
: m_accept(true)
38
, m_period(0.0)
39
, m_start(0.0)
40
, m_duration(0.0)
41
42
{
43
}
44
Gen::TimeGatedDepos::~TimeGatedDepos
()
45
{
46
}
47
48
bool
Gen::TimeGatedDepos::operator()
(
const
input_pointer
& depo,
output_queue
& outq)
49
{
50
if
(!depo) {
51
m_start
+=
m_period
;
52
outq.push_back(
nullptr
);
53
return
true
;
54
}
55
56
const
double
t
= depo->time();
57
const
bool
ingate =
m_start
<= t && t <
m_start
+
m_duration
;
58
if
(ingate ==
m_accept
) {
59
outq.push_back(depo);
60
}
61
return
true
;
62
}
63
64
void
Gen::TimeGatedDepos::configure
(
const
WireCell::Configuration
&
cfg
)
65
{
66
m_accept
= cfg[
"accept"
].asString() ==
"accept"
;
67
m_period
=
get
(
cfg
,
"period"
,
m_period
);
68
m_start
=
get
(
cfg
,
"start"
,
m_start
);
69
m_duration
=
get
(
cfg
,
"duration"
,
m_duration
);
70
}
WireCell::Gen::TimeGatedDepos
Definition:
TimeGatedDepos.h:33
WireCell::IConfigurable
Definition:
IConfigurable.h:13
NamedFactory.h
WIRECELL_FACTORY
WIRECELL_FACTORY(TimeGatedDepos, WireCell::Gen::TimeGatedDepos, WireCell::IDrifter, WireCell::IConfigurable) using namespace std
generate_CCQE_events.t
t
Definition:
generate_CCQE_events.py:68
WireCell::Gen::TimeGatedDepos::~TimeGatedDepos
virtual ~TimeGatedDepos()
Definition:
TimeGatedDepos.cxx:44
WireCell::Gen::TimeGatedDepos::m_accept
bool m_accept
Definition:
TimeGatedDepos.h:42
std
STL namespace.
WireCell::Gen::TimeGatedDepos::m_duration
double m_duration
Definition:
TimeGatedDepos.h:45
dbjson.cfg
cfg
Definition:
dbjson.py:29
SimpleDepo.h
WireCell::IQueuedoutNode< IDepo, IDepo >::output_queue
std::deque< output_pointer > output_queue
Definition:
IQueuedoutNode.h:46
WireCell::Gen::TimeGatedDepos::configure
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Definition:
TimeGatedDepos.cxx:64
WireCell::Gen::TimeGatedDepos::m_start
double m_start
Definition:
TimeGatedDepos.h:44
IAnodeFace.h
WireCell::Gen::TimeGatedDepos::operator()
virtual bool operator()(const input_pointer &depo, output_queue &outq)
The calling signature:
Definition:
TimeGatedDepos.cxx:48
WireCell::IDrifter
Definition:
IDrifter.h:18
WireCell
Definition:
Main.h:22
IWirePlane.h
IAnodePlane.h
WireCell::Gen::TimeGatedDepos::m_period
double m_period
Definition:
TimeGatedDepos.h:43
WireCell::Configuration
Json::Value Configuration
Definition:
Configuration.h:50
WireCell::IQueuedoutNode< IDepo, IDepo >::input_pointer
std::shared_ptr< const IDepo > input_pointer
Definition:
IQueuedoutNode.h:44
TimeGatedDepos.h
String.h
Units.h
Generated by
1.8.11