forked from JeffersonLab/EVe_HallC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simEVe_new.C
47 lines (39 loc) · 1.02 KB
/
simEVe_new.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 EVe with hodtest.root . Can easily be updated to work with any compatible .root file, or dynamically input as in simEVe.C ///
#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[] = {
"/u/home/davispbr/hcana-copy/EVe/",
"./",
0
};
while( found==0 ) {
// cout << "Run number?\n";
// cin >> nrun;
//if( nrun<0 ) break;
path=paths;
while ( path && *path ) {
sprintf(filename,"hodtest.root");
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);
}