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

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

#include <GGSTHits.h>

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

Public Member Functions

 GGSTIntHitBase ()
 Constructor.
 
 ~GGSTIntHitBase ()
 Destructor.
 
void Clear (Option_t *)
 Resets the data members. More...
 
const TString & GetDetectorName ()
 Retrieves the name of the detector associated to the hit. More...
 
const TArrayF & GetTimeBins ()
 Retrieves the time bins for the hit. More...
 
const TString & GetVolumeName ()
 Retrieves the name of the volume associated to the hit. More...
 
const Float_t * GetVolumePosition ()
 Retrieves the position of the volume associated to the hit. More...
 
Int_t GetVolumeID ()
 Retrieves the ID of the volume associated to the hit. More...
 
Int_t GetNPartHits ()
 Gets the number of particle hits. More...
 
GGSTPartHitBaseGetPartHit (unsigned int iHit)
 Get the specified particle hit. More...
 
std::string GetPartHitsClassName ()
 Gets the name of the class of the particle hits. More...
 

Data Fields

Float_t eDep
 Deposited energy (transient).
 
TArrayF eDepTimeBin
 Energy deposit in each time bin.
 

Friends

class GGSHitsAction
 
class GGSTHitsReader
 

Detailed Description

Base class for storing G4 integrated hits.

This class is used to write on ROOT files the informations stored in GGSIntHit. It inherits form TObject and has just data members for energy deposit and volume information.

Definition at line 218 of file GGSTHits.h.

Member Function Documentation

void GGSTIntHitBase::Clear ( Option_t *  )

Resets the data members.

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

Parameters
optThe cleaning option.

Definition at line 167 of file GGSTHits.cpp.

167  {
168  eDep = 0.;
169  eDepTimeBin.Reset();
170  _volumeIndex = 0;
171  if (_partHits)
172  _partHits->Clear("C");
173 }
Float_t eDep
Deposited energy (transient).
Definition: GGSTHits.h:222
TArrayF eDepTimeBin
Energy deposit in each time bin.
Definition: GGSTHits.h:223
const TString& GGSTIntHitBase::GetDetectorName ( )
inline

Retrieves the name of the detector associated to the hit.

Returns
The name of the detector (i.e. logical volume).

Definition at line 257 of file GGSTHits.h.

257  {
258  static const TString nullString("");
259  if (_hitDetInfo)
260  return _hitDetInfo->detectorName;
261  else
262  return nullString;
263  }
TString detectorName
Name of detector associated to integrated hits.
Int_t GGSTIntHitBase::GetNPartHits ( )

Gets the number of particle hits.

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

Definition at line 175 of file GGSTHits.cpp.

175  {
176  if (_partHits)
177  return (_partHits->GetEntries());
178  else
179  return 0;
180 }
GGSTPartHitBase * GGSTIntHitBase::GetPartHit ( unsigned int  iHit)

Get the specified particle hit.

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

Definition at line 182 of file GGSTHits.cpp.

182  {
183  GGSTPartHitBase *hit = nullptr;
184  if (_partHits) {
185  hit = (GGSTPartHitBase *)(_partHits->At(iHit));
186  }
187  return hit;
188 }
Base class for storing G4 particle hits.
Definition: GGSTHits.h:106
std::string GGSTIntHitBase::GetPartHitsClassName ( )

Gets the name of the class of the particle hits.

Returns
The particle hits class name.

Definition at line 190 of file GGSTHits.cpp.

190  {
191  if (_partHits == nullptr) {
192  return "";
193  }
194  std::string retValue = _partHits->GetName();
195  return retValue.substr(0, retValue.size() - 1);
196 }
const TArrayF& GGSTIntHitBase::GetTimeBins ( )
inline

Retrieves the time bins for the hit.

See GGSIntHit::GetTimeBins for details.

Returns
The time bins

Definition at line 271 of file GGSTHits.h.

271 { return *_timeBins; }
Int_t GGSTIntHitBase::GetVolumeID ( )
inline

Retrieves the ID of the volume associated to the hit.

Returns
The ID of the volume.

Definition at line 300 of file GGSTHits.h.

300  {
301  if (_hitVolInfo)
302  return _hitVolInfo->id;
303  else
304  return -1;
305  }
Int_t id
ID of the volume.
const TString& GGSTIntHitBase::GetVolumeName ( )
inline

Retrieves the name of the volume associated to the hit.

Returns
The name of the volume.

Definition at line 277 of file GGSTHits.h.

277  {
278  static const TString nullString("");
279  if (_hitVolInfo)
280  return _hitVolInfo->volumeName;
281  else
282  return nullString;
283  }
TString volumeName
Name of the physical volume.
const Float_t* GGSTIntHitBase::GetVolumePosition ( )
inline

Retrieves the position of the volume associated to the hit.

Returns
The position of the volume (as a Float_t[3] array containing (X,Y,Z) coordinates in cm)).

Definition at line 289 of file GGSTHits.h.

289  {
290  if (_hitVolInfo)
291  return _hitVolInfo->volumePos;
292  else
293  return NULL;
294  }
Float_t volumePos[3]
Position of the touchable in world volume coordinates [cm].

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