MCShower.h
Go to the documentation of this file.
1 /**
2  * \file MCShower.h
3  *
4  * \ingroup MCBase
5  *
6  * \brief Class def header for MCShower data container
7  *
8  * @author Kazu - Nevis 2014
9  */
10 
11 /** \addtogroup MCBase
12 
13  @{*/
14 
15 #ifndef MCSHOWER_H
16 #define MCSHOWER_H
17 
18 // LArSoft libraries
20 
21 // Supporting tools
23 
24 // ROOT libraries
25 #include <TVector3.h>
26 
27 // Standard C/C++ libraries
28 #include <string>
29 #include <vector>
30 # include <utility> // std::move()
31 
32 namespace sim {
33 
34  class MCShower {
35 
36  public:
37 
38  /// Default constructor; clears the local data
40 
41  /// Default destructor
42  virtual ~MCShower();
43 
44 
45  /// Clear method
46  virtual void Clear() { ClearData(); }
47 
48  //--- Getters ---//
49 
50  simb::Origin_t Origin () const { return fOrigin; }
51 
52  int PdgCode () const { return fPDGCode; }
53  unsigned int TrackID () const { return fTrackID; }
54  const std::string& Process () const { return fProcess; }
55  const MCStep& Start () const { return fStart; }
56  const MCStep& End () const { return fEnd; }
57 
58  int MotherPdgCode () const { return fMotherPDGCode; }
59  unsigned int MotherTrackID () const { return fMotherTrackID; }
60  const std::string& MotherProcess () const { return fMotherProcess; }
61  const MCStep& MotherStart () const { return fMotherStart; }
62  const MCStep& MotherEnd () const { return fMotherEnd; }
63 
64  int AncestorPdgCode () const { return fAncestorPDGCode; }
65  unsigned int AncestorTrackID () const { return fAncestorTrackID; }
66  const std::string& AncestorProcess () const { return fAncestorProcess; }
67  const MCStep& AncestorStart () const { return fAncestorStart; }
68  const MCStep& AncestorEnd () const { return fAncestorEnd; }
69 
70  const MCStep& DetProfile () const { return fDetProfile; }
71 
72  const std::vector<unsigned int>& DaughterTrackID() const { return fDaughterTrackID; }
73 
74  double Charge(size_t plane) const;
75  double dQdx(size_t plane) const;
76 
77  const std::vector<double>& Charge() const { return fPlaneCharge; }
78  const std::vector<double>& dQdx() const { return fdQdx; }
79 
80 
81  double dEdx() const { return fdEdx; }
82  const TVector3& StartDir() const {return fStartDir;}
83 
84  //--- Setters ---//
85  void Origin ( simb::Origin_t o ) { fOrigin = o; }
86 
87  void PdgCode ( int id ) { fPDGCode = id; }
88  void TrackID ( unsigned int id ) { fTrackID = id; }
89  void Process ( const std::string &name ) { fProcess = name; }
90  void Start ( const MCStep &s ) { fStart = s; }
91  void End ( const MCStep &s ) { fEnd = s; }
92  void StartDir ( const TVector3 &sdir) { fStartDir = sdir; }
93 
94  void MotherPdgCode ( int id ) { fMotherPDGCode = id; }
95  void MotherTrackID ( unsigned int id ) { fMotherTrackID = id; }
97  void MotherStart ( const MCStep& s ) { fMotherStart = s; }
98  void MotherEnd ( const MCStep& s ) { fMotherEnd = s; }
99 
100  void AncestorPdgCode ( int id ) { fAncestorPDGCode = id; }
101  void AncestorTrackID ( unsigned int id ) { fAncestorTrackID = id; }
103  void AncestorStart ( const MCStep& s ) { fAncestorStart = s; }
104  void AncestorEnd ( const MCStep& s ) { fAncestorEnd = s; }
105 
106  void DetProfile ( const MCStep& s) { fDetProfile = s; }
107 
108  void DaughterTrackID ( const std::vector<unsigned int>& id_v ) { fDaughterTrackID = id_v; }
109 
110  /// Copies the specified charge vector (one entry per plane) into this object
111  void Charge (const std::vector<double>& q) { fPlaneCharge = q; }
112  /// Moves the specified charge vector (one entry per plane) into this object
113  void Charge (std::vector<double>&& q) { fPlaneCharge = std::move(q); }
114 
115  /// Copies the specified dQ/dx vector (one entry per plane) into this object
116  void dQdx (const std::vector<double>& dqdx) { fdQdx = dqdx; }
117  /// Moves the specified dQ/dx vector (one entry per plane) into this object
118  void dQdx (std::vector<double>&& dqdx) { fdQdx = std::move(dqdx); }
119 
120  void dEdx (double dedx) {fdEdx = dedx;}
121  void dEdxRAD (double dedx) {fdEdx_radial = dedx;}
122 
123 
124 
125 
126  protected:
127 
128  /// @{
129  /// @name Origin info
130  simb::Origin_t fOrigin; ///< Origin information
131  /// @}
132 
133  /// @{
134  /// @name Shower particle info
135  int fPDGCode; ///< Shower particle PDG code
136  unsigned int fTrackID; ///< Shower particle G4 track ID
137  std::string fProcess; ///< Shower particle's creation process
138  MCStep fStart; ///< Shower particle's G4 start point
139  MCStep fEnd; ///< Shower particle's G4 end point
140  TVector3 fStartDir; ///< Shower Starting Direction, within the first 2.4cm
141  /// @}
142 
143 
144  /// @{
145  /// @name Mother's particle info
146  int fMotherPDGCode; ///< Shower's mother PDG code
147  unsigned int fMotherTrackID; ///< Shower's mother G4 track ID
148  std::string fMotherProcess; ///< Shower's mother creation process
149  MCStep fMotherStart; ///< Shower's mother G4 start point
150  MCStep fMotherEnd; ///< Shower's mother G4 end point
151  /// @}
152 
153  /// @{
154  /// @name Ancestor's particle info
155  int fAncestorPDGCode; ///< Shower's ancestor PDG code
156  unsigned int fAncestorTrackID; ///< Shower's ancestor G4 track ID
157  std::string fAncestorProcess; ///< Shower's ancestor creation process
158  MCStep fAncestorStart; ///< Shower's ancestor G4 start point
159  MCStep fAncestorEnd; ///< Shower's ancestor G4 end point
160  /// @}
161 
162  /// @{
163  /// @name Energy deposition info
164  std::vector<unsigned int> fDaughterTrackID; ///< Daughters' track ID
165  MCStep fDetProfile; ///< Combined energy deposition information
166  double fdEdx; ///< Shower True dEdx
167  double fdEdx_radial; ///< Shower True dEdx, with a radial requirement
168  /// @}
169 
170 
171  /// @{
172  /// @name Charge per plane
173  std::vector<double> fPlaneCharge; ///< Charge deposit per plane
174  std::vector<double> fdQdx; ///< Charge deposit per plane
175  /// @}
176 
177 
178  /// Clears the fields of this class
179  void ClearData();
180 
181  }; // class MCShower
182 
183 } // namespace sim
184 
185 #endif // MCSHOWER_H
186 /** @} */ // end of doxygen group
static QCString name
Definition: declinfo.cpp:673
const std::vector< double > & dQdx() const
Definition: MCShower.h:78
virtual ~MCShower()
Default destructor.
int fMotherPDGCode
Shower&#39;s mother PDG code.
Definition: MCShower.h:146
const MCStep & End() const
Definition: MCShower.h:56
void AncestorPdgCode(int id)
Definition: MCShower.h:100
void ClearData()
Clears the fields of this class.
Definition: MCShower.cxx:11
void PdgCode(int id)
Definition: MCShower.h:87
void dQdx(std::vector< double > &&dqdx)
Moves the specified dQ/dx vector (one entry per plane) into this object.
Definition: MCShower.h:118
void MotherPdgCode(int id)
Definition: MCShower.h:94
unsigned int TrackID() const
Definition: MCShower.h:53
std::string string
Definition: nybbler.cc:12
unsigned int fAncestorTrackID
Shower&#39;s ancestor G4 track ID.
Definition: MCShower.h:156
void Origin(simb::Origin_t o)
Definition: MCShower.h:85
enum simb::_ev_origin Origin_t
event origin types
void MotherTrackID(unsigned int id)
Definition: MCShower.h:95
void Charge(std::vector< double > &&q)
Moves the specified charge vector (one entry per plane) into this object.
Definition: MCShower.h:113
int PdgCode() const
Definition: MCShower.h:52
MCStep fStart
Shower particle&#39;s G4 start point.
Definition: MCShower.h:138
unsigned int fTrackID
Shower particle G4 track ID.
Definition: MCShower.h:136
MCStep fDetProfile
Combined energy deposition information.
Definition: MCShower.h:165
void AncestorTrackID(unsigned int id)
Definition: MCShower.h:101
Class def header for mcstep data container.
void StartDir(const TVector3 &sdir)
Definition: MCShower.h:92
void dQdx(const std::vector< double > &dqdx)
Copies the specified dQ/dx vector (one entry per plane) into this object.
Definition: MCShower.h:116
void MotherStart(const MCStep &s)
Definition: MCShower.h:97
unsigned int fMotherTrackID
Shower&#39;s mother G4 track ID.
Definition: MCShower.h:147
void Charge(const std::vector< double > &q)
Copies the specified charge vector (one entry per plane) into this object.
Definition: MCShower.h:111
std::string fAncestorProcess
Shower&#39;s ancestor creation process.
Definition: MCShower.h:157
int fPDGCode
Shower particle PDG code.
Definition: MCShower.h:135
const std::vector< unsigned int > & DaughterTrackID() const
Definition: MCShower.h:72
const TVector3 & StartDir() const
Definition: MCShower.h:82
void AncestorEnd(const MCStep &s)
Definition: MCShower.h:104
int fAncestorPDGCode
Shower&#39;s ancestor PDG code.
Definition: MCShower.h:155
simb::Origin_t Origin() const
Definition: MCShower.h:50
double fdEdx_radial
Definition: MCShower.h:167
int MotherPdgCode() const
Definition: MCShower.h:58
const std::string & AncestorProcess() const
Definition: MCShower.h:66
std::string fProcess
Shower particle&#39;s creation process.
Definition: MCShower.h:137
double fdEdx
Shower True dEdx.
Definition: MCShower.h:166
std::string fMotherProcess
Shower&#39;s mother creation process.
Definition: MCShower.h:148
MCStep fMotherStart
Shower&#39;s mother G4 start point.
Definition: MCShower.h:149
def move(depos, offset)
Definition: depos.py:107
std::vector< double > fdQdx
Definition: MCShower.h:174
void Start(const MCStep &s)
Definition: MCShower.h:90
void DaughterTrackID(const std::vector< unsigned int > &id_v)
Definition: MCShower.h:108
const MCStep & AncestorStart() const
Definition: MCShower.h:67
const std::string & MotherProcess() const
Definition: MCShower.h:60
Code to link reconstructed objects back to the MC truth information.
simb::Origin_t fOrigin
Definition: MCShower.h:130
void DetProfile(const MCStep &s)
Definition: MCShower.h:106
void AncestorStart(const MCStep &s)
Definition: MCShower.h:103
double dEdx() const
Definition: MCShower.h:81
unsigned int AncestorTrackID() const
Definition: MCShower.h:65
const MCStep & AncestorEnd() const
Definition: MCShower.h:68
const MCStep & DetProfile() const
Definition: MCShower.h:70
void MotherProcess(const std::string &name)
Definition: MCShower.h:96
const MCStep & Start() const
Definition: MCShower.h:55
void dEdxRAD(double dedx)
Definition: MCShower.h:121
MCStep fEnd
Shower particle&#39;s G4 end point.
Definition: MCShower.h:139
std::vector< unsigned int > fDaughterTrackID
Daughters&#39; track ID.
Definition: MCShower.h:164
void End(const MCStep &s)
Definition: MCShower.h:91
const MCStep & MotherEnd() const
Definition: MCShower.h:62
const std::vector< double > & Charge() const
Definition: MCShower.h:77
MCShower()
Default constructor; clears the local data.
Definition: MCShower.h:39
TVector3 fStartDir
Definition: MCShower.h:140
unsigned int MotherTrackID() const
Definition: MCShower.h:59
const std::string & Process() const
Definition: MCShower.h:54
std::vector< double > fPlaneCharge
Charge deposit per plane.
Definition: MCShower.h:173
const MCStep & MotherStart() const
Definition: MCShower.h:61
void dEdx(double dedx)
Definition: MCShower.h:120
void TrackID(unsigned int id)
Definition: MCShower.h:88
int AncestorPdgCode() const
Definition: MCShower.h:64
MCStep fMotherEnd
Definition: MCShower.h:150
virtual void Clear()
Clear method.
Definition: MCShower.h:46
MCStep fAncestorStart
Shower&#39;s ancestor G4 start point.
Definition: MCShower.h:158
MCStep fAncestorEnd
Definition: MCShower.h:159
static QCString * s
Definition: config.cpp:1042
void MotherEnd(const MCStep &s)
Definition: MCShower.h:98
void Process(const std::string &name)
Definition: MCShower.h:89
void AncestorProcess(const std::string &name)
Definition: MCShower.h:102