11 #include "TApplication.h" 15 #include "art_root_io/RootInput.h" 18 #include "cetlib_except/exception.h" 50 const char*
PrintTag()
const {
return "Test1"; }
52 static TText* t =
new TText(0.5,0.5,
"-");
55 sprintf(buff,
"%d",count);
57 t->SetText(0.5,0.5,buff);
102 wordexp( fEchoPrintFile.c_str(), &p, 0 );
104 fEchoPrintFile = std::string(*w);
110 std::string::size_type idx;
111 std::string extension;
112 idx = fEchoPrintFile.rfind(
'.');
113 if(idx != std::string::npos) {
114 extension = fEchoPrintFile.substr(idx);
121 <<
"No file extension given to EchoPrintFile " 123 <<
" so cannot determine file format, disabling EchoPrint\n";
134 std::vector<art::Worker*>
const&)
164 TApplication* app = gROOT->GetApplication();
182 throw cet::exception(
"EventDisplay") <<
"Cannot find AutoPrintPattern" 185 throw cet::exception(
"EventDisplay") <<
"Cannot find AutoPrintPattern" 208 <<
" tempfile successfully renamed to " 213 <<
" to " << fEchoPrintFile
214 <<
" " << strerror(errno) <<
"\n";
217 art::RootInput* rootInput =
dynamic_cast<art::RootInput*
>(
fInputSource);
222 <<
"Random access for the EventDisplay requires a RootInput source for proper operation.\n" 223 <<
"You do not have a RootInput source so only sequential access works.\n";
236 if(rootInput) rootInput->seekToEvent(0);
240 if(rootInput) rootInput->seekToEvent(-2);
244 if(rootInput) rootInput->seekToEvent(evt.
id());
250 if (!rootInput->seekToEvent(
id)) {
253 <<
" -- reloading current event.";
255 rootInput->seekToEvent(evt.
id());
262 <<
"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)
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.
std::string fEchoPrintFile
The file to dump that .gif to. Only one file, if you want a different file for each event...
Interface to services and their configurations.
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)
Manage all things related to colors for the event display.
Configure the ROOT environment.
Singleton to hold the current art::Event for the event display.
GlobalSignal< detail::SignalResponseType::LIFO, void(InputSource *, std::vector< Worker * > const &)> sPostBeginJobWorkers
The interactive event display.
Base class for define a detector display.
Setup the root environment.
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
Holds information about what action to take next.
EventNumber_t event() 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
A window containing a display of the detector or one of its components.
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