Public Member Functions | Private Member Functions | Private Attributes | List of all members
gar::evd3d::EventDisplay3DService Class Reference

#include <EventDisplay3DService.h>

Public Member Functions

 EventDisplay3DService (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 

Private Member Functions

void postBeginJobWorkers (art::InputSource *inputs, std::vector< art::Worker * > const &workers)
 
void postProcessEvent (art::Event const &, art::ScheduleContext)
 

Private Attributes

art::InputSourcefInputSource
 Input source of events. More...
 

Detailed Description

Definition at line 24 of file EventDisplay3DService.h.

Constructor & Destructor Documentation

gar::evd3d::EventDisplay3DService::EventDisplay3DService ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)

Definition at line 25 of file EventDisplay3DService_service.cc.

27  {
28  (void)pset;
31  }
GlobalSignal< detail::SignalResponseType::LIFO, void(InputSource *, std::vector< Worker * > const &)> sPostBeginJobWorkers
void postBeginJobWorkers(art::InputSource *inputs, std::vector< art::Worker * > const &workers)
void postProcessEvent(art::Event const &, art::ScheduleContext)
GlobalSignal< detail::SignalResponseType::LIFO, void(Event const &, ScheduleContext)> sPostProcessEvent

Member Function Documentation

void gar::evd3d::EventDisplay3DService::postBeginJobWorkers ( art::InputSource inputs,
std::vector< art::Worker * > const &  workers 
)
private

Definition at line 35 of file EventDisplay3DService_service.cc.

37  {
38  fInputSource = input_source;
39  }
art::InputSource * fInputSource
Input source of events.
void gar::evd3d::EventDisplay3DService::postProcessEvent ( art::Event const &  evt,
art::ScheduleContext   
)
private

Definition at line 43 of file EventDisplay3DService_service.cc.

44  {
45  if(gEve){
46  gEve->Redraw3D(kFALSE,kTRUE);
47  }else{
48  mf::LogWarning("EvtDisplayService") << "TeveManager is not properly initialized.";
49  gApplication->SetReturnFromRun(kFALSE);
50  gApplication->Terminate(0);
51  }
52 
53  gApplication->Run(kTRUE);
54  if(!gEve){
55  gApplication->SetReturnFromRun(kFALSE);
56  gApplication->Terminate(0);
57  }
58 
59  art::RootInput* rootInput = dynamic_cast<art::RootInput*>(fInputSource);
60  if(!rootInput){
61  throw cet::exception("EvtDisplayService")
62  << "Random access for the EvtDisplay requires a RootInput source for proper operation.\n";
63  }
64 
65  // Figure out where to go in the input stream from here
66  switch (evdb::NavState::Which()) {
67  case evdb::kNEXT_EVENT: {
68  // Contrary to appearances, this is *not* a NOP: it ensures run and
69  // subRun are (re-)read as necessary if we've been doing random
70  // access. Come the revolution ...
71  //
72  // 2011/04/10 CG.
73  rootInput->seekToEvent(0);
74  break;
75  }
76  case evdb::kPREV_EVENT: {
77  rootInput->seekToEvent(-2);
78  break;
79  }
80  case evdb::kRELOAD_EVENT: {
81  rootInput->seekToEvent(evt.id());
82  break;
83  }
84  case evdb::kGOTO_EVENT: {
85  int targRun = evdb::NavState::TargetRun();
86  int targEvt = evdb::NavState::TargetEvent();
87  if(targRun<0 || targEvt<0){
88  mf::LogWarning("EvtDisplayService") << "Negative Run or Event number specified -- reloading current event.";
89  // Reload current event.
90  rootInput->seekToEvent(evt.id());
91  } else {
93  if (!rootInput->seekToEvent(id)) { // Couldn't find event
94  mf::LogWarning("EvtDisplayService") << "Unable to find "
95  << id
96  << " -- reloading current event.";
97  // Reload current event.
98  rootInput->seekToEvent(evt.id());
99  }
100  }
101  break;
102  }
103  default: {
105  << "EvtDisplayService in unhandled state "
106  << evdb::NavState::Which()
107  << ".\n";
108  }
109  }
110 
111  }
art::InputSource * fInputSource
Input source of events.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
static SubRunID invalidSubRun(RunID const &rID)
Definition: SubRunID.h:165
TCEvent evt
Definition: DataStructs.cxx:7
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

art::InputSource* gar::evd3d::EventDisplay3DService::fInputSource
private

Input source of events.

Definition at line 37 of file EventDisplay3DService.h.


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