Skip to content

Commit

Permalink
Update filter.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
jiperl committed Oct 13, 2020
1 parent 783185b commit a1bf232
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parameters/scoring/filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,12 @@ You may specify more than one filter. For example, to score protons with initial
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV # minimum energy

You can invert the results of all previous filters by adding the InvertFilter::

b:Sc/MyScorer/InvertFilter = "True"

The InvertFilter inverts the final result of the full set of other filters.
Thus, the following would score only particles that are NOT ( (proton OR neutron) AND have initial KE larger than 100. MeV ).
Note that the NOT applies to the overall result from the set of other filters::
Note the double parenthesis after the NOT. The NOT applies to the overall result from the set of other filters::

sv:Sc/MyScorer/OnlyIncludeParticlesNamed = 2 "proton" "neutron"
d:Sc/MyScorer/OnlyIncludeParticlesWithInitialKEAbove = 100. MeV # minimum energy
Expand All @@ -193,18 +194,21 @@ Just to be more clear here: the InvertFilter is applied After all the other filt
It inverts the Total result of the other filters (rather than inverting them one at a time).

So, if you have filters::

A
B

Then the result is to allow particles that pass A AND B.

If you have filters::

A
B
Invert

Then the result is to allow particles that DO NOT PASS (A AND B)
which is logically equivalent to::

(NOT A) OR (NOT B)

(see how the And was replaced by an Or here)
Expand Down

0 comments on commit a1bf232

Please sign in to comment.