G4Particle.h
Go to the documentation of this file.
1 /*
2  * G4Particle.h
3  *
4  * Created on: Feb 18, 2021
5  * Author: chilgenb
6  */
7 
8 #ifndef GARANA_G4PARTICLE_H_
9 #define GARANA_G4PARTICLE_H_
10 
11 #include <TLorentzVector.h>
12 #include <climits>
13 #include <vector>
14 #include <utility>
15 #include <string>
16 
17 using std::vector;
18 using std::pair;
19 using std::string;
20 
21 namespace garana {
22 
23  class G4Particle {
24 
25  public:
27 
28  #ifndef __GCCXML__
29 
30  G4Particle(const int& npts, const int& pdg, const int& parentPdg, const int& progenitorPdg, const int& trackId,
31  const int& parentTrackId, const int& progenitorTrackId, const int& processI,
32  const int& processF, const vector<pair<TLorentzVector,TLorentzVector>>& positions,
33  const vector<pair<TLorentzVector,TLorentzVector>>& momenta, const vector<int>& regions, const vector<size_t>& nptsPerRegion ):
34  fNpts(npts),
35  fPdg(pdg),
36  fParentPdg(parentPdg),
37  fProgenitorPdg(progenitorPdg),
38  fTrackId(trackId),
39  fParentTrackId(parentTrackId),
40  fProgenitorTrackId(progenitorTrackId),
41  fProcessI(processI),
42  fProcessF(processF),
43  fR(positions),
44  fP(momenta),
45  fRegions(regions),
46  fNptsPerRegion(nptsPerRegion)
47  {}
48  //default dest'or
49 
50  int const& NPoints() const { return fNpts; }
51  int const& PDG() const { return fPdg; }
52  int const& ParentPDG() const { return fParentPdg; }
53  int const& ProgenitorPDG() const { return fProgenitorPdg; }
54  int const& TrackID() const { return fTrackId; }
55  int const& ParentTrackID() const { return fParentTrackId; }
56  int const& ProgenitorTrackID() const { return fProgenitorTrackId; }
57  int const& ProcessI() const { return fProcessI; }
58  int const& ProcessF() const { return fProcessF; }
59  const TLorentzVector* PositionEnter(const size_t& iregion) const { return &fR.at(iregion).first ; }
60  const TLorentzVector* PositionExit(const size_t& iregion) const { return &fR.at(iregion).second ; }
61  const TLorentzVector* MomentumEnter(const size_t& iregion) const { return &fP.at(iregion).first ; }
62  const TLorentzVector* MomentumExit(const size_t& iregion) const { return &fP.at(iregion).second ; }
63  int Region(const size_t& iregion) const { return fRegions.at(iregion); }
64  size_t NPointsPerRegion(const size_t& iregion) const { return fNptsPerRegion.at(iregion); }
65  size_t NRegions() const { return fRegions.size(); }
66 
67  #endif
68 
69  private:
70 
71  int fNpts = INT_MAX; ///< number of G4 steps (i.e. trajectory points)
72  int fPdg = INT_MAX; ///< particle PDG code
73  int fParentPdg = INT_MAX; ///< particle parent's PDG code
74  int fProgenitorPdg = INT_MAX; ///< FS particle from gen stage that led to this one
75  int fTrackId = INT_MAX; ///< particle trackID
76  int fParentTrackId = INT_MAX; ///< particle's parent's trackID
77  int fProgenitorTrackId = INT_MAX; ///< FS particle from gen stage that led to this one
78  int fProcessI = INT_MAX; ///< process that produced the particle
79  int fProcessF = INT_MAX; ///< process that killed the particle
80  vector<pair<TLorentzVector,TLorentzVector>> fR; ///< particle 4-position at entry (first) and exit (second) points for selected geometric regions
81  vector<pair<TLorentzVector,TLorentzVector>> fP; ///< particle 4-momentum at entry (first) and exit (second) points for selected geometric regions
82  vector<int> fRegions; ///< region numbers (e.g. tpc inactive (2), tpc active (1), tpcFiducial(0), eCal (3))
83  vector<size_t> fNptsPerRegion; ///< number of trajectory points (G4 steps) per region of interest
84 
85  };//class
86 }//namepsace
87 #endif /* GARANA_G4PARTICLE_H_ */
const TLorentzVector * MomentumEnter(const size_t &iregion) const
Definition: G4Particle.h:61
G4Particle(const int &npts, const int &pdg, const int &parentPdg, const int &progenitorPdg, const int &trackId, const int &parentTrackId, const int &progenitorTrackId, const int &processI, const int &processF, const vector< pair< TLorentzVector, TLorentzVector >> &positions, const vector< pair< TLorentzVector, TLorentzVector >> &momenta, const vector< int > &regions, const vector< size_t > &nptsPerRegion)
Definition: G4Particle.h:30
vector< int > fRegions
region numbers (e.g. tpc inactive (2), tpc active (1), tpcFiducial(0), eCal (3))
Definition: G4Particle.h:82
int const & NPoints() const
Definition: G4Particle.h:50
size_t NPointsPerRegion(const size_t &iregion) const
Definition: G4Particle.h:64
std::string string
Definition: nybbler.cc:12
int fNpts
number of G4 steps (i.e. trajectory points)
Definition: G4Particle.h:71
int const & ProcessI() const
Definition: G4Particle.h:57
size_t NRegions() const
Definition: G4Particle.h:65
struct vector vector
vector< pair< TLorentzVector, TLorentzVector > > fR
particle 4-position at entry (first) and exit (second) points for selected geometric regions ...
Definition: G4Particle.h:80
int fProgenitorTrackId
FS particle from gen stage that led to this one.
Definition: G4Particle.h:77
const TLorentzVector * MomentumExit(const size_t &iregion) const
Definition: G4Particle.h:62
int fProgenitorPdg
FS particle from gen stage that led to this one.
Definition: G4Particle.h:74
int const & ParentTrackID() const
Definition: G4Particle.h:55
vector< pair< TLorentzVector, TLorentzVector > > fP
particle 4-momentum at entry (first) and exit (second) points for selected geometric regions ...
Definition: G4Particle.h:81
const TLorentzVector * PositionExit(const size_t &iregion) const
Definition: G4Particle.h:60
int const & ParentPDG() const
Definition: G4Particle.h:52
size_t size
Definition: lodepng.cpp:55
int const & ProcessF() const
Definition: G4Particle.h:58
int fParentPdg
particle parent&#39;s PDG code
Definition: G4Particle.h:73
const TLorentzVector * PositionEnter(const size_t &iregion) const
Definition: G4Particle.h:59
int fPdg
particle PDG code
Definition: G4Particle.h:72
int fParentTrackId
particle&#39;s parent&#39;s trackID
Definition: G4Particle.h:76
int const & TrackID() const
Definition: G4Particle.h:54
vector< size_t > fNptsPerRegion
number of trajectory points (G4 steps) per region of interest
Definition: G4Particle.h:83
int const & PDG() const
Definition: G4Particle.h:51
int Region(const size_t &iregion) const
Definition: G4Particle.h:63
int fTrackId
particle trackID
Definition: G4Particle.h:75
int const & ProgenitorPDG() const
Definition: G4Particle.h:53
int const & ProgenitorTrackID() const
Definition: G4Particle.h:56
int fProcessF
process that killed the particle
Definition: G4Particle.h:79
int fProcessI
process that produced the particle
Definition: G4Particle.h:78