12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Visualization• Track ID• Z Cell ID• Phi Cell ID• Energy Deposited• Energy Deposited by Track• Position• Logical VolumeYou can add additional attributes of your choosing by modifying the relevant part of the hit class (look <strong>for</strong> themethods GetAttDefs and CreateAttValues).8.5.8. Visualization of textIn <strong>Geant4</strong> Visualization, a text, i.e., a character string, is described by class G4Text inheriting G4VMarker as wellas G4Square and G4Circle. There<strong>for</strong>e, the way to visualize text is the same as <strong>for</strong> hits. The corresponding drawingmethod of G4VVisManager is://----- Drawing methods of G4Textvirtual void G4VVisManager::Draw (const G4Text&, ...);The real implementation of this method is described in class G4VisManager.8.5.9. Visualization of polylines and tracking stepsPolylines, i.e., sets of successive line segments, are described by class G4Polyline. For G4Polyline, the followingdrawing method of class G4VVisManager is prepared://----- A drawing method of G4Polylinevirtual void G4VVisManager::Draw (const G4Polyline&, ...) ;The real implementation of this method is described in class G4VisManager.Using this method, C++ source codes to visualize G4Polyline are described as follows://----- C++ source code: How to visualize a polylineG4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();if (pVVisManager) {G4Polyline polyline ;}..... (C++ source codes to set vertex positions, color, etc)pVVisManager -> Draw(polyline);//----- end of C++ source codesTracking steps are able to be visualized based on the above visualization of G4Polyline. You can visualize trackingsteps at each step automatically by writing a proper implementation of class MySteppingAction inheritingG4UserSteppingAction, and also with the help of the Run Manager.First, you must implement a method, MySteppingAction::UserSteppingAction(). A typical implementationof this method is as follows://----- C++ source code: An example of visualizing tracking stepsvoid MySteppingAction::UserSteppingAction()249

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!