第一范文网 - 专业文章范例文档资料分享平台

Geant4 程序编写中的常用代码

来源:用户分享 时间:2025/6/7 2:38:35 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

} for(int i=0;iE2) { G4cout << \above \ return; } G4int index = static_cast ((E2-Energy)/dE); index = NCHN-1-index; if(index<0) index = 0; TData[index] += Data; } //Record tally data(single-channel). void MyDataRecorder::AddData(G4double Data) { TData[0] += Data; } //Calculating relative errors. void MyDataRecorder::CalErr() { for(G4int i=0;i1 && MyData[i]>0) { rerr[i]=sqrt( sumD2[i]- MyData[i]*MyData[i]/NPS )/MyData[i]; } } } //Updating data after each event, it should be called at the end of each event. void MyDataRecorder::UpdateThisEvent() { for(int i=0; i 1) { if(total>0) totalerr = sqrt( totalSD2 - total*total/NPS )/total; dataFile << std::scientific << std::setprecision(4) << \ << std::setprecision(5) << total/NPS/factor << \ << std::fixed << std::setprecision(4) << totalerr << G4endl; } //cnscott的博客 cnscott.blog.163.com dataFile << \ dataFile << \ dataFile << \ if(!message.isNull()) dataFile << message << G4endl; dataFile.close(); G4cout<< \\\\<< FileName << \is created instead.\<

搜索更多关于: Geant4 程序编写中的常用代码 的文档
Geant4 程序编写中的常用代码.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c7x1ez2igvg0mq5f7e8f4_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top