KaliVeda
Toolkit for HIC analysis
KVEventViewer.h
1 
4 #ifndef __KVEVENTVIEWER_H
5 #define __KVEVENTVIEWER_H
6 
7 #include "KVEvent.h"
8 #include "TGeoManager.h"
9 #include "TGeoMaterial.h"
10 #include "TGeoMedium.h"
11 #include "TGeoVolume.h"
12 #include "Riostream.h"
13 using namespace std;
14 
15 class TBranch;
16 class TTree;
17 
52 class KVEventViewer : public KVBase {
53 protected:
54  Int_t fproton_color;
55  Int_t fneutron_color;
56  Int_t fProton_color;
57  Int_t fNeutron_color;
58  Double_t free_nucleon_radius;
59  Double_t nucleon_radius;
60  Double_t nuclear_radius_parameter;
61 
62  Double_t fMaxVelocity;
63  Bool_t fFixSeed;
64  Int_t fRefresh;
65  Int_t fSeed;
66  Bool_t fXYMode;
67  Bool_t fMomentumSpace;
68  Double_t fScaleFactor;
69 
70  Int_t ivol;
71  Bool_t fSavePicture;
72 
73  TGeoMaterial* matEmptySpace;
74  TGeoMaterial* matNuc;
75  TGeoMaterial* matBox;
76 
77  TGeoMedium* EmptySpace;
78  TGeoMedium* Nuc;
79  TGeoMedium* Box;
80  TGeoVolume* top;
81  TGeoManager* geom;
82 
83  KVEvent* theEvent;
84 
85  ifstream eventFile;
86  Int_t eventCounter;
87  Bool_t textInput;
88 
89  TTree* theTree;
90  Long64_t NtreeEntries;
91 
92  Double_t maxV;
93  Int_t maxZ;
94 
95  Int_t fHighlightMode;
96  Bool_t fAxesMode;
97 
98  Bool_t fFixPerspective;
99 
100 public:
104  kHighlightParameter
105  };
106  KVEventViewer(Int_t protoncolor = kRed - 2, Int_t neutroncolor = kBlue - 2,
107  Int_t highlightprotoncolor = kOrange - 2,
108  Int_t highlightneutroncolor = kGreen - 2,
109  Double_t freenucleonradius = 0.2,
110  Double_t nucleonradius = 0.25,
111  Double_t nuclearradiusparameter = 0.2);
112  virtual ~KVEventViewer();
113 
115  {
116  fproton_color = c;
117  }
119  {
120  fneutron_color = c;
121  }
123  {
124  fProton_color = c;
125  }
127  {
128  fNeutron_color = c;
129  }
130  void SetSavePicture(Bool_t yes = kTRUE)
131  {
132  fSavePicture = yes;
133  }
134 
137  {
138  free_nucleon_radius = r;
139  }
142  {
143  nucleon_radius = r;
144  }
145 
147  {
148  fMaxVelocity = vel;
149  }
150  void SetFixSeed(Bool_t fix, Int_t refresh = 1)
151  {
152  fFixSeed = fix;
153  fRefresh = refresh;
154  }
155  void SetXYMode(Bool_t mode)
156  {
157  fXYMode = mode;
158  }
160  void SetDrawMomentumSpace(Bool_t on = kTRUE)
161  {
162  fMomentumSpace = on;
163  }
164 
165  void DrawNucleus(KVNucleus&, const Char_t* frame = "");
166  void DrawEvent(KVEvent*, const Char_t* frame = "");
167  void DrawEvent(KVEvent*, const Char_t* frame = "") const;
168 
169  void SetInput(TBranch* eventbranch);
170  void SetInput(const char* filename);
171 
172  void ReadEvent();
173  void ReadTextEvent();
174  void ReadTreeEvent();
175 
176  void DrawNextEvent();
177 
178  virtual Bool_t SetHighlight(KVNucleus* n);
179  virtual void SetHighlightMode(Int_t m)
180  {
188  fHighlightMode = m;
189  }
190 
191  void SetAxesMode(Bool_t on = kTRUE)
192  {
194  fAxesMode = on;
195  }
196 
198  {
199  if (theEvent) theEvent->Print("ok");
200  }
201 
202  void SetFixPerspective(Bool_t on = kTRUE)
203  {
206 
207  fFixPerspective = on;
208  }
209 
210  ClassDef(KVEventViewer, 1) //Draw events in 3D using OpenGL
211 };
212 
213 #endif
int Int_t
ROOT::R::TRInterface & r
#define c(i)
bool Bool_t
char Char_t
double Double_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char mode
Base class for KaliVeda framework.
Definition: KVBase.h:140
void Print(Option_t *option="") const override
Definition: KVBase.cpp:412
Draw events in 3D using OpenGL.
Definition: KVEventViewer.h:52
void SetFixPerspective(Bool_t on=kTRUE)
virtual void SetHighlightMode(Int_t m)
void SetXYMode(Bool_t mode)
void SetHighlightProtonColor(Int_t c)
void SetAxesMode(Bool_t on=kTRUE)
void SetHighlightNeutronColor(Int_t c)
void SetSavePicture(Bool_t yes=kTRUE)
void SetFixSeed(Bool_t fix, Int_t refresh=1)
void SetFreeNucleonRadius(Double_t r)
Set radius used to represent free nucleons (default value = 0.2)
void SetNeutronColor(Int_t c)
void SetDrawMomentumSpace(Bool_t on=kTRUE)
Draw event in momentum space (default is velocity space)
void DumpCurrentEvent()
void SetProtonColor(Int_t c)
void SetNucleonRadius(Double_t r)
Set radius used to represent nucleons in nuclei (default value = 0.25)
void SetMaxVelocity(Int_t vel)
Abstract base class container for multi-particle events.
Definition: KVEvent.h:67
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
long long Long64_t
TMarker m