GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Public Member Functions
GGSTPrimaryDisReader Class Reference

Class for reading output of GGSPrimaryDisAction. More...

#include <GGSTPrimaryDisReader.h>

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

Public Member Functions

 GGSTPrimaryDisReader ()
 Constructor.
 
 ~GGSTPrimaryDisReader ()
 Destructor.
 
bool SetChain (TChain *disInfoChain)
 Sets the chain. More...
 
void GetEntry (Long64_t entry)
 
GGSTPrimaryDisInfoGetDisInfo (Int_t trackID=1)
 Retrieves the disappearance information for the given primary. More...
 
- Public Member Functions inherited from GGSTChainReader
virtual ~GGSTChainReader ()
 Destructor.
 

Detailed Description

Class for reading output of GGSPrimaryDisAction.

This class provides methods to read the information about the disappearance of primary particles as saved by GGSPrimaryDisAction.

Definition at line 26 of file GGSTPrimaryDisReader.h.

Member Function Documentation

GGSTPrimaryDisInfo * GGSTPrimaryDisReader::GetDisInfo ( Int_t  trackID = 1)

Retrieves the disappearance information for the given primary.

Parameters
trackIDThe track ID of the primary particle.
Returns
Pointer to primary disappearance information info (NULL if the given trackID is not found).

Definition at line 32 of file GGSTPrimaryDisReader.cpp.

32  {
33 
34  GGSTPrimaryDisInfo *interaction;
35  for (int i = 0; i < _disInfo->GetEntries(); i++) {
36  interaction = (GGSTPrimaryDisInfo *)(_disInfo->At(i));
37  if (interaction->primary.trackID == trackID) {
38  return interaction;
39  }
40  }
41 
42  return nullptr;
43 }
GGSTParticle primary
Descriptor for the primary particle.
A simple class to carry informations about the disappearance of the primary particle.
Int_t trackID
Track ID.
Definition: GGSTParticle.h:22
void GGSTPrimaryDisReader::GetEntry ( Long64_t  entry)
virtual

@ brief Reads the specified entry from the primary disappearance information branch.

Parameters
entryThe desired entry.

Implements GGSTChainReader.

Definition at line 26 of file GGSTPrimaryDisReader.cpp.

26  {
27  if (entry != _disInfoChain->GetEntries()) {
28  _disInfoChain->GetEntry(entry);
29  }
30 }
bool GGSTPrimaryDisReader::SetChain ( TChain *  disInfoChain)
virtual

Sets the chain.

This method sets the disappearance info chain, from which the informations will be read.

Parameters
disInfoChainThe chain containing the primary disappearance information.

Implements GGSTChainReader.

Definition at line 16 of file GGSTPrimaryDisReader.cpp.

16  {
17 
18  _disInfoChain = disInfoChain;
19  if (_disInfoChain->SetBranchAddress("primaryDisInfo", &_disInfo) == 0) {
20  return true;
21  } else {
22  return false;
23  }
24 }

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