1 如何在virtual box里面创建共享文件夹
如果没有设置密码,密码就是默认的virtual
需要现在设置-共享文件夹-设置windows的共享路径,然后再执行下面的命令,Gateshare是我自己建的在windows里面的共享文件夹名字
sudo mount -t vboxsf GateShare share_dir
2 virtual如何退出全屏
home+ctrl键
然后选择点击全屏设置按钮即可
3 clion 安装
(1)将安装密钥jetbra-linux.zip解压到当前文件夹,然后 先进入到script\文件夹路径,执行
./install.sh
显示done, log off first, 然后选择虚拟机右上角的关机键,点击log out,之后再重新进入虚拟机
(2)在clion官网下载相应的安装包之后,复制到linux系统里面,放在以不同于jetbra的文件下, 解压之后,控制台进入当前文件,一直进入到bin文件中,然后执行 ./clion.sh,等待安装。
之后会出现交互窗口,按照提示安装即可,激活许可证(Activate code)->输入激活码。激活完成。
4 ubuntu 软件安装命令
sudo apt-get install package 安装软件包
sudo apt-get install package - - reinstall 重新安装软件包
sudo apt-get -f install 修复安装软件包"-f = ——fix-missing"
sudo apt-get remove package 删除软件包
sudo apt-get remove package - - purge 删除软件包,包括删除配置文件等
sudo apt-get update 更新源及/etc/apt/sources.list
sudo apt-get upgrade 更新已安装的软件包
sudo apt-get dist-upgrade 升级系统安装的软件包
sudo apt-get dselect-upgrade 使用 dselect 升级
sudo apt-get build-dep package 安装相关的编译环境
sudo apt-get clean && sudo apt-get autoclean 清理无用的软件包
sudo apt-get check 检查是否有损坏的依赖
apt-cache search package 搜索软件包
apt-cache show package 获取包的相关信息,如说明、大小、版本等
apt-cache depends package 了解使用依赖a
pt-cache rdepends package 是查看该软件包被哪些软件包依赖
5 root离线安装
libxpm-dev使用install 命令安装无效,修改了找到的所有的镜像源也不行,最后直接找到相应的安装包,下载下来进行安装
c'd
7 root打开已有的.root文件
我是直接用的gate,内置了root,是以网页的形式打开的,
new TBrowser之后,稍等一会,会打开一个网页,然后在这个网页里面找到自己的root文件所在路劲,就可以可视化自己的root结果了
直接在终端输入,
root回车
new TBrowser
.q 退出
8 安装好的geant4环境(ubuntu系统)如何直接迁移到另外一个电脑
找到原电脑的ubtunu安装目录,拷贝目录下的.vmx文件和vmdk文件,直接拷贝这个安装目录文件吧,然后拷贝到另外一个电脑
9 在linux系统下,对所有路径检索,查找文件位置
sudo find / -name myfile.txt
10 快速查看
然后输入grep -r 函数名, 如grep -r G4BOX,会显示所有example里面用到这个函数二点语句,然后参考别人是怎么用的
11 打印到txt文件
打印粒子运动的中间过程
./exampleB1 test.mac >log.txt 里面的text和log名字都是可以修改的,看自己的名字是什么进行修改即可
12 破解版clion安装记录
进入文件jetbra文件的script, 然后./install.sh回车,显示,Done,you’d better log off
点击虚拟机的关机按钮,选择log out,然后重新启动虚拟机器
再度进入jetbra文件的script文件下./install.sh回车,这次不需要log out,紧接着继续下面的步骤
将clion的压缩包解压放到虚拟机路径下,进入clion安装包的bin目录下,执行./clion.sh
会出现jetbra引导安装界面,选择同意,然后dont’t send,然后出现如下界面
最后将clion.txt里面的激活码全部复制粘贴,激活即安装成功
13 普通用户和root用户的切换
普通用户切换到root用户
如果你是第一次切换,要先设置密码
sudo passwd root
进入root
su root
退出root
su user, uer 是自己的linux用户名,我的是默认的vgate
14 root数据读到txt
https://www.bilibili.com/video/BV1FN411X7Tn/?spm_id_from=333.337.search-card.all.click&vd_source=ee789cf916563b0f6fa47fd0f3556c63
root read.C
15 Track ID 和parent ID的区别
16 gps UI界面设置以及messerger类的作用
内置ui命令
(1) 继承G4UImesserger类
(2) 初始化
SetUnitCategory
关于单位的定义,在G4UnitsTable.cc
void G4UnitDefinition::BuildUnitsTable()
{
// Length
new G4UnitDefinition("parsec", "pc", "Length", parsec);
new G4UnitDefinition("kilometer", "km", "Length", kilometer);
new G4UnitDefinition("meter", "m", "Length", meter);
new G4UnitDefinition("centimeter", "cm", "Length", centimeter);
new G4UnitDefinition("millimeter", "mm", "Length", millimeter);
new G4UnitDefinition("micrometer", "um", "Length", micrometer);
new G4UnitDefinition("nanometer", "nm", "Length", nanometer);
new G4UnitDefinition("angstrom", "Ang", "Length", angstrom);
new G4UnitDefinition("fermi", "fm", "Length", fermi);
// Surface
new G4UnitDefinition("kilometer2", "km2", "Surface", kilometer2);
new G4UnitDefinition("meter2", "m2", "Surface", meter2);
new G4UnitDefinition("centimeter2", "cm2", "Surface", centimeter2);
new G4UnitDefinition("millimeter2", "mm2", "Surface", millimeter2);
new G4UnitDefinition("barn", "barn", "Surface", barn);
new G4UnitDefinition("millibarn", "mbarn", "Surface", millibarn);
new G4UnitDefinition("microbarn", "mubarn", "Surface", microbarn);
new G4UnitDefinition("nanobarn", "nbarn", "Surface", nanobarn);
new G4UnitDefinition("picobarn", "pbarn", "Surface", picobarn);
// Volume
new G4UnitDefinition("kilometer3", "km3", "Volume", kilometer3);
new G4UnitDefinition("meter3", "m3", "Volume", meter3);
new G4UnitDefinition("centimeter3", "cm3", "Volume", centimeter3);
new G4UnitDefinition("millimeter3", "mm3", "Volume", millimeter3);
new G4UnitDefinition("liter", "L", "Volume", liter);
new G4UnitDefinition("dL", "dL", "Volume", dL);
new G4UnitDefinition("cL", "cL", "Volume", cL);
new G4UnitDefinition("mL", "mL", "Volume", mL);
// Angle
new G4UnitDefinition("radian", "rad", "Angle", radian);
new G4UnitDefinition("milliradian", "mrad", "Angle", milliradian);
new G4UnitDefinition("degree", "deg", "Angle", degree);
// Solid angle
new G4UnitDefinition("steradian", "sr", "Solid angle", steradian);
new G4UnitDefinition("millisteradian", "msr", "Solid angle",
steradian * 0.001);
// Time
new G4UnitDefinition("second", "s", "Time", second);
new G4UnitDefinition("millisecond", "ms", "Time", millisecond);
new G4UnitDefinition("microsecond", "us", "Time", microsecond);
new G4UnitDefinition("nanosecond", "ns", "Time", nanosecond);
new G4UnitDefinition("picosecond", "ps", "Time", picosecond);
new G4UnitDefinition("minute", "min", "Time", minute);
new G4UnitDefinition("hour", "h", "Time", hour);
new G4UnitDefinition("day", "d", "Time", day);
new G4UnitDefinition("year", "y", "Time", year);
// Frequency
new G4UnitDefinition("hertz", "Hz", "Frequency", hertz);
new G4UnitDefinition("kilohertz", "kHz", "Frequency", kilohertz);
new G4UnitDefinition("megahertz", "MHz", "Frequency", megahertz);
// Velocity
new G4UnitDefinition("cm/ns", "cm/ns", "Velocity", cm/ns);
new G4UnitDefinition("mm/ns", "mm/ns", "Velocity", mm/ns);
new G4UnitDefinition("cm/us", "cm/us", "Velocity", cm/us);
new G4UnitDefinition("km/s" , "km/s" , "Velocity", km/s);
new G4UnitDefinition("cm/ms", "cm/ms", "Velocity", cm/ms);
new G4UnitDefinition( "m/s" , "m/s" , "Velocity", m/s);
new G4UnitDefinition("cm/s" , "cm/s" , "Velocity", cm/s);
new G4UnitDefinition("mm/s" , "mm/s" , "Velocity", mm/s);
// Electric charge
new G4UnitDefinition("eplus", "e+", "Electric charge", eplus);
new G4UnitDefinition("coulomb", "C", "Electric charge", coulomb);
// Energy
new G4UnitDefinition("electronvolt", "eV", "Energy", electronvolt);
new G4UnitDefinition("kiloelectronvolt", "keV", "Energy", kiloelectronvolt);
new G4UnitDefinition("megaelectronvolt", "MeV", "Energy", megaelectronvolt);
new G4UnitDefinition("gigaelectronvolt", "GeV", "Energy", gigaelectronvolt);
new G4UnitDefinition("teraelectronvolt", "TeV", "Energy", teraelectronvolt);
new G4UnitDefinition("petaelectronvolt", "PeV", "Energy", petaelectronvolt);
new G4UnitDefinition("millielectronVolt", "meV", "Energy", millielectronvolt);
new G4UnitDefinition("joule", "J", "Energy", joule);
//Momentum
new G4UnitDefinition( "eV/c", "eV/c", "Momentum", eV);
new G4UnitDefinition("keV/c", "keV/c", "Momentum", keV);
new G4UnitDefinition("MeV/c", "MeV/c", "Momentum", MeV);
new G4UnitDefinition("GeV/c", "GeV/c", "Momentum", GeV);
new G4UnitDefinition("TeV/c", "TeV/c", "Momentum", TeV);
// Energy/Length
new G4UnitDefinition("GeV/cm", "GeV/cm", "Energy/Length", GeV / cm);
new G4UnitDefinition("MeV/cm", "MeV/cm", "Energy/Length", MeV / cm);
new G4UnitDefinition("keV/cm", "keV/cm", "Energy/Length", keV / cm);
new G4UnitDefinition("eV/cm", "eV/cm", "Energy/Length", eV / cm);
// Mass
new G4UnitDefinition("milligram", "mg", "Mass", milligram);
new G4UnitDefinition("gram", "g", "Mass", gram);
new G4UnitDefinition("kilogram", "kg", "Mass", kilogram);
// Volumic Mass
new G4UnitDefinition("g/cm3", "g/cm3", "Volumic Mass", g / cm3);
new G4UnitDefinition("mg/cm3", "mg/cm3", "Volumic Mass", mg / cm3);
new G4UnitDefinition("kg/m3", "kg/m3", "Volumic Mass", kg / m3);
// Mass/Surface
new G4UnitDefinition("g/cm2", "g/cm2", "Mass/Surface", g / cm2);
new G4UnitDefinition("mg/cm2", "mg/cm2", "Mass/Surface", mg / cm2);
new G4UnitDefinition("kg/cm2", "kg/cm2", "Mass/Surface", kg / cm2);
// Surface/Mass
new G4UnitDefinition("cm2/g", "cm2/g", "Surface/Mass", cm2 / g);
// Energy.Surface/Mass
new G4UnitDefinition("eV*cm2/g", " eV*cm2/g", "Energy*Surface/Mass",
eV * cm2 / g);
new G4UnitDefinition("keV*cm2/g", "keV*cm2/g", "Energy*Surface/Mass",
keV * cm2 / g);
new G4UnitDefinition("MeV*cm2/g", "MeV*cm2/g", "Energy*Surface/Mass",
MeV * cm2 / g);
new G4UnitDefinition("GeV*cm2/g", "GeV*cm2/g", "Energy*Surface/Mass",
GeV * cm2 / g);
// Power
new G4UnitDefinition("watt", "W", "Power", watt);
// Force
new G4UnitDefinition("newton", "N", "Force", newton);
// Pressure
new G4UnitDefinition("pascal", "Pa", "Pressure", hep_pascal);
new G4UnitDefinition("bar", "bar", "Pressure", bar);
new G4UnitDefinition("atmosphere", "atm", "Pressure", atmosphere);
// Electric current
new G4UnitDefinition("ampere", "A", "Electric current", ampere);
new G4UnitDefinition("milliampere", "mA", "Electric current", milliampere);
new G4UnitDefinition("microampere", "muA", "Electric current", microampere);
new G4UnitDefinition("nanoampere", "nA", "Electric current", nanoampere);
// Electric potential
new G4UnitDefinition("volt", "V", "Electric potential", volt);
new G4UnitDefinition("kilovolt", "kV", "Electric potential", kilovolt);
new G4UnitDefinition("megavolt", "MV", "Electric potential", megavolt);
// Electric field
new G4UnitDefinition("volt/m", "V/m", "Electric field", volt / m);
new G4UnitDefinition("kilovolt/m", "kV/m", "Electric field", kilovolt / m);
new G4UnitDefinition("megavolt/m", "MV/m", "Electric field", megavolt / m);
// Magnetic flux
new G4UnitDefinition("weber", "Wb", "Magnetic flux", weber);
// Magnetic flux density
new G4UnitDefinition("tesla", "T", "Magnetic flux density", tesla);
new G4UnitDefinition("kilogauss", "kG", "Magnetic flux density", kilogauss);
new G4UnitDefinition("gauss", "G", "Magnetic flux density", gauss);
// Temperature
new G4UnitDefinition("kelvin", "K", "Temperature", kelvin);
// Amount of substance
new G4UnitDefinition("mole", "mol", "Amount of substance", mole);
new G4UnitDefinition("g/mole", "g/mol", "Molar mass", g / mole);
// Activity
new G4UnitDefinition("becquerel", "Bq", "Activity", becquerel);
new G4UnitDefinition("curie", "Ci", "Activity", curie);
// Dose
new G4UnitDefinition("gray", "Gy", "Dose", gray);
}
// --------------------------------------------------------------------
(3)重写SetNewValue函数
传入的参数都是字字符串,要根据你最后要接收的数据类型来对做数据转换,以下是常用的数据转换类型
(4)前面提到的XXX的理解
一般都叫 XXXXmesserger,在这个里面来创建自己的UI
17 TestEm5案例笔记
geant411版本程序相对10的版本的改变