Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CsvAnalysisReader Class Reference

#include <G4CsvAnalysisReader.hh>

+ Inheritance diagram for G4CsvAnalysisReader:

Public Member Functions

 ~G4CsvAnalysisReader () override
 
tools::rcsv::ntuple * GetNtuple () const
 
tools::rcsv::ntuple * GetNtuple (G4int ntupleId) const
 
G4int GetNtuple (const G4String &ntupleName, const G4String &fileName="", const G4String &dirName="")
 
- Public Member Functions inherited from G4ToolsAnalysisReader
 ~G4ToolsAnalysisReader () override=default
 
tools::histo::h1d * GetH1 (G4int id, G4bool warn=true) const
 
tools::histo::h2d * GetH2 (G4int id, G4bool warn=true) const
 
tools::histo::h3d * GetH3 (G4int id, G4bool warn=true) const
 
tools::histo::p1d * GetP1 (G4int id, G4bool warn=true) const
 
tools::histo::p2d * GetP2 (G4int id, G4bool warn=true) const
 
- Public Member Functions inherited from G4VAnalysisReader
virtual ~G4VAnalysisReader ()
 
G4bool CloseFiles (G4bool reset=true)
 
void SetFileName (const G4String &fileName)
 
G4String GetFileName () const
 
G4int ReadH1 (const G4String &h1Name, const G4String &fileName="", const G4String &dirName="")
 
G4int ReadH2 (const G4String &h2Name, const G4String &fileName="", const G4String &dirName="")
 
G4int ReadH3 (const G4String &h3Name, const G4String &fileName="", const G4String &dirName="")
 
G4int ReadP1 (const G4String &h1Name, const G4String &fileName="", const G4String &dirName="")
 
G4int ReadP2 (const G4String &h2Name, const G4String &fileName="", const G4String &dirName="")
 
G4bool SetFirstHistoId (G4int firstId)
 
G4bool SetFirstH1Id (G4int firstId)
 
G4bool SetFirstH2Id (G4int firstId)
 
G4bool SetFirstH3Id (G4int firstId)
 
G4bool SetFirstProfileId (G4int firstId)
 
G4bool SetFirstP1Id (G4int firstId)
 
G4bool SetFirstP2Id (G4int firstId)
 
G4bool SetFirstNtupleId (G4int firstId)
 
G4int GetNtuple (const G4String &ntupleName, const G4String &fileName="", const G4String &dirName="")
 
G4bool SetNtupleIColumn (const G4String &columnName, G4int &value)
 
G4bool SetNtupleFColumn (const G4String &columnName, G4float &value)
 
G4bool SetNtupleDColumn (const G4String &columnName, G4double &value)
 
G4bool SetNtupleSColumn (const G4String &columnName, G4String &value)
 
G4bool SetNtupleIColumn (const G4String &columnName, std::vector< int > &vector)
 
G4bool SetNtupleFColumn (const G4String &columnName, std::vector< float > &vector)
 
G4bool SetNtupleDColumn (const G4String &columnName, std::vector< double > &vector)
 
G4bool SetNtupleSColumn (const G4String &columnName, std::vector< std::string > &vector)
 
G4bool SetNtupleIColumn (G4int ntupleId, const G4String &columnName, G4int &value)
 
G4bool SetNtupleFColumn (G4int ntupleId, const G4String &columnName, G4float &value)
 
G4bool SetNtupleDColumn (G4int ntupleId, const G4String &columnName, G4double &value)
 
G4bool SetNtupleSColumn (G4int ntupleId, const G4String &columnName, G4String &value)
 
G4bool SetNtupleIColumn (G4int ntupleId, const G4String &columnName, std::vector< int > &vector)
 
G4bool SetNtupleFColumn (G4int ntupleId, const G4String &columnName, std::vector< float > &vector)
 
G4bool SetNtupleDColumn (G4int ntupleId, const G4String &columnName, std::vector< double > &vector)
 
G4bool SetNtupleSColumn (G4int ntupleId, const G4String &columnName, std::vector< std::string > &vector)
 
G4bool GetNtupleRow ()
 
G4bool GetNtupleRow (G4int ntupleId)
 
G4bool IsAscii () const
 
G4int GetNofH1s () const
 
G4int GetNofH2s () const
 
G4int GetNofH3s () const
 
G4int GetNofP1s () const
 
G4int GetNofP2s () const
 
G4int GetNofNtuples () const
 
G4int GetH1Id (const G4String &name, G4bool warn=true) const
 
G4int GetH2Id (const G4String &name, G4bool warn=true) const
 
G4int GetH3Id (const G4String &name, G4bool warn=true) const
 
G4int GetP1Id (const G4String &name, G4bool warn=true) const
 
G4int GetP2Id (const G4String &name, G4bool warn=true) const
 
G4int GetH1Nbins (G4int id) const
 
G4double GetH1Xmin (G4int id) const
 
G4double GetH1Xmax (G4int id) const
 
G4double GetH1Width (G4int id) const
 
G4int GetH2Nxbins (G4int id) const
 
G4double GetH2Xmin (G4int id) const
 
G4double GetH2Xmax (G4int id) const
 
G4double GetH2XWidth (G4int id) const
 
G4int GetH2Nybins (G4int id) const
 
G4double GetH2Ymin (G4int id) const
 
G4double GetH2Ymax (G4int id) const
 
G4double GetH2YWidth (G4int id) const
 
G4int GetH3Nxbins (G4int id) const
 
G4double GetH3Xmin (G4int id) const
 
G4double GetH3Xmax (G4int id) const
 
G4double GetH3XWidth (G4int id) const
 
G4int GetH3Nybins (G4int id) const
 
G4double GetH3Ymin (G4int id) const
 
G4double GetH3Ymax (G4int id) const
 
G4double GetH3YWidth (G4int id) const
 
G4int GetH3Nzbins (G4int id) const
 
G4double GetH3Zmin (G4int id) const
 
G4double GetH3Zmax (G4int id) const
 
G4double GetH3ZWidth (G4int id) const
 
G4int GetP1Nbins (G4int id) const
 
G4double GetP1Xmin (G4int id) const
 
G4double GetP1Xmax (G4int id) const
 
G4double GetP1XWidth (G4int id) const
 
G4double GetP1Ymin (G4int id) const
 
G4double GetP1Ymax (G4int id) const
 
G4int GetP2Nxbins (G4int id) const
 
G4double GetP2Xmin (G4int id) const
 
G4double GetP2Xmax (G4int id) const
 
G4double GetP2XWidth (G4int id) const
 
G4int GetP2Nybins (G4int id) const
 
G4double GetP2Ymin (G4int id) const
 
G4double GetP2Ymax (G4int id) const
 
G4double GetP2YWidth (G4int id) const
 
G4double GetP2Zmin (G4int id) const
 
G4double GetP2Zmax (G4int id) const
 
G4String GetH1Title (G4int id) const
 
G4String GetH1XAxisTitle (G4int id) const
 
G4String GetH1YAxisTitle (G4int id) const
 
G4String GetH2Title (G4int id) const
 
G4String GetH2XAxisTitle (G4int id) const
 
G4String GetH2YAxisTitle (G4int id) const
 
G4String GetH2ZAxisTitle (G4int id) const
 
G4String GetH3Title (G4int id) const
 
G4String GetH3XAxisTitle (G4int id) const
 
G4String GetH3YAxisTitle (G4int id) const
 
G4String GetH3ZAxisTitle (G4int id) const
 
G4String GetP1Title (G4int id) const
 
G4String GetP1XAxisTitle (G4int id) const
 
G4String GetP1YAxisTitle (G4int id) const
 
G4String GetP1ZAxisTitle (G4int id) const
 
G4String GetP2Title (G4int id) const
 
G4String GetP2XAxisTitle (G4int id) const
 
G4String GetP2YAxisTitle (G4int id) const
 
G4String GetP2ZAxisTitle (G4int id) const
 
void SetVerboseLevel (G4int verboseLevel)
 
G4int GetVerboseLevel () const
 
G4String GetType () const
 
G4String GetFileType () const
 

Static Public Member Functions

static G4CsvAnalysisReaderInstance ()
 

Protected Member Functions

G4bool CloseFilesImpl (G4bool reset) final
 
- Protected Member Functions inherited from G4ToolsAnalysisReader
 G4ToolsAnalysisReader (const G4String &type)
 
G4int ReadH1Impl (const G4String &h1Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
 
G4int ReadH2Impl (const G4String &h2Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
 
G4int ReadH3Impl (const G4String &h3Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
 
G4int ReadP1Impl (const G4String &p1Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
 
G4int ReadP2Impl (const G4String &p2Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
 
template<typename HT >
G4int ReadTImpl (const G4String &htName, const G4String &fileName, const G4String &dirName, G4bool isUserFileName, G4THnManager< HT > *htManager)
 
G4bool Reset ()
 
- Protected Member Functions inherited from G4VAnalysisReader
 G4VAnalysisReader (const G4String &type)
 
virtual G4int ReadH1Impl (const G4String &h1Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName)=0
 
virtual G4int ReadH2Impl (const G4String &h2Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName)=0
 
virtual G4int ReadH3Impl (const G4String &h3Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName)=0
 
virtual G4int ReadP1Impl (const G4String &p1Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName)=0
 
virtual G4int ReadP2Impl (const G4String &p2Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName)=0
 
virtual G4bool CloseFilesImpl (G4bool reset)=0
 
void Message (G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
 
void SetH1Manager (G4VTBaseHnManager< 1 > *h1Manager)
 
void SetH2Manager (G4VTBaseHnManager< 2 > *h2Manager)
 
void SetH3Manager (G4VTBaseHnManager< 3 > *h3Manager)
 
void SetP1Manager (G4VTBaseHnManager< 2 > *p1Manager)
 
void SetP2Manager (G4VTBaseHnManager< 3 > *p2Manager)
 
void SetNtupleManager (std::shared_ptr< G4VRNtupleManager > ntupleManager)
 
void SetFileManager (std::shared_ptr< G4VRFileManager > fileManager)
 

Friends

class G4ThreadLocalSingleton< G4CsvAnalysisReader >
 

Additional Inherited Members

- Protected Attributes inherited from G4ToolsAnalysisReader
G4THnToolsManager< 1, tools::histo::h1d > * fH1Manager { nullptr }
 
G4THnToolsManager< 2, tools::histo::h2d > * fH2Manager { nullptr }
 
G4THnToolsManager< 3, tools::histo::h3d > * fH3Manager { nullptr }
 
G4THnToolsManager< 2, tools::histo::p1d > * fP1Manager { nullptr }
 
G4THnToolsManager< 3, tools::histo::p2d > * fP2Manager { nullptr }
 
- Protected Attributes inherited from G4VAnalysisReader
G4AnalysisManagerState fState
 
std::shared_ptr< G4VRFileManagerfVFileManager { nullptr }
 
- Static Protected Attributes inherited from G4ToolsAnalysisReader
static constexpr std::string_view fkClass { "G4ToolsAnalysisReader" }
 

Detailed Description

Definition at line 49 of file G4CsvAnalysisReader.hh.

Constructor & Destructor Documentation

◆ ~G4CsvAnalysisReader()

G4CsvAnalysisReader::~G4CsvAnalysisReader ( )
override

Definition at line 61 of file G4CsvAnalysisReader.cc.

62{
63 if ( fState.GetIsMaster() ) fgMasterInstance = nullptr;
64}
G4AnalysisManagerState fState

Member Function Documentation

◆ CloseFilesImpl()

G4bool G4CsvAnalysisReader::CloseFilesImpl ( G4bool  reset)
finalprotectedvirtual

Implements G4VAnalysisReader.

Definition at line 88 of file G4CsvAnalysisReader.cc.

89{
90 Message(kVL4, "close", "files");
91
92 auto result = true;
93
94 if (reset) {
95 result &= Reset();
96 }
97
98 fFileManager->CloseFiles();
99
100 Message(kVL2, "close", "files", "", result);
101
102 return result;
103}
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
constexpr G4int kVL2
constexpr G4int kVL4

◆ GetNtuple() [1/3]

tools::rcsv::ntuple * G4CsvAnalysisReader::GetNtuple ( ) const

◆ GetNtuple() [2/3]

G4int G4VAnalysisReader::GetNtuple ( const G4String ntupleName,
const G4String fileName = "",
const G4String dirName = "" 
)

Definition at line 86 of file G4VAnalysisReader.cc.

252{
253 if ( fileName != "" ) {
254 return fVNtupleManager->ReadNtupleImpl(ntupleName, fileName, dirName, true);
255 }
256 // Check if fileName was set
257 if (fVFileManager->GetFileName() == "") {
258 Warn("Cannot read Ntuple " + ntupleName += ". File name has to be set first.", fkClass,
259 "ReadNtuple");
260 return kInvalidId;
261 }
262 return fVNtupleManager->ReadNtupleImpl(ntupleName, fVFileManager->GetFileName(), dirName, false);
263}
std::shared_ptr< G4VRFileManager > fVFileManager
constexpr G4int kInvalidId
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)

◆ GetNtuple() [3/3]

tools::rcsv::ntuple * G4CsvAnalysisReader::GetNtuple ( G4int  ntupleId) const

◆ Instance()

G4CsvAnalysisReader * G4CsvAnalysisReader::Instance ( )
static

Definition at line 38 of file G4CsvAnalysisReader.cc.

Friends And Related Function Documentation

◆ G4ThreadLocalSingleton< G4CsvAnalysisReader >

Definition at line 1 of file G4CsvAnalysisReader.hh.


The documentation for this class was generated from the following files: