Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
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// Workaround for SCons build
28#ifndef HC_GITREV
29#define HC_GITREV HC_GITVERS
30#endif
31#ifndef HC_BUILDTIME
32#define HC_BUILDTIME HC_DATETIME
33#endif
34#ifndef HC_SOURCETIME
35#define HC_SOURCETIME HC_DATETIME
36#endif
37
38using namespace std;
39
40THcParmList* gHcParms = NULL; // List of symbolic analyzer variables
41THcDetectorMap* gHcDetectorMap = NULL; // Global (Hall C style) detector map
42
43//_____________________________________________________________________________
44THcInterface::THcInterface( const char* appClassName, int* argc, char** argv,
45 void* options, int numOptions, Bool_t noLogo ) :
46 THaInterface( appClassName, argc, argv, options, numOptions, kTRUE )
47
48{
58 if( !noLogo )
60
61 THaInterface::SetPrompt("hcana [%d] ");
63
64 // Jure update: 100 GB
65 TTree::SetMaxTreeSize(100000000000LL);
66
67 fgAint = this;
68}
69
70//_____________________________________________________________________________
72{
73 // Destructor
74
75 if( fgAint == this ) {
77 }
78}
79
80//_____________________________________________________________________________
82{
84
85 Int_t iday,imonth,iyear,mille;
86 static const char* months[] = {"Jan","Feb","Mar","Apr","May",
87 "Jun","Jul","Aug","Sep","Oct",
88 "Nov","Dec"};
89 const char* root_version = gROOT->GetVersion();
90 Int_t idatqq = gROOT->GetVersionDate();
91 iday = idatqq%100;
92 imonth = (idatqq/100)%100;
93 iyear = (idatqq/10000);
94 if ( iyear < 90 )
95 mille = 2000 + iyear;
96 else if ( iyear < 1900 )
97 mille = 1900 + iyear;
98 else
99 mille = iyear;
100 char* root_date = Form("%s %d %4d",months[imonth-1],iday,mille);
101
102 if( !lite ) {
103 Printf(" ************************************************");
104 Printf(" * *");
105 Printf(" * W E L C O M E to the *");
106 Printf(" * H A L L C ++ A N A L Y Z E R *");
107 Printf(" * *");
108 Printf(" * hcana release %12s %16s *", HC_VERSION "", GetHcDate());
109 Printf(" * PODD release %13s %16s *", HA_VERSION "", GetHaDate());
110 Printf(" * ROOT %10s %16s *", root_version, root_date);
111 Printf(" * *");
112 Printf(" * For information visit *");
113 Printf(" * http://hallcweb.jlab.org/hcana/docs/ *");
114 Printf(" * *");
115 Printf(" ************************************************");
116 }
117
118 gInterpreter->PrintIntro();
119}
120
121//_____________________________________________________________________________
123{
124 static TString hc_date;
125
126 if( hc_date.IsNull() ) {
127 bool use_buildtime = true;
128 size_t len = strlen(HC_GITREV "");
129 if( len > 0 ) {
130 const char* gitrev = HC_GITREV "";
131 use_buildtime = (len > 6 && strcmp(gitrev + len - 6, "-dirty") == 0);
132 }
133 if( use_buildtime )
134 hc_date = extract_short_date(HC_BUILDTIME "");
135 else
136 hc_date = extract_short_date(HC_SOURCETIME "");
137 }
138 return hc_date.Data();
139}
140
141//_____________________________________________________________________________
143{
144 // Get software version string (printed by analyzer -v)
145
146 static TString version_string;
147
148 if( version_string.IsNull() ) {
149 ostringstream ostr;
150 ostr << "hcana " << HC_VERSION "";
151 if( strlen(HC_GITREV "") > 0 )
152 ostr << " git@" << HC_GITREV "";
153 ostr << " " << GetHcDate() << endl;
155 version_string = ostr.str().c_str();
156 }
157 return version_string.Data();
158}
159
160//_____________________________________________________________________________
int Int_t
bool Bool_t
const Bool_t kTRUE
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
ClassImp(VDC::AnalyticTTDConv) using namespace std
R__EXTERN class THcParmList * gHcParms
Definition THcGlobals.h:11
R__EXTERN class THcDetectorMap * gHcDetectorMap
Definition THcGlobals.h:12
#define HC_GITREV
#define HC_SOURCETIME
THcParmList * gHcParms
#define HC_BUILDTIME
THcDetectorMap * gHcDetectorMap
#define gInterpreter
#define gROOT
char * Form(const char *fmt,...)
void Printf(const char *fmt,...)
static const char * GetVersionString()
static TString extract_short_date(const char *long_date)
static const char * GetHaDate()
virtual const char * SetPrompt(const char *newPrompt)
static THaInterface * fgAint
Class to read and hold a Hall C style detector map.
THcInterface is the interactive interface to the Hall C Analyzer.
static const char * GetHcDate()
virtual ~THcInterface()
THcInterface(const char *appClassName, int *argc, char **argv, void *options=NULL, int numOptions=0, Bool_t noLogo=kFALSE)
virtual void PrintLogo(Bool_t lite=kFALSE)
static const char * GetVersionString()
A list parameters and their values.
Definition THcParmList.h:27
const char * Data() const
Bool_t IsNull() const
STL namespace.