Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -32,81 +32,74 @@
#define G4RootMainNtupleManager_h 1
#include "G4BaseAnalysisManager.hh"
#include "G4NtupleBookingManager.hh"
#include "G4TNtupleDescription.hh"
#include "G4RootNtupleManager.hh"
#include "G4RootFileDef.hh"
#include "globals.hh"
#include <vector>
class G4RootFileManager;
class G4RootNtupleManager;
class G4NtupleBookingManager;
namespace tools {
namespace wroot {
class file;
class ntuple;
}
}
// Types alias
using RootNtupleDescription = G4TNtupleDescription<tools::wroot::ntuple, G4RootFile>;
class G4RootMainNtupleManager : public G4BaseAnalysisManager
{
friend class G4RootPNtupleManager;
friend class G4RootNtupleManager;
public:
explicit G4RootMainNtupleManager(G4RootNtupleManager* ntupleBuilder,
G4bool rowWise,
const G4AnalysisManagerState& state);
explicit G4RootMainNtupleManager(
G4RootNtupleManager* ntupleBuilder,
G4NtupleBookingManager* bookingManager,
G4bool rowWise, G4int fileNumber,
const G4AnalysisManagerState& state);
~G4RootMainNtupleManager();
protected:
// Types alias
using NtupleType = tools::wroot::ntuple;
using NtupleDescriptionType = G4TNtupleDescription<NtupleType>;
// Methods to manipulate ntuples
void CreateNtuple(const tools::ntuple_booking& ntupleBooking, G4bool warn = true);
void CreateNtuplesFromBooking();
void CreateNtuple(RootNtupleDescription* ntupleDescription, G4bool warn = true);
G4bool Merge();
G4bool Reset(G4bool deleteNtuple);
// Set/get methods
void SetNtupleFile(std::shared_ptr<tools::wroot::file> rfile);
void SetNtupleDirectory(tools::wroot::directory* directory);
void SetFileManager(std::shared_ptr<G4RootFileManager> fileManager);
void SetRowWise(G4bool rowWise);
std::shared_ptr<tools::wroot::file> GetNtupleFile() const;
tools::wroot::directory* GetNtupleDirectory() const;
std::shared_ptr<G4RootFile> GetNtupleFile(RootNtupleDescription* ntupleDescription) const;
// Access functions
const std::vector<NtupleDescriptionType*>& GetNtupleDescriptionVector()
{ return fNtupleBuilder->GetNtupleDescriptionVector(); }
const std::vector<tools::wroot::ntuple*>& GetNtupleVector()
{ return fNtupleVector; }
unsigned int GetBasketEntries() const;
private:
// Data members
G4RootNtupleManager* fNtupleBuilder;
G4RootNtupleManager* fNtupleBuilder;
G4NtupleBookingManager* fBookingManager;
std::shared_ptr<G4RootFileManager> fFileManager;
G4bool fRowWise;
std::shared_ptr<tools::wroot::file> fNtupleFile;
tools::wroot::directory* fNtupleDirectory;
std::vector<tools::wroot::ntuple*> fNtupleVector;
G4int fFileNumber;
std::vector<tools::wroot::ntuple*> fNtupleVector;
std::vector<RootNtupleDescription*> fNtupleDescriptionVector;
};
inline void G4RootMainNtupleManager::SetNtupleFile(std::shared_ptr<tools::wroot::file> rfile)
{ fNtupleFile = rfile; }
inline void G4RootMainNtupleManager::SetNtupleDirectory(tools::wroot::directory* directory)
{ fNtupleDirectory = directory; }
inline void G4RootMainNtupleManager::SetFileManager(
std::shared_ptr<G4RootFileManager> fileManager)
{ fFileManager = fileManager; }
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(); }