⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mt01.cc

📁 利用linux环境下蒙特卡罗计算工具geant4实现伽玛射线与探测器乘积能量的模拟过程
💻 CC
字号:
//// ********************************************************************// * DISCLAIMER                                                       *// *                                                                  *// * The following disclaimer summarizes all the specific disclaimers *// * of contributors to this software. The specific disclaimers,which *// * govern, are listed with their locations in:                      *// *   http://cern.ch/geant4/license                                  *// *                                                                  *// * Neither the authors of this software system, nor their employing *// * institutes,nor the agencies providing financial support for this *// * work  make  any representation or  warranty, express or implied, *// * regarding  this  software system or assume any liability for its *// * use.                                                             *// *                                                                  *// * This  code  implementation is the  intellectual property  of the *// * GEANT4 collaboration.                                            *// * By copying,  distributing  or modifying the Program (or any work *// * based  on  the Program)  you indicate  your  acceptance of  this *// * statement, and all its terms.                                    *// ********************************************************************////// $Id: exampleN02.cc,v 1.8 2002/01/09 17:23:49 ranjard Exp $// GEANT4 tag $Name: geant4-07-00-patch-01 $//// //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......#include "mt01DetectorConstruction.hh"#include "mt01PhysicsList.hh"#include "mt01PrimaryGeneratorAction.hh"#include "mt01RunAction.hh"#include "mt01EventAction.hh"#include "mt01SteppingAction.hh"//#include "mt01SteppingVerbose.hh"#include "mt01.hh"#include "G4RunManager.hh"#include "G4UImanager.hh"#include "G4UIterminal.hh"#include "G4UItcsh.hh"#ifdef G4VIS_USE//#include "mt01VisManager.hh"#endif//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......int main(int argc,char** argv) {  //my Verbose output class  //G4VSteppingVerbose::SetInstance(new ExN02SteppingVerbose);  G4int i;  for(i=0;i<10001;i++)    {      mytest[i]=0;    }  i=0;  // Run manager  G4RunManager * runManager = new G4RunManager;  G4int mycount=0;    // UserInitialization classes (mandatory)  mt01DetectorConstruction* mt01detector = new mt01DetectorConstruction;  runManager->SetUserInitialization(mt01detector);  runManager->SetUserInitialization(new mt01PhysicsList);  #ifdef G4VIS_USE// Visualization, if you choose to have it!// G4VisManager* visManager = new mt01VisManager;  // visManager->Initialize();#endif     // UserAction classes  runManager->SetUserAction(new mt01PrimaryGeneratorAction);  runManager->SetUserAction(new mt01RunAction);    runManager->SetUserAction(new mt01EventAction);  runManager->SetUserAction(new mt01SteppingAction);  //Initialize G4 kernel  runManager->Initialize();        //get the pointer to the User Interface manager  G4UImanager * UI = G4UImanager::GetUIpointer();    if(argc==1)  // Define (G)UI terminal for interactive mode    {     // G4UIterminal is a (dumb) terminal.     G4UIsession * session = 0;    #ifdef G4UI_USE_TCSH      session = new G4UIterminal(new G4UItcsh);           #else      session = new G4UIterminal();    #endif          ///xiugai      UI->ApplyCommand("/control/execute test1.mac");       UI->ApplyCommand("/run/beamOn 1000");         session->SessionStart();     delete session;     // runManager->BeamOn(1900000);  }  else  // Batch mode        {       G4String command = "/control/execute ";       G4String fileName = argv[1];        UI->ApplyCommand(command+fileName);  }#ifdef G4VIS_USE  // delete visManager;#endif  delete runManager;  //  for (i=0;i<10001;i++)  // {  //   G4cout<<mytest[i]<<G4endl;  //  }  //G4cout<<mycount;  return 0;}//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -