GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTPrimaryDisInfo.cpp
Go to the documentation of this file.
1 /*
2  * GGSTPrimaryDisInfo.cpp
3  *
4  * Created on: 1 Jun 2020
5  * Author: Nicola Mori
6  */
7 
10 #include "montecarlo/dataobjs/GGSTPrimaryDisInfo.h"
11 
12 ClassImp(GGSTPrimaryDisInfo)
13 
15  : products(nullptr) {
16  Clear();
17 }
18 
20 
21 void GGSTPrimaryDisInfo::Clear(Option_t *) {
22  primary.Clear();
23  processName = "";
24  if (products)
25  products->Clear("C");
26 }
27 
29  if (products) {
30  return products->GetEntries();
31  } else {
32  return -1;
33  }
34 }
35 
37  int nProducts = GetNProducts();
38  if (iProduct < nProducts && iProduct > -1) {
39  return (GGSTParticle *)(products->At(iProduct));
40  } else {
41  return nullptr;
42  }
43 }
GGSTParticle primary
Descriptor for the primary particle.
void Clear(Option_t *="")
Resets all the members.
int GetNProducts()
Returns the number of particles produced by the disappearance of the primary.
A simple class to carry informations about the disappearance of the primary particle.
GGSTParticle * GetProduct(int iProduct)
Retrieves a particle produced by the disappearance of the primary.
TString processName
Name of the process that made the primary disappear.
void Clear(Option_t *option)
Resets data members.
Class to store G4 particles.
Definition: GGSTParticle.h:19
~GGSTPrimaryDisInfo()
Destructor.
TClonesArray * products
Particles produced by the disappearance of the primary.