Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -211,6 +211,14 @@
|
||||
automatically merged in a single output file, while the ntuple is written
|
||||
in files per thread.
|
||||
|
||||
\section B5_s8 BUILD OPTIONS
|
||||
|
||||
This example can be built with excluding use of visualization and/or
|
||||
Geant4 user interface using G4VIS_USE and G4UI_USE compiler options.
|
||||
These options are defined with Geant4 configuration, they are not set
|
||||
when Geant4 libraries were built with G4VIS_NONE or G4UI_NONE option
|
||||
respectively.
|
||||
|
||||
<hr>
|
||||
|
||||
The following paragraphs are common to all basic examples
|
||||
@@ -273,11 +281,14 @@ The following paragraphs are common to all basic examples
|
||||
|
||||
\section B5_B USER INTERFACES
|
||||
|
||||
The user command interface is set via the G4UIExecutive class
|
||||
in the main() function in exampleB5.cc
|
||||
The selection of the user command interface is then done automatically
|
||||
according to the Geant4 configuration or it can be done explicitly via
|
||||
the third argument of the G4UIExecutive constructor (see exampleB4a.cc).
|
||||
This example can be built with excluding visualization and/or
|
||||
Geant4 user interface via G4VIS_USE and G4UI_USE compiler options
|
||||
(see exampleB5.cc).
|
||||
These options are defined by default with Geant4 configuration;
|
||||
they can switched off at compilation time via the CMake options
|
||||
G4VIS_NONE or G4UI_NONE or via the environment variables of the
|
||||
same name if using GNUmake build.
|
||||
|
||||
|
||||
\section B5_C HOW TO RUN
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History 78054 2013-12-03 08:26:31Z gcosmo $
|
||||
$Id: History 87359 2014-12-01 16:04:27Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -15,6 +15,31 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
29 November 2014 Ivana Hrivnacova
|
||||
- Use G4endl instead of \n in G4cout;
|
||||
this makes each new line in the output on threads preceded with
|
||||
G4WTN >
|
||||
|
||||
06 November 2014 Ivana Hrivnacova
|
||||
- Moved G4UIExecutive at the beginning of main() in all examples
|
||||
- Perform run initialization in macros instead of main()
|
||||
- Added BUILD OPTIONS section in README explaining meaning of
|
||||
G4UI_USE/G4VIS_USE options in main
|
||||
|
||||
27 Oct 2014 Davide Mancusi (exampleB5-V10-00-01)
|
||||
- Switch off primary randomization in gui.mac (needed for the /gun/ UI commands
|
||||
to work)
|
||||
|
||||
16 Sept 2014 Andrea Dotti
|
||||
- Removing test code introduced in previous tag. Previous
|
||||
tag has been rejected as planned.
|
||||
|
||||
15 July 2014 Andrea Dotti (exampleB5-V10-00-00)
|
||||
- This tag is intentionally WRONG: it introduces an
|
||||
FPE violation (division by zero) at event 1. It is
|
||||
used yo verify correct behavior of FPE detection in MT.
|
||||
When tests will be over, changes will be reverted.
|
||||
|
||||
02 December 2013 Ivana Hrivnacova
|
||||
- Fixed gui.mac:
|
||||
corrected wireframe parameter, removed run2.mac from gui
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: README 78001 2013-12-02 08:24:53Z gcosmo $
|
||||
$Id: README 86065 2014-11-07 08:51:15Z gcosmo $
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
@@ -135,7 +135,7 @@ $Id: README 78001 2013-12-02 08:24:53Z gcosmo $
|
||||
The frequency of printing can be tuned with the built-in command
|
||||
/run/printProgress frequency
|
||||
|
||||
4. DETECTOR RESPONSE:
|
||||
6- DETECTOR RESPONSE:
|
||||
|
||||
All the information required to simulate and analyze an event is
|
||||
recorded in hits. This information is recorded in the following
|
||||
@@ -178,7 +178,7 @@ $Id: README 78001 2013-12-02 08:24:53Z gcosmo $
|
||||
but these are filled automatically in the base classes.
|
||||
HepRep is further described at: http://www.slac.stanford.edu/~perl/heprep/
|
||||
|
||||
5. ANALYSIS:
|
||||
7- ANALYSIS:
|
||||
|
||||
The analysis tools are used to accumulate statistics.
|
||||
Histograms and an ntuple are created in B5RunAction::B5RunAction()
|
||||
@@ -208,6 +208,16 @@ $Id: README 78001 2013-12-02 08:24:53Z gcosmo $
|
||||
automatically merged in a single output file, while the ntuple is written
|
||||
in files per thread.
|
||||
|
||||
8- BUILD OPTIONS:
|
||||
|
||||
This example can be built with excluding visualization and/or
|
||||
Geant4 user interface via G4VIS_USE and G4UI_USE compiler options
|
||||
(see exampleB5.cc).
|
||||
These options are defined by default with Geant4 configuration;
|
||||
they can switched off at compilation time via the CMake options
|
||||
G4VIS_NONE or G4UI_NONE or via the environment variables of the
|
||||
same name if using GNUmake build.
|
||||
|
||||
The following paragraphs are common to all basic examples
|
||||
|
||||
A- VISUALISATION
|
||||
|
||||
@@ -53,71 +53,75 @@
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
#ifdef G4UI_USE
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = 0;
|
||||
if ( argc == 1 ) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MTRunManager* runManager = new G4MTRunManager;
|
||||
G4MTRunManager* runManager = new G4MTRunManager;
|
||||
#else
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
#endif
|
||||
|
||||
// Mandatory user initialization classes
|
||||
runManager->SetUserInitialization(new B5DetectorConstruction);
|
||||
|
||||
G4VModularPhysicsList* physicsList = new FTFP_BERT;
|
||||
physicsList->RegisterPhysics(new G4StepLimiterPhysics());
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
// User action initialization
|
||||
runManager->SetUserInitialization(new B5ActionInitialization());
|
||||
|
||||
// Initialize Geant4 kernel
|
||||
runManager->Initialize();
|
||||
|
||||
// Mandatory user initialization classes
|
||||
runManager->SetUserInitialization(new B5DetectorConstruction);
|
||||
|
||||
G4VModularPhysicsList* physicsList = new FTFP_BERT;
|
||||
physicsList->RegisterPhysics(new G4StepLimiterPhysics());
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
// User action initialization
|
||||
runManager->SetUserInitialization(new B5ActionInitialization());
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Visualization manager construction
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
visManager->Initialize();
|
||||
// Visualization manager construction
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
// Get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc>1) {
|
||||
// execute an argument macro file if exist
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
else {
|
||||
// start interactive session
|
||||
if ( argc != 1 ) {
|
||||
// execute an argument macro file if exist
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
else {
|
||||
#ifdef G4UI_USE
|
||||
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
|
||||
#ifdef G4VIS_USE
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
#else
|
||||
UImanager->ApplyCommand("/control/execute init.mac");
|
||||
UImanager->ApplyCommand("/control/execute init.mac");
|
||||
#endif
|
||||
if (ui->IsGUI())
|
||||
UImanager->ApplyCommand("/control/execute gui.mac");
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
if (ui->IsGUI()) {
|
||||
UImanager->ApplyCommand("/control/execute gui.mac");
|
||||
}
|
||||
// start interactive session
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Job termination
|
||||
// Free the store: user actions, physics_list and detector_description are
|
||||
// owned and deleted by the run manager, so they should not be deleted
|
||||
// in the main() program !
|
||||
|
||||
}
|
||||
|
||||
// Job termination
|
||||
// Free the store: user actions, physics_list and detector_description are
|
||||
// owned and deleted by the run manager, so they should not be deleted
|
||||
// in the main() program !
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
delete runManager;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
# Test macro file for exampleB5
|
||||
#
|
||||
|
||||
/run/initialize
|
||||
|
||||
# Turn off randomization
|
||||
/B5/generator/randomizePrimary false
|
||||
/B5/generator/sigmaMomentum 0.
|
||||
|
||||
+766
-1179
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,9 @@
|
||||
/gui/addButton gun "pi+" "/gun/particle pi+"
|
||||
/gui/addButton gun "neutron" "/gun/particle neutron"
|
||||
/gui/addButton gun "proton" "/gun/particle proton"
|
||||
# Also, we need to switch off primary randomization for the /gun/ commands to
|
||||
# work
|
||||
/B5/generator/randomizePrimary false
|
||||
#
|
||||
# Field menu :
|
||||
/gui/addMenu field Field
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
# Macro file for the initialization phase of example B5
|
||||
# Macro file for the initialization of example B1
|
||||
# when running in interactive mode without visualization
|
||||
#
|
||||
# Set some default verbose
|
||||
/control/verbose 2
|
||||
/control/saveHistory
|
||||
/run/verbose 2
|
||||
#
|
||||
# Change the default number of threads (in multi-threaded mode)
|
||||
#/run/numberOfThreads 4
|
||||
#
|
||||
# Initialize kernel
|
||||
/run/initialize
|
||||
|
||||
@@ -7,5 +7,11 @@
|
||||
/control/saveHistory
|
||||
/run/verbose 2
|
||||
#
|
||||
# Change the default number of threads (in multi-threaded mode)
|
||||
#/run/numberOfThreads 4
|
||||
#
|
||||
# Initialize kernel
|
||||
/run/initialize
|
||||
#
|
||||
# Visualization setting
|
||||
/control/execute vis.mac
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
# Can be run in batch, without graphic
|
||||
# or interactively: Idle> /control/execute run1.mac
|
||||
#
|
||||
# Change the default number of workers (in multi-threading mode)
|
||||
#/run/numberOfWorkers 4
|
||||
#
|
||||
# Initialize kernel
|
||||
/run/initialize
|
||||
#
|
||||
# Defaults:
|
||||
# armAngle 30. deg
|
||||
# field value: 1.0*tesla
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# To be run preferably in batch, without graphics:
|
||||
# % exampleB5 run2.mac
|
||||
#
|
||||
#/run/numberOfWorkers 4
|
||||
/run/initialize
|
||||
#
|
||||
# turn off randomization
|
||||
#
|
||||
/B5/generator/randomizePrimary FALSE
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: B5EventAction.cc 76474 2013-11-11 10:36:34Z gcosmo $
|
||||
// $Id: B5EventAction.cc 87359 2014-12-01 16:04:27Z gcosmo $
|
||||
//
|
||||
/// \file B5EventAction.cc
|
||||
/// \brief Implementation of the B5EventAction class
|
||||
@@ -87,7 +87,7 @@ void B5EventAction::EndOfEventAction(const G4Event* event)
|
||||
if (!hce)
|
||||
{
|
||||
G4ExceptionDescription msg;
|
||||
msg << "No hits collection of this event found.\n";
|
||||
msg << "No hits collection of this event found." << G4endl;
|
||||
G4Exception("B5EventAction::EndOfEventAction()",
|
||||
"B5Code001", JustWarning, msg);
|
||||
return;
|
||||
@@ -116,7 +116,7 @@ void B5EventAction::EndOfEventAction(const G4Event* event)
|
||||
if ( (!hHC1) || (!hHC2) || (!dHC1) || (!dHC2) || (!ecHC) || (!hcHC) )
|
||||
{
|
||||
G4ExceptionDescription msg;
|
||||
msg << "Some of hits collections of this event not found.\n";
|
||||
msg << "Some of hits collections of this event not found." << G4endl;
|
||||
G4Exception("B5EventAction::EndOfEventAction()",
|
||||
"B5Code001", JustWarning, msg);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user