Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
pythia6_decayer.cc
이 파일의 문서화 페이지로 가기
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 // $Id: pythia6_decayer.cc 106393 2017-10-09 09:46:03Z gcosmo $
27 //
30 
31 #include "P6DExtDecayerPhysics.hh"
32 
33 #include "DetectorConstruction.hh"
34 #include "GunPrimaryGeneratorAction.hh"
35 
36 #include "G4RunManager.hh"
37 #include "G4UImanager.hh"
38 #include "QGSP_BERT.hh"
39 #include "G4ThreeVector.hh"
40 #include "G4SystemOfUnits.hh"
41 
42 #include "G4VisExecutive.hh"
43 #include "G4UIExecutive.hh"
44 
45 #include "Randomize.hh"
46 
47 int main(int argc,char** argv)
48 {
49  // Detect interactive mode (if no arguments) and define UI session
50  //
51  G4UIExecutive* ui = 0;
52  if ( argc == 1 ) {
53  ui = new G4UIExecutive(argc, argv);
54  }
55 
56  // Choose the Random engine
57  //
58  G4Random::setTheEngine(new CLHEP::RanecuEngine);
59 
60  // Construct the default run manager
61  //
62  G4RunManager * runManager = new G4RunManager;
63 
64  // Set mandatory initialization classes
65  //
67 
68  //
69  G4VModularPhysicsList* physicsList = new QGSP_BERT;
70  physicsList->RegisterPhysics(new P6DExtDecayerPhysics());
71  runManager->SetUserInitialization(physicsList);
72 
73  // Set user action classes
74  //
75  runManager->SetUserAction(
76  new GunPrimaryGeneratorAction("B-", 50.*MeV));
77  // B- meson has not defined decay in Geant4
78 
79  // Initialize visualization
80  //
81  G4VisManager* visManager = new G4VisExecutive;
82  // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
83  // G4VisManager* visManager = new G4VisExecutive("Quiet");
84  visManager->Initialize();
85 
86  // Get the pointer to the User Interface manager
88 
89  // Process macro or start UI session
90  //
91  if ( ! ui ) {
92  // batch mode
93  G4String command = "/control/execute ";
94  G4String fileName = argv[1];
95  UImanager->ApplyCommand(command+fileName);
96  }
97  else {
98  // interactive mode
99  UImanager->ApplyCommand("/control/execute init_vis.mac");
100  ui->SessionStart();
101  delete ui;
102  }
103 
104  // Job termination
105  // Free the store: user actions, physics_list and detector_description are
106  // owned and deleted by the run manager, so they should not
107  // be deleted in the main() program !
108  delete visManager;
109  delete runManager;
110 }
static constexpr double MeV
Definition: G4SIunits.hh:214
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:466
virtual void SetUserAction(G4UserRunAction *userAction)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:73
Definition of the P6DExtDecayerPhysics class.
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void RegisterPhysics(G4VPhysicsConstructor *)
int main(int argc, char **argv)
Definition: genwindef.cc:359
The primary generator class with particle gun.
TQGSP_BERT< G4VModularPhysicsList > QGSP_BERT
Definition: QGSP_BERT.hh:63
void Initialize()
Simple detector construction with a box volume placed in a world.