GGS(GenericGEANT4Simulation)Software  2.6.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/readers/GGSTChainReader.h"
15 #include "montecarlo/dataobjs/GGSTMCTruthInfo.h"
16 
17 //ROOT headers
18 class TBranch;
19 
26 
27 public:
28 
31 
34 
41  bool SetChain(TChain *mcTruthChain);
42 
47  void GetEntry(Long64_t entry);
48 
54  GGSTParticle *GetPrimaryParticle(UInt_t particleNumber) {
55  if (_mcTruthInfo)
56  return _mcTruthInfo->GetPrimaryParticle(particleNumber);
57  else
58  return NULL;
59  }
60 
65  UInt_t GetNPrimaries() {
66  if (_mcTruthInfo)
67  return _mcTruthInfo->GetNPrimaries();
68  else
69  return 0;
70  }
71 
77  UInt_t GetNDiscarded() {
78  if (_mcTruthInfo)
79  return _mcTruthInfo->nDiscarded;
80  else
81  return 0;
82  }
83 
84 private:
85 
86  GGSTMCTruthInfo *_mcTruthInfo;
87  TChain *_mcTruthChain;
88 };
89 
90 #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...