cd mkdir g4work emacs .bashrc # 追記する内容は以下をみてください source .bashrc cp -r /usr/local/share/Geant4-9.5.1/examples g4work/ cd g4work/example/basic/B1 make ~/g4work/bin/Linux-g++/exampleB1 |
# Geant4 export G4WORKDIR=$HOME/g4work source /usr/local/share/Geant4-9.5.1/geant4make/geant4make.sh export G4VRMLFILE_VIEWER=vrmlview |
# yum install qt-devel |
cd mkdir geant4 cd geant4 tar xzvf geant4.9.5.p01.tar.gz mkdir geant4.9.5.p01-build cd geant4.9.5.p01-build ccmake /home/samurai/geant4/geant4.9.5.p01 |
CMAKE_BUILD_TYPE : (DEFAULT : Release) Debug GEANT4_INSTALL_DATA : (DEFAULT : OFF) on GEANT4_USE_QT (DEFAULT : OFF) on GEANT4_USE_OPENGL_X11 (DEFAULT : OFF, Unix Only) on GEANT4_USE_RAYTRACER_X11 on GEANT4_INSTALL_EXAMPLES : (DEFAULT : OFF) on |
# Geant4 source /usr/local/bin/geant4.sh # cmake使う人用 source /usr/local/share/Geant4-9.5.1/geant4make/geant4make.sh # 今までのmakefileを使う人用 export G4VRMLFILE_VIEWER=vrmlview # どちらか好きな方 export G4VRMLFILE_VIEWER=view3dscene # どちらか好きな方 |
$HOME/geant4/castle_game_engine $HOME/geant4/view3dscene |
$ ./compile.sh # cp tovrmlx3d view3dscene /usr/bin/ |
# yum install fpc # yum install gtk2-devel # yum install gtkglext-devel |
yum provides */libhoge-2.0.so |
libstdc++-libc6.1-1.so.2: cannot open shared object file |
# yum install compat-libstdc++-296 |
# ln -s libstdc++-libc6.2-2.so.3 libstdc++-libc6.1-1.so.2 |
#!/bin/bash CLIENT_NAME=`echo $SSH_CONNECTION | awk '{print $1}' | xargs host | awk '{print $5}'` TEMP_DIR=/tmp VRML_VIEWER=view3dscene scp $1 $CLIENT_NAME:$TEMP_DIR/ ssh $CLIENT_NAME -X "$VRML_VIEWER $TEMP_DIR/$1" |
CPPFLAGS += -UG4UI_USE_QT |
#include "G4UnitsTable.hh" G4UnitDefinition::PrintUnitsTable(); //print out the default units in unitsTable ../bin/Linux-g++/Hwater002 > h2o.txt Here Hwater002 is the executable file, and the output will be kept in h20.txt. Idle> /units/list This UI command is used to show the units defined in Geant4. |
CMAKE_BUILD_TYPE : (DEFAULT : Release) Debug |
debuginfo-install expat-2.0.1-11.fc15.i686 fontconfig-2.8.0-3.fc15.i686 freetype-2.4.4-7.fc15.i686 glib2-2.28.8-1.fc15.i686 keyutils-libs-1.2-7.fc15.i686 krb5-libs-1.9.3-1.fc15.i686 libICE-1.0.6-3.fc15.i686 libSM-1.2.0-2.fc15.i686 libXcursor-1.1.11-3.fc15.i686 libXdamage-1.1.3-2.fc15.i686 libXfixes-5.0-1.fc15.i686 libXi-1.4.3-3.fc15.i686 libXinerama-1.1.1-2.fc15.i686 libXmu-1.1.0-2.fc15.i686 libXrandr-1.3.1-2.fc15.i686 libXrender-0.9.6-2.fc15.i686 libXt-1.1.0-1.fc15.i686 libXxf86vm-1.1.1-2.fc15.i686 libcom_err-1.41.14-2.fc15.i686 libdrm-2.4.26-2.fc15.i686 libpng-1.2.48-1.fc15.i686 libselinux-2.0.99-4.fc15.i686 libuuid-2.19.1-1.4.fc15.i686 mesa-libGL-7.11.2-1.fc15.i686 mesa-libGLU-7.11.2-1.fc15.i686 openssl-1.0.0g-1.fc15.i686 qt-4.7.4-10.fc15.i686 qt-x11-4.7.4-10.fc15.i686 zlib-1.2.5-6.fc15.i686 |
if(A==1 && Z==1) return false; |
// primary change aParticleChange.ProposeEnergy(efinal); |
{ G4double mass = dynParticle->GetMass(); G4double T = efinal/mass; G4double velocity = c_light*std::sqrt(T*(T+2.))/(T+1.0); aParticleChange.ProposeVelocity(velocity); // theTotalResult->ProposeVelocity(velocity); // for 4.9.6 } |
if (!isVelocityChanged) theVelocityChange = pStep->GetTrack()->CalculateVelocity(); |
// G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep) if (!isVelocityChanged){ const G4DynamicParticle* pParticle = pStep->GetTrack()->GetDynamicParticle(); G4double mass = pParticle->GetMass(); G4double T = energy/mass; if(T > 0.0){ theVelocityChange = c_light*std::sqrt(T*(T+2.))/(T+1.0); }else{ theVelocityChange = 0; } } // G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep) // G4Step* G4ParticleChange::UpdateStepForAtRest(G4Step* pStep) if (!isVelocityChanged){ const G4DynamicParticle* pParticle = pStep->GetTrack()->GetDynamicParticle(); G4double mass = pParticle->GetMass(); G4double T = theEnergyChange/mass; theVelocityChange = c_light*std::sqrt(T*(T+2.))/(T+1.0); } |
touch: `/home/ryuki/g4work/save/neutrondetector1/tmp/Linux-g++/neutrondetectory/exe/obj.last' に touch できません: そのようなファイルやディレクトリはありません |
G4String s[19] = { "CHIPS", "FTFP_BERT","FTFP_BERT_TRV","FTF_BIC", "LBE","LHEP","QBBC", "QGSC_BERT","QGSP","QGSP_BERT","QGSP_BERT_CHIPS","QGSP_BERT_HP", "QGSP_BIC","QGSP_BIC_HP", "QGSP_FTFP_BERT","QGS_BIC","QGSP_INCLXX","QGSP_INCL_ABLA", "Shielding"}; G4String s1[6] = {"","_EMV","_EMX","_EMY","_LIV","_PEN"}; |
//neutronProcess->AddDataSet(new G4BGGNucleonElasticXS(particle)); neutronProcess->AddDataSet(new G4CHIPSElasticXS()); |
void G4BGGNucleonElasticXS::CrossSectionDescription(std::ostream& outFile) const { outFile << "The Barashenkov-Glauber-Gribov cross section handles elastic\n" << "scattering of protons and neutrons from nuclei using the\n" << "Barashenkov parameterization below 91 GeV and the Glauber-Gribov\n" << "parameterization above 91 GeV. n"; } |
outFile << "G4CHIPSElasticXS provides hadron-nuclear elastic scattering\n" << "cross sections for protons and neutrons with incident energies\n" << "between 19 MeV and X GeV. These cross sections represent\n" << "parameterizations developed by M. Kossov. (more detail)\n"; |
//neutronProcess->AddDataSet(new G4BGGNucleonElasticXS(particle)); //neutronProcess->AddDataSet(new G4CHIPSElasticXS()); neutronProcess->AddDataSet(new G4NeutronElasticXS()); |
Hadronic Processes for |
Hadronic Processes for |
void CrossSection(G4String elementName, G4String particleName) { const G4Element* elm = G4NistManager::Instance()->FindOrBuildElement(elementName); const G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle(particleName); if(!particle || !elm) { G4cout << "HistoManager WARNING Particle or element undefined" << G4endl; return; } G4cout << "### Fill Cross Sections for " << particleName << " of " << elementName << G4endl; G4HadronicProcessStore* store = G4HadronicProcessStore::Instance(); G4double eu = G4UnitDefinition::GetValueOf(energyunit); G4double cu = G4UnitDefinition::GetValueOf(crosssectionunit); for(G4double e = emin; e < emax; e = e*estep){ G4Material* targetMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLASTIC_SC_VINYLTOLUENE"); G4double elastic = store->GetElasticCrossSectionPerAtom(particle,e,elm,targetMaterial); G4double inelastic = store->GetInelasticCrossSectionPerAtom(particle,e,elm,targetMaterial); } } |
// 使えるUIを適当に G4UIExecutive* ui = new G4UIExecutive(argc, argv); ui->SessionStart(); delete ui; |
#include "G4UIterminal.hh" #include "G4UItcsh.hh" #include "G4UIQt.hh" #include "G4Qt.hh" // command line G4VUIshell* shell= new G4UItcsh; G4UIsession* session = new G4UIterminal(shell); session->SessionStart(); delete session; // Qt G4UIsession session = new G4UIQt(argc, argv); session->SessionStart(); delete session; |
CPPFLAGS += -UG4UI_USE_QT |
/vis/open VRML2FILE # vrmlviewを使う場合 /vis/open OGLIQt # Qtを使う場合 /vis/drawVolume /vis/scene/endOfEventAction accumulate 10 /vis/scene/add/trajectories /vis/scene/add/hits /run/beamOn 10 |
if(!himeSD){ G4SDManager* SDman = G4SDManager::GetSDMpointer(); himeSD = new HimeSD("/HimeSD"); SDman->AddNewDetector(himeSD); } logicTarget->SetSensitiveDetector(himeSD); |
G4ThreeVector tv(x,y,z); G4RotationMatrix rm; G4double phi(60*deg); tv.rotateZ(phi); rm.rotateZ(phi); G4PVPlacement(G4Transform3D(rm,tv),....); |
void rotate(G4double, const G4ThreeVector &); // Rotates around the axis specified by another G4ThreeVector. |
tv.rotate(phi, axis); rm.rotate(phi, axis); |
G4ThreeVector ax(x,y,z); tv -= ax; tv.rotateZ(phi); rm.rotateZ(phi); tv += ax; |
sr/local/geant4/src/geant4/source/global/managemant/include/G4RotationMatrix.hh sr/local/CLHEP/include/CLHEP/VectorThreeVector.h G4double innerRadiusOfTheTube = 0.*cm; G4double outerRadiusOfTheTube = 30.*cm; G4double hightOfTheTube = 20.*cm; G4double startAngleOfTheTube = 0.*deg; G4double spanningAngleOfTheTube = 360.*deg; G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube, outerRadiusOfTheTube,hightOfTheTube, startAngleOfTheTube,spanningAngleOfTheTube); tracker_log = new G4LogicalVolume(tracker_tube,Al,"tracker_log",0,0,0); G4double trackerPos_x = -3.0*m; G4double trackerPos_y = 0.*m; G4double trackerPos_z = 0.*m; G4ThreeVector tv(trackerPos_x,trackerPos_y,trackerPos_z);//new しなくてよい G4double shiftPos_x = 3.0*m; G4double shiftPos_y = 3.0*m; G4double shiftPos_z = 3.0*m; G4ThreeVector sh(shiftPos_x,shiftPos_y,shiftPos_z);//new しなくてよい G4double phi = 60.0*deg; G4double zaxis_x = 0.0*m; G4double zaxis_y = 0.0*m; G4double zaxis_z = 1.0*m; G4ThreeVector zaxis(zaxis_x, zaxis_y, zaxis_z); zaxis = zaxis.unit(); G4double rotateaxis_x = 1.0*m; G4double rotateaxis_y = 1.0*m; G4double rotateaxis_z = 1.0*m; G4ThreeVector rotateaxis(rotateaxis_x, rotateaxis_y, rotateaxis_z); rotateaxis = rotateaxis.unit(); G4RotationMatrix rm;//new しなくてよい rm.rotate(zaxis.angle(rotateaxis), zaxis.cross(rotateaxis)); // G4cout << rm.rep3x3() << G4endl; for(int i = 0; i < 6 ; ++i){ tracker_phys = new G4PVPlacement(G4Transform3D(rm,tv), tracker_log, "tracker_P", experimentalHall_log,false,i); tv -= sh; tv.rotate(phi, rotateaxis); rm.rotate(phi, rotateaxis); tv += sh; } |
#include "G4NistManager.hh" // targetMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al"); targetMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLASTIC_SC_VINYLTOLUENE"); worldMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic"); |
G4cout << *(G4Material::GetMaterialTable()) << G4end; |