GGS(GenericGEANT4Simulation)Software  2.99.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Macros
Public Member Functions
GGSTRngStateReader Class Reference

Class for reading output of GGSRngStateAction. More...

#include <GGSTRngStateReader.h>

Inheritance diagram for GGSTRngStateReader:
Inheritance graph
[legend]
Collaboration diagram for GGSTRngStateReader:
Collaboration graph
[legend]

Public Member Functions

 GGSTRngStateReader ()
 Constructor.
 
bool SetChain (TChain *rngStateChain)
 Sets the chain. More...
 
void GetEntry (Long64_t entry)
 
const std::string GetState ()
 Gets the state of the random number generator for the current event. More...
 
const std::string GetName ()
 Gets the name of the random number generator for the current event. More...
 
- Public Member Functions inherited from GGSTChainReader
virtual ~GGSTChainReader ()
 Destructor.
 

Detailed Description

Class for reading output of GGSRngStateAction.

Definition at line 17 of file GGSTRngStateReader.h.

Member Function Documentation

void GGSTRngStateReader::GetEntry ( Long64_t  entry)
virtual

@ brief Reads the specified entry from the random engine state branch.

Parameters
entryThe desired entry.

Implements GGSTChainReader.

Definition at line 27 of file GGSTRngStateReader.cpp.

27  {
28  if (entry != _rngStateChain->GetEntries()) {
29  _rngStateChain->GetEntry(entry);
30  }
31 }
const std::string GGSTRngStateReader::GetName ( )

Gets the name of the random number generator for the current event.

Returns
The random number generator name.

Definition at line 33 of file GGSTRngStateReader.cpp.

33  {
34  if (_rngName == "") {
35  if (_rngStateChain) {
36  TKey *key = _rngStateChain->GetFile()->GetKey("rngName");
37  if (key) {
38  _rngName = *((std::string *)(key->ReadObjectAny(TClass::GetClass("std::string"))));
39  }
40  }
41  }
42  return _rngName;
43 }
const std::string GGSTRngStateReader::GetState ( )
inline

Gets the state of the random number generator for the current event.

Returns
The random number generator state.

Definition at line 41 of file GGSTRngStateReader.h.

41 { return *_rngState; }
bool GGSTRngStateReader::SetChain ( TChain *  rngStateChain)
virtual

Sets the chain.

This method sets the random engine state chain, from which the informations will be read.

Parameters
rngStateChainThe chain containing the random engine state branch.

Implements GGSTChainReader.

Definition at line 17 of file GGSTRngStateReader.cpp.

17  {
18 
19  _rngStateChain = rngStateChain;
20  if (_rngStateChain->SetBranchAddress("rngState", &_rngState) == 0) {
21  return true;
22  } else {
23  return false;
24  }
25 }

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