1 |
// |
2 |
// CaloLEVEL2.cc -- standalone program to call the CaloLEVEL2 macro. |
3 |
// by Emiliano Mocchiutti |
4 |
// |
5 |
// Version 1.00 (2005/08/05) |
6 |
// |
7 |
// Changelog: |
8 |
// |
9 |
// 0.00 - 1.00 : working. |
10 |
// |
11 |
#include <TString.h> |
12 |
#include <iostream> |
13 |
// |
14 |
extern short int CaloLEVEL2(TString , TString , TString , TString , int ); |
15 |
extern void info(); |
16 |
// |
17 |
using namespace std; |
18 |
// |
19 |
int main(int numinp, char *inps[]){ |
20 |
int force = 0; |
21 |
TString name; |
22 |
TString trkdir; |
23 |
TString outdir; |
24 |
TString frame; |
25 |
if ( numinp < 6 ){ |
26 |
if ( numinp > 1 ){ |
27 |
if ( !strcmp(inps[1],"--version") ){ |
28 |
info(); |
29 |
return(0); |
30 |
}; |
31 |
if ( !strcmp(inps[1],"-h") || !strcmp(inps[1],"--help") ){ |
32 |
printf("\nUsage:\n\n CaloLEVEL2 file tracker_dir output_dir framework force \n"); |
33 |
printf("\n - file must be in the form: /path/to/filesfromyoda/dw_000000_00000/ \n"); |
34 |
printf( " - tracker_dir is the path to the tracker data directory \n"); |
35 |
printf( " - output_dir is the path where to store output \n"); |
36 |
printf( " - framework is the type of output data you want, can be \"root\" or \"paw\"\n"); |
37 |
printf( " - force can be 0 (the program will abort at any problem) or 1 \n (the program will try to process data anyway)\n"); |
38 |
printf("\nExample: \n\nCaloLEVEL2 /home/pamela/filesfromyoda/dw_050301_00100/ \"\" /tmp/ paw 1 \n\n"); |
39 |
return(0); |
40 |
}; |
41 |
}; |
42 |
printf("\n Welcome to CaloLEVEL2! \n"); |
43 |
// |
44 |
printf("\n You must provide the following input parameters: \n\n"); |
45 |
// |
46 |
char input[256]; |
47 |
// |
48 |
printf(" Path to YODA unpacked directory: \n "); |
49 |
cin.getline(input,256); |
50 |
name = (TString)input; |
51 |
printf(" Path to the tracker data directory: \n "); |
52 |
cin.getline(input,256); |
53 |
trkdir = (TString)input; |
54 |
printf(" Path to the output directory: \n "); |
55 |
cin.getline(input,256); |
56 |
outdir = (TString)input; |
57 |
printf(" Framework (root/paw): \n "); |
58 |
cin.getline(input,256); |
59 |
frame = (TString)input; |
60 |
printf(" FORCE (0/1): \n "); |
61 |
cin.getline(input,256); |
62 |
force = atoi(input); |
63 |
// |
64 |
} else { |
65 |
printf("\n Welcome to CaloLEVEL2! \n"); |
66 |
name = (TString)inps[1]; |
67 |
trkdir = (TString)inps[2]; |
68 |
outdir = (TString)inps[3]; |
69 |
frame = (TString)inps[4]; |
70 |
force = atoi(inps[5]); |
71 |
}; |
72 |
// |
73 |
int error = CaloLEVEL2(name,trkdir,outdir,frame,force); |
74 |
// |
75 |
return(error); |
76 |
} |