Functions
eventDisplay.cxx File Reference
#include "TEventDisplay.hxx"
#include "TEventChangeManager.hxx"
#include <TFile.h>
#include <TROOT.h>
#include <TSystem.h>
#include <TApplication.h>
#include <getopt.h>
#include <iostream>
#include <memory>

Go to the source code of this file.

Functions

void usage ()
 
int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 29 of file eventDisplay.cxx.

29  {
30  std::string fileName = "";
31  bool showGeometry = true;
32  std::vector<std::string> volumesToShow;
33 
34  while (1) {
35  int c = getopt(argc, argv, "?hgs:S");
36  if (c == -1) break;
37  switch (c) {
38  case 'g': {
39  // Show the geometry.
40  showGeometry = not showGeometry;
41  break;
42  }
43  case 's': {
44  volumesToShow.push_back(optarg);
45  break;
46  }
47  case 'S': {
48  volumesToShow.clear();
49  break;
50  }
51  case '?':
52  case 'h':
53  default:
54  usage();
55  return 1;
56  }
57  }
58 
59  // Check if there is an input file on the command line.
60  if (argc - optind > 0) {
61  fileName = argv[optind];
62  }
63 
64  TFile* eventSource = NULL;
65  if (!fileName.empty()) {
66  eventSource = new TFile(fileName.c_str());
67  }
68  if (!eventSource) {
69  usage();
70  return 1;
71  }
72 
73  TApplication theApp("EventDisplay", 0, 0);
74  theApp.ExitOnException(TApplication::kExit);
75 
77  ev.EventChange().SetShowGeometry(showGeometry);
78  for (std::vector<std::string>::iterator v = volumesToShow.begin();
79  v != volumesToShow.end(); ++v) {
81  }
82  ev.EventChange().SetEventSource(eventSource);
83 
84  theApp.Run(kFALSE);
85 
86  return 0;
87 }
intermediate_table::iterator iterator
void usage()
void SetShowGeometry(bool f)
Set the flag to show (or not show) the geometry.
std::string string
Definition: nybbler.cc:12
void SetEventSource(TFile *source)
EDep::TEventChangeManager & EventChange()
Return a reference to the event change manager.
fileName
Definition: dumpTree.py:9
static TEventDisplay & Get(void)
void AddVolumeToShow(const std::string &name)
Add the name of a volume to be drawn.
A singleton class for an event display based on EVE.
void showGeometry(std::string file, int vislevel, bool checkOverlaps)
Definition: showGeometry.cpp:9
void usage ( )

Definition at line 15 of file eventDisplay.cxx.

15  {
16  std::cout << "Usage: edep-disp [options] [input-file] " << std::endl;
17  std::cout << " The edep-sim event display: " << std::endl;
18  std::cout << " -g Toggle showing the geometry (on by default)."
19  << std::endl;
20  std::cout << " -s<name> Show volumes containing <name> (limit this to "
21  << std::endl
22  << " a few, or it's horribly slow."
23  << std::endl;
24  std::cout << " -S Clear the volumes that will be shown."
25  << std::endl;
26  std::cout << " -h This message." << std::endl;
27 }
QTextStream & endl(QTextStream &s)