Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
webevd
webevd
WebEVD
WebEVD_module.cc
Go to the documentation of this file.
1
// Chris Backhouse - bckhouse@fnal.gov
2
3
#include "
fhiclcpp/ParameterSet.h
"
4
#include "
art/Framework/Core/ModuleMacros.h
"
5
#include "
art/Framework/Core/EDAnalyzer.h
"
6
7
#include "
art/Framework/Services/Registry/ServiceHandle.h
"
8
#include "
larcore/Geometry/Geometry.h
"
9
#include "
lardata/DetectorInfoServices/DetectorPropertiesService.h
"
10
11
#include "
webevd/WebEVD/WebEVDServer.h
"
12
#include "
webevd/WebEVD/InputSeeker.h
"
13
14
namespace
evd
15
{
16
17
class
WebEVD
:
public
art::EDAnalyzer
18
{
19
public
:
20
explicit
WebEVD
(
const
fhicl::ParameterSet
& pset);
21
22
void
analyze
(
const
art::Event
&
evt
)
override
;
23
void
endJob
()
override
;
24
25
protected
:
26
evd::WebEVDServer<art::Event>
fServer
;
27
28
art::ServiceHandle<geo::Geometry>
fGeom
;
29
};
30
31
DEFINE_ART_MODULE
(
WebEVD
)
32
33
// ---------------------------------------------------------------------------
34
WebEVD
::
WebEVD
(
const
fhicl
::ParameterSet& pset)
35
:
EDAnalyzer
(pset)
36
{
37
}
38
39
void
WebEVD::endJob
()
40
{
41
std::cout <<
"Ran out of events. Goodbye!"
<<
std::endl
;
42
}
43
44
void
WebEVD::analyze
(
const
art::Event
&
evt
)
45
{
46
auto
const
detProp =
art::ServiceHandle<detinfo::DetectorPropertiesService>
()->DataFor(evt);
47
const
Result
res =
fServer
.
serve
(evt,
fGeom
.
get
(), detProp);
48
49
switch
(res.
code
){
50
case
kNEXT
:
51
std::cout <<
"Next clicked in GUI. Going to next event"
<<
std::endl
;
52
// nothing, allow art to proceed to next
53
return
;
54
55
case
kPREV
:
56
std::cout <<
"Prev clicked in GUI. Going to previous event"
<<
std::endl
;
57
// Because we will automatically increment by one
58
art::ServiceHandle<InputSeeker>
()->seekToEvent(-2);
59
return
;
60
61
case
kQUIT
:
62
// TODO give fServer a chance to clean up
63
std::cout <<
"Quit clicked in GUI. Goodbye!"
<<
std::endl
;
64
exit(0);
65
66
case
kERROR
:
67
std::cout <<
"Error. Quitting"
<<
std::endl
;
68
exit(1);
69
70
case
kSEEK
:
71
std::cout <<
"User requested seek to "
<< res.
run
<<
":"
<< res.
subrun
<<
":"
<< res.
event
<<
std::endl
;
72
art::ServiceHandle<InputSeeker>
()->seekToEvent(
art::EventID
(res.
run
,
73
res.
subrun
,
74
res.
event
));
75
return
;
76
77
default
:
78
std::cout <<
"Unhandled result code "
<< res.
code
<<
"!"
<<
std::endl
;
79
abort();
80
}
81
}
82
83
}
// namespace
freeze_graph.const
const
Definition:
freeze_graph.py:179
art::ServiceHandle< geo::Geometry >
InputSeeker.h
art::ServiceHandle::get
T * get() const
Definition:
ServiceHandle.h:63
evd::Result::subrun
int subrun
Definition:
WebEVDServer.h:21
DetectorPropertiesService.h
art::EDAnalyzer::EDAnalyzer
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition:
EDAnalyzer.h:25
Geometry.h
art framework interface to geometry description
ParameterSet.h
evd::kPREV
Definition:
WebEVDServer.h:17
ServiceHandle.h
evd::WebEVDServer< art::Event >
evd::WebEVD
Definition:
WebEVD_module.cc:17
evd::kQUIT
Definition:
WebEVDServer.h:17
evd::Result::run
int run
Definition:
WebEVDServer.h:21
evd
LArSoft includes.
Definition:
InfoTransfer.h:33
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:67
evd::WebEVD::endJob
void endJob() override
Definition:
WebEVD_module.cc:39
evd::WebEVD::fServer
evd::WebEVDServer< art::Event > fServer
Definition:
WebEVD_module.cc:26
fhicl
Definition:
InputSourceFactory.h:7
evd::kSEEK
Definition:
WebEVDServer.h:17
EDAnalyzer.h
ModuleMacros.h
evd::kNEXT
Definition:
WebEVDServer.h:17
evd::WebEVD::fGeom
art::ServiceHandle< geo::Geometry > fGeom
Definition:
WebEVD_module.cc:28
evd::Result::event
int event
Definition:
WebEVDServer.h:21
art::Event
Definition:
Event.h:22
evd::Result::code
EResult code
Definition:
WebEVDServer.h:21
evd::WebEVDServer::serve
Result serve(const T &evt, const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData &detprop)
Definition:
WebEVDServer.cxx:1011
art::EDAnalyzer
Definition:
EDAnalyzer.h:20
WebEVDServer.h
tca::evt
TCEvent evt
Definition:
DataStructs.cxx:7
evd::WebEVD::WebEVD
WebEVD(const fhicl::ParameterSet &pset)
Definition:
WebEVD_module.cc:34
art::EventID
Definition:
EventID.h:20
evd::kERROR
Definition:
WebEVDServer.h:17
evd::WebEVD::analyze
void analyze(const art::Event &evt) override
Definition:
WebEVD_module.cc:44
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
evd::Result
Definition:
WebEVDServer.h:18
Generated by
1.8.11