Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
main.cxx
Go to the documentation of this file.
1
2//
3// The Hall C analyzer interactive interface
4//
6
7#include "THcInterface.h"
8#include <iostream>
9#include <cstring>
10#include <string>
11#include <cstdlib>
12
13using namespace std;
14
15int main(int argc, char **argv)
16{
17 // Create a ROOT-style interactive interface
18
19 // Handle convenience command line options
20 bool no_logo = false;
21 for( int i=1; i<argc; ++i ) {
22 if( !strcmp(argv[i],"-l") )
23 no_logo = true;
24 else if( !strcmp(argv[1],"-v") || !strcmp(argv[1],"--version") ) {
25 cout << THcInterface::GetVersionString() << endl;
26 return 0;
27 }
28 }
29
30 if (!std::getenv("DB_DIR")) {
31 std::string db_dir_env = "DBASE";
32 if (setenv("DB_DIR", db_dir_env.c_str(), 1)) {
33 std::cout << "Failed to set env var DB_DIR\n";
34 } else {
35 std::cout << "DB_DIR set to DBASE\n";
36 }
37 }
38
39 TApplication *theApp =
40 new THcInterface( "The Hall C analyzer", &argc, argv,
41 nullptr, 0, no_logo );
42 theApp->Run(kFALSE);
43
44 cout << endl;
45
46 delete theApp;
47
48 return 0;
49}
const Bool_t kFALSE
virtual void Run(Bool_t retrn=kFALSE)
THcInterface is the interactive interface to the Hall C Analyzer.
static const char * GetVersionString()
int main(int argc, char *argv[])
STL namespace.