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

Class for reading output of GGSMCTruthAction. More...

#include <GGSTMCTruthReader.h>

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

Public Member Functions

 GGSTMCTruthReader ()
 Constructor.
 
 ~GGSTMCTruthReader ()
 Destructor.
 
bool SetChain (TChain *mcTruthChain)
 Sets the chain. More...
 
void GetEntry (Long64_t entry)
 
GGSTParticleGetPrimaryParticle (UInt_t particleNumber)
 Returns a primary particle. More...
 
UInt_t GetNPrimaries ()
 Returns the number of primaries in current event. More...
 
UInt_t GetNDiscarded ()
 Returns the number of discarded events before the current one. More...
 
- Public Member Functions inherited from GGSTChainReader
virtual ~GGSTChainReader ()
 Destructor.
 

Detailed Description

Class for reading output of GGSMCTruthAction.

This class provides methods to read the information about MC truth as saved by GGSMCTruthAction.

Definition at line 25 of file GGSTMCTruthReader.h.

Member Function Documentation

void GGSTMCTruthReader::GetEntry ( Long64_t  entry)
virtual

@ brief Reads the specified entry from the MC truth branch.

Parameters
entryThe desired entry.

Implements GGSTChainReader.

Definition at line 33 of file GGSTMCTruthReader.cpp.

33  {
34  if (entry != _mcTruthChain->GetEntries()) {
35  _mcTruthChain->GetEntry(entry);
36  }
37 }
UInt_t GGSTMCTruthReader::GetNDiscarded ( )
inline

Returns the number of discarded events before the current one.

Returns
The number of discarded events
See Also
GGSTMCTruthInfo::nDiscarded

Definition at line 76 of file GGSTMCTruthReader.h.

76  {
77  if (_mcTruthInfo)
78  return _mcTruthInfo->nDiscarded;
79  else
80  return 0;
81  }
UInt_t nDiscarded
The number of discarded + killed events the current event and the previous event saved in file...
UInt_t GGSTMCTruthReader::GetNPrimaries ( )
inline

Returns the number of primaries in current event.

Returns
The number of primaries

Definition at line 64 of file GGSTMCTruthReader.h.

64  {
65  if (_mcTruthInfo)
66  return _mcTruthInfo->GetNPrimaries();
67  else
68  return 0;
69  }
UInt_t GetNPrimaries()
Retrieves the number of primaries in this event.
GGSTParticle* GGSTMCTruthReader::GetPrimaryParticle ( UInt_t  particleNumber)
inline

Returns a primary particle.

Parameters
particleNumberThe particle to retrieve.
Returns
Pointer to primary particle.

Definition at line 53 of file GGSTMCTruthReader.h.

53  {
54  if (_mcTruthInfo)
55  return _mcTruthInfo->GetPrimaryParticle(particleNumber);
56  else
57  return NULL;
58  }
GGSTParticle * GetPrimaryParticle(UInt_t particleNumber)
Retrieves a primary particle.
bool GGSTMCTruthReader::SetChain ( TChain *  mcTruthChain)
virtual

Sets the chain.

This method sets the MC truth chain, from which the informations will be read.

Parameters
mcTruthChainThe chain containing the MC truth.

Implements GGSTChainReader.

Definition at line 22 of file GGSTMCTruthReader.cpp.

22  {
23 
24  _mcTruthChain = mcTruthChain;
25  if (_mcTruthChain->SetBranchAddress("mcTruthInfo", &_mcTruthInfo) == 0) {
26  return true;
27  } else
28  return false;
29 }

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