20int main(
int argc,
char* argv[] ) {
22 std::cout << std::endl <<
"*** Running the electron calibration ***" << std::endl << std::endl;
24 std::string configfile(
"electron.template.txt");
31 for (
int i = 1; i < argc; i++){
33 std::string
arg(argv[i]);
36 if ((i+1 == argc) || (argv[i+1][0] ==
'-'))
arg =
"-h";
37 else configfile = argv[++i]; }
39 if ((i+1 == argc) || (argv[i+1][0] ==
'-'))
arg =
"-h";
40 else ask = atoi(argv[++i]); }
42 std::cout << std::endl <<
" Usage for: " << argv[0] << std::endl << std::endl;
43 std::cout <<
"\t -c <file>\t Configuration file" << std::endl;
44 std::cout <<
"\t -i <int>\t Ask before each step? (0 = no, 1 = yes)" << std::endl;
49 if( configfile ==
"" ){
50 std::cout <<
"ERROR: No configuration file was given..." << std::endl;
55 std::string ready(
"y");
64 if( configfile !=
"" )
67 std::cout <<
"ElectronCorrection ERROR: No configuration file provided";
71 std::cout <<
"Done configuring settings..." << std::endl;
75 std::streambuf *coutbuf = std::cout.rdbuf();
76 std::ofstream out(
"widget.electron.log");
83 std::cout <<
"Do you want to apply corrections (y/n)? ";
84 std::cin >> ready; std::cout << std::endl;
86 if( ask == 0 || ready ==
"y" ){
87 std::cout <<
"Applying corrections..." << std::endl;
89 std::cout.rdbuf( out.rdbuf() );
91 std::cout.rdbuf( coutbuf );
95 std::cout << std::endl << std::endl <<
"DONE ELECTRON CORRECTION" << std::endl;
double arg(const EvtComplex &c)
void SetupFromConfigFile(std::string configfile)
void ApplyCorrections(TString outfile)