forked from JeffersonLab/EVe_HallC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simEVe.C
47 lines (39 loc) · 939 Bytes
/
simEVe.C
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
{
/// Macro for running files of the type %s/e04007_det_%d.root ///
#include <TGClient.h>
gSystem->Load("libGeom");
gSystem->Load("libEVe.so");
int nrun, nev;
int found = 0;
const char** path = 0;
char filename[300];
FILE *fd;
const char* paths[] = {
"./ROOTfiles"
0
};
while( found==0 ) {
cout << "Run number?\n";
cin >> nrun;
if( nrun<0 ) break;
path=paths;
while ( path && *path ) {
sprintf(filename,"%s/test_%5d.root",*path,nrun);
cout << filename << endl;
fd = fopen(filename,"r");
if (fd != NULL) {
found = 1;
cout << "Will analyze file "<<filename<<endl;
break;
}
path++;
}
if ( (!path || !*path) && !found ) {
cout << "File not found. Try again, or -1 to quit.\n";
}
}
if(nrun<0) return;
cout << "Opening file "<<filename<<endl;
EVe *sim = new EVe(gClient->GetRoot(),950,678);
sim->initRun(filename);
}