-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathViewer.cc
129 lines (90 loc) · 2.68 KB
/
Viewer.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include <POCAImageViewer.h>
#include <EMLLImageViewer.h>
#include <ACFImageViewer.h>
#include <ClusteringImageViewer.h>
#include <TApplication.h>
#include <iostream>
#include <vector>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
using namespace std;
using namespace MuonPortalNS;
void viewPOCA(int argc, char *argv[],std::string filename);
void viewFOF(int argc, char *argv[],std::string filename);
void viewLL(int argc, char *argv[],std::string filename);
void viewACF(int argc, char *argv[],std::string filename);
void usage();
static const struct option options_tab[] = {
/* name, has_arg, &flag, val */
{ "help", no_argument, 0, 'h' },
{ "poca", required_argument, 0, 'p' },
{ "likelihood", required_argument, 0, 'l' },
{ "acf", required_argument, 0, 'a' },
{ "fof", required_argument, 0, 'f' },
{(char*)0, (int)0, (int*)0, (int)0}
};
int main(int argc, char *argv[]){
int c = 0;
int option_index = 0;
std::string inputFileName= "";
while((c = getopt_long(argc, argv, "hplafi:",options_tab, &option_index)) != -1) {
switch (c) {
case 'h':
usage();
exit(0);
case 'p':
inputFileName= string(optarg);
viewPOCA(argc, argv,inputFileName);
break;
case 'l':
inputFileName= string(optarg);
viewLL(argc, argv,inputFileName);
break;
case 'a':
inputFileName= string(optarg);
viewACF(argc, argv,inputFileName);
break;
case 'f':
inputFileName= string(optarg);
viewFOF(argc, argv,inputFileName);
break;
default:
cout<<"default"<<endl;
usage();
exit(0);
}
}//close while
cout << endl;
//theApp.Run();
return 0;
}//close main
void viewPOCA(int argc, char *argv[],std::string filename){
TApplication theApp("App",&argc,argv);
new POCAImageViewer(gClient->GetRoot(),1000,700,filename);
theApp.Run();
}//close viewPOCA()
void viewLL(int argc, char *argv[],std::string filename){
TApplication theApp("App",&argc,argv);
new EMLLImageViewer(gClient->GetRoot(),1000,700,filename);
theApp.Run();
}//close viewLL()
void viewACF(int argc, char *argv[],std::string filename){
TApplication theApp("App",&argc,argv);
new ACFImageViewer(gClient->GetRoot(),1000,500,filename);
theApp.Run();
}//close viewACF()
void viewFOF(int argc, char *argv[],std::string filename){
TApplication theApp("App",&argc,argv);
new ClusteringImageViewer(gClient->GetRoot(),1000,500,filename);
theApp.Run();
}//close viewFOF()
void usage(){
cout<<endl;
cout<<"*** PROGRAM USAGE ***"<<endl;
cout<<"Viewer --[option] [input file]"<<endl;
cout<<" [option]"<<endl;
cout<<" poca: poca viewer "<<endl;
cout<<""<<endl;
}//close usage()