Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -80,11 +80,11 @@ class G4RootAnalysisManager : public G4ToolsAnalysisManager
|
||||
std::vector<tools::wroot::ntuple*>::const_iterator EndConstNtuple() const;
|
||||
|
||||
// MT/MPI
|
||||
void SetNtupleMerging(G4bool mergeNtuples,
|
||||
G4int nofReducedNtupleFiles = 0,
|
||||
G4bool rowWise = true,
|
||||
unsigned int basketSize = fgkDefaultBasketSize);
|
||||
void SetNtupleRowWise(G4bool rowWise);
|
||||
virtual void SetNtupleMerging(G4bool mergeNtuples,
|
||||
G4int nofReducedNtupleFiles = 0) override;
|
||||
virtual void SetNtupleRowWise(G4bool rowWise, G4bool rowMode = true) override;
|
||||
virtual void SetBasketSize(unsigned int basketSize) override;
|
||||
virtual void SetBasketEntries(unsigned int basketEntries) override;
|
||||
|
||||
protected:
|
||||
// virtual methods from base class
|
||||
@@ -97,17 +97,13 @@ class G4RootAnalysisManager : public G4ToolsAnalysisManager
|
||||
virtual G4bool Reset();
|
||||
|
||||
private:
|
||||
// constants
|
||||
static constexpr unsigned int fgkDefaultBasketSize = 32000;
|
||||
|
||||
// static data members
|
||||
static G4RootAnalysisManager* fgMasterInstance;
|
||||
static G4ThreadLocal G4RootAnalysisManager* fgInstance;
|
||||
static G4ThreadLocal G4RootAnalysisManager* fgInstance;
|
||||
|
||||
// methods
|
||||
void SetNtupleMergingMode(G4bool mergeNtuples,
|
||||
G4int nofNtupleFiles,
|
||||
G4bool rowWise);
|
||||
G4int nofNtupleFiles);
|
||||
void ClearNtupleManagers();
|
||||
void CreateNtupleManagers();
|
||||
G4int GetNtupleFileNumber();
|
||||
@@ -127,6 +123,7 @@ class G4RootAnalysisManager : public G4ToolsAnalysisManager
|
||||
// data members
|
||||
G4int fNofNtupleFiles;
|
||||
G4bool fNtupleRowWise;
|
||||
G4bool fNtupleRowMode;
|
||||
G4NtupleMergeMode fNtupleMergeMode;
|
||||
G4RootNtupleManager* fNtupleManager;
|
||||
G4RootPNtupleManager* fSlaveNtupleManager;
|
||||
|
||||
@@ -61,13 +61,15 @@ class G4RootFileManager : public G4VFileManager
|
||||
// Set methods
|
||||
void SetNofNtupleFiles(G4int nofFiles);
|
||||
void SetBasketSize(unsigned int basketSize);
|
||||
void SetBasketEntries(unsigned int basketEntries);
|
||||
|
||||
// Get methods
|
||||
tools::wroot::directory* GetHistoDirectory() const;
|
||||
tools::wroot::directory* GetNtupleDirectory() const;
|
||||
std::shared_ptr<tools::wroot::file> GetNtupleFile(G4int index) const;
|
||||
tools::wroot::directory* GetMainNtupleDirectory(G4int index) const;
|
||||
unsigned int GetBasketSize() const;
|
||||
unsigned int GetBasketSize() const;
|
||||
unsigned int GetBasketEntries() const;
|
||||
|
||||
private:
|
||||
// methods
|
||||
@@ -85,6 +87,7 @@ class G4RootFileManager : public G4VFileManager
|
||||
std::vector<std::shared_ptr<tools::wroot::file> > fNtupleFiles;
|
||||
std::vector<tools::wroot::directory*> fMainNtupleDirectories;
|
||||
unsigned int fBasketSize;
|
||||
unsigned int fBasketEntries;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
@@ -95,6 +98,9 @@ inline void G4RootFileManager::SetNofNtupleFiles(G4int nofFiles)
|
||||
inline void G4RootFileManager::SetBasketSize(unsigned int basketSize)
|
||||
{ fBasketSize = basketSize; }
|
||||
|
||||
inline void G4RootFileManager::SetBasketEntries(unsigned int basketEntries)
|
||||
{ fBasketEntries = basketEntries; }
|
||||
|
||||
inline tools::wroot::directory* G4RootFileManager::GetHistoDirectory() const
|
||||
{ return fHistoDirectory; }
|
||||
|
||||
@@ -104,5 +110,8 @@ inline tools::wroot::directory* G4RootFileManager::GetNtupleDirectory() const
|
||||
inline unsigned int G4RootFileManager::GetBasketSize() const
|
||||
{ return fBasketSize; }
|
||||
|
||||
inline unsigned int G4RootFileManager::GetBasketEntries() const
|
||||
{ return fBasketEntries; }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -69,9 +69,10 @@ class G4RootMainNtupleManager : public G4BaseAnalysisManager
|
||||
G4bool Merge();
|
||||
G4bool Reset(G4bool deleteNtuple);
|
||||
|
||||
// Set methods
|
||||
// Set/get methods
|
||||
void SetNtupleFile(std::shared_ptr<tools::wroot::file> rfile);
|
||||
void SetNtupleDirectory(tools::wroot::directory* directory);
|
||||
void SetRowWise(G4bool rowWise);
|
||||
std::shared_ptr<tools::wroot::file> GetNtupleFile() const;
|
||||
tools::wroot::directory* GetNtupleDirectory() const;
|
||||
|
||||
@@ -80,7 +81,7 @@ class G4RootMainNtupleManager : public G4BaseAnalysisManager
|
||||
{ return fNtupleBuilder->GetNtupleDescriptionVector(); }
|
||||
const std::vector<tools::wroot::ntuple*>& GetNtupleVector()
|
||||
{ return fNtupleVector; }
|
||||
unsigned int GetBasketSize() const;
|
||||
unsigned int GetBasketEntries() const;
|
||||
|
||||
private:
|
||||
// Data members
|
||||
@@ -97,11 +98,17 @@ inline void G4RootMainNtupleManager::SetNtupleFile(std::shared_ptr<tools::wroot:
|
||||
inline void G4RootMainNtupleManager::SetNtupleDirectory(tools::wroot::directory* directory)
|
||||
{ fNtupleDirectory = directory; }
|
||||
|
||||
inline void G4RootMainNtupleManager::SetRowWise(G4bool rowWise)
|
||||
{ fRowWise = rowWise; }
|
||||
|
||||
inline std::shared_ptr<tools::wroot::file> G4RootMainNtupleManager::GetNtupleFile() const
|
||||
{ return fNtupleFile; }
|
||||
|
||||
inline tools::wroot::directory* G4RootMainNtupleManager::GetNtupleDirectory() const
|
||||
{ return fNtupleDirectory; }
|
||||
|
||||
inline unsigned int G4RootMainNtupleManager::GetBasketEntries() const
|
||||
{ return fNtupleBuilder->GetBasketEntries(); }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class G4RootNtupleManager : public G4TNtupleManager<tools::wroot::ntuple>
|
||||
public:
|
||||
explicit G4RootNtupleManager(const G4AnalysisManagerState& state,
|
||||
G4int nofMainManagers,
|
||||
G4bool rowWise);
|
||||
G4bool rowWise, G4bool rowMode);
|
||||
virtual ~G4RootNtupleManager();
|
||||
|
||||
private:
|
||||
@@ -108,10 +108,12 @@ class G4RootNtupleManager : public G4TNtupleManager<tools::wroot::ntuple>
|
||||
const std::vector<NtupleDescriptionType*>& GetNtupleDescriptionVector() const;
|
||||
G4RootMainNtupleManager* GetMainNtupleManager(G4int index) const;
|
||||
unsigned int GetBasketSize() const;
|
||||
unsigned int GetBasketEntries() const;
|
||||
|
||||
// Utility functions
|
||||
//
|
||||
void SetCreateMode();
|
||||
void SetNtupleRowWise(G4bool rowWise, G4bool rowMode);
|
||||
|
||||
// data members
|
||||
//
|
||||
@@ -120,6 +122,7 @@ class G4RootNtupleManager : public G4TNtupleManager<tools::wroot::ntuple>
|
||||
tools::wroot::directory* fNtupleDirectory;
|
||||
std::vector<G4RootMainNtupleManager*> fMainNtupleManagers;
|
||||
G4bool fRowWise;
|
||||
G4bool fRowMode;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
@@ -81,7 +81,8 @@ class G4RootPNtupleManager : public G4BaseNtupleManager
|
||||
|
||||
public:
|
||||
explicit G4RootPNtupleManager(G4RootMainNtupleManager* main,
|
||||
const G4AnalysisManagerState& state);
|
||||
const G4AnalysisManagerState& state,
|
||||
G4bool rowWise, G4bool rowMode);
|
||||
~G4RootPNtupleManager();
|
||||
|
||||
private:
|
||||
@@ -147,6 +148,9 @@ class G4RootPNtupleManager : public G4BaseNtupleManager
|
||||
virtual G4int GetNofNtuples() const final;
|
||||
virtual G4int GetNofNtupleBookings() const final;
|
||||
|
||||
// Set methods
|
||||
void SetNtupleRowWise(G4bool rowWise, G4bool rowMode);
|
||||
|
||||
private:
|
||||
G4RootPNtupleDescription*
|
||||
GetNtupleDescriptionInFunction(G4int id, G4String function, G4bool warn = true) const;
|
||||
@@ -174,6 +178,8 @@ class G4RootPNtupleManager : public G4BaseNtupleManager
|
||||
G4RootMainNtupleManager* fMainNtupleManager;
|
||||
std::vector<G4RootPNtupleDescription*> fNtupleDescriptionVector;
|
||||
std::vector<tools::wroot::imt_ntuple*> fNtupleVector;
|
||||
G4bool fRowWise;
|
||||
G4bool fRowMode;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
@@ -349,4 +355,3 @@ G4bool G4RootPNtupleManager::FillNtupleTColumn(G4int columnId, const T& value) {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -29,45 +29,14 @@
|
||||
#ifndef g4root_defs_h
|
||||
#define g4root_defs_h
|
||||
|
||||
#include "tools/histo/h1d"
|
||||
#include "tools/histo/h2d"
|
||||
#include "tools/histo/h3d"
|
||||
#include "tools/histo/p1d"
|
||||
#include "tools/histo/p2d"
|
||||
#include "tools/wroot/ntuple"
|
||||
#include "tools/rroot/ntuple"
|
||||
#include "G4RootAnalysisManager.hh"
|
||||
#include "G4RootAnalysisReader.hh"
|
||||
#include "g4hntools_defs.hh"
|
||||
|
||||
namespace G4Root {
|
||||
|
||||
// H1 types
|
||||
using G4AnaH1 = tools::histo::h1d; // keep for backward compatibility
|
||||
using G4H1 = tools::histo::h1d;
|
||||
using G4H1Iterator = std::vector<tools::histo::h1d*>::iterator;
|
||||
using G4H1ConstIterator = std::vector<tools::histo::h1d*>::const_iterator;
|
||||
|
||||
// H2 types
|
||||
using G4AnaH2 = tools::histo::h2d; // keep for backward compatibility
|
||||
using G4H2 = tools::histo::h2d;
|
||||
using G4H2Iterator = std::vector<tools::histo::h2d*>::iterator;
|
||||
using G4H2ConstIterator = std::vector<tools::histo::h2d*>::const_iterator;
|
||||
|
||||
// H3 types
|
||||
using G4H3 = tools::histo::h3d;
|
||||
using G4H3Iterator = std::vector<tools::histo::h3d*>::iterator;
|
||||
using G4H3ConstIterator = std::vector<tools::histo::h3d*>::const_iterator;
|
||||
|
||||
// P1 types
|
||||
using G4P1 = tools::histo::p1d;
|
||||
using G4P1Iterator = std::vector<tools::histo::p1d*>::iterator;
|
||||
using G4P1ConstIterator = std::vector<tools::histo::p1d*>::const_iterator;
|
||||
|
||||
// P2 types
|
||||
using G4P2 = tools::histo::p2d;
|
||||
using G4P2Iterator = std::vector<tools::histo::p2d*>::iterator;
|
||||
using G4P2ConstIterator = std::vector<tools::histo::p2d*>::const_iterator;
|
||||
|
||||
namespace G4Root
|
||||
{
|
||||
// Ntuple types
|
||||
using G4Ntuple = tools::wroot::ntuple;
|
||||
using G4NtupleIterator = std::vector<tools::wroot::ntuple*>::iterator;
|
||||
|
||||
Reference in New Issue
Block a user