Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes
G4H3ToolsManager Class Reference

#include <G4H3ToolsManager.hh>

Inheritance diagram for G4H3ToolsManager:
G4VH3Manager G4THnManager< tools::histo::h3d >

Public Member Functions

G4int AddH3 (const G4String &name, tools::histo::h3d *h3d)
 
void AddH3Vector (const std::vector< tools::histo::h3d * > &h3Vector)
 
void AddTVector (const std::vector< tools::histo::h3d * > &tVector)
 
std::vector< tools::histo::h3d * >::const_iterator BeginConstH3 () const
 
std::vector< tools::histo::h3d * >::iterator BeginH3 ()
 
void ClearData ()
 
std::vector< tools::histo::h3d * >::const_iterator EndConstH3 () const
 
std::vector< tools::histo::h3d * >::iterator EndH3 ()
 
 G4H3ToolsManager (const G4AnalysisManagerState &state)
 
tools::histo::h3d * GetH3 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
 
const std::vector< tools::histo::h3d * > & GetH3Vector () const
 
const std::vector< G4HnInformation * > & GetHnVector () const
 
tools::histo::h3d * GetT (G4int id) const
 
G4bool IsEmpty () const
 
void Merge (G4Mutex &mergeMutex, G4THnManager< tools::histo::h3d > *masterInstance)
 
G4int RegisterT (tools::histo::h3d *t, const G4String &name)
 
G4bool Reset ()
 
virtual ~G4H3ToolsManager ()=default
 

Protected Member Functions

std::vector< tools::histo::h3d * >::const_iterator BeginConstT () const
 
std::vector< tools::histo::h3d * >::iterator BeginT ()
 
virtual 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") final
 
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear", const G4String &zbinScheme="linear") final
 
std::vector< tools::histo::h3d * >::const_iterator EndConstT () const
 
std::vector< tools::histo::h3d * >::iterator EndT ()
 
virtual G4bool FillH3 (G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0) final
 
virtual G4int GetH3Id (const G4String &name, G4bool warn=true) const final
 
virtual G4int GetH3Nxbins (G4int id) const final
 
virtual G4int GetH3Nybins (G4int id) const final
 
virtual G4int GetH3Nzbins (G4int id) const final
 
virtual G4String GetH3Title (G4int id) const final
 
virtual G4String GetH3XAxisTitle (G4int id) const final
 
virtual G4double GetH3Xmax (G4int id) const final
 
virtual G4double GetH3Xmin (G4int id) const final
 
virtual G4double GetH3XWidth (G4int id) const final
 
virtual G4String GetH3YAxisTitle (G4int id) const final
 
virtual G4double GetH3Ymax (G4int id) const final
 
virtual G4double GetH3Ymin (G4int id) const final
 
virtual G4double GetH3YWidth (G4int id) const final
 
virtual G4String GetH3ZAxisTitle (G4int id) const final
 
virtual G4double GetH3Zmax (G4int id) const final
 
virtual G4double GetH3Zmin (G4int id) const final
 
virtual G4double GetH3ZWidth (G4int id) const final
 
virtual std::shared_ptr< G4HnManagerGetHnManager () final
 
G4int GetTId (const G4String &name, G4bool warn=true) const
 
tools::histo::h3d * GetTInFunction (G4int id, std::string_view functionName, G4bool warn=true, G4bool onlyIfActive=true) const
 
G4bool IsVerbose (G4int verboseLevel) const
 
void Message (G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
 
virtual G4bool ScaleH3 (G4int id, G4double factor) final
 
virtual 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") final
 
virtual G4bool SetH3 (G4int id, 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 &xbinScheme="linear", const G4String &ybinScheme="linear", const G4String &zbinScheme="linear") final
 
virtual G4bool SetH3Title (G4int id, const G4String &title) final
 
virtual G4bool SetH3XAxisTitle (G4int id, const G4String &title) final
 
virtual G4bool SetH3YAxisTitle (G4int id, const G4String &title) final
 
virtual G4bool SetH3ZAxisTitle (G4int id, const G4String &title) final
 
virtual G4bool WriteOnAscii (std::ofstream &output) final
 

Protected Attributes

std::shared_ptr< G4HnManagerfHnManager
 
std::map< G4String, G4intfNameIdMap
 
const G4AnalysisManagerStatefState
 
std::vector< tools::histo::h3d * > fTVector
 

Private Member Functions

void AddH3Information (const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName, G4BinScheme xbinScheme, G4BinScheme ybinScheme, G4BinScheme zbinScheme) const
 

Static Private Attributes

static constexpr std::string_view fkClass { "G4H3ToolsManager" }
 
static constexpr G4int fkDimension = 3
 

Detailed Description

Definition at line 53 of file G4H3ToolsManager.hh.

Constructor & Destructor Documentation

◆ G4H3ToolsManager()

G4H3ToolsManager::G4H3ToolsManager ( const G4AnalysisManagerState state)
explicit

Definition at line 42 of file G4H3ToolsManager.cc.

◆ ~G4H3ToolsManager()

virtual G4H3ToolsManager::~G4H3ToolsManager ( )
virtualdefault

Member Function Documentation

◆ AddH3()

G4int G4H3ToolsManager::AddH3 ( const G4String name,
tools::histo::h3d *  h3d 
)

Definition at line 724 of file G4H3ToolsManager.cc.

725{
726 Message(kVL4, "add", "H3", name);
727
728 // Add annotation
729 AddH3Annotation(h3d, "none", "none", "none", "none", "none", "none");
730 // Add information
731 AddH3Information(name, "none", "none", "none", "none", "none", "none",
733
734 // Register histogram
735 G4int id = RegisterT(h3d, name);
736
737 Message(kVL2, "add", "H3", name);
738
739 return id;
740}
int G4int
Definition: G4Types.hh:85
void AddH3Information(const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName, G4BinScheme xbinScheme, G4BinScheme ybinScheme, G4BinScheme zbinScheme) const
G4int RegisterT(tools::histo::h3d *t, const G4String &name)
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
constexpr G4int kVL2
constexpr G4int kVL4
const char * name(G4int ptype)
void AddH3Annotation(tools::histo::h3d *h3d, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName)

References anonymous_namespace{G4H3ToolsManager.cc}::AddH3Annotation(), AddH3Information(), kLinear, G4Analysis::kVL2, G4Analysis::kVL4, G4THnManager< tools::histo::h3d >::Message(), G4InuclParticleNames::name(), and G4THnManager< tools::histo::h3d >::RegisterT().

◆ AddH3Information()

void G4H3ToolsManager::AddH3Information ( const G4String name,
const G4String xunitName,
const G4String yunitName,
const G4String zunitName,
const G4String xfcnName,
const G4String yfcnName,
const G4String zfcnName,
G4BinScheme  xbinScheme,
G4BinScheme  ybinScheme,
G4BinScheme  zbinScheme 
) const
private

Definition at line 265 of file G4H3ToolsManager.cc.

275{
276 auto hnInformation = fHnManager->AddHnInformation(name, fkDimension);
277 hnInformation->AddDimension(xunitName, xfcnName, xbinScheme);
278 hnInformation->AddDimension(yunitName, yfcnName, ybinScheme);
279 hnInformation->AddDimension(zunitName, zfcnName, zbinScheme);
280}
static constexpr G4int fkDimension
std::shared_ptr< G4HnManager > fHnManager

References G4THnManager< tools::histo::h3d >::fHnManager, fkDimension, and G4InuclParticleNames::name().

Referenced by AddH3(), and CreateH3().

◆ AddH3Vector()

void G4H3ToolsManager::AddH3Vector ( const std::vector< tools::histo::h3d * > &  h3Vector)

Definition at line 743 of file G4H3ToolsManager.cc.

745{
746 AddTVector(h3Vector);
747}
void AddTVector(const std::vector< tools::histo::h3d * > &tVector)

References G4THnManager< tools::histo::h3d >::AddTVector().

◆ AddTVector()

void G4THnManager< tools::histo::h3d >::AddTVector ( const std::vector< tools::histo::h3d * > &  tVector)
inherited

◆ BeginConstH3()

std::vector< tools::histo::h3d * >::const_iterator G4H3ToolsManager::BeginConstH3 ( ) const
inline

Definition at line 207 of file G4H3ToolsManager.hh.

208{ return BeginConstT(); }
std::vector< tools::histo::h3d * >::const_iterator BeginConstT() const

References G4THnManager< tools::histo::h3d >::BeginConstT().

◆ BeginConstT()

std::vector< tools::histo::h3d * >::const_iterator G4THnManager< tools::histo::h3d >::BeginConstT ( ) const
protectedinherited

◆ BeginH3()

std::vector< tools::histo::h3d * >::iterator G4H3ToolsManager::BeginH3 ( )
inline

Definition at line 200 of file G4H3ToolsManager.hh.

201{ return BeginT(); }
std::vector< tools::histo::h3d * >::iterator BeginT()

References G4THnManager< tools::histo::h3d >::BeginT().

◆ BeginT()

std::vector< tools::histo::h3d * >::iterator G4THnManager< tools::histo::h3d >::BeginT ( )
protectedinherited

◆ ClearData()

void G4THnManager< tools::histo::h3d >::ClearData ( )
inherited

◆ CreateH3() [1/2]

G4int G4H3ToolsManager::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" 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 330 of file G4H3ToolsManager.cc.

339{
340 Message(kVL4, "create", "H3", name);
341
342 tools::histo::h3d* h3d
343 = CreateToolsH3(title, xedges, yedges, zedges,
344 xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName);
345
346 // Add annotation
347 AddH3Annotation(h3d, xunitName, yunitName, zunitName,
348 xfcnName, yfcnName, zfcnName);
349
350 // Save H3 information
352 name, xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName,
354
355 // Register histogram
356 G4int id = RegisterT(h3d, name);
357
358 Message(kVL2, "create", "H3", name);
359
360 return id;
361}
tools::histo::h3d * CreateToolsH3(const G4String &title, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, const std::vector< G4double > &zedges, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName)

References anonymous_namespace{G4H3ToolsManager.cc}::AddH3Annotation(), AddH3Information(), anonymous_namespace{G4H3ToolsManager.cc}::CreateToolsH3(), kUser, G4Analysis::kVL2, G4Analysis::kVL4, G4THnManager< tools::histo::h3d >::Message(), G4InuclParticleNames::name(), and G4THnManager< tools::histo::h3d >::RegisterT().

◆ CreateH3() [2/2]

G4int G4H3ToolsManager::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 xbinScheme = "linear",
const G4String ybinScheme = "linear",
const G4String zbinScheme = "linear" 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 287 of file G4H3ToolsManager.cc.

299{
300 Message(kVL4, "create", "H3", name);
301
302 tools::histo::h3d* h3d
303 = CreateToolsH3(title,
304 nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax,
305 xunitName, yunitName, zunitName,
306 xfcnName, yfcnName, zfcnName,
307 xbinSchemeName, ybinSchemeName, zbinSchemeName, fkClass);
308
309 // Add annotation
310 AddH3Annotation(h3d, xunitName, yunitName, zunitName,
311 xfcnName, yfcnName, zfcnName);
312
313 // Save H3 information
314 auto xbinScheme = GetBinScheme(xbinSchemeName);
315 auto ybinScheme = GetBinScheme(ybinSchemeName);
316 auto zbinScheme = GetBinScheme(zbinSchemeName);
318 name, xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName,
319 xbinScheme, ybinScheme, zbinScheme);
320
321 // Register histogram
322 G4int id = RegisterT(h3d, name);
323
324 Message(kVL2, "create", "H3", name);
325
326 return id;
327}
static constexpr std::string_view fkClass
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:36

References anonymous_namespace{G4H3ToolsManager.cc}::AddH3Annotation(), AddH3Information(), anonymous_namespace{G4H3ToolsManager.cc}::CreateToolsH3(), fkClass, G4Analysis::GetBinScheme(), G4Analysis::kVL2, G4Analysis::kVL4, G4THnManager< tools::histo::h3d >::Message(), G4InuclParticleNames::name(), and G4THnManager< tools::histo::h3d >::RegisterT().

◆ EndConstH3()

std::vector< tools::histo::h3d * >::const_iterator G4H3ToolsManager::EndConstH3 ( ) const
inline

Definition at line 211 of file G4H3ToolsManager.hh.

212{ return EndConstT(); }
std::vector< tools::histo::h3d * >::const_iterator EndConstT() const

References G4THnManager< tools::histo::h3d >::EndConstT().

◆ EndConstT()

std::vector< tools::histo::h3d * >::const_iterator G4THnManager< tools::histo::h3d >::EndConstT ( ) const
protectedinherited

◆ EndH3()

std::vector< tools::histo::h3d * >::iterator G4H3ToolsManager::EndH3 ( )
inline

Definition at line 203 of file G4H3ToolsManager.hh.

204{ return EndT(); }
std::vector< tools::histo::h3d * >::iterator EndT()

References G4THnManager< tools::histo::h3d >::EndT().

◆ EndT()

std::vector< tools::histo::h3d * >::iterator G4THnManager< tools::histo::h3d >::EndT ( )
protectedinherited

◆ FillH3()

G4bool G4H3ToolsManager::FillH3 ( G4int  id,
G4double  xvalue,
G4double  yvalue,
G4double  zvalue,
G4double  weight = 1.0 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 453 of file G4H3ToolsManager.cc.

456{
457 auto h3d = GetTInFunction(id, "FillH3", true, false);
458 if ( ! h3d ) return false;
459
460 if ( fState.GetIsActivation() && ( ! fHnManager->GetActivation(id) ) ) {
461 return false;
462 }
463
465 = fHnManager->GetHnDimensionInformation(id, kX, "FillH3");
467 = fHnManager->GetHnDimensionInformation(id, kY, "FillH3");
469 = fHnManager->GetHnDimensionInformation(id, kZ, "FillH3");
470
471 h3d->fill(xInfo->fFcn(xvalue/xInfo->fUnit),
472 yInfo->fFcn(yvalue/yInfo->fUnit),
473 zInfo->fFcn(zvalue/zInfo->fUnit), weight);
474
475 if ( IsVerbose(kVL4) ) {
476 Message(kVL4, "fill", "H3",
477 " id " + to_string(id) +
478 " xvalue " + to_string(xvalue) +
479 " xfcn(xvalue/xunit) " + to_string(xInfo->fFcn(xvalue/xInfo->fUnit)) +
480 " yvalue " + to_string(yvalue) +
481 " yfcn(yvalue/yunit) " + to_string(yInfo->fFcn(yvalue/yInfo->fUnit)) +
482 " zvalue " + to_string(zvalue) +
483 " zfcn(zvalue/zunit) " + to_string(zInfo->fFcn(zvalue/zInfo->fUnit)) +
484 " weight " + to_string(weight));
485 }
486
487 return true;
488}
tools::histo::h3d * GetTInFunction(G4int id, std::string_view functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4AnalysisManagerState & fState
G4bool IsVerbose(G4int verboseLevel) const
constexpr G4int kX
constexpr G4int kZ
constexpr G4int kY

References G4HnDimensionInformation::fFcn, G4THnManager< tools::histo::h3d >::fHnManager, G4THnManager< tools::histo::h3d >::fState, G4HnDimensionInformation::fUnit, G4AnalysisManagerState::GetIsActivation(), G4THnManager< tools::histo::h3d >::GetTInFunction(), G4THnManager< tools::histo::h3d >::IsVerbose(), G4Analysis::kVL4, G4Analysis::kX, G4Analysis::kY, G4Analysis::kZ, and G4THnManager< tools::histo::h3d >::Message().

◆ GetH3()

tools::histo::h3d * G4H3ToolsManager::GetH3 ( G4int  id,
G4bool  warn = true,
G4bool  onlyIfActive = true 
) const

Definition at line 750 of file G4H3ToolsManager.cc.

752{
753 return GetTInFunction(id, "GetH3", warn, onlyIfActive);
754}

References G4THnManager< tools::histo::h3d >::GetTInFunction().

◆ GetH3Id()

G4int G4H3ToolsManager::GetH3Id ( const G4String name,
G4bool  warn = true 
) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 491 of file G4H3ToolsManager.cc.

492{
493 return GetTId(name, warn);
494}
G4int GetTId(const G4String &name, G4bool warn=true) const

References G4THnManager< tools::histo::h3d >::GetTId(), and G4InuclParticleNames::name().

◆ GetH3Nxbins()

G4int G4H3ToolsManager::GetH3Nxbins ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 497 of file G4H3ToolsManager.cc.

498{
499 auto h3d = GetTInFunction(id, "GetH3NXbins");
500 if ( ! h3d ) return 0;
501
502 return GetNbins(*h3d, kX);
503}
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)

References G4Analysis::GetNbins(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kX.

◆ GetH3Nybins()

G4int G4H3ToolsManager::GetH3Nybins ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 535 of file G4H3ToolsManager.cc.

536{
537 auto h3d = GetTInFunction(id, "GetH3NYbins");
538 if ( ! h3d ) return 0;
539
540 return GetNbins(*h3d, kY);
541}

References G4Analysis::GetNbins(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kY.

◆ GetH3Nzbins()

G4int G4H3ToolsManager::GetH3Nzbins ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 573 of file G4H3ToolsManager.cc.

574{
575 auto h3d = GetTInFunction(id, "GetH3NZbins");
576 if ( ! h3d ) return 0;
577
578 return GetNbins(*h3d, kZ);
579}

References G4Analysis::GetNbins(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kZ.

◆ GetH3Title()

G4String G4H3ToolsManager::GetH3Title ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 647 of file G4H3ToolsManager.cc.

648{
649 auto h3d = GetTInFunction(id, "GetH3Title");
650 if ( ! h3d ) return "";
651
652 return GetTitle(*h3d);
653}
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)

References G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::GetTitle().

◆ GetH3Vector()

const std::vector< tools::histo::h3d * > & G4H3ToolsManager::GetH3Vector ( ) const
inline

Definition at line 214 of file G4H3ToolsManager.hh.

215{ return fTVector; }
std::vector< tools::histo::h3d * > fTVector

References G4THnManager< tools::histo::h3d >::fTVector.

Referenced by G4ToolsAnalysisManager::MergeImpl(), and G4ToolsAnalysisManager::WriteImpl().

◆ GetH3XAxisTitle()

G4String G4H3ToolsManager::GetH3XAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 656 of file G4H3ToolsManager.cc.

657{
658 auto h3d = GetTInFunction(id, "GetH3XAxisTitle");
659 if ( ! h3d ) return "";
660
661 return GetAxisTitle(*h3d, kX, fHnManager->GetHnType());
662}
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)

References G4THnManager< tools::histo::h3d >::fHnManager, G4Analysis::GetAxisTitle(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kX.

◆ GetH3Xmax()

G4double G4H3ToolsManager::GetH3Xmax ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 517 of file G4H3ToolsManager.cc.

518{
519 auto h3d = GetTInFunction(id, "GetH3Xmax");
520 if ( ! h3d ) return 0.;
521
522 return GetMax(*h3d, kX);
523}
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)

References G4Analysis::GetMax(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kX.

◆ GetH3Xmin()

G4double G4H3ToolsManager::GetH3Xmin ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 506 of file G4H3ToolsManager.cc.

507{
508// Returns xmin value with applied unit and histogram function
509
510 auto h3d = GetTInFunction(id, "GetH3Xmin");
511 if ( ! h3d ) return 0.;
512
513 return GetMin(*h3d, kX);
514}
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)

References G4Analysis::GetMin(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kX.

◆ GetH3XWidth()

G4double G4H3ToolsManager::GetH3XWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 526 of file G4H3ToolsManager.cc.

527{
528 auto h3d = GetTInFunction(id, "GetH3XWidth", true, false);
529 if ( ! h3d ) return 0.;
530
531 return GetWidth(*h3d, kX, fHnManager->GetHnType());
532}
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)

References G4THnManager< tools::histo::h3d >::fHnManager, G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::GetWidth(), and G4Analysis::kX.

◆ GetH3YAxisTitle()

G4String G4H3ToolsManager::GetH3YAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 665 of file G4H3ToolsManager.cc.

666{
667 auto h3d = GetTInFunction(id, "GetH3YAxisTitle");
668 if ( ! h3d ) return "";
669
670 return GetAxisTitle(*h3d, kY, fHnManager->GetHnType());
671}

References G4THnManager< tools::histo::h3d >::fHnManager, G4Analysis::GetAxisTitle(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kY.

◆ GetH3Ymax()

G4double G4H3ToolsManager::GetH3Ymax ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 555 of file G4H3ToolsManager.cc.

556{
557 auto h3d = GetTInFunction(id, "GetH3Ymax");
558 if ( ! h3d ) return 0.;
559
560 return GetMax(*h3d, kY);
561}

References G4Analysis::GetMax(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kY.

◆ GetH3Ymin()

G4double G4H3ToolsManager::GetH3Ymin ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 544 of file G4H3ToolsManager.cc.

545{
546// Returns xmin value with applied unit and histogram function
547
548 auto h3d = GetTInFunction(id, "GetH3Ymin");
549 if ( ! h3d ) return 0.;
550
551 return GetMin(*h3d, kY);
552}

References G4Analysis::GetMin(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kY.

◆ GetH3YWidth()

G4double G4H3ToolsManager::GetH3YWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 564 of file G4H3ToolsManager.cc.

565{
566 auto h3d = GetTInFunction(id, "GetH3YWidth", true, false);
567 if ( ! h3d ) return 0.;
568
569 return GetWidth(*h3d, kY, fHnManager->GetHnType());
570}

References G4THnManager< tools::histo::h3d >::fHnManager, G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::GetWidth(), and G4Analysis::kY.

◆ GetH3ZAxisTitle()

G4String G4H3ToolsManager::GetH3ZAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 674 of file G4H3ToolsManager.cc.

675{
676 auto h3d = GetTInFunction(id, "GetH3ZAxisTitle");
677 if ( ! h3d ) return "";
678
679 return GetAxisTitle(*h3d, kZ, fHnManager->GetHnType());
680}

References G4THnManager< tools::histo::h3d >::fHnManager, G4Analysis::GetAxisTitle(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kZ.

◆ GetH3Zmax()

G4double G4H3ToolsManager::GetH3Zmax ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 593 of file G4H3ToolsManager.cc.

594{
595 auto h3d = GetTInFunction(id, "GetH3Zmax");
596 if ( ! h3d ) return 0.;
597
598 return GetMax(*h3d, kZ);
599}

References G4Analysis::GetMax(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kZ.

◆ GetH3Zmin()

G4double G4H3ToolsManager::GetH3Zmin ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 582 of file G4H3ToolsManager.cc.

583{
584// Returns xmin value with applied unit and histogram function
585
586 auto h3d = GetTInFunction(id, "GetH3Zmin");
587 if ( ! h3d ) return 0.;
588
589 return GetMin(*h3d, kZ);
590}

References G4Analysis::GetMin(), G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::kZ.

◆ GetH3ZWidth()

G4double G4H3ToolsManager::GetH3ZWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 602 of file G4H3ToolsManager.cc.

603{
604 auto h3d = GetTInFunction(id, "GetH3ZWidth", true, false);
605 if ( ! h3d ) return 0.;
606
607 return GetWidth(*h3d, kZ, fHnManager->GetHnType());
608}

References G4THnManager< tools::histo::h3d >::fHnManager, G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::GetWidth(), and G4Analysis::kZ.

◆ GetHnManager()

std::shared_ptr< G4HnManager > G4H3ToolsManager::GetHnManager ( )
inlinefinalprotectedvirtual

Implements G4VH3Manager.

Definition at line 220 of file G4H3ToolsManager.hh.

221{ return std::shared_ptr<G4HnManager>(fHnManager); }

References G4THnManager< tools::histo::h3d >::fHnManager.

◆ GetHnVector()

const std::vector< G4HnInformation * > & G4H3ToolsManager::GetHnVector ( ) const
inline

◆ GetT()

tools::histo::h3d * G4THnManager< tools::histo::h3d >::GetT ( G4int  id) const
inherited

◆ GetTId()

G4int G4THnManager< tools::histo::h3d >::GetTId ( const G4String name,
G4bool  warn = true 
) const
protectedinherited

◆ GetTInFunction()

tools::histo::h3d * G4THnManager< tools::histo::h3d >::GetTInFunction ( G4int  id,
std::string_view  functionName,
G4bool  warn = true,
G4bool  onlyIfActive = true 
) const
protectedinherited

◆ IsEmpty()

G4bool G4THnManager< tools::histo::h3d >::IsEmpty ( ) const
inherited

◆ IsVerbose()

G4bool G4THnManager< tools::histo::h3d >::IsVerbose ( G4int  verboseLevel) const
protectedinherited

◆ Merge()

void G4THnManager< tools::histo::h3d >::Merge ( G4Mutex mergeMutex,
G4THnManager< tools::histo::h3d > *  masterInstance 
)
inherited

◆ Message()

void G4THnManager< tools::histo::h3d >::Message ( G4int  level,
const G4String action,
const G4String objectType,
const G4String objectName = "",
G4bool  success = true 
) const
protectedinherited

◆ RegisterT()

G4int G4THnManager< tools::histo::h3d >::RegisterT ( tools::histo::h3d *  t,
const G4String name 
)
inherited

◆ Reset()

G4bool G4THnManager< tools::histo::h3d >::Reset ( )
inherited

◆ ScaleH3()

G4bool G4H3ToolsManager::ScaleH3 ( G4int  id,
G4double  factor 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 444 of file G4H3ToolsManager.cc.

445{
446 auto h3d = GetTInFunction(id, "ScaleH3", false, false);
447 if ( ! h3d ) return false;
448
449 return h3d->scale(factor);
450}

References G4THnManager< tools::histo::h3d >::GetTInFunction().

◆ SetH3() [1/2]

G4bool G4H3ToolsManager::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" 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 408 of file G4H3ToolsManager.cc.

416{
417 auto h3d = GetTInFunction(id, "SetH3", false, false);
418 if ( ! h3d ) return false;
419
420 auto info = fHnManager->GetHnInformation(id, "SetH3");
421
422 Message(kVL4, "configure", "H3", info->GetName());
423
424 // Configure tools h3
425 ConfigureToolsH3(h3d, xedges, yedges, zedges,
426 xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName);
427
428 // Add annotation
429 AddH3Annotation(h3d, xunitName, yunitName, zunitName,
430 xfcnName, yfcnName, zfcnName);
431
432 // Update information
434 info, xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName,
436
437 // Set activation
438 fHnManager->SetActivation(id, true);
439
440 return true;
441}
void ConfigureToolsH3(tools::histo::h3d *h3d, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, const std::vector< G4double > &zedges, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName)
void UpdateH3Information(G4HnInformation *hnInformation, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName, G4BinScheme xbinScheme, G4BinScheme ybinScheme, G4BinScheme zbinScheme)

References anonymous_namespace{G4H3ToolsManager.cc}::AddH3Annotation(), anonymous_namespace{G4H3ToolsManager.cc}::ConfigureToolsH3(), G4THnManager< tools::histo::h3d >::fHnManager, G4THnManager< tools::histo::h3d >::GetTInFunction(), kUser, G4Analysis::kVL4, G4THnManager< tools::histo::h3d >::Message(), and anonymous_namespace{G4H3ToolsManager.cc}::UpdateH3Information().

◆ SetH3() [2/2]

G4bool G4H3ToolsManager::SetH3 ( G4int  id,
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 xbinScheme = "linear",
const G4String ybinScheme = "linear",
const G4String zbinScheme = "linear" 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 364 of file G4H3ToolsManager.cc.

375{
376 auto h3d = GetTInFunction(id, "SetH3", false, false);
377 if ( ! h3d ) return false;
378
379 auto info = fHnManager->GetHnInformation(id, "SetH3");
380
381 Message(kVL4, "configure", "H3", info->GetName());
382
383 // Configure tools h3
385 h3d, nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax,
386 xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName,
387 xbinSchemeName, ybinSchemeName, zbinSchemeName, fkClass);
388
389 // Add annotation
390 AddH3Annotation(h3d, xunitName, yunitName, zunitName,
391 xfcnName, yfcnName, zfcnName);
392
393 // Update information
394 auto xbinScheme = GetBinScheme(xbinSchemeName);
395 auto ybinScheme = GetBinScheme(ybinSchemeName);
396 auto zbinScheme = GetBinScheme(zbinSchemeName);
398 info, xunitName, yunitName, zunitName, xfcnName, yfcnName, zfcnName,
399 xbinScheme, ybinScheme, zbinScheme);
400
401 // Set activation
402 fHnManager->SetActivation(id, true);
403
404 return true;
405}

References anonymous_namespace{G4H3ToolsManager.cc}::AddH3Annotation(), anonymous_namespace{G4H3ToolsManager.cc}::ConfigureToolsH3(), G4THnManager< tools::histo::h3d >::fHnManager, fkClass, G4Analysis::GetBinScheme(), G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::kVL4, G4THnManager< tools::histo::h3d >::Message(), and anonymous_namespace{G4H3ToolsManager.cc}::UpdateH3Information().

◆ SetH3Title()

G4bool G4H3ToolsManager::SetH3Title ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 611 of file G4H3ToolsManager.cc.

612{
613 auto h3d = GetTInFunction(id, "SetH3Title");
614 if ( ! h3d ) return false;
615
616 return SetTitle(*h3d, title);
617}
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)

References G4THnManager< tools::histo::h3d >::GetTInFunction(), and G4Analysis::SetTitle().

◆ SetH3XAxisTitle()

G4bool G4H3ToolsManager::SetH3XAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 620 of file G4H3ToolsManager.cc.

621{
622 auto h3d = GetTInFunction(id, "SetH3XAxisTitle");
623 if ( ! h3d ) return false;
624
625 return SetAxisTitle(*h3d, kX, title);
626}
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)

References G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::kX, and G4Analysis::SetAxisTitle().

◆ SetH3YAxisTitle()

G4bool G4H3ToolsManager::SetH3YAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 629 of file G4H3ToolsManager.cc.

630{
631 auto h3d = GetTInFunction(id, "SetH3YAxisTitle");
632 if ( ! h3d ) return false;
633
634 return SetAxisTitle(*h3d, kY, title);
635}

References G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::kY, and G4Analysis::SetAxisTitle().

◆ SetH3ZAxisTitle()

G4bool G4H3ToolsManager::SetH3ZAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 638 of file G4H3ToolsManager.cc.

639{
640 auto h3d = GetTInFunction(id, "SetH3ZAxisTitle");
641 if ( ! h3d ) return false;
642
643 return SetAxisTitle(*h3d, kZ, title);
644}

References G4THnManager< tools::histo::h3d >::GetTInFunction(), G4Analysis::kZ, and G4Analysis::SetAxisTitle().

◆ WriteOnAscii()

G4bool G4H3ToolsManager::WriteOnAscii ( std::ofstream &  output)
finalprotectedvirtual

Implements G4VH3Manager.

Definition at line 683 of file G4H3ToolsManager.cc.

684{
685// Write selected objects on ASCII file
686
687 // Do nothing if no histograms are selected
688 if ( ! fHnManager->IsAscii() ) return true;
689
690 // Write h3 histograms
691 for ( G4int i=0; i<G4int(fTVector.size()); ++i ) {
692 auto id = i + fHnManager->GetFirstId();
693 auto info = fHnManager->GetHnInformation(id,"WriteOnAscii");
694 // skip writing if activation is enabled and H1 is inactivated
695 if ( ! info->GetAscii() ) continue;
696 auto h3 = fTVector[i];
697
698 Message(kVL3, "write on ascii", "h3d", info->GetName());
699
700 output << "\n 3D histogram " << id << ": " << h3->title()
701 << "\n \n \t \t \t X \t\t Y \t\t Z \t\t Bin Height" << G4endl;
702
703 for (G4int j=0; j< G4int(h3->axis_x().bins()); ++j) {
704 for (G4int k=0; k< G4int(h3->axis_y().bins()); ++k) {
705 for (G4int l=0; l< G4int(h3->axis_y().bins()); ++l) {
706 output << " " << j << "\t" << k << "\t" << l << "\t"
707 << h3->axis_x().bin_center(j) << "\t"
708 << h3->axis_y().bin_center(k) << "\t"
709 << h3->axis_y().bin_center(l) << "\t"
710 << h3->bin_height(j, k, l) << G4endl;
711 }
712 }
713 }
714 }
715
716 return output.good();
717}
#define G4endl
Definition: G4ios.hh:57
constexpr G4int kVL3

References G4THnManager< tools::histo::h3d >::fHnManager, G4THnManager< tools::histo::h3d >::fTVector, G4endl, G4Analysis::kVL3, and G4THnManager< tools::histo::h3d >::Message().

Field Documentation

◆ fHnManager

std::shared_ptr<G4HnManager> G4THnManager< tools::histo::h3d >::fHnManager
protectedinherited

Definition at line 105 of file G4THnManager.hh.

◆ fkClass

constexpr std::string_view G4H3ToolsManager::fkClass { "G4H3ToolsManager" }
staticconstexprprivate

Definition at line 195 of file G4H3ToolsManager.hh.

Referenced by CreateH3(), and SetH3().

◆ fkDimension

constexpr G4int G4H3ToolsManager::fkDimension = 3
staticconstexprprivate

Definition at line 196 of file G4H3ToolsManager.hh.

Referenced by AddH3Information().

◆ fNameIdMap

std::map<G4String, G4int> G4THnManager< tools::histo::h3d >::fNameIdMap
protectedinherited

Definition at line 104 of file G4THnManager.hh.

◆ fState

const G4AnalysisManagerState& G4THnManager< tools::histo::h3d >::fState
protectedinherited

Definition at line 102 of file G4THnManager.hh.

◆ fTVector

std::vector<tools::histo::h3d *> G4THnManager< tools::histo::h3d >::fTVector
protectedinherited

Definition at line 103 of file G4THnManager.hh.


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