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

#include <G4H1ToolsManager.hh>

Inheritance diagram for G4H1ToolsManager:
Collaboration diagram for G4H1ToolsManager:

Public Member Functions

 G4H1ToolsManager (const G4AnalysisManagerState &state)
 
virtual ~G4H1ToolsManager ()
 
G4int AddH1 (const G4String &name, tools::histo::h1d *h1d)
 
void AddH1Vector (const std::vector< tools::histo::h1d * > &h1Vector)
 
tools::histo::h1d * GetH1 (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
 
const std::vector
< tools::histo::h1d * > & 
GetH1Vector () const
 
const std::vector
< G4HnInformation * > & 
GetHnVector () const
 
- Public Member Functions inherited from G4VH1Manager
 G4VH1Manager ()
 
virtual ~G4VH1Manager ()
 
 G4VH1Manager (const G4VH1Manager &rhs)=delete
 
G4VH1Manageroperator= (const G4VH1Manager &rhs)=delete
 
- Public Member Functions inherited from G4THnManager< tools::histo::h1d >
 G4THnManager (const G4AnalysisManagerState &state, const G4String &hnType)
 
virtual ~G4THnManager ()
 
G4bool Reset ()
 
G4bool IsEmpty () const
 

Protected Member Functions

virtual G4int CreateH1 (const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binScheme="linear") final
 
virtual G4int CreateH1 (const G4String &name, const G4String &title, const std::vector< G4double > &edges, const G4String &unitName="none", const G4String &fcnName="none") final
 
virtual G4bool SetH1 (G4int id, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear") final
 
virtual G4bool SetH1 (G4int id, const std::vector< G4double > &edges, const G4String &unitName="none", const G4String &fcnName="none") final
 
virtual G4bool ScaleH1 (G4int id, G4double factor) final
 
virtual G4bool FillH1 (G4int id, G4double value, G4double weight=1.0) final
 
virtual G4int GetH1Id (const G4String &name, G4bool warn=true) const final
 
virtual G4int GetH1Nbins (G4int id) const final
 
virtual G4double GetH1Xmin (G4int id) const final
 
virtual G4double GetH1Xmax (G4int id) const final
 
virtual G4double GetH1Width (G4int id) const final
 
virtual G4bool SetH1Title (G4int id, const G4String &title) final
 
virtual G4bool SetH1XAxisTitle (G4int id, const G4String &title) final
 
virtual G4bool SetH1YAxisTitle (G4int id, const G4String &title) final
 
virtual G4String GetH1Title (G4int id) const final
 
virtual G4String GetH1XAxisTitle (G4int id) const final
 
virtual G4String GetH1YAxisTitle (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::h1d >
void AddTVector (const std::vector< tools::histo::h1d * > &tVector)
 
std::vector< tools::histo::h1d * >
::iterator 
BeginT ()
 
std::vector< tools::histo::h1d * >
::iterator 
EndT ()
 
std::vector< tools::histo::h1d * >
::const_iterator 
BeginConstT () const
 
std::vector< tools::histo::h1d * >
::const_iterator 
EndConstT () const
 
tools::histo::h1d * GetTInFunction (G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
 
G4int RegisterT (tools::histo::h1d *t, const G4String &name)
 
G4int GetTId (const G4String &name, G4bool warn=true) const
 

Additional Inherited Members

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

Detailed Description

Definition at line 52 of file G4H1ToolsManager.hh.

Constructor & Destructor Documentation

G4H1ToolsManager::G4H1ToolsManager ( const G4AnalysisManagerState state)
explicit

Definition at line 49 of file G4H1ToolsManager.cc.

G4H1ToolsManager::~G4H1ToolsManager ( )
virtual

Definition at line 55 of file G4H1ToolsManager.cc.

56 {}

Member Function Documentation

G4int G4H1ToolsManager::AddH1 ( const G4String name,
tools::histo::h1d *  h1d 
)

Definition at line 493 of file G4H1ToolsManager.cc.

494 {
495 #ifdef G4VERBOSE
496  if ( fState.GetVerboseL4() )
497  fState.GetVerboseL4()->Message("add", "H1", name);
498 #endif
499 
500  // Add annotation
501  AddH1Annotation(h1d, "none", "none");
502  // Add information
503  AddH1Information(name, "none", "none", G4BinScheme::kLinear);
504 
505  // Register histogram
506  auto id = RegisterT(h1d, name);
507 
508 #ifdef G4VERBOSE
509  if ( fState.GetVerboseL2() )
510  fState.GetVerboseL2()->Message("add", "H1", name);
511 #endif
512  return id;
513 }
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4int RegisterT(tools::histo::h1d *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 G4H1ToolsManager::AddH1Vector ( const std::vector< tools::histo::h1d * > &  h1Vector)

Definition at line 517 of file G4H1ToolsManager.cc.

519 {
520  AddTVector(h1Vector);
521 }
void AddTVector(const std::vector< tools::histo::h1d * > &tVector)

Here is the call graph for this function:

std::vector< tools::histo::h1d * >::const_iterator G4H1ToolsManager::BeginConstH1 ( ) const
inline

Definition at line 161 of file G4H1ToolsManager.hh.

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

Here is the call graph for this function:

std::vector< tools::histo::h1d * >::iterator G4H1ToolsManager::BeginH1 ( )
inline

Definition at line 154 of file G4H1ToolsManager.hh.

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

Here is the call graph for this function:

G4int G4H1ToolsManager::CreateH1 ( const G4String name,
const G4String title,
G4int  nbins,
G4double  xmin,
G4double  xmax,
const G4String unitName = "none",
const G4String fcnName = "none",
const G4String binScheme = "linear" 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 200 of file G4H1ToolsManager.cc.

204 {
205 #ifdef G4VERBOSE
206  if ( fState.GetVerboseL4() )
207  fState.GetVerboseL4()->Message("create", "H1", name);
208 #endif
209 
210  // Create H1
211  auto h1d
212  = CreateToolsH1(title, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
213 
214  // Add annotation
215  AddH1Annotation(h1d, unitName, fcnName);
216 
217  // Save H1 information
218  auto binScheme = GetBinScheme(binSchemeName);
219  AddH1Information(name, unitName, fcnName, binScheme);
220 
221  // Register histogram
222  auto id = RegisterT(h1d, name);
223 
224 #ifdef G4VERBOSE
225  if ( fState.GetVerboseL2() )
226  fState.GetVerboseL2()->Message("create", "H1", name);
227 #endif
228  return id;
229 }
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4int RegisterT(tools::histo::h1d *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 G4H1ToolsManager::CreateH1 ( const G4String name,
const G4String title,
const std::vector< G4double > &  edges,
const G4String unitName = "none",
const G4String fcnName = "none" 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 232 of file G4H1ToolsManager.cc.

235 {
236 #ifdef G4VERBOSE
237  if ( fState.GetVerboseL4() )
238  fState.GetVerboseL4()->Message("create", "H1", name);
239 #endif
240  auto h1d
241  = CreateToolsH1(title, edges, unitName, fcnName);
242 
243  // Add annotation
244  AddH1Annotation(h1d, unitName, fcnName);
245 
246  // Save H1 information
247  AddH1Information(name, unitName, fcnName, G4BinScheme::kUser);
248 
249  // Register histogram
250  auto id = RegisterT(h1d, name);
251 
252 #ifdef G4VERBOSE
253  if ( fState.GetVerboseL2() )
254  fState.GetVerboseL2()->Message("create", "H1", name);
255 #endif
256  return id;
257 }
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4int RegisterT(tools::histo::h1d *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::h1d * >::const_iterator G4H1ToolsManager::EndConstH1 ( ) const
inline

Definition at line 165 of file G4H1ToolsManager.hh.

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

Here is the call graph for this function:

std::vector< tools::histo::h1d * >::iterator G4H1ToolsManager::EndH1 ( )
inline

Definition at line 157 of file G4H1ToolsManager.hh.

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

Here is the call graph for this function:

G4bool G4H1ToolsManager::FillH1 ( G4int  id,
G4double  value,
G4double  weight = 1.0 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 331 of file G4H1ToolsManager.cc.

332 {
333  auto h1d = GetTInFunction(id, "FillH1", true, false);
334  if ( ! h1d ) return false;
335 
336  if ( fState.GetIsActivation() && ( ! fHnManager->GetActivation(id) ) ) {
337  //G4cout << "Skipping FillH1 for " << id << G4endl;
338  return false;
339  }
340 
341  auto info
342  = fHnManager->GetHnDimensionInformation(id, kX, "FillH1");
343  h1d->fill(info->fFcn(value/info->fUnit), weight);
344 #ifdef G4VERBOSE
345  if ( fState.GetVerboseL4() ) {
346  G4ExceptionDescription description;
347  description << " id " << id << " value " << value
348  << " fcn(value/unit) " << info->fFcn(value/info->fUnit)
349  << " weight " << weight;
350  fState.GetVerboseL4()->Message("fill", "H1", description);
351  }
352 #endif
353  return true;
354 }
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::ostringstream G4ExceptionDescription
Definition: globals.hh:76
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:80
const XML_Char int const XML_Char * value
Definition: expat.h:331
const G4AnalysisVerbose * GetVerboseL4() const
const G4int kX
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

tools::histo::h1d * G4H1ToolsManager::GetH1 ( G4int  id,
G4bool  warn = true,
G4bool  onlyIfActive = true 
) const

Definition at line 524 of file G4H1ToolsManager.cc.

526 {
527  return GetTInFunction(id, "GetH1", warn, onlyIfActive);
528 }
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4int G4H1ToolsManager::GetH1Id ( const G4String name,
G4bool  warn = true 
) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 357 of file G4H1ToolsManager.cc.

358 {
359  return GetTId(name, warn);
360 }
G4int GetTId(const G4String &name, G4bool warn=true) const

Here is the call graph for this function:

G4int G4H1ToolsManager::GetH1Nbins ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 363 of file G4H1ToolsManager.cc.

364 {
365  auto h1d = GetTInFunction(id, "GetH1Nbins");
366  if ( ! h1d ) return 0;
367 
368  return GetNbins(*h1d, kX);
369 }
const G4int kX
tools::histo::h1d * 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:

G4String G4H1ToolsManager::GetH1Title ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 428 of file G4H1ToolsManager.cc.

429 {
430  auto h1d = GetTInFunction(id, "GetH1Title");
431  if ( ! h1d ) return "";
432 
433  return GetTitle(*h1d);
434 }
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)
tools::histo::h1d * 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::h1d * > & G4H1ToolsManager::GetH1Vector ( ) const
inline

Definition at line 168 of file G4H1ToolsManager.hh.

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

Here is the caller graph for this function:

G4double G4H1ToolsManager::GetH1Width ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 392 of file G4H1ToolsManager.cc.

393 {
394  auto h1d = GetTInFunction(id, "GetH1XWidth", true, false);
395  if ( ! h1d ) return 0.;
396 
397  return GetWidth(*h1d, kX, fHnManager->GetHnType());
398 }
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4int kX
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4String G4H1ToolsManager::GetH1XAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 438 of file G4H1ToolsManager.cc.

439 {
440  auto h1d = GetTInFunction(id, "GetH1XAxisTitle");
441  if ( ! h1d ) return "";
442 
443  return GetAxisTitle(*h1d, kX, fHnManager->GetHnType());
444 }
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4int kX
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4double G4H1ToolsManager::GetH1Xmax ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 383 of file G4H1ToolsManager.cc.

384 {
385  auto h1d = GetTInFunction(id, "GetH1Xmax");
386  if ( ! h1d ) return 0.;
387 
388  return GetMax(*h1d, kX);
389 }
const G4int kX
tools::histo::h1d * 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 G4H1ToolsManager::GetH1Xmin ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 372 of file G4H1ToolsManager.cc.

373 {
374 // Returns xmin value with applied unit and histogram function
375 
376  auto h1d = GetTInFunction(id, "GetH1Xmin");
377  if ( ! h1d ) return 0.;
378 
379  return GetMin(*h1d, kX);
380 }
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)
const G4int kX
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4String G4H1ToolsManager::GetH1YAxisTitle ( G4int  id) const
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 447 of file G4H1ToolsManager.cc.

448 {
449  auto h1d = GetTInFunction(id, "GetH1YAxisTitle");
450  if ( ! h1d ) return "";
451 
452  return GetAxisTitle(*h1d, kY, fHnManager->GetHnType());
453 }
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY

Here is the call graph for this function:

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

Implements G4VH1Manager.

Definition at line 174 of file G4H1ToolsManager.hh.

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

Definition at line 171 of file G4H1ToolsManager.hh.

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

Here is the caller graph for this function:

G4bool G4H1ToolsManager::ScaleH1 ( G4int  id,
G4double  factor 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 322 of file G4H1ToolsManager.cc.

323 {
324  auto h1d = GetTInFunction(id, "ScaleH1", false, false);
325  if ( ! h1d ) return false;
326 
327  return h1d->scale(factor);
328 }
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4bool G4H1ToolsManager::SetH1 ( G4int  id,
G4int  nbins,
G4double  xmin,
G4double  xmax,
const G4String unitName = "none",
const G4String fcnName = "none",
const G4String binSchemeName = "linear" 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 260 of file G4H1ToolsManager.cc.

264 {
265  auto h1d = GetTInFunction(id, "SetH1", false, false);
266  if ( ! h1d ) return false;
267 
268  auto info = fHnManager->GetHnInformation(id,"SetH1");
269 #ifdef G4VERBOSE
270  if ( fState.GetVerboseL4() )
271  fState.GetVerboseL4()->Message("configure", "H1", info->GetName());
272 #endif
273 
274  // Configure tools h1
275  ConfigureToolsH1(h1d, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
276 
277  // Add annotation
278  AddH1Annotation(h1d, unitName, fcnName);
279 
280  // Update information
281  auto binScheme = GetBinScheme(binSchemeName);
282  UpdateH1Information(info, unitName, fcnName, binScheme);
283 
284  // Set activation
285  fHnManager->SetActivation(id, true);
286 
287  return true;
288 }
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::h1d * 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 G4H1ToolsManager::SetH1 ( G4int  id,
const std::vector< G4double > &  edges,
const G4String unitName = "none",
const G4String fcnName = "none" 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 291 of file G4H1ToolsManager.cc.

295 {
296  auto h1d = GetTInFunction(id, "SetH1", false, false);
297  if ( ! h1d ) return false;
298 
299  auto info = fHnManager->GetHnInformation(id,"SetH1");
300 #ifdef G4VERBOSE
301  if ( fState.GetVerboseL4() )
302  fState.GetVerboseL4()->Message("configure", "H1", info->GetName());
303 #endif
304 
305  // Configure tools h1
306  ConfigureToolsH1(h1d, edges, unitName, fcnName);
307 
308  // Add annotation
309  AddH1Annotation(h1d, unitName, fcnName);
310 
311  // Update information
312  UpdateH1Information(info, unitName, fcnName, G4BinScheme::kUser);
313 
314  // Set activation
315  fHnManager->SetActivation(id, true);
316 
317  return true;
318 }
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::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4bool G4H1ToolsManager::SetH1Title ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 401 of file G4H1ToolsManager.cc.

402 {
403  auto h1d = GetTInFunction(id, "SetH1Title");
404  if ( ! h1d ) return false;
405 
406  return SetTitle(*h1d, title);
407 }
tools::histo::h1d * 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 G4H1ToolsManager::SetH1XAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 410 of file G4H1ToolsManager.cc.

411 {
412  auto h1d = GetTInFunction(id, "SetH1XAxisTitle");
413  if ( ! h1d ) return false;
414 
415  return SetAxisTitle(*h1d, kX, title);
416 }
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
const G4int kX
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

G4bool G4H1ToolsManager::SetH1YAxisTitle ( G4int  id,
const G4String title 
)
finalprotectedvirtual

Implements G4VH1Manager.

Definition at line 419 of file G4H1ToolsManager.cc.

420 {
421  auto h1d = GetTInFunction(id, "SetH1YAxisTitle");
422  if ( ! h1d ) return false;
423 
424  return SetAxisTitle(*h1d, kY, title);
425 }
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4int kY

Here is the call graph for this function:

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

Implements G4VH1Manager.

Definition at line 456 of file G4H1ToolsManager.cc.

457 {
458 // Write selected objects on ASCII file
459 // According to the implementation by Michel Maire, originally in
460 // extended examples.
461 
462  // h1 histograms
463  for ( G4int i=0; i<G4int(fTVector.size()); ++i ) {
464  auto id = i + fHnManager->GetFirstId();
465  auto info = fHnManager->GetHnInformation(id,"WriteOnAscii");
466  // skip writing if activation is enabled and H1 is inactivated
467  if ( ! info->GetAscii() ) continue;
468  auto h1 = fTVector[i];
469 
470 #ifdef G4VERBOSE
471  if ( fState.GetVerboseL3() )
472  fState.GetVerboseL3()->Message("write on ascii", "h1d", info->GetName());
473 #endif
474 
475  output << "\n 1D histogram " << id << ": " << h1->title()
476  << "\n \n \t X \t\t Y" << G4endl;
477 
478  for (G4int j=0; j< G4int(h1->axis().bins()); ++j) {
479  output << " " << j << "\t"
480  << h1->axis().bin_center(j) << "\t"
481  << h1->bin_height(j) << G4endl;
482  }
483  }
484 
485  return true;
486 }
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
int G4int
Definition: G4Types.hh:78
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:80
const G4AnalysisVerbose * GetVerboseL3() const
#define G4endl
Definition: G4ios.hh:61
std::vector< tools::histo::h1d * > fTVector
Definition: G4THnManager.hh:81

Here is the call graph for this function:


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