• geant4 一些问题


    geant4 一些问题


    图形界面显示的问题

    报错: 

    1 libGL error: No matching fbConfigs or visuals found 
    2 libGL error: failed to load driver: swrast
    • 是显卡的问题,目前没有解决方法,但也没有影响。

    可视化界面中粒子径迹颜色含义

    • 电荷+,蓝色;不带电,绿色;电荷负,红色。
    • gamma,绿色;电子,红色;正电子,蓝色;中子,黄色;质子,蓝绿色。

    trackingAction是用来做什么的?

    • trackingAction和EventAvtion、steppingAction、runAction是四个在G4中需要继承的基类,但是steppingAction和trackingAction可以不去继承,如果使用了灵敏探测器,那么则不需要从steppingAction、trackingAction中提取信息。

    如何添加 stepAction ?

    1. 在代码中添加 steppingAction.hh 与 steppingAction.cc 文件。
    2. 在 ActionInitialization.cc 中,把 steppingAction 写入到 runManager 中。
       1 void ActionInitialization::Build() const
       2 {
       3   RootIO* rootIO = new RootIO(saveFlag);
       4   EventAction* eventAction = new EventAction();
       5 
       6   SetUserAction(new PrimaryGeneratorAction());
       7   SetUserAction(new RunAction(rootIO));
       8   SetUserAction(eventAction);
       9   SetUserAction(new SteppingAction(new DetectorConstruction(),
      10                                    eventAction,
      11                                    rootIO));
      12 }

    如何获取 particleName ?

    •  aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() 
    •  theTrack->GetDefinition()->GetParticleName() 
    •  track->GetParticleDefinition()->GetParticleName() 

    解决一个警告的报错

    In file included from /opt/root61206/include/TDirectory.h:24:0,
                     from /opt/root61206/include/TDirectoryFile.h:24,
                     from /opt/root61206/include/TFile.h:26,
                     from /media/DATA2T/han/Simulation/source/Si/src/EventAction.cc:19:
    /opt/root61206/include/TBuffer.h: In member function ‘virtual void TBuffer::ReadStdString(std::string&)’:
    /opt/root61206/include/TBuffer.h:287:54: warning: declaration of ‘s’ shadows a global declaration [-Wshadow]
        virtual inline void ReadStdString(std::string &s) { ReadStdString(&s); }
    • 是由于 G4SystemOfUnits.hh 头文件导致的,把不需要该头文件的位置注释掉即可,比如 RunAction,EventAction 类。
    • 除了在 DetectorConsitruction 和 PrimaryGeneratorAction 类中,其他地方都可以不需要 G4SystemOfUnits.hh 头文件。
    • 类似的问题可以参考 https://root-forum.cern.ch/t/silence-warning-messages-during-a-geant4-project-compilation/20525/12
  • 相关阅读:
    MySQL 索引相关
    MySQL 事务操作
    MySQL 分支循环
    详细实例教程!集成华为虚假用户检测,防范虚假恶意流量
    快速集成华为AGC云存储服务-NodeJS
    随心译——无广告的专属实时翻译神器
    如何实现情景式精准触达用户,提高用户活跃与转化?
    快速集成华为AGC-AppLinking服务-iOS平台
    华为联运游戏或应用审核驳回:点击登录进入游戏,未显示欢迎栏
    视频App如何使用无线传输服务获得更好的播放体验
  • 原文地址:https://www.cnblogs.com/kurrrr/p/13661862.html
Copyright © 2020-2023  润新知