GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Data Fields | Friends
GGSTPartHitBase Class Reference

Base class for storing G4 particle hits. More...

#include <GGSTHits.h>

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

Public Member Functions

 GGSTPartHitBase ()
 Constructor.
 
 ~GGSTPartHitBase ()
 Destructor.
 
void Clear (Option_t *opt)
 Resets the data members. More...
 
Int_t GetNPosHits ()
 Prints members values on standard output. More...
 
GGSTPosHitBaseGetPosHit (unsigned int iHit)
 Get the specified position hit. More...
 
std::string GetPosHitsClassName ()
 Gets the name of the class of the position hits. More...
 

Data Fields

Float_t eDep
 Deposited energy.
 

Friends

class GGSHitsAction
 
class GGSTHitsReader
 

Detailed Description

Base class for storing G4 particle hits.

This class is used to write on ROOT files the informations stored in GGSPartHit. It inherits form TObject and has just one data member for energy deposit.

Definition at line 106 of file GGSTHits.h.

Member Function Documentation

void GGSTPartHitBase::Clear ( Option_t *  opt)

Resets the data members.

Will clear also the TClonesArray of position hits by passing the opt parameter (i.e. if opt is "C" then also the position hits will be cleared).

Parameters
optThe cleaning option.

Definition at line 78 of file GGSTHits.cpp.

78  {
79  eDep = 0.;
80  if (_posHits) {
81  _posHits->Clear("C");
82  }
83  _posHitIndex = 0;
84 }
Float_t eDep
Deposited energy.
Definition: GGSTHits.h:109
Int_t GGSTPartHitBase::GetNPosHits ( )

Prints members values on standard output.

Gets the number of position hits.

Returns
The number of hits (0 if the information is not available).

Definition at line 86 of file GGSTHits.cpp.

86  {
87  if (_posHits)
88  return (_posHits->GetEntries());
89  else
90  return 0;
91 }
GGSTPosHitBase * GGSTPartHitBase::GetPosHit ( unsigned int  iHit)

Get the specified position hit.

Parameters
iHitThe desired hit.
Returns
Pointer to the hit object (NULL if iHit is out of bounds).

Definition at line 93 of file GGSTHits.cpp.

93  {
94  GGSTPosHitBase *hit = nullptr;
95  if (_posHits) {
96  hit = (GGSTPosHitBase *)(_posHits->At(iHit));
97  }
98  return hit;
99 }
Base class for storing G4 position hits.
Definition: GGSTHits.h:38
std::string GGSTPartHitBase::GetPosHitsClassName ( )

Gets the name of the class of the position hits.

Returns
The position hits class name.

Definition at line 101 of file GGSTHits.cpp.

101  {
102  if (_posHits == nullptr) {
103  return "";
104  }
105  std::string retValue = _posHits->GetName();
106  return retValue.substr(0, retValue.size() - 1);
107 }

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