Files
musrfit/doc/technical/html/PTheory_8cpp.html
Gitea Actions 8a8eac55b7 Deploy site
2025-12-27 12:57:44 +00:00

289 lines
19 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>musrfit: /workspace/LMU/musrfit/src/classes/PTheory.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">musrfit<span id="projectnumber">&#160;1.9.9</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',false,false,'search.php','Search',true);
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('PTheory_8cpp.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">PTheory.cpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &lt;cmath&gt;</code><br />
<code>#include &lt;TObject.h&gt;</code><br />
<code>#include &lt;TString.h&gt;</code><br />
<code>#include &lt;TF1.h&gt;</code><br />
<code>#include &lt;TObjString.h&gt;</code><br />
<code>#include &lt;TObjArray.h&gt;</code><br />
<code>#include &lt;TClass.h&gt;</code><br />
<code>#include &lt;TMath.h&gt;</code><br />
<code>#include &lt;Math/SpecFuncMathMore.h&gt;</code><br />
<code>#include &quot;<a class="el" href="PMsrHandler_8h_source.html">PMsrHandler.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="PTheory_8h_source.html">PTheory.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for PTheory.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="PTheory_8cpp__incl.png" border="0" usemap="#a_2workspace_2LMU_2musrfit_2src_2classes_2PTheory_8cpp" alt=""/></div>
<map name="a_2workspace_2LMU_2musrfit_2src_2classes_2PTheory_8cpp" id="a_2workspace_2LMU_2musrfit_2src_2classes_2PTheory_8cpp">
<area shape="rect" title=" " alt="" coords="382,5,552,50"/>
<area shape="rect" title=" " alt="" coords="144,325,218,353"/>
<area shape="poly" title=" " alt="" coords="381,35,299,41,211,53,136,73,108,85,90,100,76,125,72,153,77,183,88,212,123,268,160,312,156,315,119,271,83,215,72,184,67,153,71,124,86,96,106,81,134,68,210,48,298,36,381,30"/>
<area shape="rect" title=" " alt="" coords="984,476,1042,504"/>
<area shape="poly" title=" " alt="" coords="552,25,751,30,868,37,986,50,1094,70,1141,83,1183,98,1217,116,1244,136,1261,160,1267,186,1267,340,1261,374,1244,402,1219,426,1189,445,1156,460,1121,471,1058,486,1057,480,1120,466,1154,455,1187,440,1216,422,1240,399,1256,372,1261,340,1261,186,1256,162,1240,140,1215,120,1181,103,1140,88,1093,75,985,56,868,43,750,35,552,31"/>
<area shape="rect" title=" " alt="" coords="100,98,159,126"/>
<area shape="poly" title=" " alt="" coords="382,52,178,101,175,101,173,96,177,95,380,46"/>
<area shape="rect" title=" " alt="" coords="971,249,1050,277"/>
<area shape="poly" title=" " alt="" coords="553,30,690,39,845,52,978,71,1023,83,1048,96,1059,113,1064,131,1061,169,1048,206,1030,238,1026,235,1043,204,1056,168,1059,131,1054,115,1045,100,1022,88,977,76,845,58,690,44,552,36"/>
<area shape="rect" title=" " alt="" coords="132,476,209,504"/>
<area shape="poly" title=" " alt="" coords="382,39,206,61,125,79,93,89,69,100,43,118,24,135,12,157,8,186,8,340,11,362,19,383,31,401,47,418,84,446,123,467,121,472,82,451,43,422,27,404,14,385,6,364,3,340,3,186,7,155,19,132,39,114,67,96,91,84,124,74,205,56,381,33"/>
<area shape="rect" title=" " alt="" coords="340,98,394,126"/>
<area shape="poly" title=" " alt="" coords="442,52,396,90,393,86,439,48"/>
<area shape="rect" title=" " alt="" coords="418,98,515,126"/>
<area shape="poly" title=" " alt="" coords="469,50,469,82,464,82,464,50"/>
<area shape="rect" title=" " alt="" coords="539,98,632,126"/>
<area shape="poly" title=" " alt="" coords="499,48,555,87,552,91,496,53"/>
<area shape="rect" title=" " alt="" coords="656,98,728,126"/>
<area shape="poly" title=" " alt="" coords="527,48,642,90,641,95,526,53"/>
<area shape="rect" title=" " alt="" coords="752,98,824,126"/>
<area shape="poly" title=" " alt="" coords="553,48,738,95,736,100,552,53"/>
<area shape="rect" title=" " alt="" coords="848,98,1035,126"/>
<area shape="poly" title=" " alt="" coords="553,41,850,92,849,97,552,46"/>
<area shape="rect" href="PMsrHandler_8h.html" title=" " alt="" coords="320,174,432,201"/>
<area shape="poly" title=" " alt="" coords="382,44,286,67,247,82,223,100,217,112,218,123,224,133,234,142,267,158,306,170,305,175,265,163,231,147,219,136,213,124,212,111,219,96,244,78,284,62,381,39"/>
<area shape="rect" href="PTheory_8h.html" title=" " alt="" coords="234,98,316,126"/>
<area shape="poly" title=" " alt="" coords="417,53,320,94,318,89,415,48"/>
<area shape="poly" title=" " alt="" coords="321,203,271,219,217,243,169,279,150,301,134,326,129,343,127,361,131,398,143,433,157,462,152,464,138,435,126,399,121,361,123,342,130,324,145,298,165,275,215,239,269,214,319,198"/>
<area shape="rect" title=" " alt="" coords="246,249,317,277"/>
<area shape="poly" title=" " alt="" coords="361,204,312,242,308,238,357,200"/>
<area shape="rect" title=" " alt="" coords="341,249,411,277"/>
<area shape="poly" title=" " alt="" coords="379,202,379,234,373,234,373,202"/>
<area shape="rect" title=" " alt="" coords="434,249,491,277"/>
<area shape="poly" title=" " alt="" coords="393,200,438,237,434,241,390,204"/>
<area shape="rect" title=" " alt="" coords="516,249,610,277"/>
<area shape="poly" title=" " alt="" coords="410,199,517,241,515,246,408,204"/>
<area shape="rect" href="PMusr_8h.html" title=" " alt="" coords="825,401,895,428"/>
<area shape="poly" title=" " alt="" coords="432,187,527,190,639,200,742,218,782,231,811,247,836,278,852,315,860,353,863,385,857,385,854,353,846,317,832,281,808,251,780,236,741,223,638,205,527,196,432,192"/>
<area shape="rect" href="PFunctionHandler_8h.html" title=" " alt="" coords="634,249,776,277"/>
<area shape="poly" title=" " alt="" coords="433,199,632,243,631,248,432,204"/>
<area shape="rect" href="PFunctionGrammar_8h.html" title=" " alt="" coords="466,401,617,428"/>
<area shape="poly" title=" " alt="" coords="321,203,283,215,250,231,238,241,232,251,230,263,236,276,255,301,279,323,334,358,394,382,451,398,450,403,392,387,331,362,276,327,251,304,231,278,225,263,227,249,234,237,247,227,281,210,319,198"/>
<area shape="rect" href="PFunction_8h.html" title=" " alt="" coords="664,325,757,353"/>
<area shape="poly" title=" " alt="" coords="432,186,525,188,632,197,683,205,728,215,765,229,790,248,796,257,797,267,789,286,772,304,751,319,748,314,769,300,785,284,792,267,791,259,786,251,763,234,727,220,682,210,631,202,524,194,432,191"/>
<area shape="poly" title=" " alt="" coords="889,426,974,467,971,472,886,431"/>
<area shape="poly" title=" " alt="" coords="825,422,224,486,224,481,825,417"/>
<area shape="rect" title=" " alt="" coords="824,476,872,504"/>
<area shape="poly" title=" " alt="" coords="860,429,855,461,850,461,855,428"/>
<area shape="rect" title=" " alt="" coords="896,476,960,504"/>
<area shape="poly" title=" " alt="" coords="874,427,908,463,904,467,870,431"/>
<area shape="poly" title=" " alt="" coords="634,278,622,280,234,333,234,328,621,274,633,273"/>
<area shape="poly" title=" " alt="" coords="728,275,803,323,908,399,989,464,985,468,905,403,800,327,725,280"/>
<area shape="poly" title=" " alt="" coords="670,280,531,332,356,403,211,472,208,467,354,398,529,327,668,275"/>
<area shape="poly" title=" " alt="" coords="721,275,771,323,838,388,835,392,767,327,717,279"/>
<area shape="poly" title=" " alt="" coords="693,279,569,392,565,388,690,275"/>
<area shape="poly" title=" " alt="" coords="709,277,711,309,706,310,704,278"/>
<area shape="rect" title=" " alt="" coords="474,476,606,504"/>
<area shape="poly" title=" " alt="" coords="544,429,543,461,538,461,538,429"/>
<area shape="rect" title=" " alt="" coords="301,476,451,504"/>
<area shape="poly" title=" " alt="" coords="513,431,420,472,418,467,511,426"/>
<area shape="rect" title=" " alt="" coords="630,476,800,504"/>
<area shape="poly" title=" " alt="" coords="573,426,671,468,669,473,571,431"/>
<area shape="poly" title=" " alt="" coords="724,351,762,388,815,426,970,473,969,478,812,431,759,392,720,355"/>
<area shape="poly" title=" " alt="" coords="664,353,454,403,224,474,223,469,453,398,663,348"/>
<area shape="poly" title=" " alt="" coords="739,351,821,391,819,396,736,356"/>
<area shape="poly" title=" " alt="" coords="681,356,586,397,584,392,679,351"/>
<area shape="poly" title=" " alt="" coords="702,355,672,390,631,430,577,470,574,466,628,426,668,387,698,351"/>
<area shape="poly" title=" " alt="" coords="714,353,717,460,711,461,708,353"/>
<area shape="poly" title=" " alt="" coords="240,129,199,149,156,178,137,195,123,215,113,238,109,262,109,340,114,374,125,407,154,462,150,465,120,410,109,376,104,340,104,262,108,236,118,213,133,192,152,174,196,144,237,124"/>
<area shape="poly" title=" " alt="" coords="294,124,347,162,344,167,291,128"/>
<area shape="poly" title=" " alt="" coords="317,120,625,193,841,247,863,270,874,294,877,321,875,353,869,386,864,385,869,352,871,321,869,295,859,273,839,252,624,199,316,126"/>
<area shape="rect" title=" " alt="" coords="952,174,1035,201"/>
<area shape="poly" title=" " alt="" coords="317,121,328,123,498,143,631,148,764,153,934,171,937,172,936,177,933,176,763,159,630,154,497,148,328,128,316,126"/>
<area shape="rect" href="PUserFcnBase_8h.html" title=" " alt="" coords="1109,174,1227,201"/>
<area shape="poly" title=" " alt="" coords="317,121,328,123,529,147,687,155,844,159,1047,171,1094,175,1093,181,1046,176,844,164,686,160,529,152,328,128,316,126"/>
<area shape="poly" title=" " alt="" coords="1156,204,1135,225,1116,251,1084,307,1058,366,1024,462,1019,461,1053,364,1080,305,1111,248,1131,221,1152,200"/>
<area shape="poly" title=" " alt="" coords="1141,204,1053,245,1051,240,1139,199"/>
<area shape="rect" title=" " alt="" coords="1125,249,1227,277"/>
<area shape="poly" title=" " alt="" coords="1172,202,1176,233,1170,234,1167,202"/>
</map>
</div>
</div>
<p><a href="PTheory_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a907d8d6dcc4c26245a296a6dadf477c1" id="r_a907d8d6dcc4c26245a296a6dadf477c1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a907d8d6dcc4c26245a296a6dadf477c1">SQRT_TWO</a>&#160;&#160;&#160;1.41421356237</td></tr>
<tr class="separator:a907d8d6dcc4c26245a296a6dadf477c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a204175c725ee19858dedec2865d490b8" id="r_a204175c725ee19858dedec2865d490b8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a204175c725ee19858dedec2865d490b8">SQRT_PI</a>&#160;&#160;&#160;1.77245385091</td></tr>
<tr class="separator:a204175c725ee19858dedec2865d490b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a003c5aa531d7a1fd21bfcfb3526d9f27" id="r_a003c5aa531d7a1fd21bfcfb3526d9f27"><td class="memItemLeft" align="right" valign="top">std::vector&lt; void * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a003c5aa531d7a1fd21bfcfb3526d9f27">gGlobalUserFcn</a></td></tr>
<tr class="memdesc:a003c5aa531d7a1fd21bfcfb3526d9f27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Global storage for user function objects requiring persistent state. <br /></td></tr>
<tr class="separator:a003c5aa531d7a1fd21bfcfb3526d9f27"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a204175c725ee19858dedec2865d490b8" name="a204175c725ee19858dedec2865d490b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a204175c725ee19858dedec2865d490b8">&#9670;&#160;</a></span>SQRT_PI</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SQRT_PI&#160;&#160;&#160;1.77245385091</td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="PTheory_8cpp_source.html#l00048">48</a> of file <a class="el" href="PTheory_8cpp_source.html">PTheory.cpp</a>.</p>
<p class="reference">Referenced by <a class="el" href="PTheory_8cpp_source.html#l02595">PTheory::SkewedGauss()</a>.</p>
</div>
</div>
<a id="a907d8d6dcc4c26245a296a6dadf477c1" name="a907d8d6dcc4c26245a296a6dadf477c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a907d8d6dcc4c26245a296a6dadf477c1">&#9670;&#160;</a></span>SQRT_TWO</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SQRT_TWO&#160;&#160;&#160;1.41421356237</td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="PTheory_8cpp_source.html#l00047">47</a> of file <a class="el" href="PTheory_8cpp_source.html">PTheory.cpp</a>.</p>
<p class="reference">Referenced by <a class="el" href="PTheory_8cpp_source.html#l02595">PTheory::SkewedGauss()</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a003c5aa531d7a1fd21bfcfb3526d9f27" name="a003c5aa531d7a1fd21bfcfb3526d9f27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a003c5aa531d7a1fd21bfcfb3526d9f27">&#9670;&#160;</a></span>gGlobalUserFcn</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;void*&gt; gGlobalUserFcn</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel extern">extern</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Global storage for user function objects requiring persistent state. </p>
<p>This vector provides a global container for user functions that need to maintain state across multiple evaluations or share data between runs. It is primarily used by user functions implementing the "global part" interface (NeedGlobalPart(), SetGlobalPart(), GlobalPartIsValid()).</p>
<h1><a class="anchor" id="gGlobalUserFcn_usage"></a>
Usage Pattern</h1>
<p>User functions with expensive initialization (lookup tables, precomputed grids, loaded data files) store their global objects here:</p>
<div class="fragment"><div class="line"><span class="comment">// In user function&#39;s SetGlobalPart implementation:</span></div>
<div class="line"><span class="keywordtype">void</span> TMyFcn::SetGlobalPart(std::vector&lt;void*&gt; &amp;globalPart, UInt_t idx) {</div>
<div class="line"> <span class="keywordflow">if</span> (idx &lt; globalPart.size() &amp;&amp; globalPart[idx] != <span class="keyword">nullptr</span>) {</div>
<div class="line"> fGlobal = <span class="keyword">static_cast&lt;</span>MyGlobalData*<span class="keyword">&gt;</span>(globalPart[idx]);</div>
<div class="line"> } <span class="keywordflow">else</span> {</div>
<div class="line"> fGlobal = <span class="keyword">new</span> MyGlobalData();</div>
<div class="line"> fGlobal-&gt;Initialize(); <span class="comment">// Expensive one-time computation</span></div>
<div class="line"> <span class="keywordflow">if</span> (idx &lt; globalPart.size())</div>
<div class="line"> globalPart[idx] = fGlobal;</div>
<div class="line"> <span class="keywordflow">else</span></div>
<div class="line"> globalPart.push_back(fGlobal);</div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>The vector stores void pointers, so user functions must cast appropriately and manage memory for their specific data types.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>User functions are responsible for proper cleanup of their global objects to avoid memory leaks.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPUserFcnBase.html#abae008b6b6799ded0825ac6befb2283b">PUserFcnBase::SetGlobalPart()</a> for the interface to populate this vector </dd>
<dd>
<a class="el" href="classPTheory.html" title="Theory function evaluator and expression tree manager.">PTheory</a> for how global parts are initialized during theory setup </dd></dl>
<p class="definition">Definition at line <a class="el" href="PUserFcnBase_8cpp_source.html#l00155">155</a> of file <a class="el" href="PUserFcnBase_8cpp_source.html">PUserFcnBase.cpp</a>.</p>
<p class="reference">Referenced by <a class="el" href="PTheory_8cpp_source.html#l00125">PTheory::PTheory()</a>, and <a class="el" href="PTheory_8cpp_source.html#l00375">PTheory::~PTheory()</a>.</p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_018e9aafb459e6e1a4953404cb0c0b1d.html">classes</a></li><li class="navelem"><a class="el" href="PTheory_8cpp.html">PTheory.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>
</html>