Hall C ROOT/C++ Analyzer (hcana)
THcInterface.cxx
Go to the documentation of this file.
1 
11 #include "TROOT.h"
12 #include "THcInterface.h"
13 #include "TInterpreter.h"
14 #include "THcParmList.h"
15 #include "THcDetectorMap.h"
16 #include "THcGlobals.h"
17 #include "ha_compiledata.h"
18 #include "hc_compiledata.h"
19 #include <sstream>
20 
21 #include "TTree.h"
22 
23 #include <iostream>
24 //#include "TGXW.h"
25  //#include "TVirtualX.h"
26 
27 using namespace std;
28 
29 THcParmList* gHcParms = NULL; // List of symbolic analyzer variables
30 THcDetectorMap* gHcDetectorMap = NULL; // Global (Hall C style) detector map
31 
32 //_____________________________________________________________________________
33 THcInterface::THcInterface( const char* appClassName, int* argc, char** argv,
34  void* options, int numOptions, Bool_t noLogo ) :
35  THaInterface( appClassName, argc, argv, options, numOptions, kTRUE )
36 
37 {
47  if( !noLogo )
48  PrintLogo();
49 
50  SetPrompt("hcana [%d] ");
51  gHcParms = new THcParmList;
52 
53  // Jure update: 100 GB
54  TTree::SetMaxTreeSize(100000000000LL);
55 
56  fgAint = this;
57 }
58 
59 //_____________________________________________________________________________
61 {
62  // Destructor
63 
64  if( fgAint == this ) {
65  delete gHcDetectorMap; gHcDetectorMap=0;
66  }
67 }
68 
69 //_____________________________________________________________________________
70 #if ROOT_VERSION_CODE < ROOT_VERSION(5,18,0)
72 #else
74 #endif
75 {
77 
78  Int_t iday,imonth,iyear,mille;
79  static const char* months[] = {"Jan","Feb","Mar","Apr","May",
80  "Jun","Jul","Aug","Sep","Oct",
81  "Nov","Dec"};
82  const char* root_version = gROOT->GetVersion();
83  Int_t idatqq = gROOT->GetVersionDate();
84  iday = idatqq%100;
85  imonth = (idatqq/100)%100;
86  iyear = (idatqq/10000);
87  if ( iyear < 90 )
88  mille = 2000 + iyear;
89  else if ( iyear < 1900 )
90  mille = 1900 + iyear;
91  else
92  mille = iyear;
93  char* root_date = Form("%s %d %4d",months[imonth-1],iday,mille);
94 
95  // const char* halla_version = HA_VERSION;
96  // const char* halla_date = Form("%d %s %4d",24,months[2-1],2003);
97 
98 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,18,0)
99  if( !lite ) {
100 #endif
101  Printf(" ************************************************");
102  Printf(" * *");
103  Printf(" * W E L C O M E to the *");
104  Printf(" * H A L L C ++ A N A L Y Z E R *");
105  Printf(" * *");
106  Printf(" * hcana release %12s %16s *",HC_VERSION,HC_DATE);
107  Printf(" * PODD release %13s %16s *",HA_VERSION,HA_DATE);
108  Printf(" * ROOT %10s %16s *",root_version,root_date);
109  Printf(" * *");
110  Printf(" * For information visit *");
111  Printf(" * http://hallcweb.jlab.org/hcana/docs/ *");
112  Printf(" * *");
113  Printf(" ************************************************");
114 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,18,0)
115  }
116 #endif
117 
118 #ifdef R__UNIX
119  // if (!strcmp(gGXW->GetName(), "X11TTF"))
120  // Printf("\nFreeType Engine v1.1 used to render TrueType fonts.");
121 #endif
122 
123  gInterpreter->PrintIntro();
124 
125 }
126 
127 //_____________________________________________________________________________
129 {
130  // Get software version string (printed by analyzer -v)
131 
132  static TString version_string;
133 
134  if( version_string.IsNull() ) {
135  ostringstream ostr;
136  ostr << "hcana " << HC_VERSION << " ";
137  if( strlen(HC_GITVERS) > 0 )
138  ostr << "git @" << HC_GITVERS << " ";
139  ostr << THaInterface::GetVersionString();
140  version_string = ostr.str().c_str();
141  }
142  return version_string.Data();
143 }
144 
145 //_____________________________________________________________________________
147 
#define HA_DATE
#define gROOT
int Int_t
bool Bool_t
#define gInterpreter
static void SetMaxTreeSize(Long64_t maxsize=100000000000LL)
STL namespace.
static const char * GetVersionString()
THcDetectorMap * gHcDetectorMap
Class to read and hold a Hall C style detector map.
const char * Data() const
virtual void PrintLogo()
THcParmList * gHcParms
THcInterface is the interactive interface to the Hall C Analyzer.
Definition: THcInterface.h:14
char * Form(const char *fmt,...)
Bool_t IsNull() const
#define HC_VERSION
Definition: hc_compiledata.h:5
void Printf(const char *fmt,...)
#define HC_GITVERS
ClassImp(THcDCLookupTTDConv) THcDCLookupTTDConv
virtual ~THcInterface()
#define HC_DATE
Definition: hc_compiledata.h:6
THcInterface(const char *appClassName, int *argc, char **argv, void *options=NULL, int numOptions=0, Bool_t noLogo=kFALSE)
const Bool_t kTRUE
A list parameters and their values.
Definition: THcParmList.h:27
#define HA_VERSION