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

#include <G4GenericAnalysisManager.hh>

+ Inheritance diagram for G4GenericAnalysisManager:

Public Member Functions

 G4GenericAnalysisManager (G4bool isMaster=true)
 
virtual ~G4GenericAnalysisManager ()
 
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
 
G4bool Merge ()
 
G4bool WriteH1 (G4int id, const G4String &fileName)
 
G4bool WriteH2 (G4int id, const G4String &fileName)
 
G4bool WriteH3 (G4int id, const G4String &fileName)
 
G4bool WriteP1 (G4int id, const G4String &fileName)
 
G4bool WriteP2 (G4int id, const G4String &fileName)
 
void SetDefaultFileType (const G4String &value)
 
G4String GetDefaultFileType () const
 
- Public Member Functions inherited from G4ToolsAnalysisManager
 G4ToolsAnalysisManager (const G4String &type, G4bool isMaster=true)
 
virtual ~G4ToolsAnalysisManager ()
 
tools::histo::h1d * GetH1 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
 
tools::histo::h2d * GetH2 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
 
tools::histo::h3d * GetH3 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
 
tools::histo::p1d * GetP1 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
 
tools::histo::p2d * GetP2 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
 
std::vector< tools::histo::h1d * >::iterator BeginH1 ()
 
std::vector< tools::histo::h1d * >::iterator EndH1 ()
 
std::vector< tools::histo::h1d * >::const_iterator BeginConstH1 () const
 
std::vector< tools::histo::h1d * >::const_iterator EndConstH1 () const
 
std::vector< tools::histo::h2d * >::iterator BeginH2 ()
 
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
 
std::vector< tools::histo::h3d * >::iterator BeginH3 ()
 
std::vector< tools::histo::h3d * >::iterator EndH3 ()
 
std::vector< tools::histo::h3d * >::const_iterator BeginConstH3 () const
 
std::vector< tools::histo::h3d * >::const_iterator EndConstH3 () const
 
std::vector< tools::histo::p1d * >::iterator BeginP1 ()
 
std::vector< tools::histo::p1d * >::iterator EndP1 ()
 
std::vector< tools::histo::p1d * >::const_iterator BeginConstP1 () const
 
std::vector< tools::histo::p1d * >::const_iterator EndConstP1 () const
 
std::vector< tools::histo::p2d * >::iterator BeginP2 ()
 
std::vector< tools::histo::p2d * >::iterator EndP2 ()
 
std::vector< tools::histo::p2d * >::const_iterator BeginConstP2 () const
 
std::vector< tools::histo::p2d * >::const_iterator EndConstP2 () const
 
std::vector< tools::wroot::ntuple * >::iterator BeginNtuple ()
 
std::vector< tools::wroot::ntuple * >::iterator EndNtuple ()
 
std::vector< tools::wroot::ntuple * >::const_iterator BeginConstNtuple () const
 
std::vector< tools::wroot::ntuple * >::const_iterator EndConstNtuple () const
 
- Public Member Functions inherited from G4VAnalysisManager
 G4VAnalysisManager (const G4String &type, G4bool isMaster)
 
virtual ~G4VAnalysisManager ()
 
G4bool OpenFile (const G4String &fileName="")
 
G4bool Write ()
 
G4bool CloseFile (G4bool reset=true)
 
G4bool Merge (tools::histo::hmpi *hmpi)
 
G4bool Plot ()
 
G4bool IsOpenFile () const
 
G4bool SetFileName (const G4String &fileName)
 
G4bool SetHistoDirectoryName (const G4String &dirName)
 
G4bool SetNtupleDirectoryName (const G4String &dirName)
 
void SetCompressionLevel (G4int level)
 
G4String GetFileName () const
 
G4String GetHistoDirectoryName () const
 
G4String GetNtupleDirectoryName () const
 
G4int GetCompressionLevel () const
 
G4int CreateH1 (const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
 
G4int CreateH1 (const G4String &name, const G4String &title, const std::vector< G4double > &edges, const G4String &unitName="none", const G4String &fcnName="none")
 
G4int CreateH2 (const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
 
G4int CreateH2 (const G4String &name, const G4String &title, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none")
 
G4int CreateH3 (const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
 
G4int CreateH3 (const G4String &name, const G4String &title, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, const std::vector< G4double > &zedges, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none")
 
G4bool SetH1 (G4int id, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
 
G4bool SetH1 (G4int id, const std::vector< G4double > &edges, const G4String &unitName="none", const G4String &fcnName="none")
 
G4bool SetH2 (G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
 
G4bool SetH2 (G4int id, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none")
 
G4bool SetH3 (G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nzbins, G4double zmin, G4double zmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
 
G4bool SetH3 (G4int id, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, const std::vector< G4double > &zedges, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none")
 
G4bool ScaleH1 (G4int id, G4double factor)
 
G4bool ScaleH2 (G4int id, G4double factor)
 
G4bool ScaleH3 (G4int id, G4double factor)
 
G4int CreateP1 (const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
 
G4int CreateP1 (const G4String &name, const G4String &title, const std::vector< G4double > &edges, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none")
 
G4int CreateP2 (const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
 
G4int CreateP2 (const G4String &name, const G4String &title, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none")
 
G4bool SetP1 (G4int id, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
 
G4bool SetP1 (G4int id, const std::vector< G4double > &edges, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none")
 
G4bool SetP2 (G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
 
G4bool SetP2 (G4int id, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none")
 
G4bool ScaleP1 (G4int id, G4double factor)
 
G4bool ScaleP2 (G4int id, G4double factor)
 
G4int CreateNtuple (const G4String &name, const G4String &title)
 
G4int CreateNtupleIColumn (const G4String &name)
 
G4int CreateNtupleFColumn (const G4String &name)
 
G4int CreateNtupleDColumn (const G4String &name)
 
G4int CreateNtupleSColumn (const G4String &name)
 
G4int CreateNtupleIColumn (const G4String &name, std::vector< int > &vector)
 
G4int CreateNtupleFColumn (const G4String &name, std::vector< float > &vector)
 
G4int CreateNtupleDColumn (const G4String &name, std::vector< double > &vector)
 
void FinishNtuple ()
 
G4int CreateNtupleIColumn (G4int ntupleId, const G4String &name)
 
G4int CreateNtupleFColumn (G4int ntupleId, const G4String &name)
 
G4int CreateNtupleDColumn (G4int ntupleId, const G4String &name)
 
G4int CreateNtupleSColumn (G4int ntupleId, const G4String &name)
 
G4int CreateNtupleIColumn (G4int ntupleId, const G4String &name, std::vector< int > &vector)
 
G4int CreateNtupleFColumn (G4int ntupleId, const G4String &name, std::vector< float > &vector)
 
G4int CreateNtupleDColumn (G4int ntupleId, const G4String &name, std::vector< double > &vector)
 
void FinishNtuple (G4int ntupleId)
 
virtual void SetNtupleMerging (G4bool mergeNtuples, G4int nofReducedNtupleFiles=0)
 
virtual void SetNtupleRowWise (G4bool rowWise, G4bool rowMode=true)
 
virtual void SetBasketSize (unsigned int basketSize)
 
virtual void SetBasketEntries (unsigned int basketEntries)
 
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)
 
G4bool SetFirstNtupleColumnId (G4int firstId)
 
G4bool FillH1 (G4int id, G4double value, G4double weight=1.0)
 
G4bool FillH2 (G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
 
G4bool FillH3 (G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)
 
G4bool FillP1 (G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
 
G4bool FillP2 (G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)
 
G4bool FillNtupleIColumn (G4int id, G4int value)
 
G4bool FillNtupleFColumn (G4int id, G4float value)
 
G4bool FillNtupleDColumn (G4int id, G4double value)
 
G4bool FillNtupleSColumn (G4int id, const G4String &value)
 
G4bool AddNtupleRow ()
 
G4bool FillNtupleIColumn (G4int ntupleId, G4int columnId, G4int value)
 
G4bool FillNtupleFColumn (G4int ntupleId, G4int columnId, G4float value)
 
G4bool FillNtupleDColumn (G4int ntupleId, G4int columnId, G4double value)
 
G4bool FillNtupleSColumn (G4int ntupleId, G4int id, const G4String &value)
 
G4bool AddNtupleRow (G4int ntupleId)
 
void SetActivation (G4bool activation)
 
G4bool GetActivation () const
 
G4bool IsActive () const
 
G4bool IsAscii () const
 
G4bool IsPlotting () const
 
G4int GetFirstH1Id () const
 
G4int GetFirstH2Id () const
 
G4int GetFirstH3Id () const
 
G4int GetFirstP1Id () const
 
G4int GetFirstP2Id () const
 
G4int GetFirstNtupleId () const
 
G4int GetFirstNtupleColumnId () 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
 
void SetH1Activation (G4bool activation)
 
void SetH1Activation (G4int id, G4bool activation)
 
void SetH1Ascii (G4int id, G4bool ascii)
 
void SetH1Plotting (G4int id, G4bool plotting)
 
void SetH1FileName (G4int id, const G4String &fileName)
 
void SetH2Activation (G4bool activation)
 
void SetH2Activation (G4int id, G4bool activation)
 
void SetH2Ascii (G4int id, G4bool ascii)
 
void SetH2Plotting (G4int id, G4bool plotting)
 
void SetH2FileName (G4int id, const G4String &fileName)
 
void SetH3Activation (G4bool activation)
 
void SetH3Activation (G4int id, G4bool activation)
 
void SetH3Ascii (G4int id, G4bool ascii)
 
void SetH3Plotting (G4int id, G4bool plotting)
 
void SetH3FileName (G4int id, const G4String &fileName)
 
void SetP1Activation (G4bool activation)
 
void SetP1Activation (G4int id, G4bool activation)
 
void SetP1Ascii (G4int id, G4bool ascii)
 
void SetP1Plotting (G4int id, G4bool plotting)
 
void SetP1FileName (G4int id, const G4String &fileName)
 
void SetP2Activation (G4bool activation)
 
void SetP2Activation (G4int id, G4bool activation)
 
void SetP2Ascii (G4int id, G4bool ascii)
 
void SetP2Plotting (G4int id, G4bool plotting)
 
void SetP2FileName (G4int id, const G4String &fileName)
 
void SetNtupleActivation (G4bool activation)
 
void SetNtupleActivation (G4int id, G4bool activation)
 
void SetNtupleFileName (const G4String &fileName)
 
void SetNtupleFileName (G4int id, const G4String &fileName)
 
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 GetH1Name (G4int id) const
 
G4double GetH1Unit (G4int id) const
 
G4bool GetH1Activation (G4int id) const
 
G4bool GetH1Ascii (G4int id) const
 
G4bool GetH1Plotting (G4int id) const
 
G4String GetH1FileName (G4int id) const
 
G4String GetH2Name (G4int id) const
 
G4double GetH2XUnit (G4int id) const
 
G4double GetH2YUnit (G4int id) const
 
G4bool GetH2Activation (G4int id) const
 
G4bool GetH2Ascii (G4int id) const
 
G4bool GetH2Plotting (G4int id) const
 
G4String GetH3Name (G4int id) const
 
G4double GetH3XUnit (G4int id) const
 
G4double GetH3YUnit (G4int id) const
 
G4double GetH3ZUnit (G4int id) const
 
G4bool GetH3Activation (G4int id) const
 
G4bool GetH3Ascii (G4int id) const
 
G4bool GetH3Plotting (G4int id) const
 
G4String GetP1Name (G4int id) const
 
G4double GetP1XUnit (G4int id) const
 
G4double GetP1YUnit (G4int id) const
 
G4bool GetP1Activation (G4int id) const
 
G4bool GetP1Ascii (G4int id) const
 
G4bool GetP1Plotting (G4int id) const
 
G4String GetP2Name (G4int id) const
 
G4double GetP2XUnit (G4int id) const
 
G4double GetP2YUnit (G4int id) const
 
G4double GetP2ZUnit (G4int id) const
 
G4bool GetP2Activation (G4int id) const
 
G4bool GetP2Ascii (G4int id) const
 
G4bool GetP2Plotting (G4int id) const
 
G4bool GetNtupleActivation (G4int id) const
 
G4String GetNtupleFileName (G4int id) const
 
G4bool SetH1Title (G4int id, const G4String &title)
 
G4bool SetH1XAxisTitle (G4int id, const G4String &title)
 
G4bool SetH1YAxisTitle (G4int id, const G4String &title)
 
G4bool SetH1XAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH1YAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH2Title (G4int id, const G4String &title)
 
G4bool SetH2XAxisTitle (G4int id, const G4String &title)
 
G4bool SetH2YAxisTitle (G4int id, const G4String &title)
 
G4bool SetH2ZAxisTitle (G4int id, const G4String &title)
 
G4bool SetH2XAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH2YAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH2ZAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH3Title (G4int id, const G4String &title)
 
G4bool SetH3XAxisTitle (G4int id, const G4String &title)
 
G4bool SetH3YAxisTitle (G4int id, const G4String &title)
 
G4bool SetH3ZAxisTitle (G4int id, const G4String &title)
 
G4bool SetH3XAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH3YAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetH3ZAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetP1Title (G4int id, const G4String &title)
 
G4bool SetP1XAxisTitle (G4int id, const G4String &title)
 
G4bool SetP1YAxisTitle (G4int id, const G4String &title)
 
G4bool SetP1XAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetP1YAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetP2Title (G4int id, const G4String &title)
 
G4bool SetP2XAxisTitle (G4int id, const G4String &title)
 
G4bool SetP2YAxisTitle (G4int id, const G4String &title)
 
G4bool SetP2ZAxisTitle (G4int id, const G4String &title)
 
G4bool SetP2XAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetP2YAxisIsLog (G4int id, G4bool isLog)
 
G4bool SetP2ZAxisIsLog (G4int id, G4bool isLog)
 
G4String GetH1Title (G4int id) const
 
G4String GetH1XAxisTitle (G4int id) const
 
G4String GetH1YAxisTitle (G4int id) const
 
G4bool GetH1XAxisIsLog (G4int id) const
 
G4bool GetH1YAxisIsLog (G4int id) const
 
G4String GetH2Title (G4int id) const
 
G4String GetH2XAxisTitle (G4int id) const
 
G4String GetH2YAxisTitle (G4int id) const
 
G4String GetH2ZAxisTitle (G4int id) const
 
G4bool GetH2XAxisIsLog (G4int id) const
 
G4bool GetH2YAxisIsLog (G4int id) const
 
G4bool GetH2ZAxisIsLog (G4int id) const
 
G4String GetH3Title (G4int id) const
 
G4String GetH3XAxisTitle (G4int id) const
 
G4String GetH3YAxisTitle (G4int id) const
 
G4String GetH3ZAxisTitle (G4int id) const
 
G4bool GetH3XAxisIsLog (G4int id) const
 
G4bool GetH3YAxisIsLog (G4int id) const
 
G4bool GetH3ZAxisIsLog (G4int id) const
 
G4String GetP1Title (G4int id) const
 
G4String GetP1XAxisTitle (G4int id) const
 
G4String GetP1YAxisTitle (G4int id) const
 
G4bool GetP1XAxisIsLog (G4int id) const
 
G4bool GetP1YAxisIsLog (G4int id) const
 
G4String GetP2Title (G4int id) const
 
G4String GetP2XAxisTitle (G4int id) const
 
G4String GetP2YAxisTitle (G4int id) const
 
G4String GetP2ZAxisTitle (G4int id) const
 
G4bool GetP2XAxisIsLog (G4int id) const
 
G4bool GetP2YAxisIsLog (G4int id) const
 
G4bool GetP2ZAxisIsLog (G4int id) const
 
void SetVerboseLevel (G4int verboseLevel)
 
G4int GetVerboseLevel () const
 
G4String GetType () const
 
G4String GetFileType () const
 

Static Public Member Functions

static G4GenericAnalysisManagerInstance ()
 
static G4bool IsInstance ()
 
- Static Public Member Functions inherited from G4ToolsAnalysisManager
static G4ToolsAnalysisManagerInstance ()
 
static G4bool IsInstance ()
 

Protected Member Functions

virtual G4bool OpenFileImpl (const G4String &fileName) override
 
virtual G4bool WriteImpl () final
 
virtual G4bool CloseFileImpl (G4bool reset=true) override
 
virtual G4bool IsOpenFileImpl () const final
 
virtual G4bool Reset () final
 
- Protected Member Functions inherited from G4ToolsAnalysisManager
virtual G4bool PlotImpl () final
 
virtual G4bool MergeImpl (tools::histo::hmpi *hmpi) final
 
G4bool Reset ()
 
- Protected Member Functions inherited from G4VAnalysisManager
virtual G4bool OpenFileImpl (const G4String &fileName)=0
 
virtual G4bool WriteImpl ()=0
 
virtual G4bool CloseFileImpl (G4bool reset)=0
 
virtual G4bool PlotImpl ()=0
 
virtual G4bool MergeImpl (tools::histo::hmpi *hmpi)=0
 
virtual G4bool IsOpenFileImpl () const =0
 
void SetH1Manager (G4VH1Manager *h1Manager)
 
void SetH2Manager (G4VH2Manager *h2Manager)
 
void SetH3Manager (G4VH3Manager *h3Manager)
 
void SetP1Manager (G4VP1Manager *p1Manager)
 
void SetP2Manager (G4VP2Manager *p2Manager)
 
void SetNtupleManager (std::shared_ptr< G4VNtupleManager > ntupleManager)
 
void SetFileManager (std::shared_ptr< G4VFileManager > fileManager)
 
void SetPlotManager (std::shared_ptr< G4PlotManager > plotManager)
 
G4bool WriteAscii (const G4String &fileName)
 

Friends

class G4RootMpiAnalysisManager
 

Additional Inherited Members

- Protected Attributes inherited from G4ToolsAnalysisManager
G4H1ToolsManagerfH1Manager
 
G4H2ToolsManagerfH2Manager
 
G4H3ToolsManagerfH3Manager
 
G4P1ToolsManagerfP1Manager
 
G4P2ToolsManagerfP2Manager
 
- Protected Attributes inherited from G4VAnalysisManager
G4AnalysisManagerState fState
 
std::shared_ptr< G4VFileManagerfVFileManager
 
std::shared_ptr< G4PlotManagerfPlotManager
 
std::shared_ptr< G4NtupleBookingManagerfNtupleBookingManager
 
std::shared_ptr< G4VNtupleManagerfVNtupleManager
 
- Static Protected Attributes inherited from G4ToolsAnalysisManager
static G4ThreadLocal G4ToolsAnalysisManagerfgToolsInstance = nullptr
 
- Static Protected Attributes inherited from G4VAnalysisManager
static constexpr unsigned int fgkDefaultBasketSize = 32000
 
static constexpr unsigned int fgkDefaultBasketEntries = 4000
 

Detailed Description

Definition at line 46 of file G4GenericAnalysisManager.hh.

Constructor & Destructor Documentation

◆ G4GenericAnalysisManager()

G4GenericAnalysisManager::G4GenericAnalysisManager ( G4bool  isMaster = true)
explicit

Definition at line 80 of file G4GenericAnalysisManager.cc.

81 : G4ToolsAnalysisManager("", isMaster),
82 fFileManager(nullptr),
83 fNtupleFileManager(nullptr)
84{
85 if ( ( isMaster && fgMasterInstance ) || ( fgInstance ) ) {
86 G4ExceptionDescription description;
87 description
88 << " "
89 << "G4GenericAnalysisManager already exists."
90 << "Cannot create another instance.";
91 G4Exception("G4GenericAnalysisManager::G4GenericAnalysisManager()",
92 "Analysis_F001", FatalException, description);
93 }
94 if ( isMaster ) fgMasterInstance = this;
95 fgInstance = this;
96
97 // File manager
98 fFileManager = std::make_shared<G4GenericFileManager>(fState);
99 SetFileManager(fFileManager);
100}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4AnalysisManagerState fState
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)

◆ ~G4GenericAnalysisManager()

G4GenericAnalysisManager::~G4GenericAnalysisManager ( )
virtual

Definition at line 103 of file G4GenericAnalysisManager.cc.

104{
105 if ( fState.GetIsMaster() ) fgMasterInstance = nullptr;
106 fgInstance = nullptr;
107}

Member Function Documentation

◆ CloseFileImpl()

G4bool G4GenericAnalysisManager::CloseFileImpl ( G4bool  reset = true)
overrideprotectedvirtual

Implements G4VAnalysisManager.

Definition at line 305 of file G4GenericAnalysisManager.cc.

306{
307 auto finalResult = true;
308
309#ifdef G4VERBOSE
310 if ( fState.GetVerboseL4() ) {
311 fState.GetVerboseL4()->Message("close (generic)", "files", "");
312 }
313#endif
314
315 if (fNtupleFileManager) {
316 auto result = fNtupleFileManager->ActionAtCloseFile(reset);
317 finalResult = finalResult && result;
318 }
319
320 // close file
321 auto result = fFileManager->CloseFiles();
322 if ( ! result ) {
323 G4ExceptionDescription description;
324 description << " " << "Closing files failed";
325 G4Exception("G4GenericAnalysisManager::CloseFile()",
326 "Analysis_W021", JustWarning, description);
327 }
328 finalResult = finalResult && result;
329
330 // delete empty files
331 result = fFileManager->DeleteEmptyFiles();
332 if ( ! result ) {
333 G4ExceptionDescription description;
334 description << " " << "Deleting empty files failed";
335 G4Exception("G4GenericAnalysisManager::CloseFile()",
336 "Analysis_W021", JustWarning, description);
337 }
338 finalResult = finalResult && result;
339
340 if ( reset ) {
341 result = Reset();
342 if ( ! result ) {
343 G4ExceptionDescription description;
344 description << " " << "Resetting data failed";
345 G4Exception("G4GenericAnalysisManager::CloseFile()",
346 "Analysis_W021", JustWarning, description);
347 }
348 }
349 finalResult = finalResult && result;
350
351#ifdef G4VERBOSE
352 if ( fState.GetVerboseL3() ) {
353 fState.GetVerboseL3()->Message("close (generic)", "files", "", finalResult);
354 }
355#endif
356
357 return finalResult;
358}
@ JustWarning
const G4AnalysisVerbose * GetVerboseL3() const
const G4AnalysisVerbose * GetVerboseL4() const
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const

◆ GetDefaultFileType()

G4String G4GenericAnalysisManager::GetDefaultFileType ( ) const

◆ Instance()

G4GenericAnalysisManager * G4GenericAnalysisManager::Instance ( )
static

Definition at line 63 of file G4GenericAnalysisManager.cc.

64{
65 if ( fgInstance == nullptr ) {
67 fgInstance = new G4GenericAnalysisManager(isMaster);
68 }
69
70 return fgInstance;
71}
bool G4bool
Definition: G4Types.hh:86
G4bool IsWorkerThread()
Definition: G4Threading.cc:123

◆ IsInstance()

G4bool G4GenericAnalysisManager::IsInstance ( )
static

Definition at line 74 of file G4GenericAnalysisManager.cc.

75{
76 return ( fgInstance != nullptr );
77}

◆ IsOpenFileImpl()

virtual G4bool G4GenericAnalysisManager::IsOpenFileImpl ( ) const
finalprotectedvirtual

Implements G4VAnalysisManager.

◆ Merge()

G4bool G4GenericAnalysisManager::Merge ( )

Definition at line 377 of file G4GenericAnalysisManager.cc.

378{
379 // Nothing to be done on master
380 if ( ! G4Threading::IsWorkerThread() ) return false;
381
382#ifdef G4VERBOSE
383 if ( fState.GetVerboseL4() ) {
384 fState.GetVerboseL4()->Message("merge (generic) on worker", "histograms", "");
385 }
386#endif
387
388 // The worker manager just adds its histograms to the master
389 fH1Manager->Merge(mergeHnMutex, fgMasterInstance->fH1Manager);
390 fH2Manager->Merge(mergeHnMutex, fgMasterInstance->fH2Manager);
391 fH3Manager->Merge(mergeHnMutex, fgMasterInstance->fH3Manager);
392 fP1Manager->Merge(mergeHnMutex, fgMasterInstance->fP1Manager);
393 fP2Manager->Merge(mergeHnMutex, fgMasterInstance->fP2Manager);
394
395#ifdef G4VERBOSE
396 if ( fState.GetVerboseL3() ) {
397 fState.GetVerboseL3()->Message("merge (generic) on worker", "histograms", "", true);
398 }
399#endif
400
401 return true;
402}
void Merge(G4Mutex &mergeMutex, G4THnManager< T > *masterInstance)

Referenced by WriteImpl().

◆ OpenFileImpl()

G4bool G4GenericAnalysisManager::OpenFileImpl ( const G4String fileName)
overrideprotectedvirtual

Implements G4VAnalysisManager.

Definition at line 180 of file G4GenericAnalysisManager.cc.

181{
182 // Add file name extension, if missing
183 auto fullFileName = fileName;
184 if ( ! GetExtension(fileName).size() ) {
185 // G4cout << "File type is not defined, using default: " << fFileManager->GetDefaultFileType() << G4endl;
186 fullFileName = fileName + "." + fFileManager->GetDefaultFileType();
187 }
188
189#ifdef G4VERBOSE
190 if ( fState.GetVerboseL4() ) {
191 fState.GetVerboseL4()->Message("open (generic)", "file", fileName);
192 }
193#endif
194
195 // Create ntuple file manager if there are booked ntuples
196 if (! fNtupleFileManager) {
197 CreateNtupleFileManager(fullFileName);
198 }
199
200 // Create ntuple manager
201 // and set it to base class which takes then its ownership
202 if (fNtupleFileManager) {
203 SetNtupleManager(fNtupleFileManager->CreateNtupleManager());
204 }
205
206 auto finalResult = true;
207
208 // Open file for histograms/profiles
209 auto result = fFileManager->OpenFile(fullFileName);
210 finalResult = finalResult && result;
211
212 // Open ntuple file(s) and create ntuples from bookings
213 if (fNtupleFileManager) {
214 result = fNtupleFileManager->ActionAtOpenFile(fullFileName);
215 finalResult = finalResult && result;
216 }
217
218#ifdef G4VERBOSE
219 if ( fState.GetVerboseL3() ) {
220 fState.GetVerboseL3()->Message("open (generic)", "file", fileName, finalResult);
221 }
222#endif
223 return finalResult;
224}
void SetNtupleManager(std::shared_ptr< G4VNtupleManager > ntupleManager)
G4String GetExtension(const G4String &fileName, const G4String &defaultExtension="")

◆ Reset()

G4bool G4GenericAnalysisManager::Reset ( )
finalprotectedvirtual

Definition at line 361 of file G4GenericAnalysisManager.cc.

362{
363// Reset histograms and ntuple
364
365 auto finalResult = true;
366
367 auto result = G4ToolsAnalysisManager::Reset();
368 finalResult = finalResult && result;
369
370 result = fNtupleFileManager->Reset();
371 finalResult = result && finalResult;
372
373 return finalResult;
374}

Referenced by CloseFileImpl().

◆ SetBasketEntries()

virtual void G4GenericAnalysisManager::SetBasketEntries ( unsigned int  basketEntries)
overridevirtual

Reimplemented from G4VAnalysisManager.

◆ SetBasketSize()

virtual void G4GenericAnalysisManager::SetBasketSize ( unsigned int  basketSize)
overridevirtual

Reimplemented from G4VAnalysisManager.

◆ SetDefaultFileType()

void G4GenericAnalysisManager::SetDefaultFileType ( const G4String value)

◆ SetNtupleMerging()

virtual void G4GenericAnalysisManager::SetNtupleMerging ( G4bool  mergeNtuples,
G4int  nofReducedNtupleFiles = 0 
)
overridevirtual

Reimplemented from G4VAnalysisManager.

◆ SetNtupleRowWise()

virtual void G4GenericAnalysisManager::SetNtupleRowWise ( G4bool  rowWise,
G4bool  rowMode = true 
)
overridevirtual

Reimplemented from G4VAnalysisManager.

◆ WriteH1()

G4bool G4GenericAnalysisManager::WriteH1 ( G4int  id,
const G4String fileName 
)

Definition at line 405 of file G4GenericAnalysisManager.cc.

406{
407 // Experimental extra write
408
409 // Do not write histo on worker (redundant and fails in hdf5 )
410 // If default file is not used, users have to call Merge from their code
411 if ( G4Threading::IsWorkerThread() ) return false;
412
413 auto h1d = GetH1(id, false);
414 if ( ! h1d ) {
415 WriteHnException("H1", id);
416 return false;
417 }
418
419 auto h1Name = GetH1Name(id);
420 return fFileManager->WriteTExtra<tools::histo::h1d>(fileName, h1d, h1Name);
421}
tools::histo::h1d * GetH1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
G4String GetH1Name(G4int id) const

◆ WriteH2()

G4bool G4GenericAnalysisManager::WriteH2 ( G4int  id,
const G4String fileName 
)

Definition at line 424 of file G4GenericAnalysisManager.cc.

425{
426 // Experimental extra write
427
428 // Do not write histo on worker (redundant and fails in hdf5 )
429 // If default file is not used, users have to call Merge from their code
430 if ( G4Threading::IsWorkerThread() ) return false;
431
432 auto h2d = GetH2(id, false);
433 if ( ! h2d ) {
434 WriteHnException("H2", id);
435 return false;
436 }
437
438 auto h2Name = GetH2Name(id);
439 return fFileManager->WriteTExtra<tools::histo::h2d>(fileName, h2d, h2Name);
440}
tools::histo::h2d * GetH2(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
G4String GetH2Name(G4int id) const

◆ WriteH3()

G4bool G4GenericAnalysisManager::WriteH3 ( G4int  id,
const G4String fileName 
)

Definition at line 442 of file G4GenericAnalysisManager.cc.

443{
444 // Experimental extra write
445
446 // Do not write histo on worker (redundant and fails in hdf5 )
447 // If default file is not used, users have to call Merge from their code
448 if ( G4Threading::IsWorkerThread() ) return false;
449
450 auto h3d = GetH3(id, false);
451 if ( ! h3d ) {
452 WriteHnException("H3", id);
453 return false;
454 }
455
456 auto h3Name = GetH3Name(id);
457 return fFileManager->WriteTExtra<tools::histo::h3d>(fileName, h3d, h3Name);
458}
tools::histo::h3d * GetH3(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
G4String GetH3Name(G4int id) const

◆ WriteImpl()

G4bool G4GenericAnalysisManager::WriteImpl ( )
finalprotectedvirtual

Implements G4VAnalysisManager.

Definition at line 227 of file G4GenericAnalysisManager.cc.

228{
229#ifdef G4VERBOSE
230 if ( fState.GetVerboseL4() ) {
231 fState.GetVerboseL4()->Message("write (generic)", "files", "");
232 }
233#endif
234
235 auto finalResult = true;
236 auto result = true;
237
238 if ( ! fgMasterInstance &&
239 ( ( ! fH1Manager->IsEmpty() ) || ( ! fH2Manager->IsEmpty() ) ||
240 ( ! fH3Manager->IsEmpty() ) || ( ! fP1Manager->IsEmpty() ) ||
241 ( ! fP2Manager->IsEmpty() ) ) ) {
242 G4ExceptionDescription description;
243 description
244 << " " << "No master G4GenericAnalysisManager instance exists."
245 << G4endl
246 << " " << "Histogram/profile data will not be merged.";
247 G4Exception("G4GenericAnalysisManager::Write()",
248 "Analysis_W031", JustWarning, description);
249 }
250
252 result = Merge();
253 finalResult = finalResult && result;
254 }
255 else {
256 // GO ON
257
258 // Open all files registered with objects
259 fFileManager->OpenFiles();
260
261 // Write all histograms/profile on master
262 //
263 result = fFileManager->WriteT(fH1Manager->GetH1Vector(), fH1Manager->GetHnVector());
264 finalResult = finalResult && result;
265
266 result = fFileManager->WriteT(fH2Manager->GetH2Vector(), fH2Manager->GetHnVector());
267 finalResult = finalResult && result;
268
269 result = fFileManager->WriteT(fH3Manager->GetH3Vector(), fH3Manager->GetHnVector());
270 finalResult = finalResult && result;
271
272 result = fFileManager->WriteT(fP1Manager->GetP1Vector(), fP1Manager->GetHnVector());
273 finalResult = finalResult && result;
274
275 result = fFileManager->WriteT(fP2Manager->GetP2Vector(), fP2Manager->GetHnVector());
276 finalResult = finalResult && result;
277 }
278
279 // Ntuples
280 if (fNtupleFileManager) {
281 result = fNtupleFileManager->ActionAtWrite();
282 finalResult = finalResult && result;
283 }
284
285 // File
286 result = fFileManager->WriteFiles();
287 finalResult = finalResult && result;
288
289 // Write ASCII if activated
290 if ( IsAscii() ) {
291 result = WriteAscii(fFileManager->GetFileName());
292 finalResult = finalResult && result;
293 }
294
295#ifdef G4VERBOSE
296 if ( fState.GetVerboseL3() ) {
297 fState.GetVerboseL3()->Message("write (generic)", "files", "", finalResult);
298 }
299#endif
300
301 return finalResult;
302}
#define G4endl
Definition: G4ios.hh:57
const std::vector< G4HnInformation * > & GetHnVector() const
const std::vector< tools::histo::h1d * > & GetH1Vector() const
const std::vector< tools::histo::h2d * > & GetH2Vector() const
const std::vector< G4HnInformation * > & GetHnVector() const
const std::vector< G4HnInformation * > & GetHnVector() const
const std::vector< tools::histo::h3d * > & GetH3Vector() const
const std::vector< G4HnInformation * > & GetHnVector() const
const std::vector< tools::histo::p1d * > & GetP1Vector() const
const std::vector< G4HnInformation * > & GetHnVector() const
const std::vector< tools::histo::p2d * > & GetP2Vector() const
G4bool IsEmpty() const
G4bool WriteAscii(const G4String &fileName)

◆ WriteP1()

G4bool G4GenericAnalysisManager::WriteP1 ( G4int  id,
const G4String fileName 
)

Definition at line 461 of file G4GenericAnalysisManager.cc.

462{
463 // Experimental extra write
464
465 // Do not write histo on worker (redundant and fails in hdf5 )
466 // If default file is not used, users have to call Merge from their code
467 if ( G4Threading::IsWorkerThread() ) return false;
468
469 auto p1d = GetP1(id, false);
470 if ( ! p1d ) {
471 WriteHnException("P1", id);
472 return false;
473 }
474
475 auto p1Name = GetP1Name(id);
476 return fFileManager->WriteTExtra<tools::histo::p1d>(fileName, p1d, p1Name);
477}
tools::histo::p1d * GetP1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
G4String GetP1Name(G4int id) const

◆ WriteP2()

G4bool G4GenericAnalysisManager::WriteP2 ( G4int  id,
const G4String fileName 
)

Definition at line 479 of file G4GenericAnalysisManager.cc.

480{
481 // Experimental extra write
482
483 // Do not write histo on worker (redundant and fails in hdf5 )
484 // If default file is not used, users have to call Merge from their code
485 if ( G4Threading::IsWorkerThread() ) return false;
486
487 auto p2d = GetP2(id, false);
488 if ( ! p2d ) {
489 WriteHnException("P2", id);
490 return false;
491 }
492
493 auto p2Name = GetP2Name(id);
494 return fFileManager->WriteTExtra<tools::histo::p2d>(fileName, p2d, p2Name);
495}
tools::histo::p2d * GetP2(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
G4String GetP2Name(G4int id) const

Friends And Related Function Documentation

◆ G4RootMpiAnalysisManager

friend class G4RootMpiAnalysisManager
friend

Definition at line 48 of file G4GenericAnalysisManager.hh.


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