GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTHadrIntInfo.cpp
Go to the documentation of this file.
1 /*
2  * GGSTHadrIntInfo.cpp
3  *
4  * Created on: 08 Jun 2011
5  * Author: Nicola Mori
6  */
7 
10 #include "montecarlo/dataobjs/GGSTHadrIntInfo.h"
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
14  products(NULL) {
15  Clear();
16 }
17 
18 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20  delete products;
21 }
22 
23 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
24 
25 void GGSTHadrIntInfo::Clear(Option_t *) {
26  primary.Clear();
27  targetPDGCode = 0;
28  originalTrackID = 0;
29  processName = "";
30  if (products)
31  products->Clear("C");
32 }
33 
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
37  if (products) {
38  return products->GetEntries();
39  }
40  else {
41  return -1;
42  }
43 }
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48  int nProducts = GetNProducts();
49  if (iProduct < nProducts && iProduct > -1) {
50  return (GGSTParticle*) (products->At(iProduct));
51  }
52  else {
53  return NULL;
54  }
55 }
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
59 ClassImp(GGSTHadrIntInfo)
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Int_t originalTrackID
Track ID of the original primary particle.
GGSTParticle primary
The particle originating the interaction.
GGSTParticle * GetProduct(int iProduct)
Retrieves the particles produced in the interaction.
int GetNProducts()
Returns the number of particles produced in the interaction.
TClonesArray * products
Particles produced in the interaction.
void Clear(Option_t *option)
Resets data members.
A simple class to carry informations about hadronic interactions.
Class to store G4 particles.
Definition: GGSTParticle.h:19
~GGSTHadrIntInfo()
Destructor.
Int_t targetPDGCode
PDG code of target nucleus.
void Clear(Option_t *="")
Resets all the members.
GGSTHadrIntInfo()
Constructor.
TString processName
Hadronic process name.