LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MCTrack.h
Go to the documentation of this file.
1 
15 #ifndef MCTRACK_H
16 #define MCTRACK_H
17 
20 #include <vector>
21 
22 namespace sim {
23 
27  class MCTrack : public std::vector<sim::MCStep> {
28 
29  public:
31  MCTrack() : std::vector<sim::MCStep>() { Clear(); }
32 
34  virtual ~MCTrack() {}
35 
36  void Clear();
37 
38  simb::Origin_t Origin() const { return fOrigin; }
39  int PdgCode() const { return fPDGCode; }
40  unsigned int TrackID() const { return fTrackID; }
41  const std::string& Process() const { return fProcess; }
42  const MCStep& Start() const { return fStart; }
43  const MCStep& End() const { return fEnd; }
44  const std::vector<std::vector<double>>& dQdx() const
45  {
46  return fdQdx;
47  } // dQdx[# of MCSteps][# of plane]
48  const std::vector<double>& dEdx() const { return fdEdx; } // dEdx[# of MCSteps]
49 
50  int MotherPdgCode() const { return fMotherPDGCode; }
51  unsigned int MotherTrackID() const { return fMotherTrackID; }
52  const std::string& MotherProcess() const { return fMotherProcess; }
53  const MCStep& MotherStart() const { return fMotherStart; }
54  const MCStep& MotherEnd() const { return fMotherEnd; }
55 
56  int AncestorPdgCode() const { return fAncestorPDGCode; }
57  unsigned int AncestorTrackID() const { return fAncestorTrackID; }
58  const std::string& AncestorProcess() const { return fMotherProcess; }
59  const MCStep& AncestorStart() const { return fAncestorStart; }
60  const MCStep& AncestorEnd() const { return fAncestorEnd; }
61 
62  void Origin(simb::Origin_t o) { fOrigin = o; }
63  void PdgCode(int id) { fPDGCode = id; }
64  void TrackID(unsigned int id) { fTrackID = id; }
65  void Process(std::string name) { fProcess = name; }
66  void Start(const MCStep s) { fStart = s; }
67  void End(const MCStep s) { fEnd = s; }
68  void dEdx(const std::vector<double> s) { fdEdx = s; }
69  void dQdx(const std::vector<std::vector<double>> s) { fdQdx = s; }
70 
71  void MotherPdgCode(int id) { fMotherPDGCode = id; }
72  void MotherTrackID(unsigned int id) { fMotherTrackID = id; }
73  void MotherProcess(const std::string& n) { fMotherProcess = n; }
74  void MotherStart(const MCStep& s) { fMotherStart = s; }
75  void MotherEnd(const MCStep& s) { fMotherEnd = s; }
76 
77  void AncestorPdgCode(int id) { fAncestorPDGCode = id; }
78  void AncestorTrackID(unsigned int id) { fAncestorTrackID = id; }
79  void AncestorProcess(const std::string& n) { fAncestorProcess = n; }
80  void AncestorStart(const MCStep& s) { fAncestorStart = s; }
81  void AncestorEnd(const MCStep& s) { fAncestorEnd = s; }
82 
83  protected:
85  int fPDGCode;
86  unsigned int fTrackID;
87  std::string fProcess;
90  std::vector<std::vector<double>>
91  fdQdx; //< the G4 electron yeild per plane between each step // [N Plane][MCSteps - 1]
92  std::vector<double>
93  fdEdx; //< the G4 "ionization" energy loss between each step // [MCSteps - 1]
94 
96  unsigned int fMotherTrackID;
97  std::string fMotherProcess;
100 
102  unsigned int fAncestorTrackID;
103  std::string fAncestorProcess;
106  };
107 }
108 #endif
109  // end of doxygen group
MCStep fStart
G4 start position/momentum of this track particle.
Definition: MCTrack.h:88
MCStep fMotherEnd
This particle&#39;s mother&#39;s G4 end position/momentum.
Definition: MCTrack.h:99
unsigned int fAncestorTrackID
This particle&#39;s ancestor&#39;s G4 track ID.
Definition: MCTrack.h:102
simb::Origin_t Origin() const
Definition: MCTrack.h:38
void Origin(simb::Origin_t o)
Definition: MCTrack.h:62
const std::vector< std::vector< double > > & dQdx() const
Definition: MCTrack.h:44
void dEdx(const std::vector< double > s)
Definition: MCTrack.h:68
std::string fProcess
G4 creation process of this track particle.
Definition: MCTrack.h:87
const std::string & AncestorProcess() const
Definition: MCTrack.h:58
std::vector< double > fdEdx
Definition: MCTrack.h:93
void Clear()
Definition: MCTrack.cxx:5
enum simb::_ev_origin Origin_t
event origin types
const MCStep & MotherEnd() const
Definition: MCTrack.h:54
unsigned int AncestorTrackID() const
Definition: MCTrack.h:57
void AncestorTrackID(unsigned int id)
Definition: MCTrack.h:78
STL namespace.
int AncestorPdgCode() const
Definition: MCTrack.h:56
const MCStep & End() const
Definition: MCTrack.h:43
Class def header for mcstep data container.
void TrackID(unsigned int id)
Definition: MCTrack.h:64
unsigned int MotherTrackID() const
Definition: MCTrack.h:51
int fPDGCode
PDG code of this track particle.
Definition: MCTrack.h:85
int fMotherPDGCode
This particle&#39;s mother&#39;s PDG code.
Definition: MCTrack.h:95
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
void MotherTrackID(unsigned int id)
Definition: MCTrack.h:72
void PdgCode(int id)
Definition: MCTrack.h:63
void dQdx(const std::vector< std::vector< double >> s)
Definition: MCTrack.h:69
void AncestorProcess(const std::string &n)
Definition: MCTrack.h:79
MCStep fEnd
G4 end position/momentum of this track particle.
Definition: MCTrack.h:89
int fAncestorPDGCode
This particle&#39;s ancestor&#39;s PDG code.
Definition: MCTrack.h:101
const MCStep & AncestorStart() const
Definition: MCTrack.h:59
Monte Carlo Simulation.
void Start(const MCStep s)
Definition: MCTrack.h:66
int PdgCode() const
Definition: MCTrack.h:39
simb::Origin_t fOrigin
Origin of this particle (see simb::Origin_t)
Definition: MCTrack.h:84
void AncestorEnd(const MCStep &s)
Definition: MCTrack.h:81
void AncestorStart(const MCStep &s)
Definition: MCTrack.h:80
const MCStep & MotherStart() const
Definition: MCTrack.h:53
MCStep fAncestorEnd
This particle&#39;s ancestor&#39;s G4 start position/momentum.
Definition: MCTrack.h:105
int MotherPdgCode() const
Definition: MCTrack.h:50
std::string fMotherProcess
This particle&#39;s mother&#39;s G4 process name.
Definition: MCTrack.h:97
unsigned int fTrackID
G4 track ID.
Definition: MCTrack.h:86
MCStep fAncestorStart
This particle&#39;s ancestor&#39;s G4 start position/momentum.
Definition: MCTrack.h:104
unsigned int fMotherTrackID
This particle&#39;s mother&#39;s G4 track ID.
Definition: MCTrack.h:96
const std::string & Process() const
Definition: MCTrack.h:41
const std::string & MotherProcess() const
Definition: MCTrack.h:52
std::vector< std::vector< double > > fdQdx
Definition: MCTrack.h:91
MCStep fMotherStart
This particle&#39;s mother&#39;s G4 start position/momentum.
Definition: MCTrack.h:98
void Process(std::string name)
Definition: MCTrack.h:65
void MotherStart(const MCStep &s)
Definition: MCTrack.h:74
const MCStep & Start() const
Definition: MCTrack.h:42
Char_t n[5]
void End(const MCStep s)
Definition: MCTrack.h:67
unsigned int TrackID() const
Definition: MCTrack.h:40
const std::vector< double > & dEdx() const
Definition: MCTrack.h:48
virtual ~MCTrack()
Default destructor.
Definition: MCTrack.h:34
std::string fAncestorProcess
This particle&#39;s ancestor&#39;s G4 process name.
Definition: MCTrack.h:103
void MotherPdgCode(int id)
Definition: MCTrack.h:71
const MCStep & AncestorEnd() const
Definition: MCTrack.h:60
void AncestorPdgCode(int id)
Definition: MCTrack.h:77
MCTrack()
Default constructor.
Definition: MCTrack.h:31
void MotherProcess(const std::string &n)
Definition: MCTrack.h:73
void MotherEnd(const MCStep &s)
Definition: MCTrack.h:75