Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHEventDisplay.h
Go to the documentation of this file.
1 
10 #ifndef __PHEVENTDISPLAY_H__
11 #define __PHEVENTDISPLAY_H__
12 
13 #include <fun4all/SubsysReco.h>
14 #include <string>
15 #include <vector>
16 
17 #ifndef __CINT__
18 #include<boost/shared_ptr.hpp>
19 #include<boost/thread/thread.hpp>
20 #else
21 class shared_ptr;
22 #endif
23 
24 #include <pthread.h>
25 
26 class PHEveDisplay;
27 class PHCompositeNode;
28 class TEveManager;
29 class TGLViewer;
30 class TGLAutoRotator;
31 class mPHEveModuleBase;
32 class TEveWindowSlot;
33 
34 class PHEventDisplay : public SubsysReco
35 {
36 public:
37  PHEventDisplay(int w,
38  int h,
39  bool _use_fieldmap,
40  bool _use_geofile,
41  const std::string& _mapname,
42  const std::string& _geoname);
43 
45 
47  int Init(PHCompositeNode *topNode);
49  int InitRun(PHCompositeNode *topNode);
51  int process_event(PHCompositeNode *topNode);
53  int End(PHCompositeNode *topNode);
54 
56  //void run_evt_in_thread();
57  void start_rotation();
58  void go_fullscreen();
59  void set_jet_pt_threshold(float pt){jet_pt_threshold = pt;}
60  void set_jet_e_scale(float e_scale){jet_e_scale = e_scale;}
61  void set_calo_e_threshold(float e){calo_e_threshold = e;}
62  void set_dc_on(bool dc_on) {is_dc_on = dc_on;}
63  void set_hodo_on(bool hodo_on) {is_hodo_on = hodo_on;}
64  void set_prop_on(bool prop_on){is_prop_on = prop_on;}
65  void set_truth_on(bool truth_on) {is_truth_on = truth_on;}
66  void set_verbosity(int verb) {verbosity = verb;}
67 
68  void set_view_top();
69  void set_view_side();
70  void set_view_3d();
71 
72 private:
73  void reco_thread();
74  void draw_default(PHCompositeNode *topNode);
75  void update_scene(PHCompositeNode *topNode);
76 
77 #ifndef _CLING__
79 
80  template<typename T> boost::shared_ptr<T>
81  register_module()
82  {
83  pBase ptr = pBase(new T(_PHEveDisplay)); // Store in a base type shared_ptr
84  _modules.push_back(ptr);
85  return boost::dynamic_pointer_cast<T>(ptr); // Cast back to derived for return
86  }
87 #endif
88 
89  bool _pending_update;
90 
92 #ifndef _CLING__
93  std::vector<boost::shared_ptr<mPHEveModuleBase> > _modules;
94  pthread_mutex_t _mutex;
95  boost::shared_ptr<boost::thread> _update_thread;
96  boost::shared_ptr<PHEveDisplay> _PHEveDisplay;
97 #endif
98 
99  TGLAutoRotator* _rot;
100 
101 #ifndef _CLING__
102  boost::shared_ptr<boost::thread> _status_thread;
103 #endif
104  float jet_pt_threshold;
105  float jet_e_scale;
106  float calo_e_threshold;
107 
108  bool is_dc_on;
109  bool is_hodo_on;
110  bool is_prop_on;
111  bool is_truth_on;
112 
113  bool use_fieldmap;
114  bool use_geofile;
115  int width;
116  int height;
117  std::string mapname;
118  std::string geoname;
119  int nevent;
120  int verbosity;
121 
122  TEveWindowSlot* _slot_dc;
123  TEveWindowSlot* _slot_dc_00;
124  TEveWindowSlot* _slot_dc_01;
125  TEveWindowSlot* _slot_dc_10;
126  TEveWindowSlot* _slot_dc_11;
127 
128 
129  TEveWindowSlot* _slot_hodo;
130  TEveWindowSlot* _slot_hodo_xz;
131  TEveWindowSlot* _slot_hodo_yz;
132 
133 
134 };
135 
136 #endif // __PHEVENTDISPLAY_H__
int InitRun(PHCompositeNode *topNode)
Run initialization.
void set_jet_e_scale(float e_scale)
void set_verbosity(int verb)
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
Definition: shared_ptr.hpp:516
int Init(PHCompositeNode *topNode)
Module initialization.
int process_event(PHCompositeNode *topNode)
Event processing.
void set_jet_pt_threshold(float pt)
void set_dc_on(bool dc_on)
int End(PHCompositeNode *topNode)
End of process.
void set_prop_on(bool prop_on)
void start_rotation()
Threaded access to Fun4All server.
void set_truth_on(bool truth_on)
PHEventDisplay(int w, int h, bool _use_fieldmap, bool _use_geofile, const std::string &_mapname, const std::string &_geoname)
void set_hodo_on(bool hodo_on)
void set_calo_e_threshold(float e)