{"id":202158,"date":"2013-11-14T14:36:04","date_gmt":"2013-11-14T10:36:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=202158"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=202158","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Geant4<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Geant4. \u041d\u0430\u043f\u043e\u043c\u043d\u044e \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044e. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Geant4 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f &quot;<a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/202154\/\">Copy-Paste \u0438 \u043c\u044e\u043e\u043d\u044b<\/a>&quot;. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f? \u041b\u044e\u0434\u0438 \u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b. \u0421\u0443\u0442\u044c \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Geant4 \u0432\u0435\u0440\u0441\u0438\u0438 10.0-beta.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/h2>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u00abCopy-Paste \u0438 \u043c\u044e\u043e\u043d\u044b\u00bb \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 <a href=\"http:\/\/www.viva64.com\/ru\/t\/0046\/\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/a> \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio\/\">PVS-Studio<\/a>. \u0411\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u0431\u043e\u0440\u043e\u0434\u0430\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 Geant4 \u0432\u0435\u0440\u0441\u0438\u0438 4.9.4. \u0411\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0431\u044b\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  <b><i>Geant4<\/i><\/b><i> \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0438\u0446 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0432 CERN \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0421++. \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 GEANT, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u043c \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c.<\/i> <\/p>\n<p>  \u0421\u0430\u0439\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"http:\/\/geant4.org\">http:\/\/geant4.org<\/a>. <\/p>\n<p>  \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e 16 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430. \u041d\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e 10 \u0438\u0437 \u043d\u0438\u0445. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0438\u0434\u0438\u043c\u043e \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b, \u0438\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0432\u043d\u043e\u0432\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044d\u0442\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0412 \u043d\u0435\u0439 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043e, \u0438\u0441\u0447\u0435\u0437\u043b\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  \u041f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u043e \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0447\u0435\u0442\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Geant4 \u0438 \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043b\u044e\u0434\u0435\u0439 \u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0443 PVS-Studio.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u044f \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a 2011 \u0433\u043e\u0434\u0443. \u0417\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043c\u043d\u043e\u0433\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u0438 \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043a\u043e\u0434\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0438\u043b\u0438 \u0442\u043e, \u0447\u0442\u043e \u044f \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0440\u0430\u043d\u0435\u0435.<\/p>\n<h2>\u041d\u043e\u0432\u044b\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430<\/h2>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/www.viva64.com\/external-pictures\/txt\/geant4_new.txt\">geant4_new.txt<\/a>. \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a. \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u043b\u044e\u0447 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Geant4: <a href=\"http:\/\/www.viva64.com\/ru\/about-feedback\/\">\u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438<\/a>.<\/p>\n<h3>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">G4double G4CsvAnalysisManager::GetH2Xmax(G4int \/*id*\/) const {   ExceptionForHistograms(&quot;GetH2Xmin&quot;);   return 0; }  G4double G4CsvAnalysisManager::GetH2Xmax(G4int \/*id*\/) const {   ExceptionForHistograms(&quot;GetH2Xmin&quot;);   return 0; }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V524 It is odd that the body of &#8216;GetH2Xmax&#8217; function is fully equivalent to the body of &#8216;GetH2Xmin&#8217; function. _G4analysis-archive g4csvanalysismanager.cc 933<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f GetH2Xmax(), \u043f\u043e \u0432\u0441\u0435\u0439 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f ExceptionForHistograms() \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c:  <\/p>\n<pre><code class=\"cpp\">ExceptionForHistograms(&quot;GetH2Xmax&quot;);<\/code><\/pre>\n<p>  \u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0439. \u041a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0435\u0448\u0438\u043b \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u0439 Copy-Paste \u043e\u0448\u0438\u0431\u043a\u0435.<\/p>\n<h3>\u042d\u043d\u0435\u0440\u0433\u0438\u044f \u0440\u0430\u0432\u043d\u0430 \u043d\u0443\u043b\u044e<\/h3>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438 CalculateTotalEnergy () \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#8216;Etot&#8217;. \u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e, \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e.  <\/p>\n<pre><code class=\"cpp\">G4double G4RKFieldIntegrator::CalculateTotalEnergy(const G4KineticTrackVector&amp; Barions) {   G4double Etot = 0;   ....   for(G4int c2 = c1 + 1; c2 &lt; nBarion; c2++)   {       ....     \/\/  Esk2     Etot += t1*std::pow(Alpha\/pi, 3\/2)*             std::exp(-Alpha*r12*r12);      \/\/ Eyuk     Etot += ....;      \/\/ Ecoul     Etot += 1.44*p1-&gt;GetDefinition()-&gt;GetPDGCharge()*             p2-&gt;GetDefinition()-&gt;GetPDGCharge()\/r12*             Erf(std::sqrt(Alpha)*r12);      \/\/ Epaul     Etot = 0;     ....   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V519 The &#8216;Etot&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 80, 83. _G4processes-archive g4rkfieldintegrator.cc 83<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">G4double  G4EmBiasingManager::ApplySecondaryBiasing(....) {   ....   if(0 == nsplit) {      if(safety &gt; fSafetyMin) ....   } if(1 == nsplit) {      weight = ApplyRussianRoulette(vd, index);   } else {     G4double tmpEnergy = pPartChange-&gt;GetProposedKineticEnergy();     G4ThreeVector tmpMomDir = ....     weight = ApplySplitting(vd, track, currentModel, index, tcut);     pPartChange-&gt;SetProposedKineticEnergy(tmpEnergy);     pPartChange-&gt;ProposeMomentumDirection(tmpMomDir);   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V646 Consider inspecting the application&#8217;s logic. It&#8217;s possible that &#8216;else&#8217; keyword is missing. _G4processes-archive g4embiasingmanager.cc 299<\/p>\n<p>  \u041a\u043e\u0434 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u0442\u0430\u043a, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u00abelse if\u00bb. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0415\u0441\u043b\u0438 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u043a\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u043e\u0442 \u044d\u0442\u043e:  <\/p>\n<pre><code class=\"cpp\">if(0 == nsplit) {    if(safety &gt; fSafetyMin) .... }  if(1 == nsplit) {    weight = ApplyRussianRoulette(vd, index); } else {   G4double tmpEnergy = pPartChange-&gt;GetProposedKineticEnergy();   G4ThreeVector tmpMomDir = ....   weight = ApplySplitting(vd, track, currentModel, index, tcut);   pPartChange-&gt;SetProposedKineticEnergy(tmpEnergy);   pPartChange-&gt;ProposeMomentumDirection(tmpMomDir); }<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0431\u043b\u043e\u043a, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0439\u0441\u044f \u043a \u0432\u0435\u0442\u043a\u0435 &#8216;else&#8217; \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u00ab1 != nsplit\u00bb. \u0415\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0438\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<\/p>\n<p>  V646 Consider inspecting the application&#8217;s logic. It&#8217;s possible that &#8216;else&#8217; keyword is missing. _G4processes-archive g4embiasingmanager.cc 347<\/p>\n<h3>\u041d\u0435\u0434\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434?<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">void G4MolecularDecayTable::AddExcitedState(const G4String&amp; label) {   channelsMap::iterator channelsIter =     fDecayChannelsMap.find(label);   if(channelsIter != fDecayChannelsMap.end())   {     G4String errMsg = &quot;Excited state&quot; + label +                       &quot; already registered in the decay table.&quot;;     G4Exception(&quot;G4MolecularDecayTable::AddExcitedState&quot;,                 &quot;G4MolecularDecayTable003&quot;,                 FatalErrorInArgument, errMsg);      return;   }   fDecayChannelsMap[label] ; }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V607 Ownerless expression &#8216;fDecayChannelsMap[label]&#8217;. _G4processes-archive g4moleculardecaytable.cc 140<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0446 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e:  <\/p>\n<pre><code class=\"cpp\">fDecayChannelsMap[label] ;<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u044d\u0442\u043e? \u0417\u0434\u0435\u0441\u044c \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442? \u0427\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044f\u0447\u0435\u0439\u043a\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430?<\/p>\n<h3>\u041a\u0438\u043d\u0435\u043c\u0430\u0442\u0438\u043a\u0430<\/h3>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u044b\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043c\u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;id&#8217;.  <\/p>\n<pre><code class=\"cpp\">void G4QMDCollision::CalKinematicsOfBinaryCollisions(   G4double dt) {   ....   G4int id = 0;   ....   if ( secs )   {     ....     id++;     ....   }   if ( std::abs ( eini - efin ) &lt; fepse*10 )      ....   else   {       ....                  for ( G4int i0i = 0 ; i0i &lt; id-1 ; i0i++ )     {       theSystem-&gt;DeleteParticipant( i0i+n0 );     }     ....   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V621 Consider inspecting the &#8216;for&#8217; operator. It&#8217;s possible that the loop will be executed incorrectly or won&#8217;t be executed at all. _G4processes-archive g4qmdcollision.cc 228<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u00abif ( secs )\u00bb \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;id&#8217; \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u0430 \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430, \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0446\u0438\u043a\u043b \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code class=\"cpp\">for ( G4int i0i = 0 ; i0i &lt; -1 ; i0i++ )<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u0414\u0443\u043c\u0430\u044e, \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CalKinematicsOfBinaryCollisions().<\/p>\n<h3>\u041f\u0440\u043e\u0447\u0435\u0435<\/h3>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u0440\u044f\u0434 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041d\u0435 \u0431\u0443\u0434\u0443 \u0438 \u0432 \u044d\u0442\u043e\u0439. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u043e\u043a\u0430\u0436\u0443 \u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0447\u0430\u0439:  <\/p>\n<pre><code class=\"cpp\">class G4HadronicException : public std::exception {   .... };  inline G4double G4GeneralPhaseSpaceDecay::Pmx(   G4double e, G4double p1, G4double p2) {    if (e-p1-p2 &lt; 0 )    {       G4HadronicException(__FILE__, __LINE__,       &quot;G4GeneralPhaseSpaceDecay::Pmx &quot;       &quot;energy in cms &gt; mass1+mass2&quot;);    }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio. V596 The object was created but it is not being used. The &#8216;throw&#8217; keyword could be missing: throw G4HadronicException(FOO); _G4processes-archive g4generalphasespacedecay.hh 116<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0431\u044b\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;throw&#8217;. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0438 \u0442\u0443\u0442 \u0436\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0442\u0438\u043f &#8216;G4HadronicException&#8217;. \u0418 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u043d\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/www.viva64.com\/external-pictures\/txt\/geant4_new.txt\">geant4_new.txt<\/a>. \u0422\u0430\u043c \u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0430 \u0442\u0435\u043c\u0443 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u043e\u0442 \u0432\u0438\u0434\u0438\u0442\u0435, \u0438 \u044f \u043a\u043e\u0441\u0430\u043d\u0443\u043b. \ud83d\ude42<\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043c\u0435\u043d\u044f \u043f\u043e\u0442\u0440\u043e\u043b\u043b\u0438\u0442\u044c.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/202158\/\"> http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/202158\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Geant4. \u041d\u0430\u043f\u043e\u043c\u043d\u044e \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044e. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Geant4 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f &quot;<a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/202154\/\">Copy-Paste \u0438 \u043c\u044e\u043e\u043d\u044b<\/a>&quot;. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f? \u041b\u044e\u0434\u0438 \u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b. \u0421\u0443\u0442\u044c \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Geant4 \u0432\u0435\u0440\u0441\u0438\u0438 10.0-beta.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-202158","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202158"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202158\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}