|
||||
File indexing completed on 2025-01-30 09:20:37
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // 0027 // ********************************************************************** 0028 // * * 0029 // * GEANT 4 xray_telescope advanced example * 0030 // * * 0031 // * MODULE: XrayTel.cc main file * 0032 // * ------- * 0033 // * * 0034 // * Version: 0.4 * 0035 // * Date: 06/11/00 * 0036 // * Author: R Nartallo * 0037 // * Organisation: ESA/ESTEC, Noordwijk, THe Netherlands * 0038 // * * 0039 // ********************************************************************** 0040 // 0041 // HISTORY 0042 // ------- 0043 // 0044 // The development of this advanced example is based on earlier work 0045 // carried out by a team of Geant4 collaborators to simulate the Chandra 0046 // and XMM X-ray observatories. The authors involved in those models are 0047 // J Apostolakis, P Arce, S Giani, F Lei, R Nartallo, S Magni, 0048 // P Truscott, L Urban 0049 // 0050 // ********************************************************************** 0051 // 0052 // CHANGE HISTORY 0053 // -------------- 0054 // 0055 // 05.12.2001 R. Nartallo 0056 // -Removed XM vis option 0057 // 0058 // 07.11.2001 M.G. Pia 0059 // - Modified the analysis management 0060 // - Small design iteration 0061 // 0062 // 30.11.2000 R. Nartallo, A. Pfeiffer 0063 // - Implementation of analysis manager code for histograming 0064 // 0065 // 15.11.2000 R. Nartallo 0066 // - Minor changes proposed by F. Lei to implement the GPS module now 0067 // replacing the standard particle gun 0068 // - Remove commented lines related to old histograming code 0069 // 0070 // 06.11.2000 R.Nartallo 0071 // - First implementation of X-ray Telescope advanced example. 0072 // - Based on Chandra and XMM models 0073 // - Lines for using GAG and the histogram manager are commented out. 0074 // 0075 // 0076 // ********************************************************************** 0077 0078 #include "G4Types.hh" 0079 #include "G4RunManagerFactory.hh" 0080 #include "G4UImanager.hh" 0081 #include "XrayTelDetectorConstruction.hh" 0082 #include "XrayTelPhysicsList.hh" 0083 #include "XrayTelActionInitializer.hh" 0084 #include "G4VisExecutive.hh" 0085 #include "G4UIExecutive.hh" 0086 0087 int main( int argc, char** argv ) 0088 { 0089 // Construct the default run manager 0090 auto* runManager = G4RunManagerFactory::CreateRunManager(); 0091 G4int nThreads = 4; 0092 runManager->SetNumberOfThreads(nThreads); 0093 0094 // set mandatory initialization classes 0095 runManager->SetUserInitialization(new XrayTelDetectorConstruction ) ; 0096 runManager->SetUserInitialization(new XrayTelPhysicsList); 0097 runManager->SetUserInitialization(new XrayTelActionInitializer()); 0098 0099 // visualization manager 0100 G4VisManager* visManager = new G4VisExecutive; 0101 visManager->Initialize(); 0102 0103 //Initialize G4 kernel 0104 runManager->Initialize(); 0105 0106 // get the pointer to the User Interface manager 0107 G4UImanager *UImanager = G4UImanager::GetUIpointer(); 0108 if ( argc==1 ){ 0109 G4UIExecutive* ui = new G4UIExecutive(argc, argv); 0110 UImanager->ApplyCommand("/control/execute vis.mac"); 0111 ui->SessionStart(); 0112 delete ui; 0113 } 0114 else { 0115 // Create a pointer to the User Interface manager 0116 G4String command = "/control/execute "; 0117 for (int i=2; i<=argc; i++) { 0118 G4String macroFileName = argv[i-1]; 0119 UImanager->ApplyCommand(command+macroFileName); 0120 } 0121 } 0122 0123 // job termination 0124 delete visManager; 0125 delete runManager; 0126 return 0; 0127 }
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |