All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
evd::WebEVD Class Reference
Inheritance diagram for evd::WebEVD:

Public Member Functions

 WebEVD (const fhicl::ParameterSet &pset)
 
void analyze (const art::Event &evt) override
 
void endJob () override
 

Protected Attributes

evd::WebEVDServer< art::Event > fServer
 
art::ServiceHandle< geo::GeometryfGeom
 

Detailed Description

Definition at line 17 of file WebEVD_module.cc.

Constructor & Destructor Documentation

evd::WebEVD::WebEVD ( const fhicl::ParameterSet &  pset)
explicit

Definition at line 34 of file WebEVD_module.cc.

35  : EDAnalyzer(pset)
36 {
37 }

Member Function Documentation

void evd::WebEVD::analyze ( const art::Event &  evt)
override

Definition at line 44 of file WebEVD_module.cc.

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 }
evd::WebEVDServer< art::Event > fServer
art::ServiceHandle< geo::Geometry > fGeom
Result serve(const T &evt, const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData &detprop)
TCEvent evt
Definition: DataStructs.cxx:8
BEGIN_PROLOG could also be cout
auto const detProp
void evd::WebEVD::endJob ( )
override

Definition at line 39 of file WebEVD_module.cc.

40 {
41  std::cout << "Ran out of events. Goodbye!" << std::endl;
42 }
BEGIN_PROLOG could also be cout

Member Data Documentation

art::ServiceHandle<geo::Geometry> evd::WebEVD::fGeom
protected

Definition at line 28 of file WebEVD_module.cc.

evd::WebEVDServer<art::Event> evd::WebEVD::fServer
protected

Definition at line 26 of file WebEVD_module.cc.


The documentation for this class was generated from the following file: