Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1b88096 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
asogaard committed Nov 30, 2023
1 parent dc22878 commit 2094390
Showing 9 changed files with 159 additions and 7 deletions.
1 change: 1 addition & 0 deletions _modules/graphnet/data/constants.html
Original file line number Diff line number Diff line change
@@ -367,6 +367,7 @@ <h1 id="modules-graphnet-data-constants--page-root">Source code for graphnet.dat
<span class="n">ICECUBE86</span> <span class="o">=</span> <span class="p">[</span>
<span class="s2">"energy"</span><span class="p">,</span>
<span class="s2">"energy_track"</span><span class="p">,</span>
<span class="s2">"energy_cascade"</span><span class="p">,</span>
<span class="s2">"position_x"</span><span class="p">,</span>
<span class="s2">"position_y"</span><span class="p">,</span>
<span class="s2">"position_z"</span><span class="p">,</span>
14 changes: 11 additions & 3 deletions _modules/graphnet/data/extractors/i3truthextractor.html
Original file line number Diff line number Diff line change
@@ -434,6 +434,7 @@ <h1 id="modules-graphnet-data-extractors-i3truthextractor--page-root">Source cod
<span class="s2">"track_length"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
<span class="s2">"stopped_muon"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
<span class="s2">"energy_track"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
<span class="s2">"energy_cascade"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
<span class="s2">"inelasticity"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
<span class="s2">"DeepCoreFilter_13"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
<span class="s2">"CascadeFilter_13"</span><span class="p">:</span> <span class="n">padding_value</span><span class="p">,</span>
@@ -503,10 +504,15 @@ <h1 id="modules-graphnet-data-extractors-i3truthextractor--page-root">Source cod
<span class="k">try</span><span class="p">:</span>
<span class="p">(</span>
<span class="n">energy_track</span><span class="p">,</span>
<span class="n">energy_cascade</span><span class="p">,</span>
<span class="n">inelasticity</span><span class="p">,</span>
<span class="p">)</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_primary_track_energy_and_inelasticity</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">:</span> <span class="c1"># track energy fails on northeren tracks with ""Hadrons" has no mass implemented. Cannot get total energy."</span>
<span class="n">energy_track</span><span class="p">,</span> <span class="n">inelasticity</span> <span class="o">=</span> <span class="p">(</span><span class="n">padding_value</span><span class="p">,</span> <span class="n">padding_value</span><span class="p">)</span>
<span class="n">energy_track</span><span class="p">,</span> <span class="n">energy_cascade</span><span class="p">,</span> <span class="n">inelasticity</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">padding_value</span><span class="p">,</span>
<span class="n">padding_value</span><span class="p">,</span>
<span class="n">padding_value</span><span class="p">,</span>
<span class="p">)</span>

<span class="n">output</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="p">{</span>
@@ -523,6 +529,7 @@ <h1 id="modules-graphnet-data-extractors-i3truthextractor--page-root">Source cod
<span class="n">frame</span><span class="p">,</span> <span class="n">padding_value</span>
<span class="p">),</span>
<span class="s2">"energy_track"</span><span class="p">:</span> <span class="n">energy_track</span><span class="p">,</span>
<span class="s2">"energy_cascade"</span><span class="p">:</span> <span class="n">energy_cascade</span><span class="p">,</span>
<span class="s2">"inelasticity"</span><span class="p">:</span> <span class="n">inelasticity</span><span class="p">,</span>
<span class="p">}</span>
<span class="p">)</span>
@@ -702,7 +709,7 @@ <h1 id="modules-graphnet-data-extractors-i3truthextractor--page-root">Source cod
<span class="k">def</span> <span class="nf">_get_primary_track_energy_and_inelasticity</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">frame</span><span class="p">:</span> <span class="s2">"icetray.I3Frame"</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">"""Get the total energy of tracks from primary, and inelasticity.</span>

<span class="sd"> Args:</span>
@@ -725,9 +732,10 @@ <h1 id="modules-graphnet-data-extractors-i3truthextractor--page-root">Source cod

<span class="n">energy_total</span> <span class="o">=</span> <span class="n">primary</span><span class="o">.</span><span class="n">total_energy</span>
<span class="n">energy_track</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">(</span><span class="n">track</span><span class="o">.</span><span class="n">total_energy</span> <span class="k">for</span> <span class="n">track</span> <span class="ow">in</span> <span class="n">tracks</span><span class="p">)</span>
<span class="n">energy_cascade</span> <span class="o">=</span> <span class="n">energy_total</span> <span class="o">-</span> <span class="n">energy_track</span>
<span class="n">inelasticity</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">-</span> <span class="n">energy_track</span> <span class="o">/</span> <span class="n">energy_total</span>

<span class="k">return</span> <span class="n">energy_track</span><span class="p">,</span> <span class="n">inelasticity</span>
<span class="k">return</span> <span class="n">energy_track</span><span class="p">,</span> <span class="n">energy_cascade</span><span class="p">,</span> <span class="n">inelasticity</span>

<span class="c1"># Utility methods</span>
<span class="k">def</span> <span class="nf">_find_data_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mc</span><span class="p">:</span> <span class="nb">bool</span><span class="p">,</span> <span class="n">input_file</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
23 changes: 23 additions & 0 deletions _modules/graphnet/models/task/reconstruction.html
Original file line number Diff line number Diff line change
@@ -470,6 +470,29 @@ <h1 id="modules-graphnet-models-task-reconstruction--page-root">Source code for



<div class="viewcode-block" id="EnergyTCReconstruction">
<a class="viewcode-back" href="../../../../api/graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.EnergyTCReconstruction">[docs]</a>
<span class="k">class</span> <span class="nc">EnergyTCReconstruction</span><span class="p">(</span><span class="n">Task</span><span class="p">):</span>
<span class="w"> </span><span class="sd">"""Reconstructs track and cascade energies using stable method."""</span>

<span class="c1"># Requires two features: untransformed energy for track and cascade</span>
<span class="n">default_target_labels</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"energy_track"</span><span class="p">,</span> <span class="s2">"energy_cascade"</span><span class="p">]</span>
<span class="n">default_prediction_labels</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"energy_track_pred"</span><span class="p">,</span> <span class="s2">"energy_cascade_pred"</span><span class="p">]</span>
<span class="n">nb_inputs</span> <span class="o">=</span> <span class="mi">2</span>

<span class="k">def</span> <span class="nf">_forward</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">:</span> <span class="n">Tensor</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tensor</span><span class="p">:</span>
<span class="c1"># Transform to positive energy domain avoiding `-inf` in `log10`</span>
<span class="c1"># Transform, thereby preventing overflow and underflow error.</span>
<span class="n">x</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">nn</span><span class="o">.</span><span class="n">functional</span><span class="o">.</span><span class="n">softplus</span><span class="p">(</span>
<span class="n">x</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">clone</span><span class="p">(),</span> <span class="n">beta</span><span class="o">=</span><span class="mf">0.05</span>
<span class="p">)</span> <span class="o">+</span> <span class="n">eps_like</span><span class="p">(</span><span class="n">x</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">clone</span><span class="p">())</span>
<span class="n">x</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">nn</span><span class="o">.</span><span class="n">functional</span><span class="o">.</span><span class="n">softplus</span><span class="p">(</span>
<span class="n">x</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">clone</span><span class="p">(),</span> <span class="n">beta</span><span class="o">=</span><span class="mf">0.05</span>
<span class="p">)</span> <span class="o">+</span> <span class="n">eps_like</span><span class="p">(</span><span class="n">x</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">clone</span><span class="p">())</span>
<span class="k">return</span> <span class="n">x</span></div>



<div class="viewcode-block" id="EnergyReconstructionWithUncertainty">
<a class="viewcode-back" href="../../../../api/graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.EnergyReconstructionWithUncertainty">[docs]</a>
<span class="k">class</span> <span class="nc">EnergyReconstructionWithUncertainty</span><span class="p">(</span><span class="n">EnergyReconstruction</span><span class="p">):</span>
6 changes: 3 additions & 3 deletions api/graphnet.data.constants.html
Original file line number Diff line number Diff line change
@@ -639,15 +639,15 @@
<p>Namespace for standard names working with <cite>I3TruthExtractor</cite>.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="graphnet.data.constants.TRUTH.ICECUBE86">
<span class="sig-name descname"><span class="pre">ICECUBE86</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['energy',</span> <span class="pre">'energy_track',</span> <span class="pre">'position_x',</span> <span class="pre">'position_y',</span> <span class="pre">'position_z',</span> <span class="pre">'azimuth',</span> <span class="pre">'zenith',</span> <span class="pre">'pid',</span> <span class="pre">'elasticity',</span> <span class="pre">'sim_type',</span> <span class="pre">'interaction_type',</span> <span class="pre">'interaction_time',</span> <span class="pre">'inelasticity',</span> <span class="pre">'stopped_muon']</span></em><a class="headerlink" href="#graphnet.data.constants.TRUTH.ICECUBE86" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">ICECUBE86</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['energy',</span> <span class="pre">'energy_track',</span> <span class="pre">'energy_cascade',</span> <span class="pre">'position_x',</span> <span class="pre">'position_y',</span> <span class="pre">'position_z',</span> <span class="pre">'azimuth',</span> <span class="pre">'zenith',</span> <span class="pre">'pid',</span> <span class="pre">'elasticity',</span> <span class="pre">'sim_type',</span> <span class="pre">'interaction_type',</span> <span class="pre">'interaction_time',</span> <span class="pre">'inelasticity',</span> <span class="pre">'stopped_muon']</span></em><a class="headerlink" href="#graphnet.data.constants.TRUTH.ICECUBE86" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="graphnet.data.constants.TRUTH.DEEPCORE">
<span class="sig-name descname"><span class="pre">DEEPCORE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['energy',</span> <span class="pre">'energy_track',</span> <span class="pre">'position_x',</span> <span class="pre">'position_y',</span> <span class="pre">'position_z',</span> <span class="pre">'azimuth',</span> <span class="pre">'zenith',</span> <span class="pre">'pid',</span> <span class="pre">'elasticity',</span> <span class="pre">'sim_type',</span> <span class="pre">'interaction_type',</span> <span class="pre">'interaction_time',</span> <span class="pre">'inelasticity',</span> <span class="pre">'stopped_muon']</span></em><a class="headerlink" href="#graphnet.data.constants.TRUTH.DEEPCORE" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">DEEPCORE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['energy',</span> <span class="pre">'energy_track',</span> <span class="pre">'energy_cascade',</span> <span class="pre">'position_x',</span> <span class="pre">'position_y',</span> <span class="pre">'position_z',</span> <span class="pre">'azimuth',</span> <span class="pre">'zenith',</span> <span class="pre">'pid',</span> <span class="pre">'elasticity',</span> <span class="pre">'sim_type',</span> <span class="pre">'interaction_type',</span> <span class="pre">'interaction_time',</span> <span class="pre">'inelasticity',</span> <span class="pre">'stopped_muon']</span></em><a class="headerlink" href="#graphnet.data.constants.TRUTH.DEEPCORE" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="graphnet.data.constants.TRUTH.UPGRADE">
<span class="sig-name descname"><span class="pre">UPGRADE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['energy',</span> <span class="pre">'energy_track',</span> <span class="pre">'position_x',</span> <span class="pre">'position_y',</span> <span class="pre">'position_z',</span> <span class="pre">'azimuth',</span> <span class="pre">'zenith',</span> <span class="pre">'pid',</span> <span class="pre">'elasticity',</span> <span class="pre">'sim_type',</span> <span class="pre">'interaction_type',</span> <span class="pre">'interaction_time',</span> <span class="pre">'inelasticity',</span> <span class="pre">'stopped_muon']</span></em><a class="headerlink" href="#graphnet.data.constants.TRUTH.UPGRADE" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">UPGRADE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['energy',</span> <span class="pre">'energy_track',</span> <span class="pre">'energy_cascade',</span> <span class="pre">'position_x',</span> <span class="pre">'position_y',</span> <span class="pre">'position_z',</span> <span class="pre">'azimuth',</span> <span class="pre">'zenith',</span> <span class="pre">'pid',</span> <span class="pre">'elasticity',</span> <span class="pre">'sim_type',</span> <span class="pre">'interaction_type',</span> <span class="pre">'interaction_time',</span> <span class="pre">'inelasticity',</span> <span class="pre">'stopped_muon']</span></em><a class="headerlink" href="#graphnet.data.constants.TRUTH.UPGRADE" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="graphnet.data.constants.TRUTH.PROMETHEUS">
1 change: 1 addition & 0 deletions api/graphnet.models.task.html
Original file line number Diff line number Diff line change
@@ -487,6 +487,7 @@
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.ZenithReconstructionWithKappa"><code class="docutils literal notranslate"><span class="pre">ZenithReconstructionWithKappa</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.EnergyReconstruction"><code class="docutils literal notranslate"><span class="pre">EnergyReconstruction</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.EnergyReconstructionWithPower"><code class="docutils literal notranslate"><span class="pre">EnergyReconstructionWithPower</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.EnergyTCReconstruction"><code class="docutils literal notranslate"><span class="pre">EnergyTCReconstruction</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.EnergyReconstructionWithUncertainty"><code class="docutils literal notranslate"><span class="pre">EnergyReconstructionWithUncertainty</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.VertexReconstruction"><code class="docutils literal notranslate"><span class="pre">VertexReconstruction</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="graphnet.models.task.reconstruction.html#graphnet.models.task.reconstruction.PositionReconstruction"><code class="docutils literal notranslate"><span class="pre">PositionReconstruction</span></code></a></li>
Loading

0 comments on commit 2094390

Please sign in to comment.