Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## [Nsclspectcl-cvscommits] SF.net SVN: nsclspectcl:[1828] branches/LLNLMadcChainSpecTcl

 [Nsclspectcl-cvscommits] SF.net SVN: nsclspectcl:[1828] branches/LLNLMadcChainSpecTcl From: - 2011-03-11 01:08:44 ```Revision: 1828 http://nsclspectcl.svn.sourceforge.net/nsclspectcl/?rev=1828&view=rev Author: ron-fox Date: 2011-03-11 01:08:39 +0000 (Fri, 11 Mar 2011) Log Message: ----------- Add y3f computation (I think I got it right from memory). Modified Paths: -------------- branches/LLNLMadcChainSpecTcl/CMultiplicity.cpp branches/LLNLMadcChainSpecTcl/CMultiplicity.h Modified: branches/LLNLMadcChainSpecTcl/CMultiplicity.cpp =================================================================== --- branches/LLNLMadcChainSpecTcl/CMultiplicity.cpp 2011-03-11 01:02:56 UTC (rev 1827) +++ branches/LLNLMadcChainSpecTcl/CMultiplicity.cpp 2011-03-11 01:08:39 UTC (rev 1828) @@ -1162,3 +1162,34 @@ double result = (pairs/(cb*nbks(gate)) - 0.5*cb); return result; } +/** + ** Computes the y2f for a specified gate. + ** The formula is identical to y2f but the divisors + ** are binomial(i,3) since we are looking for 3 neutron + ** correlations. + ** + ** @param gate - Gate number for which to comput3 y3f. + ** @return double + ** @retval - y3f(gate). + */ +double +CMultiplicity::y3f(int gate) +{ + double cb = cbar(gate); + double pairs = 0.0; + if (cb == 0.0) return 0.0; // special case. + + + + vector mult = getGateMultiplicities(gate); + + + for (int i = 3; i < mult.size(); i++) { + double coef = binomial(i,3); + pairs += coef*mult[i]; + } + + double result = (pairs/(cb*nbks(gate)) - 0.5*cb); + return result; +} + Modified: branches/LLNLMadcChainSpecTcl/CMultiplicity.h =================================================================== --- branches/LLNLMadcChainSpecTcl/CMultiplicity.h 2011-03-11 01:02:56 UTC (rev 1827) +++ branches/LLNLMadcChainSpecTcl/CMultiplicity.h 2011-03-11 01:08:39 UTC (rev 1828) @@ -176,6 +176,7 @@ double nbks(int gate); double cbar(int gate); double y2f(int gate); + double y3f(int gate); // Utitities: private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```