Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
edep-sim
display
eventDisplay.cxx
Go to the documentation of this file.
1
#include "
TEventDisplay.hxx
"
2
#include "
TEventChangeManager.hxx
"
3
4
#include <TFile.h>
5
6
#include <TROOT.h>
7
#include <TSystem.h>
8
#include <TApplication.h>
9
10
#include <getopt.h>
11
12
#include <iostream>
13
#include <memory>
14
15
void
usage
() {
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
}
28
29
int
main
(
int
argc,
char
**
argv
) {
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
76
EDep::TEventDisplay
& ev =
EDep::TEventDisplay::Get
();
77
ev.
EventChange
().
SetShowGeometry
(showGeometry);
78
for
(
std::vector<std::string>::iterator
v = volumesToShow.begin();
79
v != volumesToShow.end(); ++v) {
80
ev.
EventChange
().
AddVolumeToShow
(*v);
81
}
82
ev.
EventChange
().
SetEventSource
(eventSource);
83
84
theApp.Run(kFALSE);
85
86
return
0;
87
}
88
89
iterator
intermediate_table::iterator iterator
Definition:
intermediate_table.cc:27
usage
void usage()
Definition:
eventDisplay.cxx:15
EDep::TEventChangeManager::SetShowGeometry
void SetShowGeometry(bool f)
Set the flag to show (or not show) the geometry.
Definition:
TEventChangeManager.hxx:44
string
std::string string
Definition:
nybbler.cc:12
EDep::TEventChangeManager::SetEventSource
void SetEventSource(TFile *source)
Definition:
TEventChangeManager.cxx:107
EDep::TEventDisplay::EventChange
EDep::TEventChangeManager & EventChange()
Return a reference to the event change manager.
Definition:
TEventDisplay.hxx:27
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
dumpTree.fileName
fileName
Definition:
dumpTree.py:9
ValidateOpDetSimulation.c
dictionary c
Definition:
ValidateOpDetSimulation.py:57
EDep::TEventDisplay::Get
static TEventDisplay & Get(void)
Definition:
TEventDisplay.cxx:18
EDep::TEventChangeManager::AddVolumeToShow
void AddVolumeToShow(const std::string &name)
Add the name of a volume to be drawn.
Definition:
TEventChangeManager.hxx:48
main
int main(int argc, char **argv)
Definition:
eventDisplay.cxx:29
TEventChangeManager.hxx
EDep::TEventDisplay
A singleton class for an event display based on EVE.
Definition:
TEventDisplay.hxx:13
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
TEventDisplay.hxx
showGeometry
void showGeometry(std::string file, int vislevel, bool checkOverlaps)
Definition:
showGeometry.cpp:9
Generated by
1.8.11