Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
+17
View File
@@ -0,0 +1,17 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4analysis
# Package: Geant4.src.G4analysis.G4analysismng
#
# CMakeLists.txt for building a single granular library.
#
# Created on : 15/07/2013
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
+22
View File
@@ -0,0 +1,22 @@
# --------------------------------------------------------------------
# GNUmakefile for analysis/management sub-library.
# --------------------------------------------------------------------
name := G4analysisfac
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/intercoms/include \
-I$(G4BASE)/analysis/g4tools/include \
-I$(G4BASE)/analysis/management/include \
-I$(G4BASE)/analysis/hntools/include \
-I$(G4BASE)/analysis/csv/include \
-I$(G4BASE)/analysis/root/include \
-I$(G4BASE)/analysis/xml/include
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,46 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Author: Ivana Hrivnacova, 10/09/2019 (ivana@ipno.in2p3.fr)
#ifndef g4analysis_h
#define g4analysis_h 1
#include "globals.hh"
#include "g4analysis_defs.hh"
namespace G4Analysis
{
G4ToolsAnalysisManager* ManagerInstance(const G4String& outputType);
}
#endif
@@ -0,0 +1,41 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Author: Ivana Hrivnacova, 10/09/2019 (ivana@ipno.in2p3.fr)
#ifndef g4analysis_defs_h
#define g4analysis_defs_h 1
#include "g4hntools_defs.hh"
#include "G4ToolsAnalysisManager.hh"
using G4AnalysisManager = G4ToolsAnalysisManager;
#endif
+15
View File
@@ -0,0 +1,15 @@
Added new factory function which allows to create analysis manager
of the type selected via a string argument; the user code:
#include "g4analysis.hh"
G4AnalysisManager* analysisManager = G4Analysis::ManagerInstance("root");
Note that G4AnalysisManager is in this case G4ToolsAnalysisManager, and not
the output type specific manager (eg. G4RootAnalysisManager), as it is
in case of using a type specific include, eg. "g4root.hh"
Details:
- Added new analysis sub-category "factory"
- Clean-up analysis type definitions:
G4Hn*, G4Pn* types moved out of type specific namespace
- Added methods for setting ntuple merge mode in G4VAnalysisManager
with a default implementatation (issuing a warning if merging is not available)
+61
View File
@@ -0,0 +1,61 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4csv
# Package: Geant4.src.G4analysis.G4analysismng
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 15/07/2013
#
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
include_directories(${ZLIB_INCLUDE_DIRS})
if (GEANT4_USE_HDF5)
include_directories(${HDF5_INCLUDE_DIRS})
set(G4analysisfac_LINK_LIBRARIES Geant4::HDF5)
endif()
if(GEANT4_USE_FREETYPE)
set(G4analysisfac_LINK_LIBRARIES Freetype::Freetype ${G4analysisfac_LINK_LIBRARIES})
endif()
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/intercoms/include)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/g4tools/include)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/hntools/include)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/csv/include)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/root/include)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/xml/include)
if (GEANT4_USE_HDF5)
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/hdf5/include)
endif()
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4analysisfac
HEADERS
g4analysis.hh
g4analysis_defs.hh
SOURCES
g4analysis.cc
GRANULAR_DEPENDENCIES
G4globman
G4intercoms
GLOBAL_DEPENDENCIES
G4global
G4intercoms
LINK_LIBRARIES
${G4analysisfac_LINK_LIBRARIES}
)
# List any source specific properties here
+91
View File
@@ -0,0 +1,91 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Author: Ivana Hrivnacova, 09/09/2019 (ivana@ipno.in2p3.fr)
#include "g4analysis.hh"
#include "G4AnalysisUtilities.hh"
#include "G4CsvAnalysisManager.hh"
#include "G4RootAnalysisManager.hh"
#include "G4XmlAnalysisManager.hh"
#ifdef TOOLS_USE_HDF5
#include "G4Hdf5AnalysisManager.hh"
#endif
#include "G4Exception.hh"
namespace {
void DoFatalException(const G4String& outputName)
{
G4ExceptionDescription description;
description
<< " \"" << outputName << "\" output type is not supported." << G4endl
<< " " << "Analysis manager cannot be created.";
G4Exception("G4Analysis::ManagerInstance",
"Analysis_F002", FatalException, description);
}
}
namespace G4Analysis
{
G4ToolsAnalysisManager* ManagerInstance(const G4String& outputName)
{
// Get output type
G4AnalysisOutput outputType = GetOutput(outputName, false);
if ( outputType == G4AnalysisOutput::kNone ) {
DoFatalException(outputName);
return nullptr;
}
// Create the analysis manager of a selected type
switch ( outputType ) {
case G4AnalysisOutput::kCsv:
return G4CsvAnalysisManager::Instance();
break;
#ifdef TOOLS_USE_HDF5
case G4AnalysisOutput::kHdf5:
return G4Hdf5AnalysisManager::Instance();
break;
#endif
case G4AnalysisOutput::kRoot:
return G4RootAnalysisManager::Instance();
break;
case G4AnalysisOutput::kXml:
return G4XmlAnalysisManager::Instance();
break;
case G4AnalysisOutput::kNone:
default:
break;
}
// should never reach this line
DoFatalException(outputName);
return nullptr;
}
}