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
@@ -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