Warning, /geant4/examples/extended/field/BlineTracer/README is written in an unsupported language. File is not indexed.
0001 README file for the Geant4 BlineTracer module
0002
0003 Author : Laurent Desorgher (desorgher@phim.unibe.ch) - 04/10/2003
0004
0005 -------------------------------------------------
0006
0007 The BlineTracer module allows to trace and visualise magnetic field
0008 lines in a Geant4 application where particle are tracked through the
0009 magnetic field (in future, these functionalities may be integrated in
0010 the Geant4 kernel).
0011 To use the tracer, the user should copy the classes provided here in
0012 his/her own application/example and create somewhere in his/her code
0013 an instance of a G4BlineTracer object.
0014 It can be anywhere (for example in the main code or in the user class
0015 defining the magnetic field):
0016
0017 #include "G4BlineTracer.hh"
0018 G4BlineTracer* theBlineTool = new G4BlineTracer();
0019
0020
0021 Design principles:
0022
0023 The core of the tool is the method ComputeBlines() of G4BlineTracer class.
0024 In this method a bline is computed by tracking a ChargedGeantino in the user
0025 defined magnetic field and by using a Bline equation of motion (class
0026 G4BlineEquation, motion along the field) instead of a Lorentz equation.
0027
0028 During the execution of this method :
0029
0030 -The user defined equations of motion associated to the different
0031 global and local fields are replaced by instances of G4BlineEquation
0032 associated to the same fields.
0033 The G4BlineEquation class defines the differential equation of a
0034 magnetic field line.
0035
0036 -User defined ChordFinders are replaced by new ChordFinders
0037 associated to the G4BlineEquation object.
0038
0039 -The user primary generator action, run action, event action and
0040 stepping action are replaced by instances of the classes
0041 G4BlinePrimaryGeneratorAction, G4BlineTracer, G4BlineEventAction
0042 and G4BlineSteppingAction respectively. Other actions are set to
0043 a NULL pointer.
0044
0045 After the execution of the method, the original user defined actions, equation
0046 of motions and chord-finders are restored.
0047
0048 In other words, the deafult run-action is temporarly replaced by a
0049 G4BlineTracer run-action using the same Geometry, physics and magnetic fields
0050 but with a different equation of motion and user actions.
0051
0052 The GeneratePrimaries() method of the G4BlinePrimaryGeneratorAction class
0053 call the GeneratePrimaries() method of the user defined PrimaryGeneratorAction
0054 for defining the start position and start time of tracking.
0055 Start position for user application and for Bline tracking are therefore
0056 controlled by the same UI commands.
0057 The type of particles to be tracked when tracing Blines is always set
0058 to Charged-Geantino. This allows to switch off the effect of electromagnetic
0059 and hadronics physics when tracing field lines.
0060
0061
0062 The G4BlineEventAction class is responsible to store computed magnetic field
0063 lines as a vector of Polylines and Polymarkers for later visualisation.
0064 These vectors can be drawn and reset at any time.
0065
0066 The stepping action does nothing in this implementation but it can be used
0067 in future versions to limit field line tracing to physical volumes defined
0068 by the user. For this purpose a G4BlineStackingAction could also be
0069 implemented.
0070
0071 User Manual:
0072
0073 General description:
0074
0075 The BlineTracer is controlled by the UI commands contained in the directory
0076 /vis/blineTracer. By calling the command 'computeBline', several magnetic field
0077 lines passing through user defined start positions are computed.
0078 Start positions are generated by the user primary generator action.
0079 By doing so, the definition of start positions is the same for usual particles
0080 tracking and magnetic field line tracking.
0081
0082 A magnetic field line is computed as a track of a charged geantino that moves
0083 along the field line. The user can define the maximum length of a tracking step
0084 (only valid for Bline tracing purposes) by the use of the 'setMaxStepLength'
0085 command.
0086 By using small enough maximum step length, smooth magnetic field lines are
0087 obtained. By using the command 'stockLines' and 'stockPoints' the user
0088 can decide to store the series of tracking step positions defining
0089 a magnetic field line as a Polyline object and/or a PolyMarker object
0090 (circles) respectively.
0091 These objects are stored in vectors of PolyLines and PolyMarkers.
0092 By using the command 'draw', these vectors are added to the scene
0093 of the visualisation manager, provided that a scene handler and
0094 visualisation driver have been properly created.
0095 The scene is visualised by invoking the vis command '/vis/show'.
0096 Polyline objects are visualised as line segments joining the different
0097 step positions defining a line, while for a Polymarker object markers
0098 (here circles), are drawn at each step positions.
0099 By using the 'setColour' the user defines the visualisation colour
0100 that will be associated to the next computed magnetic field lines.
0101 By calling 'setPointSize' the user defines the size of visualisation markers
0102 that will be associated to the next computed magnetic field lines.
0103 The user can remove the vector of Polymarker and Polyline from the memory
0104 by invoking 'resetMaterialToBeDrawn'.
0105 When using small max step size and polymarkers for visualisation purposes, the
0106 thickness of a smooth magnetic field line is obtained. It is controlled by the
0107 Marker size parameter ('setPointSize')
0108
0109 Command description:
0110 /vis/blineTracer/computeBline nb_of_lines :
0111 Parameters: integer nb_of_lines
0112 Description: Compute nb_of_lines different magnetic field lines
0113
0114 /vis/blineTracer/setMaxStepLength max_step_length :
0115 Parameters: double max_step_length
0116 Description: Set the maximum tracking step length for computing
0117 magnetic field lines
0118
0119 /vis/blineTracer/setColour red green blue
0120 Parameters: double red, green, blue
0121 Description: Define the colour for visualisation of the
0122 next computed magnetic field lines. The color is
0123 defined by a RGB code (red,green,blue) with all
0124 parameters smaller than 1.
0125
0126 /vis/blineTracer/stockLines aBool
0127 Parameters: boolean aBool
0128 Description: If true the next computed field lines are stored
0129 as Polylines for further visualisation
0130 /vis/blineTracer/stockLines aBool
0131 Parameters: boolean aBool
0132 Description: If true the next computed field lines are stored
0133 as Polymarkers for further visualisation
0134
0135 /vis/blineTracer/setPointSize point_size
0136 Parameters: double point_size
0137 DEscription: set the size of the visualisation markers
0138 that will be associated with the next computed
0139 magnetic field lines
0140
0141 /vis/blineTracer/resetMaterialToBeDrawn
0142 Parameters: none
0143 Description: The vector of Polyline and Polymarker representing
0144 magnetic field lines to be visualised are removed
0145 from memory
0146
0147 /tracking/storeTrajectory 1 :
0148 If the storeTrajectory parameter is not set no field lines are
0149 stored.
0150
0151 An example for Bline visualisation is provided in the bline_vis.mac macro.
0152
0153 Current limitations & known problems:
0154
0155 The tool is working properly only for detectors parts where magnetic
0156 field are defined. It is planned in the future to stop the tracking of
0157 field lines in regions where no fields are existing.