Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
@@ -26,7 +26,7 @@
// Manager class for tools::histo::h2d.
// It implements functions specific to the H2 type
// (defined in g4tools).
// (defined in g4tools).
//
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
@@ -41,10 +41,11 @@
#include <vector>
#include <map>
#include <memory>
#include <string_view>
namespace tools {
namespace histo {
class h2d;
namespace histo {
class h2d;
}
}
@@ -53,13 +54,13 @@ class G4H2ToolsManager : public G4VH2Manager,
{
public:
explicit G4H2ToolsManager(const G4AnalysisManagerState& state);
virtual ~G4H2ToolsManager();
virtual ~G4H2ToolsManager() = default;
// Method to add histograms read from a file
G4int AddH2(const G4String& name, tools::histo::h2d* h2d);
// Method for merge (MT)
void AddH2Vector(const std::vector<tools::histo::h2d*>& h2Vector);
// Access methods
//
tools::histo::h2d* GetH2(G4int id, G4bool warn = true,
@@ -69,11 +70,11 @@ class G4H2ToolsManager : public G4VH2Manager,
std::vector<tools::histo::h2d*>::iterator EndH2();
std::vector<tools::histo::h2d*>::const_iterator BeginConstH2() const;
std::vector<tools::histo::h2d*>::const_iterator EndConstH2() const;
// Access to histogram vector (needed for Write())
const std::vector<tools::histo::h2d*>& GetH2Vector() const;
const std::vector<G4HnInformation*>& GetHnVector() const;
protected:
// Virtual functions from base class
//
@@ -81,48 +82,48 @@ class G4H2ToolsManager : public G4VH2Manager,
// Methods to create histograms
//
virtual G4int CreateH2(const G4String& name, const G4String& title,
G4int nxbins, G4double xmin, G4double xmax,
G4int nxbins, G4double xmin, G4double xmax,
G4int nybins, G4double ymin, G4double ymax,
const G4String& xunitName = "none",
const G4String& xunitName = "none",
const G4String& yunitName = "none",
const G4String& xfcnName = "none",
const G4String& xfcnName = "none",
const G4String& yfcnName = "none",
const G4String& xbinScheme = "linear",
const G4String& ybinScheme = "linear") final;
virtual G4int CreateH2(const G4String& name, const G4String& title,
const std::vector<G4double>& xedges,
const std::vector<G4double>& yedges,
const G4String& xunitName = "none",
const G4String& xunitName = "none",
const G4String& yunitName = "none",
const G4String& xfcnName = "none",
const G4String& xfcnName = "none",
const G4String& yfcnName = "none") final;
virtual G4bool SetH2(G4int id,
G4int nxbins, G4double xmin, G4double xmax,
G4int nxbins, G4double xmin, G4double xmax,
G4int nybins, G4double ymin, G4double ymax,
const G4String& xunitName = "none",
const G4String& xunitName = "none",
const G4String& yunitName = "none",
const G4String& xfcnName = "none",
const G4String& xfcnName = "none",
const G4String& yfcnName = "none",
const G4String& xbinScheme = "linear",
const G4String& ybinScheme = "linear") final;
virtual G4bool SetH2(G4int id,
const std::vector<G4double>& xedges,
const std::vector<G4double>& yedges,
const G4String& xunitName = "none",
const G4String& xunitName = "none",
const G4String& yunitName = "none",
const G4String& xfcnName = "none",
const G4String& xfcnName = "none",
const G4String& yfcnName = "none") final;
virtual G4bool ScaleH2(G4int id, G4double factor) final;
// Method to fill histograms
//
virtual G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
G4double weight = 1.0) final;
// Methods to manipulate histograms
//
@@ -139,7 +140,7 @@ class G4H2ToolsManager : public G4VH2Manager,
virtual G4double GetH2Ymin(G4int id) const final;
virtual G4double GetH2Ymax(G4int id) const final;
virtual G4double GetH2YWidth(G4int id) const final;
// Setters for attributes for plotting
virtual G4bool SetH2Title(G4int id, const G4String& title) final;
virtual G4bool SetH2XAxisTitle(G4int id, const G4String& title) final;
@@ -151,26 +152,25 @@ class G4H2ToolsManager : public G4VH2Manager,
virtual G4String GetH2XAxisTitle(G4int id) const final;
virtual G4String GetH2YAxisTitle(G4int id) const final;
virtual G4String GetH2ZAxisTitle(G4int id) const final;
// Write data on ASCII file
virtual G4bool WriteOnAscii(std::ofstream& output) final;
// Access to Hn manager
virtual std::shared_ptr<G4HnManager> GetHnManager() final;
private:
void AddH2Information(const G4String& name,
const G4String& xunitName,
const G4String& yunitName,
void AddH2Information(const G4String& name,
const G4String& xunitName,
const G4String& yunitName,
const G4String& xfcnName,
const G4String& yfcnName,
G4BinScheme xbinScheme,
G4BinScheme ybinScheme) const;
// data members
//
// static constexpr G4int kDimension = 2; // not yet supported on vc12
static const G4int kDimension;
// Static data members
static constexpr std::string_view fkClass { "G4H2ToolsManager" };
static constexpr G4int fkDimension = 2;
};
// inline methods
@@ -180,11 +180,11 @@ inline std::vector<tools::histo::h2d*>::iterator G4H2ToolsManager::BeginH2()
inline std::vector<tools::histo::h2d*>::iterator G4H2ToolsManager::EndH2()
{ return EndT(); }
inline std::vector<tools::histo::h2d*>::const_iterator
inline std::vector<tools::histo::h2d*>::const_iterator
G4H2ToolsManager::BeginConstH2() const
{ return BeginConstT(); }
inline std::vector<tools::histo::h2d*>::const_iterator
inline std::vector<tools::histo::h2d*>::const_iterator
G4H2ToolsManager::EndConstH2() const
{ return EndConstT(); }
@@ -194,7 +194,7 @@ inline const std::vector<tools::histo::h2d*>& G4H2ToolsManager::GetH2Vector() co
inline const std::vector<G4HnInformation*>& G4H2ToolsManager::GetHnVector() const
{ return fHnManager->GetHnVector(); }
inline std::shared_ptr<G4HnManager> G4H2ToolsManager::GetHnManager()
inline std::shared_ptr<G4HnManager> G4H2ToolsManager::GetHnManager()
{ return std::shared_ptr<G4HnManager>(fHnManager); }
#endif