GGS(GenericGEANT4Simulation)Software
2.7.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Macros
src
montecarlo
dataobjs
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......
20
GGSTMCTruthInfo
::
GGSTMCTruthInfo
()
21
: eventID(-1), nDiscarded(0) {
22
_primaries =
new
TClonesArray(
"GGSTParticle"
);
23
}
24
25
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
26
GGSTMCTruthInfo::~GGSTMCTruthInfo
() {
delete
_primaries; }
27
28
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29
30
void
GGSTMCTruthInfo::Reset
() {
31
nDiscarded
= 0;
32
eventID
= -1;
33
_primaries->Clear(
"C"
);
34
}
35
36
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37
38
GGSTParticle
*
GGSTMCTruthInfo::GetPrimaryParticle
(UInt_t particleNumber) {
39
40
if
(particleNumber < (UInt_t)(_primaries->GetEntries())) {
41
return
(
GGSTParticle
*)(_primaries->At(particleNumber));
42
}
else
43
return
NULL;
44
}
45
46
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47
48
void
GGSTMCTruthInfo::AddPrimaryParticle
(
GGSTParticle
*primaryParticle) {
49
50
Int_t n = _primaries->GetEntries();
51
new
((*_primaries)[n])
GGSTParticle
(*primaryParticle);
52
}
53
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
GGSTMCTruthInfo::GetPrimaryParticle
GGSTParticle * GetPrimaryParticle(UInt_t particleNumber)
Retrieves a primary particle.
Definition:
GGSTMCTruthInfo.cpp:38
GGSTMCTruthInfo::Reset
void Reset()
Resets the object's properties.
Definition:
GGSTMCTruthInfo.cpp:30
GGSTParticle
Class to store G4 particles.
Definition:
GGSTParticle.h:19
GGSTMCTruthInfo::~GGSTMCTruthInfo
~GGSTMCTruthInfo()
Destructor.
Definition:
GGSTMCTruthInfo.cpp:26
GGSTMCTruthInfo::AddPrimaryParticle
void AddPrimaryParticle(GGSTParticle *primaryParticle)
Adds a primary particle to the particles' array.
Definition:
GGSTMCTruthInfo.cpp:48
GGSTMCTruthInfo
A class to store MC truth informations on ROOT files.
Definition:
GGSTMCTruthInfo.h:20
GGSTMCTruthInfo::eventID
Int_t eventID
The event ID.
Definition:
GGSTMCTruthInfo.h:56
GGSTMCTruthInfo::nDiscarded
UInt_t nDiscarded
The number of discarded + killed events the current event and the previous event saved in file...
Definition:
GGSTMCTruthInfo.h:66
Generated on Wed Jul 8 2020 07:29:44 for GGS(GenericGEANT4Simulation)Software by
1.8.5