8 #include "nutools/EventDisplayBase/EventDisplay.h" 11 #include "TApplication.h" 15 #include "art_root_io/RootInput.h" 17 #include "cetlib_except/exception.h" 19 #include "nutools/EventDisplayBase/ServiceTable.h" 20 #include "nutools/EventDisplayBase/DisplayWindow.h" 21 #include "nutools/EventDisplayBase/Canvas.h" 22 #include "nutools/EventDisplayBase/RootEnv.h" 23 #include "nutools/EventDisplayBase/EventHolder.h" 24 #include "nutools/EventDisplayBase/NavState.h" 49 const char*
PrintTag()
const {
return "Test1"; }
51 static TText*
t =
new TText(0.5,0.5,
"-");
54 sprintf(buff,
"%d",count);
56 t->SetText(0.5,0.5,buff);
101 wordexp( fEchoPrintFile.c_str(), &
p, 0 );
109 std::string::size_type idx;
111 idx = fEchoPrintFile.rfind(
'.');
112 if(idx != std::string::npos) {
113 extension = fEchoPrintFile.substr(idx);
120 <<
"No file extension given to EchoPrintFile " 122 <<
" so cannot determine file format, disabling EchoPrint\n";
133 std::vector<art::Worker*>
const&)
163 TApplication* app = gROOT->GetApplication();
181 throw cet::exception(
"EventDisplay") <<
"Cannot find AutoPrintPattern" 184 throw cet::exception(
"EventDisplay") <<
"Cannot find AutoPrintPattern" 207 <<
" tempfile successfully renamed to " 212 <<
" to " << fEchoPrintFile
213 <<
" " << strerror(
errno) <<
"\n";
216 art::RootInput* rootInput =
dynamic_cast<art::RootInput*
>(
fInputSource);
221 <<
"Random access for the EventDisplay requires a RootInput source for proper operation.\n" 222 <<
"You do not have a RootInput source so only sequential access works.\n";
235 if(rootInput) rootInput->seekToEvent(0);
239 if(rootInput) rootInput->seekToEvent(-2);
243 if(rootInput) rootInput->seekToEvent(evt.
id());
249 if (!rootInput->seekToEvent(
id)) {
252 <<
" -- reloading current event.";
254 rootInput->seekToEvent(evt.
id());
261 <<
"EvengtDisplay in unhandled state " EventDisplay(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
static void RemoveFromListOfPrintables(evdb::Printable *p)
testCanvas1(TGMainFrame *mf)
static void Set(int which)
EventNumber_t event() const
GlobalSignal< detail::SignalResponseType::FIFO, void()> sPostBeginJob
int fAutoPrintMax
How many events to print (zero = disable printing).
static ServiceTable & Instance()
const char * Description() const
Base class for printable objects.
#define DEFINE_ART_SERVICE(svc)
std::string fEchoPrintFile
The file to dump that .gif to. Only one file, if you want a different file for each event...
unsigned int fAutoAdvanceInterval
Wait time in milliseconds.
bool fEchoPrint
Copy what you see in X to a .gif for each event.
static void SetServicesAll()
void postBeginJobWorkers(art::InputSource *inputs, std::vector< art::Worker * > const &workers)
TCanvas * fCanvas
The ROOT drawing canvas.
virtual const char * PrintTag() const =0
std::string fEchoPrintTempFile
a temporary file to enable atomic writes
void preProcessEvent(art::Event const &, art::ScheduleContext)
int errno
Contains the last error code.
Manage all things related to colors for the event display.
Configure the ROOT environment.
ART event display service.
GlobalSignal< detail::SignalResponseType::LIFO, void(InputSource *, std::vector< Worker * > const &)> sPostBeginJobWorkers
static std::map< std::string, evdb::Printable * > & GetPrintables()
static void SetRunEventAll(int run, int event)
void postProcessEvent(art::Event const &, art::ScheduleContext)
static EventHolder * Instance()
T get(std::string const &key) const
const char * PrintTag() const
static evdb::RootEnv gsRootEnv(0, 0)
GlobalSignal< detail::SignalResponseType::FIFO, void(Event const &, ScheduleContext)> sPreProcessEvent
GlobalSignal< detail::SignalResponseType::LIFO, void(Event const &, ScheduleContext)> sPostProcessEvent
static void DrawAll(const char *opt=0)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
static SubRunID invalidSubRun(RunID const &rID)
EventNumber_t event() const
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
void reconfigure(fhicl::ParameterSet const &pset)
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
int fAutoPrintCount
Number of events printed so far.
std::string fAutoPrintPattern
Pattern for printing output filenames. Must contain "%s" and "%d", in that order. ...
void SetEvent(art::Event const *evt)
cet::coded_exception< error, detail::translate > exception
art::InputSource * fInputSource
Input source of events.
virtual void Print(const char *filename)=0