GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTMCTruthReader.h
Go to the documentation of this file.
1 /*
2  * GGSTMCTruthReader.h
3  *
4  * Created on: 25 Aug 2011
5  * Author: Nicola Mori
6  */
7 
10 #ifndef GGSTMCTRUTHREADER_H_
11 #define GGSTMCTRUTHREADER_H_
12 
13 // GGS headers
14 #include "montecarlo/dataobjs/GGSTMCTruthInfo.h"
15 #include "montecarlo/readers/GGSTChainReader.h"
16 
17 // ROOT headers
18 class TBranch;
19 
26 
27 public:
30 
33 
40  bool SetChain(TChain *mcTruthChain);
41 
46  void GetEntry(Long64_t entry);
47 
53  GGSTParticle *GetPrimaryParticle(UInt_t particleNumber) {
54  if (_mcTruthInfo)
55  return _mcTruthInfo->GetPrimaryParticle(particleNumber);
56  else
57  return NULL;
58  }
59 
64  UInt_t GetNPrimaries() {
65  if (_mcTruthInfo)
66  return _mcTruthInfo->GetNPrimaries();
67  else
68  return 0;
69  }
70 
76  UInt_t GetNDiscarded() {
77  if (_mcTruthInfo)
78  return _mcTruthInfo->nDiscarded;
79  else
80  return 0;
81  }
82 
83 private:
84  GGSTMCTruthInfo *_mcTruthInfo;
85  TChain *_mcTruthChain;
86 };
87 
88 #endif /* GGSTMCTRUTHREADER_H_ */
UInt_t GetNPrimaries()
Retrieves the number of primaries in this event.
void GetEntry(Long64_t entry)
GGSTParticle * GetPrimaryParticle(UInt_t particleNumber)
Returns a primary particle.
~GGSTMCTruthReader()
Destructor.
Abstract class defining the interface for tree readers.
GGSTParticle * GetPrimaryParticle(UInt_t particleNumber)
Retrieves a primary particle.
Class for reading output of GGSMCTruthAction.
UInt_t GetNPrimaries()
Returns the number of primaries in current event.
Class to store G4 particles.
Definition: GGSTParticle.h:19
bool SetChain(TChain *mcTruthChain)
Sets the chain.
A class to store MC truth informations on ROOT files.
UInt_t GetNDiscarded()
Returns the number of discarded events before the current one.
GGSTMCTruthReader()
Constructor.
UInt_t nDiscarded
The number of discarded + killed events the current event and the previous event saved in file...