1 | |
2 | #include <stdlib.h> |
3 | |
4 | #include <iostream> |
5 | #include <string> |
6 | using namespace std; |
7 | |
8 | |
9 | |
10 | extern string INFILE; |
11 | extern string OUTFILE; |
12 | extern bool POSTSMEAR; |
13 | extern string MCSMEAROPTS; |
14 | extern bool DELETEUNSMEARED; |
15 | |
16 | |
17 | extern "C" int hdgeant_(void); |
18 | |
19 | |
20 | int main(int narg, char *argv[]) |
21 | { |
22 | |
23 | int res = hdgeant_(); |
24 | |
25 | |
26 | if(POSTSMEAR){ |
27 | string cmd = "mcsmear "+MCSMEAROPTS+" "+OUTFILE; |
28 | cout<<endl; |
29 | cout<<"Smearing data with:"<<endl; |
30 | cout<<endl; |
31 | cout<<cmd<<endl; |
32 | cout<<endl; |
33 | int retcode; |
34 | retcode = system(cmd.c_str()); |
| Value stored to 'retcode' is never read |
35 | |
36 | if(DELETEUNSMEARED){ |
37 | cmd = "rm -f "+OUTFILE; |
38 | cout<<endl; |
39 | cout<<"Deleting unsmeared file:"<<endl; |
40 | cout<<" "<<cmd<<endl; |
41 | retcode = system(cmd.c_str()); |
42 | } |
43 | }else{ |
44 | if(DELETEUNSMEARED){ |
45 | cerr<<endl; |
46 | cerr<<"The DELETEUNSMEARED flag is set indicating that you want the output file"<<endl; |
47 | cerr<<"\""<<OUTFILE<<"\" to be deleted. However, the POSTSMEAR flag is not set"<<endl; |
48 | cerr<<"so no smeared data file was created so deleting the unsmeared file is"<<endl; |
49 | cerr<<"most likely NOT what you want to do. Therefore, I'm ignoring the"<<endl; |
50 | cerr<<"DELETEUNSMEARED flag. "<<__FILE__"hdgeant.cc"<<":"<<__LINE__50<<endl; |
51 | } |
52 | } |
53 | |
54 | return res; |
55 | } |
56 | |