BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
CalculateTruncation.cc
Go to the documentation of this file.
1//********************************************************************************
2// This file is part of the Widget, a package for performing dE/dx calibration.
3//
4// Author: Jake Bennett
5// Date: July 8, 2015
6//
7// CalculateTruncation recalculates the truncated means for a sample of tracks.
8//
9// For additional details, see the Widget document.
10//
11//********************************************************************************
12
13#include <string>
15
16int main( int argc, char* argv[] ) {
17
18 std::cout << std::endl << "*** Recalculating truncation ***" << std::endl << std::endl;
19
20 TString inputfile("");
21 TString outputfile("");
22
23 // ***************************
24 // Parse command line options
25 // ***************************
26
27 for (int i = 1; i < argc; i++){
28
29 std::string arg(argv[i]);
30
31 if (arg == "-f"){
32 if ((i+1 == argc) || (argv[i+1][0] == '-')) arg = "-h";
33 else inputfile = argv[++i]; }
34 if (arg == "-o"){
35 if ((i+1 == argc) || (argv[i+1][0] == '-')) arg = "-h";
36 else outputfile = argv[++i]; }
37 if (arg == "-h"){
38 std::cout << std::endl << " Usage for: " << argv[0] << std::endl << std::endl;
39 std::cout << "\t -f <file>\t Input file" << std::endl;
40 std::cout << "\t -o <file>\t Output file" << std::endl;
41 exit(1);
42 }
43 }
44
45 if( inputfile == "" || outputfile == "" ){
46 std::cout << std::endl << " Usage for: " << argv[0] << std::endl << std::endl;
47 std::cout << "\t -c <file>\t Configuration file" << std::endl;
48 std::cout << "\t -f <file>\t Input file" << std::endl;
49 std::cout << "\t -o <file>\t Output file" << std::endl;
50 exit(1);
51 }
52
53 // Create a widget interface and simulate the trucation
54 WidgetGenerator widget;
55 widget.simulateReconstruction(inputfile,outputfile);
56}
double arg(const EvtComplex &c)
Definition: EvtComplex.hh:227
void simulateReconstruction(TString infilename, TString outfilename)
int main()
Definition: test_IFile.cxx:11