GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTMCTruthInfo.cpp
Go to the documentation of this file.
1 /*
2  * GGSTMCTruthInfo.cpp
3  *
4  * Created on: 17 Aug 2011
5  * Author: Nicola Mori
6  */
7 
10 #include "montecarlo/dataobjs/GGSTMCTruthInfo.h"
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13 /* **************************************** *
14  * GGSTMCTruthInfo class implementation *
15  * **************************************** */
16 
17 ClassImp(GGSTMCTruthInfo)
18 
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
21  eventID(-1), nDiscarded(0) {
22  _primaries = new TClonesArray("GGSTParticle");
23 }
24 
25 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
27  delete _primaries;
28 }
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
33  nDiscarded = 0;
34  eventID = -1;
35  _primaries->Clear("C");
36 }
37 
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
39 
41 
42  if (particleNumber < (UInt_t) (_primaries->GetEntries())) {
43  return (GGSTParticle*) (_primaries->At(particleNumber));
44  }
45  else
46  return NULL;
47 }
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52 
53  Int_t n = _primaries->GetEntries();
54  new ((*_primaries)[n]) GGSTParticle(*primaryParticle);
55 
56 }
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
GGSTParticle * GetPrimaryParticle(UInt_t particleNumber)
Retrieves a primary particle.
void Reset()
Resets the object&#39;s properties.
Class to store G4 particles.
Definition: GGSTParticle.h:19
~GGSTMCTruthInfo()
Destructor.
void AddPrimaryParticle(GGSTParticle *primaryParticle)
Adds a primary particle to the particles&#39; array.
A class to store MC truth informations on ROOT files.
Int_t eventID
The event ID.
UInt_t nDiscarded
The number of discarded + killed events the current event and the previous event saved in file...