1 | <!-- ******************************************************** --> |
---|
2 | <!-- --> |
---|
3 | <!-- [History] --> |
---|
4 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 --> |
---|
5 | <!-- --> |
---|
6 | <!-- ******************************************************** --> |
---|
7 | |
---|
8 | <!-- ******************* Section (Level#1) ****************** --> |
---|
9 | <sect1 id="sect.VisFltr"> |
---|
10 | <title> |
---|
11 | Trajectory Filtering |
---|
12 | </title> |
---|
13 | |
---|
14 | <para> |
---|
15 | Trajectory filtering allows you to visualise a subset of available |
---|
16 | trajectories. This can be useful if you only want to view |
---|
17 | interesting trajectories and discard uninteresting ones. Trajectory |
---|
18 | filtering can be run in two modes: |
---|
19 | |
---|
20 | <itemizedlist spacing="compact"> |
---|
21 | <listitem><para> |
---|
22 | <emphasis role="bold">Soft filtering</emphasis>: In this mode, |
---|
23 | uninteresting trajectories are marked invisible. Hence, they are |
---|
24 | still written, but (depending |
---|
25 | on the driver) will not be displayed. Some drivers, for example the |
---|
26 | HepRepFile driver, will allow you to selectively view these soft |
---|
27 | filtered trajectories |
---|
28 | </para></listitem> |
---|
29 | <listitem><para> |
---|
30 | <emphasis role="bold">Hard filtering</emphasis>: In this mode, |
---|
31 | uninteresting trajectories are not drawn at all. |
---|
32 | This mode is especially useful if the job |
---|
33 | produces huge graphics files, dominated by data from uninteresting |
---|
34 | trajectories. |
---|
35 | </para></listitem> |
---|
36 | </itemizedlist> |
---|
37 | </para> |
---|
38 | |
---|
39 | <para> |
---|
40 | Trajectory filter models are used to apply filtering according to |
---|
41 | specific criteria. The following models are currently supplied with |
---|
42 | the Geant4 distribution: |
---|
43 | |
---|
44 | <itemizedlist spacing="compact"> |
---|
45 | <listitem><para> |
---|
46 | G4TrajectoryChargeFilter (chargeFilter) |
---|
47 | </para></listitem> |
---|
48 | <listitem><para> |
---|
49 | G4TrajectoryParticleFilter (particleFilter) |
---|
50 | </para></listitem> |
---|
51 | <listitem><para> |
---|
52 | G4TrajectoryOriginVolumeFilter (originVolumeFilter) |
---|
53 | </para></listitem> |
---|
54 | <listitem><para> |
---|
55 | G4TrajectoryAttributeFilter (attributeFilter) |
---|
56 | </para></listitem> |
---|
57 | </itemizedlist> |
---|
58 | </para> |
---|
59 | |
---|
60 | <para> |
---|
61 | Multiple filters are automatically chained together, and can |
---|
62 | configured either interactively or in commands or in compiled code. |
---|
63 | The filters can be inverted, set to be inactive or set in a verbose |
---|
64 | mode. The above models are described briefly below, followed by |
---|
65 | some example configuration commands. |
---|
66 | </para> |
---|
67 | |
---|
68 | <!-- ******* Bridgehead ******* --> |
---|
69 | <bridgehead renderas='sect4'> |
---|
70 | G4TrajectoryChargeFilter |
---|
71 | </bridgehead> |
---|
72 | |
---|
73 | <para> |
---|
74 | This model filters trajectories according to charge. In standard |
---|
75 | running mode, only trajectories with charges matching those |
---|
76 | registered with the model will pass the filter. |
---|
77 | </para> |
---|
78 | |
---|
79 | <!-- ******* Bridgehead ******* --> |
---|
80 | <bridgehead renderas='sect4'> |
---|
81 | G4TrajectoryParticleFilter |
---|
82 | </bridgehead> |
---|
83 | |
---|
84 | <para> |
---|
85 | This model filters trajectories according to particle type. In |
---|
86 | standard running mode, only trajectories with particle types |
---|
87 | matching those registered with the model will pass the filter. |
---|
88 | </para> |
---|
89 | |
---|
90 | <!-- ******* Bridgehead ******* --> |
---|
91 | <bridgehead renderas='sect4'> |
---|
92 | G4TrajectoryOriginVolumeFilter |
---|
93 | </bridgehead> |
---|
94 | |
---|
95 | <para> |
---|
96 | This model filters trajectories according to originating volume |
---|
97 | name. In standard running mode, only trajectories with originating |
---|
98 | volumes matching those registered with the model will pass the |
---|
99 | filter. |
---|
100 | </para> |
---|
101 | |
---|
102 | <!-- ******* Bridgehead ******* --> |
---|
103 | <bridgehead renderas='sect4'> |
---|
104 | G4TrajectoryAttributeFilter |
---|
105 | </bridgehead> |
---|
106 | |
---|
107 | <para> |
---|
108 | This model filters trajectories based on the HepRep style attributes |
---|
109 | associated with trajectories. Each attribute drawer can be |
---|
110 | configured with interval and/or single value data. Single value data |
---|
111 | should override the interval data. |
---|
112 | Units should be specified on the command line if the attribute unit |
---|
113 | is specified either as a G4BestUnit or if the unit is part of the |
---|
114 | value string. |
---|
115 | </para> |
---|
116 | |
---|
117 | |
---|
118 | <!-- ******************* Section (Level#2) ****************** --> |
---|
119 | <sect2 id="sect.VisFltr.CntlComm"> |
---|
120 | <title> |
---|
121 | Controlling from Commands |
---|
122 | </title> |
---|
123 | |
---|
124 | <para> |
---|
125 | Multiple trajectory filter models can be created and configured |
---|
126 | using commands in the "<literal>/vis/filtering/trajectories/</literal>" |
---|
127 | directory. All generated filter models are chained together |
---|
128 | automatically. |
---|
129 | </para> |
---|
130 | |
---|
131 | <para> |
---|
132 | Model configuration commands are generated dynamically when a |
---|
133 | filter model is instantiated. These commands apply directly to that |
---|
134 | instance. |
---|
135 | </para> |
---|
136 | |
---|
137 | <para> |
---|
138 | See the interactive help for more information on the available |
---|
139 | commands. |
---|
140 | </para> |
---|
141 | |
---|
142 | </sect2> |
---|
143 | |
---|
144 | |
---|
145 | <!-- ******************* Section (Level#2) ****************** --> |
---|
146 | <sect2 id="sect.VisFltr.ExpComm"> |
---|
147 | <title> |
---|
148 | Example commands |
---|
149 | </title> |
---|
150 | |
---|
151 | <para> |
---|
152 | #Create a particle filter. Configure to pass only gammas. Then |
---|
153 | </para> |
---|
154 | |
---|
155 | <para> |
---|
156 | #invert to pass anything other than gammas. Set verbose |
---|
157 | printout, |
---|
158 | </para> |
---|
159 | |
---|
160 | <para> |
---|
161 | #and then deactivate filter |
---|
162 | |
---|
163 | <informalexample> |
---|
164 | <programlisting> |
---|
165 | /vis/filtering/trajectories/create/particleFilter |
---|
166 | /vis/filtering/trajectories/particleFilter-0/add gamma |
---|
167 | /vis/filtering/trajectories/particleFilter-0/invert true |
---|
168 | /vis/filtering/trajectories/particleFilter-0/verbose true |
---|
169 | /vis/filtering/trajectories/particleFilter-0/active false |
---|
170 | </programlisting> |
---|
171 | </informalexample> |
---|
172 | </para> |
---|
173 | |
---|
174 | <para> |
---|
175 | #Create a charge filter. Configure to pass only neutral |
---|
176 | trajectories. |
---|
177 | </para> |
---|
178 | |
---|
179 | <para> |
---|
180 | #Set verbose printout. Reset filter and reconfigure to pass |
---|
181 | only |
---|
182 | </para> |
---|
183 | |
---|
184 | <para> |
---|
185 | #negativly charged trajectories. |
---|
186 | |
---|
187 | <informalexample> |
---|
188 | <programlisting> |
---|
189 | /vis/filtering/trajectories/create/chargeFilter |
---|
190 | /vis/filtering/trajectories/chargeFilter-0/add 0 |
---|
191 | /vis/filtering/trajectories/chargeFilter-0/verbose true |
---|
192 | /vis/filtering/trajectories/chargeFilter-0/reset true |
---|
193 | /vis/filtering/trajectories/chargeFilter-0/add -1 |
---|
194 | </programlisting> |
---|
195 | </informalexample> |
---|
196 | </para> |
---|
197 | |
---|
198 | <para> |
---|
199 | #Create an attribute filter named attributeFilter-0 |
---|
200 | |
---|
201 | <informalexample> |
---|
202 | <programlisting> |
---|
203 | /vis/filtering/trajectories/create/attributeFilter |
---|
204 | </programlisting> |
---|
205 | </informalexample> |
---|
206 | </para> |
---|
207 | |
---|
208 | <para> |
---|
209 | #Select attribute "IMag" |
---|
210 | |
---|
211 | <informalexample> |
---|
212 | <programlisting> |
---|
213 | /vis/filtering/trajectories/attributeFilter-0/setAttribute IMag |
---|
214 | </programlisting> |
---|
215 | </informalexample> |
---|
216 | </para> |
---|
217 | |
---|
218 | <para> |
---|
219 | #Select trajectories with 2.5 MeV <= IMag< 1000 MeV |
---|
220 | |
---|
221 | <informalexample> |
---|
222 | <programlisting> |
---|
223 | /vis/filtering/trajectories/attributeFilter-0/addInterval 2.5 MeV 1000 MeV |
---|
224 | </programlisting> |
---|
225 | </informalexample> |
---|
226 | </para> |
---|
227 | |
---|
228 | <para> |
---|
229 | #List filters |
---|
230 | |
---|
231 | <informalexample> |
---|
232 | <programlisting> |
---|
233 | /vis/filtering/trajectories/list |
---|
234 | </programlisting> |
---|
235 | </informalexample> |
---|
236 | </para> |
---|
237 | |
---|
238 | <para> |
---|
239 | #Note that although particleFilter-0 and chargeFilter-0 are |
---|
240 | automatically |
---|
241 | </para> |
---|
242 | |
---|
243 | <para> |
---|
244 | #chained, particleFilter-0 will not have any effect since |
---|
245 | </para> |
---|
246 | |
---|
247 | <para> |
---|
248 | #it is has been deactivated. |
---|
249 | </para> |
---|
250 | |
---|
251 | </sect2> |
---|
252 | |
---|
253 | <!-- ******************* Section (Level#2) ****************** --> |
---|
254 | <sect2 id="sect.VisFltr.HitFilt"> |
---|
255 | <title> |
---|
256 | Hit Filtering |
---|
257 | </title> |
---|
258 | |
---|
259 | <para> |
---|
260 | The attribute based filtering can be used on hits as well as trajectories. |
---|
261 | To active the interactive attribute based hit filtering, a filter call |
---|
262 | should be added to the "Draw" method of the hit class: |
---|
263 | |
---|
264 | <informalexample> |
---|
265 | <programlisting> |
---|
266 | void MyHit::Draw() |
---|
267 | { |
---|
268 | ... |
---|
269 | if (! pVVisManager->FilterHit(*this)) return; |
---|
270 | ... |
---|
271 | } |
---|
272 | </programlisting> |
---|
273 | </informalexample> |
---|
274 | </para> |
---|
275 | |
---|
276 | <para> |
---|
277 | Interactive filtering can then be done through the commands in |
---|
278 | <literal>/vis/filtering/hits</literal>. |
---|
279 | </para> |
---|
280 | |
---|
281 | |
---|
282 | </sect2> |
---|
283 | </sect1> |
---|