Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RootAnalysisManager Class Reference

#include <G4RootAnalysisManager.hh>

Inheritance diagram for G4RootAnalysisManager:
Collaboration diagram for G4RootAnalysisManager:

Public Member Functions

 G4RootAnalysisManager (G4bool isMaster=true)
 
virtual ~G4RootAnalysisManager ()
 
tools::wroot::ntuple * GetNtuple () const
 
tools::wroot::ntuple * GetNtuple (G4int ntupleId) 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
 
void SetNtupleMerging (G4bool mergeNtuples, G4int nofReducedNtupleFiles=0, unsigned int basketSize=fgkDefaultBasketSize)
 
- 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 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)
 
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 SetH2Activation (G4bool activation)
 
void SetH2Activation (G4int id, G4bool activation)
 
void SetH2Ascii (G4int id, G4bool ascii)
 
void SetH2Plotting (G4int id, G4bool plotting)
 
void SetH3Activation (G4bool activation)
 
void SetH3Activation (G4int id, G4bool activation)
 
void SetH3Ascii (G4int id, G4bool ascii)
 
void SetH3Plotting (G4int id, G4bool plotting)
 
void SetP1Activation (G4bool activation)
 
void SetP1Activation (G4int id, G4bool activation)
 
void SetP1Ascii (G4int id, G4bool ascii)
 
void SetP1Plotting (G4int id, G4bool plotting)
 
void SetP2Activation (G4bool activation)
 
void SetP2Activation (G4int id, G4bool activation)
 
void SetP2Ascii (G4int id, G4bool ascii)
 
void SetP2Plotting (G4int id, G4bool plotting)
 
void SetNtupleActivation (G4bool activation)
 
void SetNtupleActivation (G4int id, G4bool activation)
 
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 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
 
G4bool SetH1Title (G4int id, const G4String &title)
 
G4bool SetH1XAxisTitle (G4int id, const G4String &title)
 
G4bool SetH1YAxisTitle (G4int id, const G4String &title)
 
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 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 SetP1Title (G4int id, const G4String &title)
 
G4bool SetP1XAxisTitle (G4int id, const G4String &title)
 
G4bool SetP1YAxisTitle (G4int id, const G4String &title)
 
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)
 
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 G4RootAnalysisManagerInstance ()
 
static G4bool IsInstance ()
 

Protected Member Functions

virtual G4bool OpenFileImpl (const G4String &fileName) final
 
virtual G4bool WriteImpl () final
 
virtual G4bool CloseFileImpl () final
 
virtual G4bool IsOpenFileImpl () const 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
void SetH1Manager (G4VH1Manager *h1Manager)
 
void SetH2Manager (G4VH2Manager *h2Manager)
 
void SetH3Manager (G4VH3Manager *h3Manager)
 
void SetP1Manager (G4VP1Manager *p1Manager)
 
void SetP2Manager (G4VP2Manager *p2Manager)
 
void SetNtupleManager (G4VNtupleManager *ntupleManager)
 
void SetFileManager (std::shared_ptr< G4VFileManager > fileManager)
 
G4bool WriteAscii (const G4String &fileName)
 

Additional Inherited Members

- Protected Attributes inherited from G4ToolsAnalysisManager
G4H1ToolsManagerfH1Manager
 
G4H2ToolsManagerfH2Manager
 
G4H3ToolsManagerfH3Manager
 
G4P1ToolsManagerfP1Manager
 
G4P2ToolsManagerfP2Manager
 
- Protected Attributes inherited from G4VAnalysisManager
G4AnalysisManagerState fState
 
std::shared_ptr< G4VFileManagerfVFileManager
 

Detailed Description

Definition at line 61 of file G4RootAnalysisManager.hh.

Constructor & Destructor Documentation

G4RootAnalysisManager::G4RootAnalysisManager ( G4bool  isMaster = true)
explicit

Definition at line 80 of file G4RootAnalysisManager.cc.

81  : G4ToolsAnalysisManager("Root", isMaster),
82  fNofNtupleFiles(0),
83  fNtupleMergeMode(G4NtupleMergeMode::kNone),
84  fNtupleManager(nullptr),
85  fSlaveNtupleManager(nullptr),
86  fFileManager(nullptr)
87 {
88  if ( ( isMaster && fgMasterInstance ) || ( fgInstance ) ) {
89  G4ExceptionDescription description;
90  description
91  << " "
92  << "G4RootAnalysisManager already exists."
93  << "Cannot create another instance.";
94  G4Exception("G4RootAnalysisManager::G4RootAnalysisManager()",
95  "Analysis_F001", FatalException, description);
96  }
97  if ( isMaster ) fgMasterInstance = this;
98  fgInstance = this;
99 
100  // File manager
101  fFileManager = std::make_shared<G4RootFileManager>(fState);
102  SetFileManager(fFileManager);
103  fFileManager->SetBasketSize(fgkDefaultBasketSize);
104 
105  // Do not merge ntuples by default
106  // Merging may require user code migration as analysis manager
107  // must be created both on master and workers.
108  auto mergeNtuples = false;
109  SetNtupleMergingMode(mergeNtuples, fNofNtupleFiles);
110 
111  // Create ntuple managers
112  CreateNtupleManagers();
113 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
G4AnalysisManagerState fState
G4ToolsAnalysisManager(const G4String &type, G4bool isMaster=true)

Here is the call graph for this function:

Here is the caller graph for this function:

G4RootAnalysisManager::~G4RootAnalysisManager ( )
virtual

Definition at line 116 of file G4RootAnalysisManager.cc.

117 {
118  if ( fState.GetIsMaster() ) fgMasterInstance = nullptr;
119  fgInstance = nullptr;
120 }
G4AnalysisManagerState fState

Here is the call graph for this function:

Member Function Documentation

std::vector<tools::wroot::ntuple*>::const_iterator G4RootAnalysisManager::BeginConstNtuple ( ) const
std::vector<tools::wroot::ntuple*>::iterator G4RootAnalysisManager::BeginNtuple ( )
G4bool G4RootAnalysisManager::CloseFileImpl ( )
finalprotectedvirtual

Implements G4VAnalysisManager.

Definition at line 608 of file G4RootAnalysisManager.cc.

609 {
610  auto finalResult = true;
611 
612  G4bool isNtupleManagerEmpty = fNtupleManager->IsEmpty();
613  // the ntuple decription vector is cleared on Reset()
614  // in kNoMergeAfterOpen ntuple manager mode
615 
616  // reset data
617  auto result = Reset();
618  if ( ! result ) {
619  G4ExceptionDescription description;
620  description << " " << "Resetting data failed";
621  G4Exception("G4RootAnalysisManager::Write()",
622  "Analysis_W021", JustWarning, description);
623  }
624  finalResult = finalResult && result;
625 
626  if ( fNtupleMergeMode != G4NtupleMergeMode::kSlave ) {
627  // close file
628  fFileManager->CloseFile();
629  }
630 
631  // No files clean-up in sequential mode
632  if ( ! G4Threading::IsMultithreadedApplication() ) return finalResult;
633 
634  // Delete files if empty in MT mode
635  if ( ( fState.GetIsMaster() &&
637  fP1Manager->IsEmpty() && fP2Manager->IsEmpty() && isNtupleManagerEmpty ) ||
638  ( ( ! fState.GetIsMaster() ) && isNtupleManagerEmpty &&
639  fNtupleMergeMode == G4NtupleMergeMode::kNone ) ) {
640  result = ! std::remove(fFileManager->GetFullFileName());
641  // std::remove returns 0 when success
642  if ( ! result ) {
643  G4ExceptionDescription description;
644  description << " " << "Removing file "
645  << fFileManager->GetFullFileName() << " failed";
646  G4Exception("G4XmlAnalysisManager::CloseFile()",
647  "Analysis_W021", JustWarning, description);
648  }
649  finalResult = finalResult && result;
650 #ifdef G4VERBOSE
651  if ( fState.GetVerboseL1() )
653  ->Message("delete", "empty file", fFileManager->GetFullFileName());
654 #endif
655  }
656 
657  return finalResult;
658 }
G4double G4ParticleHPJENDLHEData::G4double result
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
bool G4bool
Definition: G4Types.hh:79
G4bool IsEmpty() const
G4bool IsMultithreadedApplication()
Definition: G4Threading.cc:152
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4AnalysisManagerState fState
G4bool IsEmpty() const
const G4AnalysisVerbose * GetVerboseL1() const

Here is the call graph for this function:

std::vector<tools::wroot::ntuple*>::const_iterator G4RootAnalysisManager::EndConstNtuple ( ) const
std::vector<tools::wroot::ntuple*>::iterator G4RootAnalysisManager::EndNtuple ( )
tools::wroot::ntuple* G4RootAnalysisManager::GetNtuple ( ) const
tools::wroot::ntuple* G4RootAnalysisManager::GetNtuple ( G4int  ntupleId) const
G4RootAnalysisManager * G4RootAnalysisManager::Instance ( void  )
static

Definition at line 63 of file G4RootAnalysisManager.cc.

64 {
65  if ( fgInstance == nullptr ) {
66  G4bool isMaster = ! G4Threading::IsWorkerThread();
67  fgInstance = new G4RootAnalysisManager(isMaster);
68  }
69 
70  return fgInstance;
71 }
bool G4bool
Definition: G4Types.hh:79
G4RootAnalysisManager(G4bool isMaster=true)
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4RootAnalysisManager::IsInstance ( )
static

Definition at line 74 of file G4RootAnalysisManager.cc.

75 {
76  return ( fgInstance != 0 );
77 }
virtual G4bool G4RootAnalysisManager::IsOpenFileImpl ( ) const
finalprotectedvirtual

Implements G4VAnalysisManager.

G4bool G4RootAnalysisManager::OpenFileImpl ( const G4String fileName)
finalprotectedvirtual

Implements G4VAnalysisManager.

Definition at line 494 of file G4RootAnalysisManager.cc.

495 {
496  auto finalResult = true;
497  auto result = fFileManager->SetFileName(fileName);
498  finalResult = finalResult && result;
499 
500  if ( fNtupleMergeMode == G4NtupleMergeMode::kNone ) {
501 
502 #ifdef G4VERBOSE
503  G4String name = fFileManager->GetFullFileName();
504  if ( fState.GetVerboseL4() )
505  fState.GetVerboseL4()->Message("open", "analysis file", name);
506 #endif
507 
508  result = fFileManager->OpenFile(fileName);
509  finalResult = finalResult && result;
510 
511  fNtupleManager->SetNtupleDirectory(fFileManager->GetNtupleDirectory());
512  fNtupleManager->CreateNtuplesFromBooking();
513 
514 #ifdef G4VERBOSE
515  if ( fState.GetVerboseL1() )
516  fState.GetVerboseL1()->Message("open", "analysis file", name, finalResult);
517 #endif
518 
519  }
520 
521  if ( fNtupleMergeMode == G4NtupleMergeMode::kMain ) {
522 
523 #ifdef G4VERBOSE
524  G4String name = fFileManager->GetFullFileName();
525  if ( fState.GetVerboseL4() )
526  fState.GetVerboseL4()->Message("open", "main analysis file", name);
527 #endif
528 
529  fFileManager->SetNofNtupleFiles(fNofNtupleFiles);
530  result = fFileManager->OpenFile(fileName);
531  finalResult = finalResult && result;
532 
533  fNtupleManager->CreateNtuplesFromBooking();
534 
535 #ifdef G4VERBOSE
536  if ( fState.GetVerboseL1() )
537  fState.GetVerboseL1()->Message("open", "main analysis file", name, finalResult);
538 #endif
539  }
540 
541  if ( fNtupleMergeMode == G4NtupleMergeMode::kSlave ) {
542  // No file is open by Slave manager
543  fSlaveNtupleManager->CreateNtuplesFromMain();
544  }
545 
546  return finalResult;
547 }
G4double G4ParticleHPJENDLHEData::G4double result
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
const XML_Char * name
Definition: expat.h:151
void CreateNtuplesFromBooking()
const G4AnalysisVerbose * GetVerboseL4() const
G4AnalysisManagerState fState
const G4AnalysisVerbose * GetVerboseL1() const

Here is the call graph for this function:

void G4RootAnalysisManager::SetNtupleMerging ( G4bool  mergeNtuples,
G4int  nofReducedNtupleFiles = 0,
unsigned int  basketSize = fgkDefaultBasketSize 
)

Definition at line 665 of file G4RootAnalysisManager.cc.

669 {
670  // Keep basketSize in file manager
671  fFileManager->SetBasketSize(basketSize);
672 
673  // Set ntuple merging mode
674  SetNtupleMergingMode(mergeNtuples, nofNtupleFiles);
675 
676  // Clear existing managers
677  ClearNtupleManagers();
678 
679  // Re-create managers
680  CreateNtupleManagers();
681 }
G4bool G4RootAnalysisManager::WriteImpl ( )
finalprotectedvirtual

Implements G4VAnalysisManager.

Definition at line 550 of file G4RootAnalysisManager.cc.

551 {
552 
553  auto finalResult = true;
554 
555  if ( ! fgMasterInstance &&
556  ( ( ! fH1Manager->IsEmpty() ) || ( ! fH2Manager->IsEmpty() ) ||
557  ( ! fH3Manager->IsEmpty() ) || ( ! fP1Manager->IsEmpty() ) ||
558  ( ! fP2Manager->IsEmpty() ) ) ) {
559  G4ExceptionDescription description;
560  description
561  << " " << "No master G4RootAnalysisManager instance exists."
562  << G4endl
563  << " " << "Histogram/profile data will not be merged.";
564  G4Exception("G4RootAnalysisManager::Write()",
565  "Analysis_W031", JustWarning, description);
566  }
567 
568  // H1
569  auto result = WriteH1();
570  finalResult = finalResult && result;
571 
572  // H2
573  result = WriteH2();
574  finalResult = finalResult && result;
575 
576  // H3
577  result = WriteH3();
578  finalResult = finalResult && result;
579 
580  // P1
581  result = WriteP1();
582  finalResult = finalResult && result;
583 
584  // P2
585  result = WriteP2();
586  finalResult = finalResult && result;
587 
588  // Ntuples
589  result = WriteNtuple();
590  finalResult = finalResult && result;
591 
592  // File
593  if ( fNtupleMergeMode != G4NtupleMergeMode::kSlave ) {
594  result = fFileManager->WriteFile();
595  finalResult = finalResult && result;
596  }
597 
598  // Write ASCII if activated
599  if ( IsAscii() ) {
600  result = WriteAscii(fFileManager->GetFileName());
601  finalResult = finalResult && result;
602  }
603 
604  return finalResult;
605 }
G4double G4ParticleHPJENDLHEData::G4double result
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4bool IsAscii() const
G4bool IsEmpty() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
G4bool WriteAscii(const G4String &fileName)

Here is the call graph for this function:


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