Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -204,8 +204,19 @@
|
||||
- Vector of energy deposits in EM calorimeter cells
|
||||
- Vector of energy deposits in Hadronic calorimeter cells
|
||||
|
||||
The histograms and ntuple are saved in the output file in a format
|
||||
according to a technology selected in B5Analysis.hh.
|
||||
The histograms and ntuple are saved in two output files in a default
|
||||
(Root) file format.
|
||||
|
||||
Another file format (for example xml) can be selected either by
|
||||
changing the generic analysis manager default file type:
|
||||
\verbatim
|
||||
analysisManager->SetDefaultFileType("xml");
|
||||
\endverbatim
|
||||
or by providing the file names with the extension:
|
||||
\verbatim
|
||||
analysisManager->SetFileName("B5.xml");
|
||||
analysisManager->SetNtupleFileName(0, "B4ntuple.xml");
|
||||
\endverbatim
|
||||
|
||||
When running in multi-threading mode, the histograms and ntuple accumulated
|
||||
on threads are automatically merged in a single output file.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Setup the project
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.8...3.18)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
endif()
|
||||
project(B5)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
@@ -25,7 +28,7 @@ include(${Geant4_USE_FILE})
|
||||
# Locate sources and headers for this project
|
||||
# NB: headers are included so they will show up in IDEs
|
||||
#
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${Geant4_INCLUDE_DIR})
|
||||
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
|
||||
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
|
||||
@@ -42,15 +45,15 @@ target_link_libraries(exampleB5 ${Geant4_LIBRARIES})
|
||||
# relies on these scripts being in the current working directory.
|
||||
#
|
||||
set(B5_SCRIPTS
|
||||
exampleB5.in
|
||||
exampleB5.out
|
||||
exampleB5.in
|
||||
exampleB5.out
|
||||
icons.mac
|
||||
gui.mac
|
||||
run.png
|
||||
init.mac
|
||||
init_vis.mac
|
||||
run1.mac
|
||||
run2.mac
|
||||
init.mac
|
||||
init_vis.mac
|
||||
run1.mac
|
||||
run2.mac
|
||||
vis.mac
|
||||
)
|
||||
|
||||
|
||||
@@ -14,6 +14,14 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
06 Nov 2020 I. Hrivnacova (exampleB5-V10-06-02)
|
||||
- Replaced use of G4Analysis::ManagerInstance("root") with new
|
||||
generic analysis manager
|
||||
- Storing ntuple in a separate file
|
||||
|
||||
02 Nov 2020 B.Morgan (exampleB5-V10-06-01)
|
||||
- Support same CMake version range as core Geant4
|
||||
|
||||
10 June 2020 Jonathan Madsen (exampleB5-V10-06-00)
|
||||
- Migrated to new G4RunManagerFactory
|
||||
|
||||
|
||||
@@ -201,8 +201,15 @@
|
||||
- Vector of energy deposits in EM calorimeter cells
|
||||
- Vector of energy deposits in Hadronic calorimeter cells
|
||||
|
||||
The histograms and ntuple are saved in the output file in a format
|
||||
according to a technology selected in B5Analysis.hh.
|
||||
The histograms and ntuple are saved in two output files in a default
|
||||
(Root) file format.
|
||||
|
||||
Another file format (for example xml) can be selected either by
|
||||
changing the generic analysis manager default file type:
|
||||
analysisManager->SetDefaultFileType("xml");
|
||||
or by providing the file names with the extension:
|
||||
analysisManager->SetFileName("B5.xml");
|
||||
analysisManager->SetNtupleFileName(0, "B4ntuple.xml");
|
||||
|
||||
When running in multi-threading mode, the histograms and ntuple accumulated
|
||||
on threads are automatically merged in a single output file.
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
/B5/generator/sigmaAngle 0.
|
||||
/run/printProgress 5
|
||||
#
|
||||
/analysis/ntuple/setFileName 0 B5ntuple
|
||||
#
|
||||
/B5/detector/armAngle 30. deg
|
||||
/gun/particle proton
|
||||
/B5/generator/momentum 100. GeV
|
||||
|
||||
+466
-248
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,8 @@
|
||||
# % exampleB5 run2.mac
|
||||
#
|
||||
#/run/numberOfThreads 4
|
||||
/control/cout/ignoreThreadsExcept 0
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
# turn off randomization
|
||||
@@ -19,6 +21,7 @@
|
||||
/B5/generator/momentum 100. GeV
|
||||
/B5/field/value 100. tesla
|
||||
/analysis/setFileName B5_proton
|
||||
/analysis/ntuple/setFileName 0 B5ntuple_proton
|
||||
/run/beamOn 30
|
||||
#
|
||||
/B5/detector/armAngle 60. deg
|
||||
@@ -26,6 +29,7 @@
|
||||
/B5/generator/momentum 100. GeV
|
||||
/B5/field/value 200. tesla
|
||||
/analysis/setFileName B5_pi+
|
||||
/analysis/ntuple/setFileName 0 B5ntuple_pi+
|
||||
/run/beamOn 30
|
||||
#
|
||||
/gun/particle e+
|
||||
@@ -33,5 +37,6 @@
|
||||
/B5/generator/momentum 100. GeV
|
||||
/B5/field/value 100. tesla
|
||||
/analysis/setFileName B5_e+
|
||||
/analysis/ntuple/setFileName 0 B5ntuple_e+
|
||||
/run/beamOn 30
|
||||
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
#include "G4Run.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "g4analysis.hh"
|
||||
#include "G4GenericAnalysisManager.hh"
|
||||
|
||||
using G4AnalysisManager = G4GenericAnalysisManager;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -41,19 +43,21 @@ B5RunAction::B5RunAction(B5EventAction* eventAction)
|
||||
: G4UserRunAction(),
|
||||
fEventAction(eventAction)
|
||||
{
|
||||
// Create the analysis manager using a new factory method.
|
||||
// The choice of analysis technology is done via the function argument.
|
||||
auto analysisManager = G4Analysis::ManagerInstance("root");
|
||||
G4cout << "Using " << analysisManager->GetType() << G4endl;
|
||||
// Create the generic analysis manager
|
||||
// The choice of analysis technology is done according to the file extension
|
||||
auto analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->SetVerboseLevel(1);
|
||||
|
||||
// Default settings
|
||||
analysisManager->SetNtupleMerging(true);
|
||||
// Note: merging ntuples is available only with Root output
|
||||
analysisManager->SetVerboseLevel(1);
|
||||
analysisManager->SetFileName("B5");
|
||||
// If the filename extension is not provided, the default file type (root)
|
||||
// will be used for all files specified without extension.
|
||||
// analysisManager->SetDefaultFileType("xml");
|
||||
// The default file type (root) can be redefined by the user.
|
||||
|
||||
// Book histograms, ntuple
|
||||
//
|
||||
|
||||
// Creating 1D histograms
|
||||
analysisManager
|
||||
@@ -70,7 +74,6 @@ B5RunAction::B5RunAction(B5EventAction* eventAction)
|
||||
50, -1500., 1500, 50, -300., 300.);
|
||||
|
||||
// Creating ntuple
|
||||
//
|
||||
if ( fEventAction ) {
|
||||
analysisManager->CreateNtuple("B5", "Hits");
|
||||
analysisManager->CreateNtupleIColumn("Dc1Hits"); // column Id = 0
|
||||
@@ -85,6 +88,9 @@ B5RunAction::B5RunAction(B5EventAction* eventAction)
|
||||
->CreateNtupleDColumn("HCEnergyVector", fEventAction->GetHadCalEdep());
|
||||
analysisManager->FinishNtuple();
|
||||
}
|
||||
|
||||
// Set ntuple output file
|
||||
analysisManager->SetNtupleFileName(0, "B4ntuple");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user