4 #include "KVEventViewer.h"
13 #include "KVNucleusEvent.h"
28 : fproton_color(protoncolor), fneutron_color(neutroncolor),
29 fProton_color(highlightprotoncolor), fNeutron_color(highlightneutroncolor),
30 free_nucleon_radius(freenucleonradius),
31 nucleon_radius(nucleonradius),
32 nuclear_radius_parameter(nuclearradiusparameter)
57 fHighlightMode = kNoHighlight;
89 if (nucleus.
GetA() == 1) {
91 if (Z == 0) ball = geom->
MakeSphere(
"n", Nuc, 0., free_nucleon_radius);
92 else if (Z == 1) ball = geom->
MakeSphere(
"p", Nuc, 0., free_nucleon_radius);
94 if (Z == 0) color = (Highlight ? fNeutron_color : fneutron_color);
95 else if (Z == 1) color = (Highlight ? fProton_color : fproton_color);
101 double sph_rad =
pow(nuclear_radius_parameter, 3.) * (
N + Z);
103 for (
int i = 0; i <
N; i++) {
105 ball->
SetLineColor(Highlight ? fNeutron_color : fneutron_color);
111 for (
int i = 0; i < Z; i++) {
113 ball->
SetLineColor(Highlight ? fProton_color : fproton_color);
130 if (geom)
delete geom;
133 matEmptySpace =
new TGeoMaterial(
"EmptySpace", 0, 0, 0);
137 EmptySpace =
new TGeoMedium(
"Empty", 1, matEmptySpace);
141 top = geom->
MakeBox(
"WORLD", EmptySpace, 30, 30, 30);
147 if (fMomentumSpace) fScaleFactor = 1.e-2;
148 else fScaleFactor = 1.;
150 Double_t v = fScaleFactor * (fMomentumSpace ? nuc.GetFrame(frame,
kFALSE)->GetMomentum().Mag() :
151 nuc.GetFrame(frame,
kFALSE)->GetV().Mag());
152 if (
v > maxV) maxV =
v;
153 if (nuc.GetZ() > maxZ) maxZ = nuc.GetZ();
157 if (fFixPerspective) {
161 if (fMaxVelocity > 0) maxV = fMaxVelocity;
162 else fMaxVelocity = maxV;
164 else if (fMaxVelocity > 0) maxV = fMaxVelocity;
168 box->SetTransparency(100);
175 if (!(
event->GetNumber() % fRefresh)) fSeed += 7;
225 theTree = eventbranch->
GetTree();
240 if (!eventFile.good()) {
295 for (
int i = 0; i < nballs; i++) {
297 eventFile >> Z >> V[0] >> V[1] >> V[2];
314 if (eventCounter == (
Int_t)NtreeEntries) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Class for iterating over "OK" nuclei in events accessed through base pointer/reference.
virtual void SetNumber(UInt_t num)
Draw events in 3D using OpenGL.
virtual Bool_t SetHighlight(KVNucleus *n)
Decide whether or not to highlight this nucleus in the event display.
void ReadEvent()
Read an event from input source.
void DrawNextEvent()
Draw next event read from input source.
virtual ~KVEventViewer()
Destructor.
void DrawEvent(KVEvent *, const Char_t *frame="")
Draw all particles in event which are "ok".
void SetInput(TBranch *eventbranch)
Read events from branch of a TTree.
void DrawNucleus(KVNucleus &, const Char_t *frame="")
Draw nucleus.
Abstract base class container for multi-particle events.
void Clear(Option_t *opt="") override
An event container for KVNucleus objects.
Description of properties and kinematics of atomic nuclei.
Int_t GetN() const
Return the number of neutron.
Int_t GetZ() const
Return the number of proton / atomic number.
TVector3 GetMomentum() const
KVParticle const * GetFrame(const Char_t *frame, Bool_t warn_and_return_null_if_unknown=kTRUE) const
virtual void SetAddress(void *add)
void SetLight(ELight light, Bool_t on)
void SetGuideState(Int_t axesType, Bool_t axesDepthTest, Bool_t referenceOn, const Double_t *referencePos)
TGLLightSet * GetLightSet() const
TGLCamera & CurrentCamera() const
void SetCurrentCamera(ECameraType camera)
void SetSmoothPoints(Bool_t s)
void SetOrthoCamera(ECameraType camera, Double_t zoom, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate)
void SetSmoothLines(Bool_t s)
void SetClearColor(Color_t col)
void CloseGeometry(Option_t *option="d")
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
void SetTopVolume(TGeoVolume *vol)
void SetNsegments(Int_t nseg)
void SetVisContainers(Bool_t flag=kTRUE) override
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
void Draw(Option_t *option="") override
void SetLineColor(Color_t lcolor) override
virtual void SetSeed(ULong_t seed=0)
virtual Double_t Uniform(Double_t x1, Double_t x2)
virtual void Sphere(Double_t &x, Double_t &y, Double_t &z, Double_t r)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual Long64_t GetEntries() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RVec< PromoteTypes< T0, T1 > > pow(const T0 &x, const RVec< T1 > &v)
void Error(UserClass p, const char *location, const char *va_(fmt),...)
void Warning(UserClass p, const char *location, const char *va_(fmt),...)