GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Application.h
1 /*
2  * Application.h
3  *
4  * Created on: 16 Mar 2017
5  * Author: Valerio Formato
6  */
7 
8 /*
9  * This is our TApplication class. This defines most of the operating logic of
10  * the program. It also acts as the signal/slot hub. All signals go to some
11  * slot in this class to avoid confusion.
12  */
13 
14 #include "RQ_OBJECT.h"
15 
16 #include <argp.h>
17 #include <cstdio>
18 #include <fstream>
19 #include <iostream>
20 #include <math.h>
21 #include <signal.h>
22 #include <stdlib.h>
23 
24 #include "TApplication.h"
25 #include "TChain.h"
26 #include "TColor.h"
27 #include "TEveGeoNode.h"
28 #include "TEveManager.h"
29 #include "TFile.h"
30 #include "TGLViewer.h"
31 #include "TGeometry.h"
32 #include "TStyle.h"
33 #include "TSystem.h"
34 #include "TTimeStamp.h"
35 #include "TTree.h"
36 
37 #include "application/event/GGSFileManager.h"
38 #include "application/gui/MainWindow.h"
39 #include "geometry/GeoManager.h"
40 
41 #ifndef _EDAPPLICATION_
42 #define _EDAPPLICATION_
43 
44 class EDApplication : public TApplication {
45  RQ_OBJECT("EDApplication")
46 
47 public:
48  EDApplication(int argc, char **argv);
49  ~EDApplication();
50 
51  GGSFileManager *GetFileManager() { return _FileManager; };
52  LeonardGeoManager *GetGeoManager() { return _GeoManager; };
53 
54  void LoadRootFile();
55  void NextEvent();
56  void PrevEvent();
57  void LoadEvent();
58  void SetFileToBeLoaded(char *text);
59  void SetEventToBeLoaded(char *text);
60  void SetDisplayDetector(char *det);
61  void SetDisplayPartHits(Bool_t s);
62 
63 private:
64  void HandleArgs();
65  void InitGUI();
66  void LoadGeometry();
67 
68  MainWindow *_MainWindow;
69  LeonardGeoManager *_GeoManager;
70  GGSFileManager *_FileManager;
71 
72  TString _fileToBeLoaded;
73  TString _fileLoaded;
74 
75  Int_t _evtToBeLoaded;
76  Int_t _evtLoaded;
77 
78  // For argument parsing
79  static struct argp_option options[];
80  static struct argp argp;
81 
82  static int ParseArgs(int key, char *arg, struct argp_state *state);
83 
84  struct arguments {
85  const char *infilename;
86  const char *geofilename;
87  Bool_t flag_debug;
88  };
89  struct arguments args;
90 
91  ClassDef(EDApplication, 1)
92 };
93 
94 #endif