| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>8.8. Trajectory Filtering</title><link rel="stylesheet" href="../xml/XSLCustomizationLayer/G4HTMLStylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="Geant4 User's Guide for Application Developers"><link rel="up" href="ch08.html" title="Chapter 8. Visualization"><link rel="prev" href="ch08s07.html" title="8.7. Enhanced Trajectory Drawing"><link rel="next" href="ch08s09.html" title="8.9. Polylines, Markers and Text"><script language="JavaScript">
|
|---|
| 2 | function remote_win(fName)
|
|---|
| 3 | {
|
|---|
| 4 | var url = "AllResources/Detector/geometry.src/" + fName;
|
|---|
| 5 | RemoteWin=window.open(url,"","resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=520,height=520")
|
|---|
| 6 | RemoteWin.creator=self
|
|---|
| 7 | }
|
|---|
| 8 | </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.8.
|
|---|
| 9 | Trajectory Filtering
|
|---|
| 10 | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch08s07.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Chapter 8.
|
|---|
| 11 | Visualization
|
|---|
| 12 | </th><td width="20%" align="right"> <a accesskey="n" href="ch08s09.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.VisFltr"></a>8.8.
|
|---|
| 13 | Trajectory Filtering
|
|---|
| 14 | </h2></div></div></div><p>
|
|---|
| 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 | </p><div class="itemizedlist"><ul type="disc" compact><li><p>
|
|---|
| 21 | <span class="bold"><strong>Soft filtering</strong></span>: In this mode,
|
|---|
| 22 | uninteresting trajectories are marked invisible. Hence, they are
|
|---|
| 23 | still written, but (depending
|
|---|
| 24 | on the driver) will not be displayed. Some drivers, for example the
|
|---|
| 25 | HepRepFile driver, will allow you to selectively view these soft
|
|---|
| 26 | filtered trajectories
|
|---|
| 27 | </p></li><li><p>
|
|---|
| 28 | <span class="bold"><strong>Hard filtering</strong></span>: In this mode,
|
|---|
| 29 | uninteresting trajectories are not drawn at all.
|
|---|
| 30 | This mode is especially useful if the job
|
|---|
| 31 | produces huge graphics files, dominated by data from uninteresting
|
|---|
| 32 | trajectories.
|
|---|
| 33 | </p></li></ul></div><p>
|
|---|
| 34 | </p><p>
|
|---|
| 35 | Trajectory filter models are used to apply filtering according to
|
|---|
| 36 | specific criteria. The following models are currently supplied with
|
|---|
| 37 | the Geant4 distribution:
|
|---|
| 38 |
|
|---|
| 39 | </p><div class="itemizedlist"><ul type="disc" compact><li><p>
|
|---|
| 40 | G4TrajectoryChargeFilter (chargeFilter)
|
|---|
| 41 | </p></li><li><p>
|
|---|
| 42 | G4TrajectoryParticleFilter (particleFilter)
|
|---|
| 43 | </p></li><li><p>
|
|---|
| 44 | G4TrajectoryOriginVolumeFilter (originVolumeFilter)
|
|---|
| 45 | </p></li><li><p>
|
|---|
| 46 | G4TrajectoryAttributeFilter (attributeFilter)
|
|---|
| 47 | </p></li></ul></div><p>
|
|---|
| 48 | </p><p>
|
|---|
| 49 | Multiple filters are automatically chained together, and can
|
|---|
| 50 | configured either interactively or in commands or in compiled code.
|
|---|
| 51 | The filters can be inverted, set to be inactive or set in a verbose
|
|---|
| 52 | mode. The above models are described briefly below, followed by
|
|---|
| 53 | some example configuration commands.
|
|---|
| 54 | </p><h5><a name="id519214"></a>
|
|---|
| 55 | G4TrajectoryChargeFilter
|
|---|
| 56 | </h5><p>
|
|---|
| 57 | This model filters trajectories according to charge. In standard
|
|---|
| 58 | running mode, only trajectories with charges matching those
|
|---|
| 59 | registered with the model will pass the filter.
|
|---|
| 60 | </p><h5><a name="id519227"></a>
|
|---|
| 61 | G4TrajectoryParticleFilter
|
|---|
| 62 | </h5><p>
|
|---|
| 63 | This model filters trajectories according to particle type. In
|
|---|
| 64 | standard running mode, only trajectories with particle types
|
|---|
| 65 | matching those registered with the model will pass the filter.
|
|---|
| 66 | </p><h5><a name="id519241"></a>
|
|---|
| 67 | G4TrajectoryOriginVolumeFilter
|
|---|
| 68 | </h5><p>
|
|---|
| 69 | This model filters trajectories according to originating volume
|
|---|
| 70 | name. In standard running mode, only trajectories with originating
|
|---|
| 71 | volumes matching those registered with the model will pass the
|
|---|
| 72 | filter.
|
|---|
| 73 | </p><h5><a name="id519255"></a>
|
|---|
| 74 | G4TrajectoryAttributeFilter
|
|---|
| 75 | </h5><p>
|
|---|
| 76 | This model filters trajectories based on the HepRep style attributes
|
|---|
| 77 | associated with trajectories. Each attribute drawer can be
|
|---|
| 78 | configured with interval and/or single value data. Single value data
|
|---|
| 79 | should override the interval data.
|
|---|
| 80 | Units should be specified on the command line if the attribute unit
|
|---|
| 81 | is specified either as a G4BestUnit or if the unit is part of the
|
|---|
| 82 | value string.
|
|---|
| 83 | </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisFltr.CntlComm"></a>8.8.1.
|
|---|
| 84 | Controlling from Commands
|
|---|
| 85 | </h3></div></div></div><p>
|
|---|
| 86 | Multiple trajectory filter models can be created and configured
|
|---|
| 87 | using commands in the "<code class="literal">/vis/filtering/trajectories/</code>"
|
|---|
| 88 | directory. All generated filter models are chained together
|
|---|
| 89 | automatically.
|
|---|
| 90 | </p><p>
|
|---|
| 91 | Model configuration commands are generated dynamically when a
|
|---|
| 92 | filter model is instantiated. These commands apply directly to that
|
|---|
| 93 | instance.
|
|---|
| 94 | </p><p>
|
|---|
| 95 | See the interactive help for more information on the available
|
|---|
| 96 | commands.
|
|---|
| 97 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisFltr.ExpComm"></a>8.8.2.
|
|---|
| 98 | Example commands
|
|---|
| 99 | </h3></div></div></div><p>
|
|---|
| 100 | #Create a particle filter. Configure to pass only gammas. Then
|
|---|
| 101 | </p><p>
|
|---|
| 102 | #invert to pass anything other than gammas. Set verbose
|
|---|
| 103 | printout,
|
|---|
| 104 | </p><p>
|
|---|
| 105 | #and then deactivate filter
|
|---|
| 106 |
|
|---|
| 107 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 108 | /vis/filtering/trajectories/create/particleFilter
|
|---|
| 109 | /vis/filtering/trajectories/particleFilter-0/add gamma
|
|---|
| 110 | /vis/filtering/trajectories/particleFilter-0/invert true
|
|---|
| 111 | /vis/filtering/trajectories/particleFilter-0/verbose true
|
|---|
| 112 | /vis/filtering/trajectories/particleFilter-0/active false
|
|---|
| 113 | </pre></div><p>
|
|---|
| 114 | </p><p>
|
|---|
| 115 | #Create a charge filter. Configure to pass only neutral
|
|---|
| 116 | trajectories.
|
|---|
| 117 | </p><p>
|
|---|
| 118 | #Set verbose printout. Reset filter and reconfigure to pass
|
|---|
| 119 | only
|
|---|
| 120 | </p><p>
|
|---|
| 121 | #negativly charged trajectories.
|
|---|
| 122 |
|
|---|
| 123 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 124 | /vis/filtering/trajectories/create/chargeFilter
|
|---|
| 125 | /vis/filtering/trajectories/chargeFilter-0/add 0
|
|---|
| 126 | /vis/filtering/trajectories/chargeFilter-0/verbose true
|
|---|
| 127 | /vis/filtering/trajectories/chargeFilter-0/reset true
|
|---|
| 128 | /vis/filtering/trajectories/chargeFilter-0/add -1
|
|---|
| 129 | </pre></div><p>
|
|---|
| 130 | </p><p>
|
|---|
| 131 | #Create an attribute filter named attributeFilter-0
|
|---|
| 132 |
|
|---|
| 133 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 134 | /vis/filtering/trajectories/create/attributeFilter
|
|---|
| 135 | </pre></div><p>
|
|---|
| 136 | </p><p>
|
|---|
| 137 | #Select attribute "IMag"
|
|---|
| 138 |
|
|---|
| 139 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 140 | /vis/filtering/trajectories/attributeFilter-0/setAttribute IMag
|
|---|
| 141 | </pre></div><p>
|
|---|
| 142 | </p><p>
|
|---|
| 143 | #Select trajectories with 2.5 MeV <= IMag< 1000 MeV
|
|---|
| 144 |
|
|---|
| 145 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 146 | /vis/filtering/trajectories/attributeFilter-0/addInterval 2.5 MeV 1000 MeV
|
|---|
| 147 | </pre></div><p>
|
|---|
| 148 | </p><p>
|
|---|
| 149 | #List filters
|
|---|
| 150 |
|
|---|
| 151 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 152 | /vis/filtering/trajectories/list
|
|---|
| 153 | </pre></div><p>
|
|---|
| 154 | </p><p>
|
|---|
| 155 | #Note that although particleFilter-0 and chargeFilter-0 are
|
|---|
| 156 | automatically
|
|---|
| 157 | </p><p>
|
|---|
| 158 | #chained, particleFilter-0 will not have any effect since
|
|---|
| 159 | </p><p>
|
|---|
| 160 | #it is has been deactivated.
|
|---|
| 161 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisFltr.HitFilt"></a>8.8.3.
|
|---|
| 162 | Hit Filtering
|
|---|
| 163 | </h3></div></div></div><p>
|
|---|
| 164 | The attribute based filtering can be used on hits as well as trajectories.
|
|---|
| 165 | To active the interactive attribute based hit filtering, a filter call
|
|---|
| 166 | should be added to the "Draw" method of the hit class:
|
|---|
| 167 |
|
|---|
| 168 | </p><div class="informalexample"><pre class="programlisting">
|
|---|
| 169 | void MyHit::Draw()
|
|---|
| 170 | {
|
|---|
| 171 | ...
|
|---|
| 172 | if (! pVVisManager->FilterHit(*this)) return;
|
|---|
| 173 | ...
|
|---|
| 174 | }
|
|---|
| 175 | </pre></div><p>
|
|---|
| 176 | </p><p>
|
|---|
| 177 | Interactive filtering can then be done through the commands in
|
|---|
| 178 | <code class="literal">/vis/filtering/hits</code>.
|
|---|
| 179 | </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch08s07.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ch08.html"><img src="AllResources/IconsGIF/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch08s09.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">8.7.
|
|---|
| 180 | Enhanced Trajectory Drawing
|
|---|
| 181 | </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="AllResources/IconsGIF/home.gif" alt="Home"></a></td><td width="40%" align="right" valign="top"> 8.9.
|
|---|
| 182 | Polylines, Markers and Text
|
|---|
| 183 | </td></tr></table></div></body></html>
|
|---|