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

#include <G4H2ToolsManager.hh>

+ Inheritance diagram for G4H2ToolsManager:

Public Member Functions

 G4H2ToolsManager (const G4AnalysisManagerState &state)
 
virtual ~G4H2ToolsManager ()
 
G4int AddH2 (const G4String &name, tools::histo::h2d *h2d)
 
void AddH2Vector (const std::vector< tools::histo::h2d * > &h2Vector)
 
tools::histo::h2d * GetH2 (G4int id, G4bool warn=true, G4bool onlyIfActive=true) 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
 
const std::vector< tools::histo::h2d * > & GetH2Vector () const
 
const std::vector< G4HnInformation * > & GetHnVector () const
 
- Public Member Functions inherited from G4VH2Manager
 G4VH2Manager ()
 
virtual ~G4VH2Manager ()
 
 G4VH2Manager (const G4VH2Manager &rhs)=delete
 
G4VH2Manageroperator= (const G4VH2Manager &rhs)=delete
 
- Public Member Functions inherited from G4THnManager< tools::histo::h2d >
 G4THnManager (const G4AnalysisManagerState &state, const G4String &hnType)
 
virtual ~G4THnManager ()
 
G4bool Reset ()
 
G4bool IsEmpty () const
 
void AddTVector (const std::vector< tools::histo::h2d * > &tVector)
 
void Merge (G4Mutex &mergeMutex, G4THnManager< tools::histo::h2d > *masterInstance)
 

Protected Member Functions

virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear") final
 
virtual 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") final
 
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear") final
 
virtual 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") final
 
virtual G4bool ScaleH2 (G4int id, G4double factor) final
 
virtual G4bool FillH2 (G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0) final
 
virtual G4int GetH2Id (const G4String &name, G4bool warn=true) const final
 
virtual G4int GetH2Nxbins (G4int id) const final
 
virtual G4double GetH2Xmin (G4int id) const final
 
virtual G4double GetH2Xmax (G4int id) const final
 
virtual G4double GetH2XWidth (G4int id) const final
 
virtual G4int GetH2Nybins (G4int id) const final
 
virtual G4double GetH2Ymin (G4int id) const final
 
virtual G4double GetH2Ymax (G4int id) const final
 
virtual G4double GetH2YWidth (G4int id) const final
 
virtual G4bool SetH2Title (G4int id, const G4String &title) final
 
virtual G4bool SetH2XAxisTitle (G4int id, const G4String &title) final
 
virtual G4bool SetH2YAxisTitle (G4int id, const G4String &title) final
 
virtual G4bool SetH2ZAxisTitle (G4int id, const G4String &title) final
 
virtual G4String GetH2Title (G4int id) const final
 
virtual G4String GetH2XAxisTitle (G4int id) const final
 
virtual G4String GetH2YAxisTitle (G4int id) const final
 
virtual G4String GetH2ZAxisTitle (G4int id) const final
 
virtual G4bool WriteOnAscii (std::ofstream &output) final
 
virtual std::shared_ptr< G4HnManagerGetHnManager () final
 
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear")=0
 
virtual 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")=0
 
virtual 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 &xbinScheme="linear", const G4String &ybinScheme="linear")=0
 
virtual 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")=0
 
virtual G4bool ScaleH2 (G4int id, G4double factor)=0
 
virtual G4bool FillH2 (G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)=0
 
virtual G4int GetH2Id (const G4String &name, G4bool warn=true) const =0
 
virtual G4int GetH2Nxbins (G4int id) const =0
 
virtual G4double GetH2Xmin (G4int id) const =0
 
virtual G4double GetH2Xmax (G4int id) const =0
 
virtual G4double GetH2XWidth (G4int id) const =0
 
virtual G4int GetH2Nybins (G4int id) const =0
 
virtual G4double GetH2Ymin (G4int id) const =0
 
virtual G4double GetH2Ymax (G4int id) const =0
 
virtual G4double GetH2YWidth (G4int id) const =0
 
virtual G4bool SetH2Title (G4int id, const G4String &title)=0
 
virtual G4bool SetH2XAxisTitle (G4int id, const G4String &title)=0
 
virtual G4bool SetH2YAxisTitle (G4int id, const G4String &title)=0
 
virtual G4bool SetH2ZAxisTitle (G4int id, const G4String &title)=0
 
virtual G4String GetH2Title (G4int id) const =0
 
virtual G4String GetH2XAxisTitle (G4int id) const =0
 
virtual G4String GetH2YAxisTitle (G4int id) const =0
 
virtual G4String GetH2ZAxisTitle (G4int id) const =0
 
virtual G4bool WriteOnAscii (std::ofstream &output)=0
 
virtual std::shared_ptr< G4HnManagerGetHnManager ()=0
 
- Protected Member Functions inherited from G4THnManager< tools::histo::h2d >
std::vector< tools::histo::h2d * >::iterator BeginT ()
 
std::vector< tools::histo::h2d * >::iterator EndT ()
 
std::vector< tools::histo::h2d * >::const_iterator BeginConstT () const
 
std::vector< tools::histo::h2d * >::const_iterator EndConstT () const
 
tools::histo::h2d * GetTInFunction (G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
 
G4int RegisterT (tools::histo::h2d *t, const G4String &name)
 
G4int GetTId (const G4String &name, G4bool warn=true) const
 

Additional Inherited Members

- Protected Attributes inherited from G4THnManager< tools::histo::h2d >
const G4AnalysisManagerStatefState
 
std::vector< tools::histo::h2d * > fTVector
 
std::map< G4String, G4intfNameIdMap
 
std::shared_ptr< G4HnManagerfHnManager
 

Detailed Description

Definition at line 51 of file G4H2ToolsManager.hh.

Constructor & Destructor Documentation

◆ G4H2ToolsManager()

G4H2ToolsManager::G4H2ToolsManager ( const G4AnalysisManagerState state)
explicit

Definition at line 44 of file G4H2ToolsManager.cc.

◆ ~G4H2ToolsManager()

G4H2ToolsManager::~G4H2ToolsManager ( )
virtual

Definition at line 50 of file G4H2ToolsManager.cc.

51{}

Member Function Documentation

◆ AddH2()

G4int G4H2ToolsManager::AddH2 ( const G4String name,
tools::histo::h2d *  h2d 
)

Definition at line 604 of file G4H2ToolsManager.cc.

605{
606#ifdef G4VERBOSE
607 if ( fState.GetVerboseL4() )
608 fState.GetVerboseL4()->Message("add", "H2", name);
609#endif
610
611 // Add annotation
612 AddH2Annotation(h2d, "none", "none", "none", "none");
613 // Add information
614 AddH2Information(name, "none", "none", "none", "none",
615 G4BinScheme::kLinear, G4BinScheme::kLinear);
616
617 // Register histogram
618 G4int id = RegisterT(h2d, name);
619
620#ifdef G4VERBOSE
621 if ( fState.GetVerboseL2() )
622 fState.GetVerboseL2()->Message("add", "H2", name);
623#endif
624 return id;
625}
int G4int
Definition: G4Types.hh:85
const G4AnalysisVerbose * GetVerboseL2() const
const G4AnalysisVerbose * GetVerboseL4() const
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:82
G4int RegisterT(tools::histo::h2d *t, const G4String &name)

Referenced by G4XmlAnalysisReader::ReadH2Impl(), G4CsvAnalysisReader::ReadH2Impl(), G4Hdf5AnalysisReader::ReadH2Impl(), and G4RootAnalysisReader::ReadH2Impl().

◆ AddH2Vector()

void G4H2ToolsManager::AddH2Vector ( const std::vector< tools::histo::h2d * > &  h2Vector)

Definition at line 628 of file G4H2ToolsManager.cc.

630{
631 AddTVector(h2Vector);
632}
void AddTVector(const std::vector< tools::histo::h2d * > &tVector)

◆ BeginConstH2()

std::vector< tools::histo::h2d * >::const_iterator G4H2ToolsManager::BeginConstH2 ( ) const
inline

Definition at line 184 of file G4H2ToolsManager.hh.

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

◆ BeginH2()

std::vector< tools::histo::h2d * >::iterator G4H2ToolsManager::BeginH2 ( )
inline

Definition at line 177 of file G4H2ToolsManager.hh.

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

◆ CreateH2() [1/2]

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

Implements G4VH2Manager.

Definition at line 288 of file G4H2ToolsManager.cc.

294{
295#ifdef G4VERBOSE
296 if ( fState.GetVerboseL4() )
297 fState.GetVerboseL4()->Message("create", "H2", name);
298#endif
299 tools::histo::h2d* h2d
300 = CreateToolsH2(title, xedges, yedges,
301 xunitName, yunitName, xfcnName, yfcnName);
302
303 // Add annotation
304 AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
305
306 // Save H2 information
307 AddH2Information(
308 name, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser, G4BinScheme::kUser);
309
310 // Register histogram
311 G4int id = RegisterT(h2d, name);
312
313#ifdef G4VERBOSE
314 if ( fState.GetVerboseL2() )
315 fState.GetVerboseL2()->Message("create", "H2", name);
316#endif
317
318 return id;
319}

◆ CreateH2() [2/2]

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

Implements G4VH2Manager.

Definition at line 249 of file G4H2ToolsManager.cc.

257{
258#ifdef G4VERBOSE
259 if ( fState.GetVerboseL4() )
260 fState.GetVerboseL4()->Message("create", "H2", name);
261#endif
262 tools::histo::h2d* h2d
263 = CreateToolsH2(title, nxbins, xmin, xmax, nybins, ymin, ymax,
264 xunitName, yunitName, xfcnName, yfcnName,
265 xbinSchemeName, ybinSchemeName);
266
267 // Add annotation
268 AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
269
270 // Save H2 information
271 auto xbinScheme = GetBinScheme(xbinSchemeName);
272 auto ybinScheme = GetBinScheme(ybinSchemeName);
273 AddH2Information(
274 name, xunitName, yunitName, xfcnName, yfcnName, xbinScheme, ybinScheme);
275
276 // Register histogram
277 G4int id = RegisterT(h2d, name);
278
279#ifdef G4VERBOSE
280 if ( fState.GetVerboseL2() )
281 fState.GetVerboseL2()->Message("create", "H2", name);
282#endif
283
284 return id;
285}
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:35

◆ EndConstH2()

std::vector< tools::histo::h2d * >::const_iterator G4H2ToolsManager::EndConstH2 ( ) const
inline

Definition at line 188 of file G4H2ToolsManager.hh.

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

◆ EndH2()

std::vector< tools::histo::h2d * >::iterator G4H2ToolsManager::EndH2 ( )
inline

Definition at line 180 of file G4H2ToolsManager.hh.

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

◆ FillH2()

G4bool G4H2ToolsManager::FillH2 ( G4int  id,
G4double  xvalue,
G4double  yvalue,
G4double  weight = 1.0 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 401 of file G4H2ToolsManager.cc.

404{
405 auto h2d = GetTInFunction(id, "FillH2", true, false);
406 if ( ! h2d ) return false;
407
408 if ( fState.GetIsActivation() && ( ! fHnManager->GetActivation(id) ) ) {
409 return false;
410 }
411
413 = fHnManager->GetHnDimensionInformation(id, kX, "FillH2");
415 = fHnManager->GetHnDimensionInformation(id, kY, "FillH2");
416
417 h2d->fill(xInfo->fFcn(xvalue/xInfo->fUnit),
418 yInfo->fFcn(yvalue/yInfo->fUnit), weight);
419#ifdef G4VERBOSE
420 if ( fState.GetVerboseL4() ) {
421 G4ExceptionDescription description;
422 description << " id " << id
423 << " xvalue " << xvalue
424 << " xfcn(xvalue/xunit) " << xInfo->fFcn(xvalue/xInfo->fUnit)
425 << " yvalue " << yvalue
426 << " yfcn(yvalue/yunit) " << yInfo->fFcn(yvalue/yInfo->fUnit)
427 << " weight " << weight;
428 fState.GetVerboseL4()->Message("fill", "H2", description);
429 }
430#endif
431 return true;
432}
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:85
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY
const G4int kX

◆ GetH2()

tools::histo::h2d * G4H2ToolsManager::GetH2 ( G4int  id,
G4bool  warn = true,
G4bool  onlyIfActive = true 
) const

Definition at line 634 of file G4H2ToolsManager.cc.

636{
637 return GetTInFunction(id, "GetH2", warn, onlyIfActive);
638}

◆ GetH2Id()

G4int G4H2ToolsManager::GetH2Id ( const G4String name,
G4bool  warn = true 
) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 435 of file G4H2ToolsManager.cc.

436{
437 return GetTId(name, warn);
438}
G4int GetTId(const G4String &name, G4bool warn=true) const

◆ GetH2Nxbins()

G4int G4H2ToolsManager::GetH2Nxbins ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 441 of file G4H2ToolsManager.cc.

442{
443 auto h2d = GetTInFunction(id, "GetH2NXbins");
444 if ( ! h2d ) return 0;
445
446 return GetNbins(*h2d, kX);
447}
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)

◆ GetH2Nybins()

G4int G4H2ToolsManager::GetH2Nybins ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 479 of file G4H2ToolsManager.cc.

480{
481 auto h2d = GetTInFunction(id, "GetH2NYbins");
482 if ( ! h2d ) return 0;
483
484 return GetNbins(*h2d, kY);
485}

◆ GetH2Title()

G4String G4H2ToolsManager::GetH2Title ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 553 of file G4H2ToolsManager.cc.

554{
555 auto h2d = GetTInFunction(id, "GetH2Title");
556 if ( ! h2d ) return "";
557
558 return GetTitle(*h2d);
559}
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)

◆ GetH2Vector()

const std::vector< tools::histo::h2d * > & G4H2ToolsManager::GetH2Vector ( ) const
inline

◆ GetH2XAxisTitle()

G4String G4H2ToolsManager::GetH2XAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 562 of file G4H2ToolsManager.cc.

563{
564 auto h2d = GetTInFunction(id, "GetH2XAxisTitle");
565 if ( ! h2d ) return "";
566
567 return GetAxisTitle(*h2d, kX, fHnManager->GetHnType());
568}
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)

◆ GetH2Xmax()

G4double G4H2ToolsManager::GetH2Xmax ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 461 of file G4H2ToolsManager.cc.

462{
463 auto h2d = GetTInFunction(id, "GetH2Xmax");
464 if ( ! h2d ) return 0.;
465
466 return GetMax(*h2d, kX);
467}
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)

◆ GetH2Xmin()

G4double G4H2ToolsManager::GetH2Xmin ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 450 of file G4H2ToolsManager.cc.

451{
452// Returns xmin value with applied unit and histogram function
453
454 auto h2d = GetTInFunction(id, "GetH2Xmin");
455 if ( ! h2d ) return 0.;
456
457 return GetMin(*h2d, kX);
458}
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)

◆ GetH2XWidth()

G4double G4H2ToolsManager::GetH2XWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 470 of file G4H2ToolsManager.cc.

471{
472 auto h2d = GetTInFunction(id, "GetH2XWidth", true, false);
473 if ( ! h2d ) return 0.;
474
475 return GetWidth(*h2d, kX, fHnManager->GetHnType());
476}
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)

◆ GetH2YAxisTitle()

G4String G4H2ToolsManager::GetH2YAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 571 of file G4H2ToolsManager.cc.

572{
573 auto h2d = GetTInFunction(id, "GetH2YAxisTitle");
574 if ( ! h2d ) return "";
575
576 return GetAxisTitle(*h2d, kY, fHnManager->GetHnType());
577}

◆ GetH2Ymax()

G4double G4H2ToolsManager::GetH2Ymax ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 499 of file G4H2ToolsManager.cc.

500{
501 auto h2d = GetTInFunction(id, "GetH2Ymax");
502 if ( ! h2d ) return 0.;
503
504 return GetMax(*h2d, kY);
505}

◆ GetH2Ymin()

G4double G4H2ToolsManager::GetH2Ymin ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 488 of file G4H2ToolsManager.cc.

489{
490// Returns xmin value with applied unit and histogram function
491
492 auto h2d = GetTInFunction(id, "GetH2Ymin");
493 if ( ! h2d ) return 0.;
494
495 return GetMin(*h2d, kY);
496}

◆ GetH2YWidth()

G4double G4H2ToolsManager::GetH2YWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 508 of file G4H2ToolsManager.cc.

509{
510 auto h2d = GetTInFunction(id, "GetH2YWidth", true, false);
511 if ( ! h2d ) return 0.;
512
513 return GetWidth(*h2d, kY, fHnManager->GetHnType());
514}

◆ GetH2ZAxisTitle()

G4String G4H2ToolsManager::GetH2ZAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 580 of file G4H2ToolsManager.cc.

581{
582 auto h2d = GetTInFunction(id, "GetH2ZAxisTitle");
583 if ( ! h2d ) return "";
584
585 return GetAxisTitle(*h2d, kZ, fHnManager->GetHnType());
586}
const G4int kZ

◆ GetHnManager()

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

Implements G4VH2Manager.

Definition at line 197 of file G4H2ToolsManager.hh.

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

◆ GetHnVector()

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

◆ ScaleH2()

G4bool G4H2ToolsManager::ScaleH2 ( G4int  id,
G4double  factor 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 392 of file G4H2ToolsManager.cc.

393{
394 auto h2d = GetTInFunction(id, "ScaleH2", false, false);
395 if ( ! h2d ) return false;
396
397 return h2d->scale(factor);
398}

◆ SetH2() [1/2]

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

Implements G4VH2Manager.

Definition at line 360 of file G4H2ToolsManager.cc.

365{
366 auto h2d = GetTInFunction(id, "SetH2", false, false);
367 if ( ! h2d ) return false;
368
369 auto info = fHnManager->GetHnInformation(id, "SetH2");
370#ifdef G4VERBOSE
371 if ( fState.GetVerboseL4() )
372 fState.GetVerboseL4()->Message("configure", "H2", info->GetName());
373#endif
374
375 // Configure tools h2
376 ConfigureToolsH2(h2d, xedges, yedges, xunitName, yunitName, xfcnName, yfcnName);
377
378 // Add annotation
379 AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
380
381 // Update information
382 UpdateH2Information(
383 info, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser, G4BinScheme::kUser);
384
385 // Set activation
386 fHnManager->SetActivation(id, true);
387
388 return true;
389}

◆ SetH2() [2/2]

G4bool G4H2ToolsManager::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 xbinScheme = "linear",
const G4String ybinScheme = "linear" 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 322 of file G4H2ToolsManager.cc.

329{
330 auto h2d = GetTInFunction(id, "SetH2", false, false);
331 if ( ! h2d ) return false;
332
333 auto info = fHnManager->GetHnInformation(id, "SetH2");
334#ifdef G4VERBOSE
335 if ( fState.GetVerboseL4() )
336 fState.GetVerboseL4()->Message("configure", "H2", info->GetName());
337#endif
338
339 // Configure tools h2
340 ConfigureToolsH2(
341 h2d, nxbins, xmin, xmax, nybins, ymin, ymax,
342 xunitName, yunitName, xfcnName, yfcnName, xbinSchemeName, ybinSchemeName);
343
344 // Add annotation
345 AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
346
347 // Update information
348 auto xbinScheme = GetBinScheme(xbinSchemeName);
349 auto ybinScheme = GetBinScheme(ybinSchemeName);
350 UpdateH2Information(
351 info, xunitName, yunitName, xfcnName, yfcnName, xbinScheme, ybinScheme);
352
353 // Set activation
354 fHnManager->SetActivation(id, true);
355
356 return true;
357}

◆ SetH2Title()

G4bool G4H2ToolsManager::SetH2Title ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 517 of file G4H2ToolsManager.cc.

518{
519 auto h2d = GetTInFunction(id, "SetH2Title");
520 if ( ! h2d ) return false;
521
522 return SetTitle(*h2d, title);
523}
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)

◆ SetH2XAxisTitle()

G4bool G4H2ToolsManager::SetH2XAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 526 of file G4H2ToolsManager.cc.

527{
528 auto h2d = GetTInFunction(id, "SetH2XAxisTitle");
529 if ( ! h2d ) return false;
530
531 return SetAxisTitle(*h2d, kX, title);
532}
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)

◆ SetH2YAxisTitle()

G4bool G4H2ToolsManager::SetH2YAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 535 of file G4H2ToolsManager.cc.

536{
537 auto h2d = GetTInFunction(id, "SetH2YAxisTitle");
538 if ( ! h2d ) return false;
539
540 return SetAxisTitle(*h2d, kY, title);
541}

◆ SetH2ZAxisTitle()

G4bool G4H2ToolsManager::SetH2ZAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 544 of file G4H2ToolsManager.cc.

545{
546 auto h2d = GetTInFunction(id, "SetH2ZAxisTitle");
547 if ( ! h2d ) return false;
548
549 return SetAxisTitle(*h2d, kZ, title);
550}

◆ WriteOnAscii()

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

Implements G4VH2Manager.

Definition at line 589 of file G4H2ToolsManager.cc.

590{
591// Write selected objects on ASCII file
592// According to the implementation by Michel Maire, originally in
593// extended examples.
594// Not yet available for H2
595
596 return ! fHnManager->IsAscii();
597}

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