KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVEventViewer.h
Go to the documentation of this file.
1 
4 #ifndef __KVEVENTVIEWER_H
5 #define __KVEVENTVIEWER_H
6 
7 #include "KVBase.h"
8 #include "KVEvent.h"
9 #include "TGeoManager.h"
10 #include "TGeoMaterial.h"
11 #include "TGeoMedium.h"
12 #include "TGeoVolume.h"
13 #include "Riostream.h"
14 using namespace std;
15 
16 class TBranch;
17 class TTree;
18 
52 class KVEventViewer : public KVBase {
53 protected:
61 
69 
72 
76 
82 
84 
85  ifstream eventFile;
88 
91 
94 
97 
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)
char Char_t
bool Bool_t
double Double_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:135
Draw events in 3D using OpenGL.
Definition: KVEventViewer.h:52
Long64_t NtreeEntries
Definition: KVEventViewer.h:90
void SetFixPerspective(Bool_t on=kTRUE)
Double_t nucleon_radius
radius of nucleons in nuclei
Definition: KVEventViewer.h:59
virtual void SetHighlightMode(Int_t m)
void SetXYMode(Bool_t mode)
Double_t fMaxVelocity
Definition: KVEventViewer.h:62
void SetHighlightProtonColor(Int_t c)
void SetAxesMode(Bool_t on=kTRUE)
Int_t fproton_color
proton colour
Definition: KVEventViewer.h:54
Double_t fScaleFactor
Definition: KVEventViewer.h:68
Int_t fProton_color
proton colour for highlighted nuclei
Definition: KVEventViewer.h:56
void SetHighlightNeutronColor(Int_t c)
Int_t eventCounter
Definition: KVEventViewer.h:86
TGeoVolume * top
Definition: KVEventViewer.h:80
void SetSavePicture(Bool_t yes=kTRUE)
Int_t fHighlightMode
Definition: KVEventViewer.h:95
void SetFixSeed(Bool_t fix, Int_t refresh=1)
TGeoMaterial * matNuc
Definition: KVEventViewer.h:74
Double_t nuclear_radius_parameter
to calculate radii of nuclei
Definition: KVEventViewer.h:60
void SetFreeNucleonRadius(Double_t r)
Set radius used to represent free nucleons (default value = 0.2)
TGeoMedium * Nuc
Definition: KVEventViewer.h:78
TGeoManager * geom
Definition: KVEventViewer.h:81
void SetNeutronColor(Int_t c)
Int_t fNeutron_color
neutron colour for highlighted nuclei
Definition: KVEventViewer.h:57
void SetDrawMomentumSpace(Bool_t on=kTRUE)
Draw event in momentum space (default is velocity space)
ifstream eventFile
Definition: KVEventViewer.h:85
TTree * theTree
Definition: KVEventViewer.h:89
Double_t maxV
largest velocity of event
Definition: KVEventViewer.h:92
void DumpCurrentEvent()
KVEvent * theEvent
Definition: KVEventViewer.h:83
TGeoMedium * Box
Definition: KVEventViewer.h:79
Double_t free_nucleon_radius
radius of free nucleons
Definition: KVEventViewer.h:58
TGeoMedium * EmptySpace
Definition: KVEventViewer.h:77
void SetProtonColor(Int_t c)
Int_t ivol
geovolume counter
Definition: KVEventViewer.h:70
Bool_t fSavePicture
kTRUE to save in GIF file
Definition: KVEventViewer.h:71
Int_t fneutron_color
neutron colour
Definition: KVEventViewer.h:55
Int_t maxZ
largest Z of event
Definition: KVEventViewer.h:93
void SetNucleonRadius(Double_t r)
Set radius used to represent nucleons in nuclei (default value = 0.25)
void SetMaxVelocity(Int_t vel)
Bool_t fAxesMode
Definition: KVEventViewer.h:96
Bool_t fMomentumSpace
kTRUE to show event in momentum space
Definition: KVEventViewer.h:67
Bool_t fFixPerspective
Definition: KVEventViewer.h:98
Bool_t textInput
Definition: KVEventViewer.h:87
TGeoMaterial * matBox
Definition: KVEventViewer.h:75
TGeoMaterial * matEmptySpace
Definition: KVEventViewer.h:73
Base class container for multi-particle events.
Definition: KVEvent.h:176
virtual void Print(Option_t *t="") const
Definition: KVEvent.cpp:224
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
long long Long64_t
const long double m
Definition: KVUnits.h:70