source: trunk/examples/extended/field/BlineTracer/README @ 1358

Last change on this file since 1358 was 807, checked in by garnier, 16 years ago

update

File size: 6.9 KB
Line 
1README file for the Geant4 BlineTracer module
2 
3Author : Laurent Desorgher (desorgher@phim.unibe.ch) - 04/10/2003
4
5              -------------------------------------------------
6
7The BlineTracer module allows to trace and visualise magnetic field
8lines in a Geant4 application where particle are tracked through the
9magnetic field (in future, these functionalities may be integrated in
10the Geant4 kernel).
11To use the tracer, the user should copy the classes provided here in
12his/her own application/example and create somewhere in his/her code
13an instance of a G4BlineTracer object.
14It can be anywhere (for example in the main code or in the user class
15defining the magnetic field):
16
17  #include "G4BlineTracer.hh"
18  G4BlineTracer* theBlineTool = new G4BlineTracer();
19
20
21Design principles:
22
23The core of the tool is the method ComputeBlines() of G4BlineTracer class.
24In this method a bline is computed by tracking a ChargedGeantino in the user
25defined magnetic field and by using a Bline equation of motion (class
26G4BlineEquation, motion along the field) instead of a Lorentz equation.   
27
28During the execution of this method :
29       
30        -The user defined  equations of motion associated to the different
31         global  and local fields are replaced by instances of G4BlineEquation
32         associated to the same fields.
33         The G4BlineEquation class defines the differential equation of a
34         magnetic field line.
35
36        -User defined ChordFinders are replaced by new ChordFinders
37         associated to the G4BlineEquation object.
38
39        -The user primary generator action, run action, event action and
40         stepping action are replaced by instances of the classes
41         G4BlinePrimaryGeneratorAction, G4BlineTracer, G4BlineEventAction
42         and G4BlineSteppingAction respectively. Other actions are set to
43         a NULL pointer.
44
45After the execution of the method, the original user defined actions, equation
46of motions and chord-finders are restored.       
47         
48In other words, the deafult run-action is temporarly replaced by a
49G4BlineTracer run-action using the same Geometry, physics and magnetic fields
50but with a different equation of motion and user actions.
51
52The  GeneratePrimaries() method of the G4BlinePrimaryGeneratorAction class
53call the GeneratePrimaries() method of the user defined PrimaryGeneratorAction
54for defining the start position and start time of tracking.
55Start position for user application and for Bline tracking are therefore
56controlled by the same UI commands.
57The type of particles to be tracked when tracing Blines is always set
58to Charged-Geantino. This allows to switch off the effect of electromagnetic
59and hadronics physics when tracing field lines.
60
61
62The G4BlineEventAction class is responsible to store computed magnetic field
63lines as a vector of Polylines and Polymarkers for later visualisation.
64These vectors can be drawn and reset at any time.
65
66The stepping action does nothing in this implementation but it can be used
67in future versions to limit field line tracing to physical volumes defined
68by the user. For this purpose a G4BlineStackingAction could also be
69implemented.
70
71User Manual:
72 
73  General description:
74
75The BlineTracer is controlled by the UI commands contained in the directory
76/vis/blineTracer. By calling the command 'computeBline', several magnetic field
77lines passing through user defined start positions are computed.
78Start positions are generated by the user primary generator action.
79By doing so, the definition of start positions is the same for usual particles
80tracking and magnetic field line tracking.
81
82A magnetic field line is computed as a track of a charged geantino that moves
83along the field line. The user can define the maximum length of a tracking step
84(only valid for Bline tracing purposes) by the use of the 'setMaxStepLength'
85command.
86By using small enough maximum step length, smooth magnetic field lines are
87obtained. By using the command 'stockLines' and 'stockPoints' the user
88can decide to store the series of tracking step positions defining 
89a magnetic field line as a Polyline object and/or a PolyMarker object
90(circles) respectively.
91These objects are stored in vectors of PolyLines and PolyMarkers.
92By using the command 'draw', these vectors are added to the scene
93of the visualisation manager, provided that a scene handler and
94visualisation driver have been properly created.
95The scene is visualised by invoking the vis command '/vis/show'.
96Polyline objects are visualised as line segments joining the different
97step positions defining a line, while for a Polymarker object markers
98(here circles), are  drawn at each step positions.
99By using the 'setColour' the user defines the visualisation colour
100that will be associated to the next computed magnetic field lines.
101By calling 'setPointSize' the user defines the size of visualisation markers
102that will be  associated to the next computed magnetic field lines.
103The user can remove the vector of Polymarker and Polyline from the memory
104by invoking 'resetMaterialToBeDrawn'.
105When using small max step size and polymarkers for visualisation purposes, the
106thickness of a smooth magnetic field line is obtained. It is controlled by the
107Marker size parameter ('setPointSize') 
108
109 Command description:
110        /vis/blineTracer/computeBline  nb_of_lines : 
111                Parameters: integer nb_of_lines     
112                Description: Compute nb_of_lines different magnetic field lines
113       
114        /vis/blineTracer/setMaxStepLength max_step_length :
115                Parameters: double max_step_length
116                Description: Set the maximum tracking step length for computing
117                             magnetic field lines
118                             
119        /vis/blineTracer/setColour  red green blue
120                Parameters: double red, green, blue
121                Description: Define  the colour for visualisation of the
122                            next computed magnetic field lines. The color is
123                            defined by a  RGB code (red,green,blue)  with all
124                            parameters smaller than 1.
125                           
126        /vis/blineTracer/stockLines aBool
127                Parameters: boolean aBool
128                Desscription: If true the next computed field lines are stored
129                              as Polylines for further visualisation
130        /vis/blineTracer/stockLines aBool
131                Parameters: boolean aBool
132                Desscription: If true the next computed field lines are stored
133                              as Polymarkers for further visualisation
134                             
135        /vis/blineTracer/setPointSize point_size
136                Parameters: double point_size
137                DEscription: set the size of the visualisation  markers
138                             that will be associated with the next computed
139                             magnetic field lines
140   
141        /vis/blineTracer/resetMaterialToBeDrawn
142                Parameters: none
143                Description: The vector of Polyline and Polymarker representing
144                             magnetic field lines to be visualised are removed
145                             from memory
146       
147        /tracking/storeTrajectory 1 :
148               If the storeTrajectory parameter is not set no field lines are
149               stored.               
150                             
151Current limitations & known problems:
152
153        The tool is working properly only for detectors parts where magnetic
154        field are defined. It is planned in the future to stop the tracking of
155        field lines in regions where no fields are existing.
Note: See TracBrowser for help on using the repository browser.