ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
STCyclotron.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file STCyclotron.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
// --------------------------------------------------------------
27
// GEANT 4 - Solid Target Cyclotron example
28
// --------------------------------------------------------------
29
//
30
// Code developed currently by:
31
// F. Poignant & S.Guatelli
32
// Code also developed in the past by:
33
// S. Penfold
34
//
35
// file STCyclotron.cc
36
//
37
#include "
G4MTRunManager.hh
"
38
#include "
G4RunManager.hh
"
39
#include "
G4UImanager.hh
"
40
#include "
G4VisExecutive.hh
"
41
#include "
G4UIExecutive.hh
"
42
#include "
STCyclotronAnalysis.hh
"
43
44
#include "
STCyclotronActionInitialization.hh
"
45
#include "
STCyclotronDetectorConstruction.hh
"
46
#include "
STCyclotronPhysicsList.hh
"
47
#include "
STCyclotronPrimaryGeneratorAction.hh
"
48
#include "
STCyclotronRunAction.hh
"
49
50
int
main
(
int
argc,
char
** argv)
51
{
52
#ifdef G4MULTITHREADED
53
G4MTRunManager
* runManager =
new
G4MTRunManager
;
54
runManager->
SetNumberOfThreads
(4);
// Is equal to 2 by default
55
#else
56
G4RunManager
* runManager =
new
G4RunManager
;
57
#endif
58
59
//Set mandatory initialization classes
60
STCyclotronDetectorConstruction
* det =
new
STCyclotronDetectorConstruction
();
61
runManager->
SetUserInitialization
(det);
62
63
STCyclotronPhysicsList
* physList =
new
STCyclotronPhysicsList
(det);
64
runManager->
SetUserInitialization
(physList);
65
66
// User action initialization
67
STCyclotronActionInitialization
* actions =
new
STCyclotronActionInitialization
(det);
68
runManager->
SetUserInitialization
(actions);
69
70
//Set the random number seed
71
/*
72
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
73
G4long seed=time(0);
74
CLHEP::HepRandom::setTheSeed(seed);
75
G4cout << "***********************" << G4endl;
76
G4cout << "*** Seed: " << CLHEP::HepRandom::getTheSeed() << " ***" << G4endl;
77
G4cout << "***********************" << G4endl;
78
//getchar();
79
*/
80
81
G4VisManager
* visManager =
new
G4VisExecutive
(
"Quiet"
);
82
visManager->
Initialize
();
83
84
// Get the pointer to the User Interface manager
85
G4UImanager
* UImanager =
G4UImanager::GetUIpointer
();
86
//initialize : beam parameters + simulation parameters (geometry)
87
UImanager->
ApplyCommand
(
"/control/execute Macro/init_parameters.mac"
);
88
89
if
(argc!=1) {
90
// batch mode
91
//to apply the command : sahmri_simulation run.mac
92
G4String
command =
"/control/execute "
;
93
G4String
fileName = argv[1];
94
UImanager->
ApplyCommand
(command+fileName);
95
}
96
97
else
{
98
// interactive mode : define UI session
99
100
G4UIExecutive
* ui =
new
G4UIExecutive
(argc, argv);
101
102
UImanager->
ApplyCommand
(
"/control/execute Macro/Vis/init_vis.mac"
);
103
//UImanager->ApplyCommand("/control/execute Macro/init.mac");
104
105
if
(ui->
IsGUI
())
106
UImanager->
ApplyCommand
(
"/control/execute Macro/GUI/gui.mac"
);
107
ui->
SessionStart
();
108
delete
ui;
109
}
110
111
delete
visManager;
112
delete
runManager;
113
114
return
0;
115
116
}
geant4
tree
geant4-10.6-release
examples
advanced
STCyclotron
STCyclotron.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:00
using
1.8.2 with
ECCE GitHub integration