KaliVeda  1.13/01
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 "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 
51 class KVEventViewer : public KVBase {
52 protected:
60 
68 
71 
75 
81 
83 
84  ifstream eventFile;
87 
90 
93 
96 
98 
99 public:
103  kHighlightParameter
104  };
105  KVEventViewer(Int_t protoncolor = kRed - 2, Int_t neutroncolor = kBlue - 2,
106  Int_t highlightprotoncolor = kOrange - 2,
107  Int_t highlightneutroncolor = kGreen - 2,
108  Double_t freenucleonradius = 0.2,
109  Double_t nucleonradius = 0.25,
110  Double_t nuclearradiusparameter = 0.2);
111  virtual ~KVEventViewer();
112 
114  {
115  fproton_color = c;
116  }
118  {
119  fneutron_color = c;
120  }
122  {
123  fProton_color = c;
124  }
126  {
127  fNeutron_color = c;
128  }
129  void SetSavePicture(Bool_t yes = kTRUE)
130  {
131  fSavePicture = yes;
132  }
133 
136  {
137  free_nucleon_radius = r;
138  }
141  {
142  nucleon_radius = r;
143  }
144 
146  {
147  fMaxVelocity = vel;
148  }
149  void SetFixSeed(Bool_t fix, Int_t refresh = 1)
150  {
151  fFixSeed = fix;
152  fRefresh = refresh;
153  }
154  void SetXYMode(Bool_t mode)
155  {
156  fXYMode = mode;
157  }
159  void SetDrawMomentumSpace(Bool_t on = kTRUE)
160  {
161  fMomentumSpace = on;
162  }
163 
164  void DrawNucleus(KVNucleus&, const Char_t* frame = "");
165  void DrawEvent(KVEvent*, const Char_t* frame = "");
166  void DrawEvent(KVEvent*, const Char_t* frame = "") const;
167 
168  void SetInput(TBranch* eventbranch);
169  void SetInput(const char* filename);
170 
171  void ReadEvent();
172  void ReadTextEvent();
173  void ReadTreeEvent();
174 
175  void DrawNextEvent();
176 
177  virtual Bool_t SetHighlight(KVNucleus* n);
178  virtual void SetHighlightMode(Int_t m)
179  {
187  fHighlightMode = m;
188  }
189 
190  void SetAxesMode(Bool_t on = kTRUE)
191  {
193  fAxesMode = on;
194  }
195 
197  {
198  if (theEvent) theEvent->Print("ok");
199  }
200 
201  void SetFixPerspective(Bool_t on = kTRUE)
202  {
205 
206  fFixPerspective = on;
207  }
208 
209  ClassDef(KVEventViewer, 1) //Draw events in 3D using OpenGL
210 };
211 
212 #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:141
virtual void Print(Option_t *option="") const
Definition: KVBase.cpp:410
Draw events in 3D using OpenGL.
Definition: KVEventViewer.h:51
Long64_t NtreeEntries
Definition: KVEventViewer.h:89
void SetFixPerspective(Bool_t on=kTRUE)
Double_t nucleon_radius
radius of nucleons in nuclei
Definition: KVEventViewer.h:58
virtual void SetHighlightMode(Int_t m)
void SetXYMode(Bool_t mode)
Double_t fMaxVelocity
Definition: KVEventViewer.h:61
void SetHighlightProtonColor(Int_t c)
void SetAxesMode(Bool_t on=kTRUE)
Int_t fproton_color
proton colour
Definition: KVEventViewer.h:53
Double_t fScaleFactor
Definition: KVEventViewer.h:67
Int_t fProton_color
proton colour for highlighted nuclei
Definition: KVEventViewer.h:55
void SetHighlightNeutronColor(Int_t c)
Int_t eventCounter
Definition: KVEventViewer.h:85
TGeoVolume * top
Definition: KVEventViewer.h:79
void SetSavePicture(Bool_t yes=kTRUE)
Int_t fHighlightMode
Definition: KVEventViewer.h:94
void SetFixSeed(Bool_t fix, Int_t refresh=1)
TGeoMaterial * matNuc
Definition: KVEventViewer.h:73
Double_t nuclear_radius_parameter
to calculate radii of nuclei
Definition: KVEventViewer.h:59
void SetFreeNucleonRadius(Double_t r)
Set radius used to represent free nucleons (default value = 0.2)
TGeoMedium * Nuc
Definition: KVEventViewer.h:77
TGeoManager * geom
Definition: KVEventViewer.h:80
void SetNeutronColor(Int_t c)
Int_t fNeutron_color
neutron colour for highlighted nuclei
Definition: KVEventViewer.h:56
void SetDrawMomentumSpace(Bool_t on=kTRUE)
Draw event in momentum space (default is velocity space)
ifstream eventFile
Definition: KVEventViewer.h:84
TTree * theTree
Definition: KVEventViewer.h:88
Double_t maxV
largest velocity of event
Definition: KVEventViewer.h:91
void DumpCurrentEvent()
KVEvent * theEvent
Definition: KVEventViewer.h:82
TGeoMedium * Box
Definition: KVEventViewer.h:78
Double_t free_nucleon_radius
radius of free nucleons
Definition: KVEventViewer.h:57
TGeoMedium * EmptySpace
Definition: KVEventViewer.h:76
void SetProtonColor(Int_t c)
Int_t ivol
geovolume counter
Definition: KVEventViewer.h:69
Bool_t fSavePicture
kTRUE to save in GIF file
Definition: KVEventViewer.h:70
Int_t fneutron_color
neutron colour
Definition: KVEventViewer.h:54
Int_t maxZ
largest Z of event
Definition: KVEventViewer.h:92
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:95
Bool_t fMomentumSpace
kTRUE to show event in momentum space
Definition: KVEventViewer.h:66
Bool_t fFixPerspective
Definition: KVEventViewer.h:97
Bool_t textInput
Definition: KVEventViewer.h:86
TGeoMaterial * matBox
Definition: KVEventViewer.h:74
TGeoMaterial * matEmptySpace
Definition: KVEventViewer.h:72
Abstract base class container for multi-particle events.
Definition: KVEvent.h:66
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
long long Long64_t
const long double m
Definition: KVUnits.h:70