FairRoot/PandaRoot
RecoCompleteMain.cxx
Go to the documentation of this file.
1 // Example of a compiled program to perform a full simulation run: a compiled
2 // version of the reco_complete_tpc.C macro.
3 //
4 // Elwin Dijck, December 2009
5 // JGM, January 2010
6 
7 #include "RecoComplete.h"
8 
9 #include <TRint.h>
10 #include <TROOT.h>
11 
12 #include <iostream>
13 #include <sstream>
14 
15 
16 using namespace std;
17 
18 
19 template <typename Type>
20 Type StrTo(char const *str);
21 
22 
23 int main(int argc, char *argv[])
24 {
25  // Start application.
26  gROOT->SetBatch();
27  TApplication app("RecoComplete", &argc, argv, 0, -1);
28 
29  // Read the command line options or provide default values.
30 
31  TString mcFile = argc > 1 ? argv[1] : "sim_complete.root";
32  TString dgFile = argc > 2 ? argv[2] : "digi_complete.root";
33  TString parFile = argc > 3 ? argv[3] : "simparams.root";
34  TString digiFile = argc > 4 ? argv[4] : "all.par";
35  TString outFile = argc > 5 ? argv[5] : "reco_complete.root";
36 
37  cout << boolalpha;
38 
39  cout << endl << "Starting reco simulation with TPC:" << endl
40  << " input MC file : " << mcFile << endl
41  << " input DIG file : " << dgFile << endl
42  << " output file : " << outFile << endl
43  << " params file : " << parFile << endl
44  << " input digi params file : " << digiFile << endl << endl;
45 
46  // Start the simulation.
47  RecoComplete(mcFile, dgFile, parFile, digiFile, outFile);
48 
49  return 0;
50 }
51 
52 
53 // Helper function to convert an argument to any type.
54 template <typename Type>
55 Type StrTo(char const *str)
56 {
57  istringstream iss(str);
58 
59  iss >> boolalpha; // Use true/false instead of 1/0 for booleans.
60 
61  Type result;
62  iss >> result;
63 
64  return result;
65 }
TString outFile
Definition: hit_dirc.C:17
TString digiFile
Definition: bump_emc.C:20
void RecoComplete(TString const &mcFile, TString const &dgFile, TString const &parFile, TString const &digiFile, TString const &outFile)
TString parFile
Definition: hit_dirc.C:14
TString mcFile
Definition: runMvdTpcReco.C:22
int main(int argc, char *argv[])
Type StrTo(char const *str)