Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+18
View File
@@ -0,0 +1,18 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4analysis
# Package: Geant4.src.G4analysis.G4csv
#
# CMakeLists.txt for building a single granular library.
#
# Created on : 15/07/2013
#
# $Id: CMakeLists.txt 72292 2013-07-15 12:01:43Z ihrivnac $
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
+24
View File
@@ -0,0 +1,24 @@
# $Id: GNUmakefile 66356 2012-12-18 09:02:32Z gcosmo $
# --------------------------------------------------------------------
# GNUmakefile for geometry/biasing library. Gabriele Cosmo, 25/03/02.
# --------------------------------------------------------------------
name := G4csv
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
ifdef G4LIB_BUILD_ZLIB
CPPFLAGS += -I$(G4BASE)/externals/zlib/include
endif
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,92 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvAnalysisManager.hh 74257 2013-10-02 14:24:55Z gcosmo $
// The main manager for Csv analysis.
// It delegates most of functions to the object specific managers.
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
#ifndef G4CsvAnalysisManager_h
#define G4CsvAnalysisManager_h 1
#include "G4VAnalysisManager.hh"
#include "G4CsvNtupleDescription.hh"
#include "globals.hh"
#include "tools/wcsv_ntuple"
#include <fstream>
#include <vector>
#include <map>
class G4H1DummyManager;
class G4H2DummyManager;
class G4CsvFileManager;
class G4CsvNtupleManager;
class G4CsvAnalysisManager : public G4VAnalysisManager
{
public:
G4CsvAnalysisManager(G4bool isMaster = true);
~G4CsvAnalysisManager();
// static methods
static G4CsvAnalysisManager* Instance();
// Access methods
tools::wcsv::ntuple* GetNtuple() const;
tools::wcsv::ntuple* GetNtuple(G4int ntupleId) const;
protected:
// virtual methods from base class
virtual G4bool OpenFileImpl(const G4String& fileName);
virtual G4bool WriteImpl();
virtual G4bool CloseFileImpl();
private:
// static data members
//
static G4CsvAnalysisManager* fgMasterInstance;
static G4ThreadLocal G4CsvAnalysisManager* fgInstance;
// methods
//
G4bool CloseNtupleFiles();
// data members
//
G4H1DummyManager* fH1Manager;
G4H2DummyManager* fH2Manager;
G4CsvNtupleManager* fNtupleManager;
G4CsvFileManager* fFileManager;
};
#include "G4CsvAnalysisManager.icc"
#endif
@@ -0,0 +1,42 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvAnalysisManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
#include "G4CsvNtupleManager.hh"
//_____________________________________________________________________________
inline
tools::wcsv::ntuple* G4CsvAnalysisManager::GetNtuple() const
{
return fNtupleManager->GetNtuple();
}
//_____________________________________________________________________________
inline
tools::wcsv::ntuple* G4CsvAnalysisManager::GetNtuple(G4int ntupleId) const
{
return fNtupleManager->GetNtuple(ntupleId);
}
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvFileManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
// The manager for Csv file operations.
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
#ifndef G4CsvFileManager_h
#define G4CsvFileManager_h 1
#include "G4VFileManager.hh"
#include "G4CsvNtupleDescription.hh"
#include "globals.hh"
#include <fstream>
class G4CsvFileManager : public G4VFileManager
{
public:
G4CsvFileManager(const G4AnalysisManagerState& state);
~G4CsvFileManager();
// Methods to manipulate files
virtual G4bool OpenFile(const G4String& fileName);
virtual G4bool WriteFile();
virtual G4bool CloseFile();
G4bool CreateNtupleFile(G4CsvNtupleDescription* ntupleDescription);
G4bool CloseNtupleFile(G4CsvNtupleDescription* ntupleDescription);
};
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id$
// Structure containing the information related to Csv ntuple
//
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
#ifndef G4CsvNtupleDescription_h
#define G4CsvNtupleDescription_h 1
#include "tools/wcsv_ntuple"
#include <fstream>
#include <map>
namespace tools {
class ntuple_booking;
}
struct G4CsvNtupleDescription
{
G4CsvNtupleDescription()
: fFile(0),
fNtuple(0),
fNtupleBooking(0),
fNtupleIColumnMap(),
fNtupleFColumnMap(),
fNtupleDColumnMap() {}
~G4CsvNtupleDescription()
{ delete fFile;
delete fNtuple;
delete fNtupleBooking;
}
std::ofstream* fFile;
tools::wcsv::ntuple* fNtuple;
tools::ntuple_booking* fNtupleBooking;
std::map<G4int, tools::wcsv::ntuple::column<int>* > fNtupleIColumnMap;
std::map<G4int, tools::wcsv::ntuple::column<float>* > fNtupleFColumnMap;
std::map<G4int, tools::wcsv::ntuple::column<double>* > fNtupleDColumnMap;
};
#endif
@@ -0,0 +1,136 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvNtupleManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
// Manager class for CSV ntuples.
//
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
#ifndef G4CsvNtupleManager_h
#define G4CsvNtupleManager_h 1
#include "G4VNtupleManager.hh"
#include "globals.hh"
#include "tools/wcsv_ntuple"
#include <vector>
class G4CsvFileManager;
struct G4CsvNtupleDescription;
class G4CsvNtupleManager : public G4VNtupleManager
{
friend class G4CsvAnalysisManager;
protected:
G4CsvNtupleManager(const G4AnalysisManagerState& state);
~G4CsvNtupleManager();
// Functions specific to the output type
//
// Methods to manipulate ntuples
void CreateNtuplesFromBooking();
G4bool IsEmpty() const;
G4bool Reset();
// Set methods
void SetFileManager(G4CsvFileManager* fileManager);
// Access methods
tools::wcsv::ntuple* GetNtuple() const;
tools::wcsv::ntuple* GetNtuple(G4int ntupleId) const;
// Access to ntuple vector (needed for Write())
const std::vector<G4CsvNtupleDescription*>& GetNtupleVector() const;
// Functions independent from the output type
//
// Methods to create ntuples
virtual G4int CreateNtuple(const G4String& name, const G4String& title);
// Create columns in the last created ntuple
virtual G4int CreateNtupleIColumn(const G4String& name);
virtual G4int CreateNtupleFColumn(const G4String& name);
virtual G4int CreateNtupleDColumn(const G4String& name);
virtual void FinishNtuple();
// Create columns in the ntuple with given id
virtual G4int CreateNtupleIColumn(G4int ntupleId, const G4String& name);
virtual G4int CreateNtupleFColumn(G4int ntupleId, const G4String& name);
virtual G4int CreateNtupleDColumn(G4int ntupleId, const G4String& name);
virtual void FinishNtuple(G4int ntupleId);
// Methods to fill ntuples
// Methods for ntuple with id = FirstNtupleId
virtual G4bool FillNtupleIColumn(G4int columnId, G4int value);
virtual G4bool FillNtupleFColumn(G4int columnId, G4float value);
virtual G4bool FillNtupleDColumn(G4int columnId, G4double value);
virtual G4bool AddNtupleRow();
// Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
virtual G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value);
virtual G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value);
virtual G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value);
virtual G4bool AddNtupleRow(G4int ntupleId);
// Access methods
virtual G4int GetNofNtuples() const;
private:
// methods
//
tools::wcsv::ntuple::column<int>*
GetNtupleIColumn(G4int ntupleId, G4int columnId) const;
tools::wcsv::ntuple::column<float>*
GetNtupleFColumn(G4int ntupleId, G4int columnId) const;
tools::wcsv::ntuple::column<double>*
GetNtupleDColumn(G4int ntupleId, G4int columnId) const;
virtual G4CsvNtupleDescription* GetNtupleInFunction(G4int id,
G4String function,
G4bool warn = true,
G4bool onlyIfActive = true) const;
// data members
//
G4CsvFileManager* fFileManager;
std::vector<G4CsvNtupleDescription*> fNtupleVector;
};
// inline functions
inline void G4CsvNtupleManager::SetFileManager(G4CsvFileManager* fileManager)
{ fFileManager = fileManager; }
inline G4int G4CsvNtupleManager::GetNofNtuples() const
{ return fNtupleVector.size(); }
inline const std::vector<G4CsvNtupleDescription*>& G4CsvNtupleManager::GetNtupleVector() const
{ return fNtupleVector; }
#endif
+37
View File
@@ -0,0 +1,37 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: g4csv.hh 74257 2013-10-02 14:24:55Z gcosmo $
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
#ifndef g4csv_h
#define g4csv_h
#include "g4csv_defs.hh"
using namespace G4Csv;
#endif
+44
View File
@@ -0,0 +1,44 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: g4csv_defs.hh 74257 2013-10-02 14:24:55Z gcosmo $
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
#ifndef g4csv_defs_h
#define g4csv_defs_h
#include "tools/wcsv_ntuple"
#include "G4CsvAnalysisManager.hh"
namespace G4Csv {
typedef tools::wcsv::ntuple G4Ntuple;
typedef G4CsvAnalysisManager G4AnalysisManager;
}
#endif
+56
View File
@@ -0,0 +1,56 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4csv
# Package: Geant4.src.G4analysis.G4csv
#
# 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
#
# $Id: sources.cmake 72956 2013-08-14 14:24:35Z gcosmo $
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
# 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)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4csv
HEADERS
G4CsvAnalysisManager.hh
G4CsvAnalysisManager.icc
G4CsvFileManager.hh
G4CsvNtupleDescription.hh
G4CsvNtupleManager.hh
g4csv_defs.hh
g4csv.hh
SOURCES
G4CsvAnalysisManager.cc
G4CsvFileManager.cc
G4CsvNtupleManager.cc
GRANULAR_DEPENDENCIES
G4globman
G4intercoms
G4analysismng
G4hntools
GLOBAL_DEPENDENCIES
G4global
G4intercoms
LINK_LIBRARIES
)
# List any source specific properties here
@@ -0,0 +1,192 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvAnalysisManager.cc 74257 2013-10-02 14:24:55Z gcosmo $
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
#include "G4CsvAnalysisManager.hh"
#include "G4CsvFileManager.hh"
#include "G4H1DummyManager.hh"
#include "G4H2DummyManager.hh"
#include "G4CsvNtupleManager.hh"
#include "G4AnalysisVerbose.hh"
#include "G4UnitsTable.hh"
#include "G4Threading.hh"
#include "G4AutoLock.hh"
#include <iostream>
G4CsvAnalysisManager* G4CsvAnalysisManager::fgMasterInstance = 0;
G4ThreadLocal G4CsvAnalysisManager* G4CsvAnalysisManager::fgInstance = 0;
//_____________________________________________________________________________
G4CsvAnalysisManager* G4CsvAnalysisManager::Instance()
{
if ( fgInstance == 0 ) {
G4bool isMaster = ! G4Threading::IsWorkerThread();
fgInstance = new G4CsvAnalysisManager(isMaster);
}
return fgInstance;
}
//_____________________________________________________________________________
G4CsvAnalysisManager::G4CsvAnalysisManager(G4bool isMaster)
: G4VAnalysisManager("Csv", isMaster),
fNtupleManager(0),
fFileManager(0)
{
if ( ( isMaster && fgMasterInstance ) || ( fgInstance ) ) {
G4ExceptionDescription description;
description << " "
<< "G4CsvAnalysisManager already exists."
<< "Cannot create another instance.";
G4Exception("G4CsvAnalysisManager::G4CsvAnalysisManager()",
"Analysis_F001", FatalException, description);
}
if ( isMaster ) fgMasterInstance = this;
fgInstance = this;
// Create managers
fH1Manager = new G4H1DummyManager(fState);
fH2Manager = new G4H2DummyManager(fState);
fNtupleManager = new G4CsvNtupleManager(fState);
fFileManager = new G4CsvFileManager(fState);
fNtupleManager->SetFileManager(fFileManager);
// The managers will be deleted by the base class
// Set managers to base class
SetH1Manager(fH1Manager);
SetH2Manager(fH2Manager);
SetNtupleManager(fNtupleManager);
SetFileManager(fFileManager);
}
//_____________________________________________________________________________
G4CsvAnalysisManager::~G4CsvAnalysisManager()
{
if ( fState.GetIsMaster() ) fgMasterInstance = 0;
fgInstance = 0;
}
//
// private methods
//
//_____________________________________________________________________________
G4bool G4CsvAnalysisManager::CloseNtupleFiles()
{
const std::vector<G4CsvNtupleDescription*>& ntupleVector
= fNtupleManager->GetNtupleVector();
// Close ntuple files
std::vector<G4CsvNtupleDescription*>::const_iterator it;
for (it = ntupleVector.begin(); it != ntupleVector.end(); it++ ) {
fFileManager->CloseNtupleFile((*it));
}
return true;
}
//
// protected methods
//
//_____________________________________________________________________________
G4bool G4CsvAnalysisManager::OpenFileImpl(const G4String& fileName)
{
G4bool finalResult = true;
// Only book file name in file manager
G4bool result = fFileManager->OpenFile(fileName);
finalResult = finalResult && result;
// Create ntuples if they are booked
// (The files will be created with creating ntuples)
fNtupleManager->CreateNtuplesFromBooking();
return finalResult;
}
//_____________________________________________________________________________
G4bool G4CsvAnalysisManager::WriteImpl()
{
// nothing to be done for Csv file
G4bool result = true;
// Write ASCII if activated
// Not available
//if ( IsAscii() ) {
// result = WriteAscii();
//}
return result;
}
//_____________________________________________________________________________
G4bool G4CsvAnalysisManager::CloseFileImpl()
{
G4bool finalResult = true;
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() )
fState.GetVerboseL4()->Message("close", "files", "");
#endif
// Unlock file name only
G4bool result = fFileManager->CloseFile();
finalResult = finalResult && result;
// Close ntuple files
if ( ( ! G4AnalysisManagerState::IsMT() ) || ( ! fState.GetIsMaster() ) ) {
// In sequential mode or in MT mode only on workers
result = CloseNtupleFiles();
finalResult = finalResult && result;
}
// reset data
result = fNtupleManager->Reset();
if ( ! result ) {
G4ExceptionDescription description;
description << " " << "Resetting data failed";
G4Exception("G4CsvAnalysisManager::CloseFile()",
"Analysis_W002", JustWarning, description);
result = false;
}
finalResult = finalResult && result;
#ifdef G4VERBOSE
if ( fState.GetVerboseL1() ) {
fState.GetVerboseL1()->Message("close", "files", "");
}
#endif
return finalResult;
}
+130
View File
@@ -0,0 +1,130 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvFileManager.cc 70604 2013-06-03 11:27:06Z ihrivnac $
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
#include "G4CsvFileManager.hh"
#include "G4AnalysisManagerState.hh"
//_____________________________________________________________________________
G4CsvFileManager::G4CsvFileManager(const G4AnalysisManagerState& state)
: G4VFileManager(state)
{
}
//_____________________________________________________________________________
G4CsvFileManager::~G4CsvFileManager()
{
}
//
// public methods
//
//_____________________________________________________________________________
G4bool G4CsvFileManager::OpenFile(const G4String& fileName)
{
// Keep file name
fFileName = fileName;
fLockFileName = true;
fLockNtupleDirectoryName = true;
return true;
}
//_____________________________________________________________________________
G4bool G4CsvFileManager::WriteFile()
{
// nothing to be done for Csv file
return true;
}
//_____________________________________________________________________________
G4bool G4CsvFileManager::CloseFile()
{
fLockFileName = false;
return true;
}
//_____________________________________________________________________________
G4bool G4CsvFileManager::CreateNtupleFile(
G4CsvNtupleDescription* ntupleDescription)
{
G4String ntupleName = ntupleDescription->fNtupleBooking->m_name;
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() )
fState.GetVerboseL4()
->Message("create", "file", GetNtupleFileName(ntupleName));
#endif
std::ofstream* ntupleFile
= new std::ofstream(GetNtupleFileName(ntupleName));
if ( ntupleFile->fail() ) {
G4ExceptionDescription description;
description << " " << "Cannot open file "
<< GetNtupleFileName(ntupleName);
G4Exception("G4CsvFileManager::CreateNtupleFile()",
"Analysis_W001", JustWarning, description);
return false;
}
#ifdef G4VERBOSE
if ( fState.GetVerboseL1() )
fState.GetVerboseL1()
->Message("create", "file", GetNtupleFileName(ntupleName));
#endif
ntupleDescription->fFile = ntupleFile;
return true;
}
//_____________________________________________________________________________
G4bool G4CsvFileManager::CloseNtupleFile(
G4CsvNtupleDescription* ntupleDescription)
{
G4String ntupleName = ntupleDescription->fNtupleBooking->m_name;
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() )
fState.GetVerboseL4()
->Message("close", "file", GetNtupleFileName(ntupleName));
#endif
// close file
ntupleDescription->fFile->close();
#ifdef G4VERBOSE
if ( fState.GetVerboseL1() )
fState.GetVerboseL1()
->Message("close", "file", GetNtupleFileName(ntupleName));
#endif
return true;
}
@@ -0,0 +1,620 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4CsvNtupleManager.cc 70604 2013-06-03 11:27:06Z ihrivnac $
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
#include "G4CsvNtupleManager.hh"
#include "G4CsvNtupleDescription.hh"
#include "G4CsvFileManager.hh"
#include "G4AnalysisManagerState.hh"
#include <iostream>
//_____________________________________________________________________________
G4CsvNtupleManager::G4CsvNtupleManager(const G4AnalysisManagerState& state)
: G4VNtupleManager(state),
fFileManager(0),
fNtupleVector()
{
}
//_____________________________________________________________________________
G4CsvNtupleManager::~G4CsvNtupleManager()
{
std::vector<G4CsvNtupleDescription*>::iterator it;
for (it = fNtupleVector.begin(); it != fNtupleVector.end(); it++ ) {
delete (*it);
}
}
//
// private methods
//
//_____________________________________________________________________________
tools::wcsv::ntuple::column<int>*
G4CsvNtupleManager::GetNtupleIColumn(G4int ntupleId, G4int columnId) const
{
G4CsvNtupleDescription* ntupleDecription
= GetNtupleInFunction(ntupleId, "GetNtupleIColumn");
if ( ! ntupleDecription ) {
// add exception
return 0;
}
std::map<G4int, tools::wcsv::ntuple::column<int>* >& ntupleIColumnMap
= ntupleDecription->fNtupleIColumnMap;
std::map<G4int, tools::wcsv::ntuple::column<int>* >::const_iterator it
= ntupleIColumnMap.find(columnId);
if ( it == ntupleIColumnMap.end() ) {
G4ExceptionDescription description;
description << " " << "ntupleId " << ntupleId
<< "column " << columnId << " does not exist.";
G4Exception("G4CsvNtupleManager::GetNtupleIColumn()",
"Analysis_W009", JustWarning, description);
return 0;
}
return it->second;
}
//_____________________________________________________________________________
tools::wcsv::ntuple::column<float>*
G4CsvNtupleManager::GetNtupleFColumn(G4int ntupleId, G4int columnId) const
{
G4CsvNtupleDescription* ntupleDecription
= GetNtupleInFunction(ntupleId, "GetNtupleFColumn");
if ( ! ntupleDecription ) {
// add exception
return 0;
}
std::map<G4int, tools::wcsv::ntuple::column<float>* >& ntupleFColumnMap
= ntupleDecription->fNtupleFColumnMap;
std::map<G4int, tools::wcsv::ntuple::column<float>* >::const_iterator it
= ntupleFColumnMap.find(columnId);
if ( it == ntupleFColumnMap.end() ) {
G4ExceptionDescription description;
description << " " << "ntupleId " << ntupleId
<< "column " << columnId << " does not exist.";
G4Exception("G4CsvNtupleManager::GetNtupleFColumn()",
"Analysis_W009", JustWarning, description);
return 0;
}
return it->second;
}
//_____________________________________________________________________________
tools::wcsv::ntuple::column<double>*
G4CsvNtupleManager::GetNtupleDColumn(G4int ntupleId, G4int columnId) const
{
G4CsvNtupleDescription* ntupleDecription
= GetNtupleInFunction(ntupleId, "GetNtupleDColumn");
if ( ! ntupleDecription ) {
// add exception
return 0;
}
std::map<G4int, tools::wcsv::ntuple::column<double>* >& ntupleDColumnMap
= ntupleDecription->fNtupleDColumnMap;
std::map<G4int, tools::wcsv::ntuple::column<double>* >::const_iterator it
= ntupleDColumnMap.find(columnId);
if ( it == ntupleDColumnMap.end() ) {
G4ExceptionDescription description;
description << " " << "ntupleId " << ntupleId
<< "column " << columnId << " does not exist.";
G4Exception("G4CsvNtupleManager::GetNtupleDColumn()",
"Analysis_W009", JustWarning, description);
return 0;
}
return it->second;
}
//_____________________________________________________________________________
G4CsvNtupleDescription* G4CsvNtupleManager::GetNtupleInFunction(G4int id,
G4String functionName, G4bool warn,
G4bool /*onlyIfActive*/) const
{
G4int index = id - fFirstId;
if ( index < 0 || index >= G4int(fNtupleVector.size()) ) {
if ( warn) {
G4String inFunction = "G4CsvNtupleManager::";
inFunction += functionName;
G4ExceptionDescription description;
description << " " << "ntuple " << id << " does not exist.";
G4Exception(inFunction, "Analysis_W007", JustWarning, description);
}
return 0;
}
return fNtupleVector[index];
}
//
// protected methods
//
//_____________________________________________________________________________
void G4CsvNtupleManager::CreateNtuplesFromBooking()
{
// Create ntuple from ntuple_booking.
// Do not create ntuples on master thread
if ( G4AnalysisManagerState::IsMT() && fState.GetIsMaster() ) return;
std::vector<G4CsvNtupleDescription*>::iterator itn;
for (itn = fNtupleVector.begin(); itn != fNtupleVector.end(); itn++ ) {
tools::ntuple_booking* ntupleBooking = (*itn)->fNtupleBooking;
if ( ! ntupleBooking ) continue;
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() )
fState.GetVerboseL4()
->Message("create from booking", "ntuple", ntupleBooking->m_name);
#endif
// create a file for this ntuple
if ( ! fFileManager->CreateNtupleFile((*itn)) ) continue;
// create ntuple
(*itn)->fNtuple
= new tools::wcsv::ntuple(*((*itn)->fFile), G4cerr, *ntupleBooking);
if ( ntupleBooking->m_columns.size() ) {
// store ntuple columns in local maps
const std::vector<tools::ntuple_booking::col_t>& columns
= ntupleBooking->m_columns;
std::vector<tools::ntuple_booking::col_t>::const_iterator it;
G4int index = 0;
for ( it = columns.begin(); it!=columns.end(); ++it) {
if ( (*it).second == tools::_cid(int(0) ) ) {
(*itn)->fNtupleIColumnMap[index++]
= (*itn)->fNtuple->find_column<int>((*it).first);
}
else if ( (*it).second == tools::_cid(float(0) ) ) {
(*itn)->fNtupleFColumnMap[index++]
= (*itn)->fNtuple->find_column<float>((*it).first);
}
else if ( (*it).second== tools::_cid(double(0))) {
(*itn)->fNtupleDColumnMap[index++]
= (*itn)->fNtuple->find_column<double>((*it).first);
}
else {
G4ExceptionDescription description;
description << " "
<< "Unsupported column type " << (*it).first;
G4Exception("G4CsvNtupleManager::CreateNtupleFromBooking()",
"Analysis_W004", JustWarning, description);
}
}
}
#ifdef G4VERBOSE
if ( fState.GetVerboseL3() )
fState.GetVerboseL3()
->Message("create from booking", "ntuple", ntupleBooking->m_name);
#endif
}
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::IsEmpty() const
{
return ! fNtupleVector.size();
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::Reset()
{
std::vector<G4CsvNtupleDescription*>::iterator it;
for (it = fNtupleVector.begin(); it != fNtupleVector.end(); it++ ) {
delete (*it)->fNtuple;
(*it)->fNtuple = 0;
}
return true;
}
//_____________________________________________________________________________
tools::wcsv::ntuple* G4CsvNtupleManager::GetNtuple() const
{
return GetNtuple(fFirstId);
}
//_____________________________________________________________________________
tools::wcsv::ntuple* G4CsvNtupleManager::GetNtuple(G4int ntupleId) const
{
G4CsvNtupleDescription* ntupleDescription
= GetNtupleInFunction(ntupleId, "GetNtuple");
return ntupleDescription->fNtuple;
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtuple(const G4String& name,
const G4String& title)
{
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() )
fState.GetVerboseL4()->Message("create", "ntuple", name);
#endif
// Create ntuple description
G4int index = fNtupleVector.size();
G4CsvNtupleDescription* ntupleDescription
= new G4CsvNtupleDescription();
fNtupleVector.push_back(ntupleDescription);
// Create ntuple booking
ntupleDescription->fNtupleBooking = new tools::ntuple_booking();
ntupleDescription->fNtupleBooking->m_name = name;
ntupleDescription->fNtupleBooking->m_title = title;
// ntuple booking object is deleted in destructor
// Create ntuple if the file is open (what means here that
// a filename was already set)
if ( fFileManager->GetFileName().size() ) {
if ( fFileManager->CreateNtupleFile(ntupleDescription) ) {
ntupleDescription->fNtuple
= new tools::wcsv::ntuple(*(ntupleDescription->fFile));
// ntuple object is deleted when closing a file
}
}
fLockFirstId = true;
#ifdef G4VERBOSE
if ( fState.GetVerboseL2() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << index + fFirstId;
fState.GetVerboseL2()->Message("create", "ntuple", description);
}
#endif
return index + fFirstId;
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtupleIColumn(const G4String& name)
{
G4int ntupleId = fNtupleVector.size() + fFirstId - 1;
return CreateNtupleIColumn(ntupleId, name);
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtupleFColumn(const G4String& name)
{
G4int ntupleId = fNtupleVector.size() + fFirstId - 1;
return CreateNtupleFColumn(ntupleId, name);
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtupleDColumn(const G4String& name)
{
G4int ntupleId = fNtupleVector.size() + fFirstId - 1;
return CreateNtupleDColumn(ntupleId, name);
}
//_____________________________________________________________________________
void G4CsvNtupleManager::FinishNtuple()
{
// nothing to be done here
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtupleIColumn(G4int ntupleId, const G4String& name)
{
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << ntupleId;
fState.GetVerboseL4()->Message("create", "ntuple I column", description);
}
#endif
G4CsvNtupleDescription* ntupleDescription
= GetNtupleInFunction(ntupleId, "CreateNtupleIColumn");
tools::ntuple_booking* ntupleBooking
= ntupleDescription->fNtupleBooking;
if ( ! ntupleBooking ) {
G4ExceptionDescription description;
description << " "
<< "Ntuple " << ntupleId << " has to be created first. ";
G4Exception("G4CsvNtupleManager::CreateNtupleIColumn()",
"Analysis_W005", JustWarning, description);
return -1;
}
// Save column info in booking
G4int index = ntupleBooking->m_columns.size();
ntupleBooking->add_column<int>(name);
// Create column if ntuple already exists
if ( ntupleDescription->fNtuple ) {
tools::wcsv::ntuple::column<int>* column
= ntupleDescription->fNtuple->create_column<int>(name);
ntupleDescription->fNtupleIColumnMap[index] = column;
}
fLockFirstNtupleColumnId = true;
#ifdef G4VERBOSE
if ( fState.GetVerboseL2() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << ntupleId;
fState.GetVerboseL2()->Message("create", "ntuple I column", description);
}
#endif
return index + fFirstNtupleColumnId;
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtupleFColumn(G4int ntupleId, const G4String& name)
{
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << ntupleId;
fState.GetVerboseL4()->Message("create", "ntuple F column", description);
}
#endif
G4CsvNtupleDescription* ntupleDescription
= GetNtupleInFunction(ntupleId, "CreateNtupleFColumn");
tools::ntuple_booking* ntupleBooking
= ntupleDescription->fNtupleBooking;
if ( ! ntupleBooking ) {
G4ExceptionDescription description;
description << " "
<< "Ntuple " << ntupleId << " has to be created first. ";
G4Exception("G4CsvNtupleManager::CreateNtupleFColumn()",
"Analysis_W005", JustWarning, description);
return -1;
}
// Save column info in booking
G4int index = ntupleBooking->m_columns.size();
ntupleBooking->add_column<float>(name);
// Create column if ntuple already exists
if ( ntupleDescription->fNtuple ) {
tools::wcsv::ntuple::column<float>* column
= ntupleDescription->fNtuple->create_column<float>(name);
ntupleDescription->fNtupleFColumnMap[index] = column;
}
fLockFirstNtupleColumnId = true;
#ifdef G4VERBOSE
if ( fState.GetVerboseL2() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << ntupleId;
fState.GetVerboseL2()->Message("create", "ntuple F column", description);
}
#endif
return index + fFirstNtupleColumnId;
}
//_____________________________________________________________________________
G4int G4CsvNtupleManager::CreateNtupleDColumn(G4int ntupleId, const G4String& name)
{
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << ntupleId;
fState.GetVerboseL4()->Message("create", "ntuple D column", description);
}
#endif
G4CsvNtupleDescription* ntupleDescription
= GetNtupleInFunction(ntupleId, "CreateNtupleDColumn");
tools::ntuple_booking* ntupleBooking
= ntupleDescription->fNtupleBooking;
if ( ! ntupleBooking ) {
G4ExceptionDescription description;
description << " "
<< "Ntuple " << ntupleId << " has to be created first. ";
G4Exception("G4CsvNtupleManager::CreateNtupleDColumn()",
"Analysis_W005", JustWarning, description);
return -1;
}
// Save column info in booking
G4int index = ntupleBooking->m_columns.size();
ntupleBooking->add_column<double>(name);
// Create column if ntuple already exists
if ( ntupleDescription->fNtuple ) {
tools::wcsv::ntuple::column<double>* column
= ntupleDescription->fNtuple->create_column<double>(name);
ntupleDescription->fNtupleDColumnMap[index] = column;
}
fLockFirstNtupleColumnId = true;
#ifdef G4VERBOSE
if ( fState.GetVerboseL2() ) {
G4ExceptionDescription description;
description << name << " ntupleId " << ntupleId;
fState.GetVerboseL2()->Message("create", "ntuple D column", description);
}
#endif
return index + fFirstNtupleColumnId;
}
//_____________________________________________________________________________
void G4CsvNtupleManager::FinishNtuple(G4int /*ntupleId*/)
{
// nothing to be done here
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::FillNtupleIColumn(G4int columnId, G4int value)
{
return FillNtupleIColumn(fFirstId, columnId, value);
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::FillNtupleFColumn(G4int columnId, G4float value)
{
return FillNtupleFColumn(fFirstId, columnId, value);
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::FillNtupleDColumn(G4int columnId, G4double value)
{
return FillNtupleDColumn(fFirstId, columnId, value);
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::AddNtupleRow()
{
return AddNtupleRow(fFirstId);
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::FillNtupleIColumn(G4int ntupleId, G4int columnId,
G4int value)
{
tools::wcsv::ntuple::column<int>* column
= GetNtupleIColumn(ntupleId, columnId);
if ( ! column ) {
G4ExceptionDescription description;
description << " " << "ntupleId " << ntupleId
<< "column " << columnId << " does not exist.";
G4Exception("G4CsvNtupleManager::FillNtupleIColumn()",
"Analysis_W009", JustWarning, description);
return false;
}
column->fill(value);
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << " ntupleId " << ntupleId
<< " columnId " << columnId << " value " << value;
fState.GetVerboseL4()->Message("fill", "ntuple I column", description);
}
#endif
return true;
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::FillNtupleFColumn(G4int ntupleId, G4int columnId,
G4float value)
{
tools::wcsv::ntuple::column<float>* column
= GetNtupleFColumn(ntupleId, columnId);
if ( ! column ) {
G4ExceptionDescription description;
description << " " << "ntupleId " << ntupleId
<< "column " << columnId << " does not exist.";
G4Exception("G4CsvNtupleManager::FillNtupleFColumn()",
"Analysis_W009", JustWarning, description);
return false;
}
column->fill(value);
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << " ntupleId " << ntupleId
<< " columnId " << columnId << " value " << value;
fState.GetVerboseL4()->Message("fill", "ntuple F column", description);
}
#endif
return true;
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::FillNtupleDColumn(G4int ntupleId, G4int columnId,
G4double value)
{
tools::wcsv::ntuple::column<double>* column
= GetNtupleDColumn(ntupleId, columnId);
if ( ! column ) {
G4ExceptionDescription description;
description << " " << "ntupleId " << ntupleId
<< "column " << columnId << " does not exist.";
G4Exception("G4CsvNtupleManager::FillNtupleDColumn()",
"Analysis_W009", JustWarning, description);
return false;
}
column->fill(value);
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << " ntupleId " << ntupleId
<< " columnId " << columnId << " value " << value;
fState.GetVerboseL4()->Message("fill", "ntuple D column", description);
}
#endif
return true;
}
//_____________________________________________________________________________
G4bool G4CsvNtupleManager::AddNtupleRow(G4int ntupleId)
{
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << " ntupleId " << ntupleId;
fState.GetVerboseL4()->Message("add", "ntuple row", description);
}
#endif
G4CsvNtupleDescription* ntupleDescription
= GetNtupleInFunction(ntupleId, "AddNtupleRow");
if ( ! ntupleDescription || ! ntupleDescription->fNtuple ) {
G4ExceptionDescription description;
description << " " << "ntuple does not exist. ";
G4Exception("G4CsvNtupleManager::AddNtupleRow()",
"Analysis_W008", JustWarning, description);
return false;
}
ntupleDescription->fNtuple->add_row();
#ifdef G4VERBOSE
if ( fState.GetVerboseL4() ) {
G4ExceptionDescription description;
description << " ntupleId " << ntupleId;
fState.GetVerboseL4()->Message("add", "ntuple row", description);
}
#endif
return true;
}