<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Peter,</p>
    <p>find enclosed my example of an instrument where the
      back-propagation fails.</p>
    <p>The source is an MCPL_input component and I added a small
      mcpl-input file, too.<br>
      The particles in the MCPL file all start at z=1.84m<br>
    </p>
    <p>Without gravitation back-propagation works, with gravitation it
      fails. <br>
    </p>
    <p>Any ideas, what could cause such a behavior?<br>
    </p>
    <p>Best, <br>
    </p>
    <p>Richard<br>
    </p>
    <p>PS: The PSI_source instrument you enclosed works for me (==
      back-propagation with gravity turned on)<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 26/07/2021 16:58, Peter Kjær
      Willendrup wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1E57F302-67AA-4797-8FFE-D194AC9E0D68@fysik.dtu.dk">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="" style="word-wrap:break-word;
        line-break:after-white-space">Hi Richard,
        <div class=""><br class="">
        </div>
        <div class=""><br class="">
        </div>
        <div class="">I just came back from vacation and had a look at
          the issue you report. ALLOW_BACKPROP ought to work
          irrespective of the gravity setting in fact.</div>
        <div class=""><br class="">
        </div>
        <div class="">I tried putting your snippet of code into the
          PSI_source instrument “behind” the source (see attached) - and
          I don’t seem to reproduce your finding? </div>
        <div class=""><br class="">
        </div>
        <div class="">Could the issue potentially be specific to the
          instrument you are using it in? If you send me a copy (plus
          need inputfiles etc.) I will have a closer look.</div>
        <div class=""><br class="">
        </div>
        <div class="">(Feel free to do this outside the mailinglist if
          you prefer. :) )</div>
        <div class=""><br class="">
        </div>
        <div class=""><br class="">
        </div>
        <div class="">Best,</div>
        <div class="">Peter</div>
        <div class=""><br class="">
        </div>
      </div>
      <div class="" style="word-wrap:break-word;
        line-break:after-white-space">
        <div class="">
          <div><br class="">
            <blockquote type="cite" class="">
              <div class="">On 18 Jul 2021, at 00.14, Richard Wagner
                <<a href="mailto:wagnerrichard@ill.fr" class=""
                  moz-do-not-send="true">wagnerrichard@ill.fr</a>>
                wrote:</div>
              <br class="x_Apple-interchange-newline">
              <div class=""><span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">Dear All,</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">I have the following issue
                  with a Shape Component in a simulation. It is used to
                  filter neutrons that have not are not originating from
                  the moderator window.</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <font class="" style="font-size:12px; font-style:normal;
                  font-weight:normal; letter-spacing:normal;
                  text-align:start; text-indent:0px;
                  text-transform:none; white-space:normal;
                  word-spacing:0px; text-decoration:none"
                  face="monospace"><br class="">
                  COMPONENT Mod_Face = Shape(xwidth=.30,yheight=.24)<br
                    class="">
                  AT (0,0,0.16) RELATIVE ABSOLUTE<br class="">
                  EXTEND %{<br class="">
                    /* Propagate back to a small rectangle in front of
                  moderator */<br class="">
                    printf("(before) x=%g y=%g z=%g\n", x, y, z);<br
                    class="">
                   <span class="x_Apple-converted-space"> </span><br
                    class="">
                    ALLOW_BACKPROP;<br class="">
                    PROP_Z0;<br class="">
                    SCATTER;<br class="">
                   <span class="x_Apple-converted-space"> </span><br
                    class="">
                    printf("(after) x=%g y=%g z=%g\n", x, y, z); <span
                    class="x_Apple-converted-space"> </span><br class="">
                    printf("(if) %d\n", (fabs(x)> xwidth/2 ||
                  fabs(y)> yheight/2));<br class="">
                    /* Remove neutrons that are not from around the
                  moderators */<br class="">
                    if (fabs(x)> xwidth/2 || fabs(y)> yheight/2)<span
                    class="x_Apple-converted-space"> </span><br class="">
                    {<br class="">
                      printf("(absorbed) x=%g y=%g z=%g\n", x, y, z);  <span
                    class="x_Apple-converted-space"> </span><br class="">
                      ABSORB;  <span class="x_Apple-converted-space"> </span><br
                    class="">
                    }<br class="">
                  %}</font><br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">If I run the McStas
                  simulation with the --gravitation flag the back
                  propagation is not working.</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">Log entries will exemplaryly
                  read:</span><br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(if) 0</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(before) x=0.131648 y=0.00568935 z=1.84</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(after) x=0.131648 y=0.00568935 z=1.84</span></div>
                <p class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)"></span></p>
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">And no neutrons will be
                  filtered out</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">With gravity set to 'off' I
                  get:</span><br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(before) x=0.110096 y=0.118489 z=1.84</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(after) x=-0.118996 y=-0.00294855 z=0</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(if) 0</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(before) x=-0.0518426 y=-0.0952835 z=1.84</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(after) x=0.519784 y=-0.514964 z=0</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(if) 1</span></div>
                <div class="" style="white-space:pre-wrap; font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; text-decoration:none; margin:0px">
<span class="" style="color:rgb(0,128,0)">(absorbed) x=0.519784 y=-0.514964 z=0</span></div>
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">So it works as intended.</span><br
                  class="" style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">Is this behavior as
                  expected? Or differently is backprop not working with
                  gravity turned on?</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">I use McStas 2.7 and need to
                  make the simulation with gravity.</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">Any ideas?</span><br
                  class="" style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">Best,</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">Richard</span><br class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <br class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <div class="x_moz-signature"
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                  --<span class="x_Apple-converted-space"> </span><br
                    class="">
                  <b class="">Richard Wagner</b><br class="">
                  Research Engineer<br class="">
                  Nuclear and Particle Physics Group<br class="">
                  Institut Laue-Langevin - ILL<br class="">
                  71, avenue des Martyrs<br class="">
                  CS 20156<br class="">
                  38042 Grenoble Cedex 9<br class="">
                  France<span class="x_Apple-converted-space"> </span><br
                    class="">
                  <br class="">
                  <a href="" class="" moz-do-not-send="true"><font
                      class="" color="#3984c6">www.ill.eu</font></a>
                  <div class="" style="white-space:pre-wrap">

</div>
                </div>
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">_______________________________________________</span><br
                  class="" style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <span class="" style="font-family:Helvetica;
                  font-size:12px; font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none; float:none;
                  display:inline!important">mcstas-users mailing list</span><br
                  class="" style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <a href="mailto:mcstas-users@mcstas.org" class=""
                  style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; orphans:auto; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; widows:auto; word-spacing:0px"
                  moz-do-not-send="true">mcstas-users@mcstas.org</a><br
                  class="" style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; word-spacing:0px;
                  text-decoration:none">
                <a
                  href="https://mailman2.mcstas.org/mailman/listinfo/mcstas-users"
                  class="" style="font-family:Helvetica; font-size:12px;
                  font-style:normal; font-weight:normal;
                  letter-spacing:normal; orphans:auto; text-align:start;
                  text-indent:0px; text-transform:none;
                  white-space:normal; widows:auto; word-spacing:0px"
                  moz-do-not-send="true">https://mailman2.mcstas.org/mailman/listinfo/mcstas-users</a></div>
            </blockquote>
          </div>
          <br class="">
        </div>
      </div>
    </blockquote>
    <div class="moz-signature">-- <br>
      <b>Richard Wagner</b><br>
      Research Engineer<br>
      Nuclear and Particle Physics Group<br>
      Institut Laue-Langevin - ILL<br>
      71, avenue des Martyrs<br>
      CS 20156<br>
      38042 Grenoble Cedex 9<br>
      France <br>
      <br>
      <a href="www.ill.eu"><font color="#3984c6">www.ill.eu</font></a>
      <p><br>
      </p>
    </div>
  </body>
</html>