1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: decay_test_01.cc,v 1.4 2007/05/07 10:12:29 kurasige Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ |
---|
29 | // |
---|
30 | |
---|
31 | #include "Tst01DetectorConstruction.hh" |
---|
32 | #include "Tst01RunAction.hh" |
---|
33 | #include "Tst01PrimaryGeneratorAction.hh" |
---|
34 | #include "Tst01PhysicsList.hh" |
---|
35 | |
---|
36 | #include "G4UImanager.hh" |
---|
37 | #include "G4UIterminal.hh" |
---|
38 | #include "G4RunManager.hh" |
---|
39 | |
---|
40 | #include "G4ios.hh" |
---|
41 | |
---|
42 | int main(int argc,char** argv) { |
---|
43 | |
---|
44 | // Set the default random engine to RanecuEngine |
---|
45 | CLHEP::RanecuEngine defaultEngine; |
---|
46 | CLHEP::HepRandom::setTheEngine(&defaultEngine); |
---|
47 | |
---|
48 | // Run manager |
---|
49 | G4RunManager * runManager = new G4RunManager; |
---|
50 | |
---|
51 | // UserInitialization classes |
---|
52 | runManager->SetUserInitialization(new Tst01DetectorConstruction); |
---|
53 | runManager->SetUserInitialization(new Tst01PhysicsList); |
---|
54 | |
---|
55 | // UserAction classes |
---|
56 | runManager->SetUserAction(new Tst01RunAction); |
---|
57 | runManager->SetUserAction(new Tst01PrimaryGeneratorAction); |
---|
58 | |
---|
59 | if(argc==1) |
---|
60 | { |
---|
61 | // G4UIterminal is a (dumb) terminal. |
---|
62 | G4UIsession* session = new G4UIterminal; |
---|
63 | session->SessionStart(); |
---|
64 | delete session; |
---|
65 | } |
---|
66 | else |
---|
67 | { |
---|
68 | G4UImanager* UImanager = G4UImanager::GetUIpointer(); |
---|
69 | G4String command = "/control/execute "; |
---|
70 | G4String fileName = argv[1]; |
---|
71 | UImanager->ApplyCommand(command+fileName); |
---|
72 | } |
---|
73 | |
---|
74 | delete runManager; |
---|
75 | return 0; |
---|
76 | } |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | |
---|