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

#include <G4H2ToolsManager.hh>

Inheritance diagram for G4H2ToolsManager:
Collaboration 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
 

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
< G4HnManager
GetHnManager () final
 
- Protected Member Functions inherited from G4THnManager< tools::histo::h2d >
void AddTVector (const std::vector< tools::histo::h2d * > &tVector)
 
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 52 of file G4H2ToolsManager.hh.

Constructor & Destructor Documentation

G4H2ToolsManager::G4H2ToolsManager ( const G4AnalysisManagerState state)
explicit

Definition at line 45 of file G4H2ToolsManager.cc.

G4H2ToolsManager::~G4H2ToolsManager ( )
virtual

Definition at line 51 of file G4H2ToolsManager.cc.

52 {}

Member Function Documentation

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

Definition at line 605 of file G4H2ToolsManager.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 629 of file G4H2ToolsManager.cc.

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

Here is the call graph for this function:

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

Definition at line 185 of file G4H2ToolsManager.hh.

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

Here is the call graph for this function:

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

Definition at line 178 of file G4H2ToolsManager.hh.

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

Here is the call graph for this function:

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 250 of file G4H2ToolsManager.cc.

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

Here is the call graph for this function:

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 289 of file G4H2ToolsManager.cc.

295 {
296 #ifdef G4VERBOSE
297  if ( fState.GetVerboseL4() )
298  fState.GetVerboseL4()->Message("create", "H2", name);
299 #endif
300  tools::histo::h2d* h2d
301  = CreateToolsH2(title, xedges, yedges,
302  xunitName, yunitName, xfcnName, yfcnName);
303 
304  // Add annotation
305  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
306 
307  // Save H2 information
308  AddH2Information(
309  name, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser, G4BinScheme::kUser);
310 
311  // Register histogram
312  G4int id = RegisterT(h2d, name);
313 
314 #ifdef G4VERBOSE
315  if ( fState.GetVerboseL2() )
316  fState.GetVerboseL2()->Message("create", "H2", name);
317 #endif
318 
319  return id;
320 }
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
int G4int
Definition: G4Types.hh:78
G4int RegisterT(tools::histo::h2d *t, const G4String &name)
const G4AnalysisVerbose * GetVerboseL2() const
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:80
const G4AnalysisVerbose * GetVerboseL4() const

Here is the call graph for this function:

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

Definition at line 189 of file G4H2ToolsManager.hh.

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

Here is the call graph for this function:

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

Definition at line 181 of file G4H2ToolsManager.hh.

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

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 402 of file G4H2ToolsManager.cc.

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

Here is the call graph for this function:

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

Definition at line 635 of file G4H2ToolsManager.cc.

637 {
638  return GetTInFunction(id, "GetH2", warn, onlyIfActive);
639 }
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 436 of file G4H2ToolsManager.cc.

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

Here is the call graph for this function:

G4int G4H2ToolsManager::GetH2Nxbins ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 442 of file G4H2ToolsManager.cc.

443 {
444  auto h2d = GetTInFunction(id, "GetH2NXbins");
445  if ( ! h2d ) return 0;
446 
447  return GetNbins(*h2d, kX);
448 }
const G4int kX
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)

Here is the call graph for this function:

G4int G4H2ToolsManager::GetH2Nybins ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 480 of file G4H2ToolsManager.cc.

481 {
482  auto h2d = GetTInFunction(id, "GetH2NYbins");
483  if ( ! h2d ) return 0;
484 
485  return GetNbins(*h2d, kY);
486 }
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)
const G4int kY

Here is the call graph for this function:

G4String G4H2ToolsManager::GetH2Title ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 554 of file G4H2ToolsManager.cc.

555 {
556  auto h2d = GetTInFunction(id, "GetH2Title");
557  if ( ! h2d ) return "";
558 
559  return GetTitle(*h2d);
560 }
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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

Definition at line 192 of file G4H2ToolsManager.hh.

193 { return fTVector; }
std::vector< tools::histo::h2d * > fTVector
Definition: G4THnManager.hh:81

Here is the caller graph for this function:

G4String G4H2ToolsManager::GetH2XAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 563 of file G4H2ToolsManager.cc.

564 {
565  auto h2d = GetTInFunction(id, "GetH2XAxisTitle");
566  if ( ! h2d ) return "";
567 
568  return GetAxisTitle(*h2d, kX, fHnManager->GetHnType());
569 }
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4int kX
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4double G4H2ToolsManager::GetH2Xmax ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 462 of file G4H2ToolsManager.cc.

463 {
464  auto h2d = GetTInFunction(id, "GetH2Xmax");
465  if ( ! h2d ) return 0.;
466 
467  return GetMax(*h2d, kX);
468 }
const G4int kX
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)

Here is the call graph for this function:

G4double G4H2ToolsManager::GetH2Xmin ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 451 of file G4H2ToolsManager.cc.

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

Here is the call graph for this function:

G4double G4H2ToolsManager::GetH2XWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 471 of file G4H2ToolsManager.cc.

472 {
473  auto h2d = GetTInFunction(id, "GetH2XWidth", true, false);
474  if ( ! h2d ) return 0.;
475 
476  return GetWidth(*h2d, kX, fHnManager->GetHnType());
477 }
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4int kX
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4String G4H2ToolsManager::GetH2YAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 572 of file G4H2ToolsManager.cc.

573 {
574  auto h2d = GetTInFunction(id, "GetH2YAxisTitle");
575  if ( ! h2d ) return "";
576 
577  return GetAxisTitle(*h2d, kY, fHnManager->GetHnType());
578 }
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY

Here is the call graph for this function:

G4double G4H2ToolsManager::GetH2Ymax ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 500 of file G4H2ToolsManager.cc.

501 {
502  auto h2d = GetTInFunction(id, "GetH2Ymax");
503  if ( ! h2d ) return 0.;
504 
505  return GetMax(*h2d, kY);
506 }
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)
const G4int kY

Here is the call graph for this function:

G4double G4H2ToolsManager::GetH2Ymin ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 489 of file G4H2ToolsManager.cc.

490 {
491 // Returns xmin value with applied unit and histogram function
492 
493  auto h2d = GetTInFunction(id, "GetH2Ymin");
494  if ( ! h2d ) return 0.;
495 
496  return GetMin(*h2d, kY);
497 }
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY

Here is the call graph for this function:

G4double G4H2ToolsManager::GetH2YWidth ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 509 of file G4H2ToolsManager.cc.

510 {
511  auto h2d = GetTInFunction(id, "GetH2YWidth", true, false);
512  if ( ! h2d ) return 0.;
513 
514  return GetWidth(*h2d, kY, fHnManager->GetHnType());
515 }
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY

Here is the call graph for this function:

G4String G4H2ToolsManager::GetH2ZAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH2Manager.

Definition at line 581 of file G4H2ToolsManager.cc.

582 {
583  auto h2d = GetTInFunction(id, "GetH2ZAxisTitle");
584  if ( ! h2d ) return "";
585 
586  return GetAxisTitle(*h2d, kZ, fHnManager->GetHnType());
587 }
const G4int kZ
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 198 of file G4H2ToolsManager.hh.

199 { return std::shared_ptr<G4HnManager>(fHnManager); }
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const std::vector< G4HnInformation * > & G4H2ToolsManager::GetHnVector ( ) const
inline

Definition at line 195 of file G4H2ToolsManager.hh.

196 { return fHnManager->GetHnVector(); }
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83

Here is the caller graph for this function:

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

Implements G4VH2Manager.

Definition at line 393 of file G4H2ToolsManager.cc.

394 {
395  auto h2d = GetTInFunction(id, "ScaleH2", false, false);
396  if ( ! h2d ) return false;
397 
398  return h2d->scale(factor);
399 }
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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 323 of file G4H2ToolsManager.cc.

330 {
331  auto h2d = GetTInFunction(id, "SetH2", false, false);
332  if ( ! h2d ) return false;
333 
334  auto info = fHnManager->GetHnInformation(id, "SetH2");
335 #ifdef G4VERBOSE
336  if ( fState.GetVerboseL4() )
337  fState.GetVerboseL4()->Message("configure", "H2", info->GetName());
338 #endif
339 
340  // Configure tools h2
341  ConfigureToolsH2(
342  h2d, nxbins, xmin, xmax, nybins, ymin, ymax,
343  xunitName, yunitName, xfcnName, yfcnName, xbinSchemeName, ybinSchemeName);
344 
345  // Add annotation
346  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
347 
348  // Update information
349  auto xbinScheme = GetBinScheme(xbinSchemeName);
350  auto ybinScheme = GetBinScheme(ybinSchemeName);
351  UpdateH2Information(
352  info, xunitName, yunitName, xfcnName, yfcnName, xbinScheme, ybinScheme);
353 
354  // Set activation
355  fHnManager->SetActivation(id, true);
356 
357  return true;
358 }
const XML_Char XML_Encoding * info
Definition: expat.h:530
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:80
const G4AnalysisVerbose * GetVerboseL4() const
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:36

Here is the call graph for this function:

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 361 of file G4H2ToolsManager.cc.

366 {
367  auto h2d = GetTInFunction(id, "SetH2", false, false);
368  if ( ! h2d ) return false;
369 
370  auto info = fHnManager->GetHnInformation(id, "SetH2");
371 #ifdef G4VERBOSE
372  if ( fState.GetVerboseL4() )
373  fState.GetVerboseL4()->Message("configure", "H2", info->GetName());
374 #endif
375 
376  // Configure tools h2
377  ConfigureToolsH2(h2d, xedges, yedges, xunitName, yunitName, xfcnName, yfcnName);
378 
379  // Add annotation
380  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
381 
382  // Update information
383  UpdateH2Information(
384  info, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser, G4BinScheme::kUser);
385 
386  // Set activation
387  fHnManager->SetActivation(id, true);
388 
389  return true;
390 }
const XML_Char XML_Encoding * info
Definition: expat.h:530
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:80
const G4AnalysisVerbose * GetVerboseL4() const
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 518 of file G4H2ToolsManager.cc.

519 {
520  auto h2d = GetTInFunction(id, "SetH2Title");
521  if ( ! h2d ) return false;
522 
523  return SetTitle(*h2d, title);
524 }
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 527 of file G4H2ToolsManager.cc.

528 {
529  auto h2d = GetTInFunction(id, "SetH2XAxisTitle");
530  if ( ! h2d ) return false;
531 
532  return SetAxisTitle(*h2d, kX, title);
533 }
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
const G4int kX
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 536 of file G4H2ToolsManager.cc.

537 {
538  auto h2d = GetTInFunction(id, "SetH2YAxisTitle");
539  if ( ! h2d ) return false;
540 
541  return SetAxisTitle(*h2d, kY, title);
542 }
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 545 of file G4H2ToolsManager.cc.

546 {
547  auto h2d = GetTInFunction(id, "SetH2ZAxisTitle");
548  if ( ! h2d ) return false;
549 
550  return SetAxisTitle(*h2d, kZ, title);
551 }
const G4int kZ
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

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

Implements G4VH2Manager.

Definition at line 590 of file G4H2ToolsManager.cc.

591 {
592 // Write selected objects on ASCII file
593 // According to the implementation by Michel Maire, originally in
594 // extended examples.
595 // Not yet available for H2
596 
597  return ! fHnManager->IsAscii();
598 }
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83

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