All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Interaction.hh
Go to the documentation of this file.
1 #ifndef __sbnanalysis_util_Interaction__
2 #define __sbnanalysis_util_Interaction__
3 
4 #include <TVector3.h>
5 #include "nusimdata/SimulationBase/MCParticle.h"
8 
9 namespace util {
10 
11 /**
12  * Calculate CCQE energy from associated lepton information.
13  *
14  * \param l_momentum Lepton momentum (any units, used only to get angle info)
15  * \param l_energy Lepton energy in GeV
16  * \return CCQE energy in GeV.
17  */
18 double ECCQE(const TVector3& l_momentum, double l_energy);
19 
20 /**
21  *
22  * Calculate length between two points contained in a list of
23  * (non-overlapping) volumes. Units are abitrary, but must be consistent
24  * between the three inputs.
25  *
26  * \param v0 The first point
27  * \param v1 The second point
28  * \param boxes A list of non-overlapping boxes through which the
29  * contained length will be calculated.
30  * \return The contained length in units of the inputs
31  */
32 double ContainedLength(const TVector3 &v0, const TVector3 &v1,
33  const std::vector<geo::BoxBoundedGeo> &boxes);
34 
35 /**
36  * Calculated length of an MCParticle trajectory through a list of
37  * (non-overlapping) volumes.
38  *
39  * \param particle The particle to calculate the length for
40  * \param active_volumes A list of non-overlapping volumes through which
41  * the contained length will be calculated
42  * \return The length of the MCParticle trajectory contained in the
43  * active_volumes. Returns 0 if the list of volumes is empty or the
44  * particle does not contain trajectory points.
45  */
46 double MCParticleContainedLength(const simb::MCParticle &particle, const std::vector<geo::BoxBoundedGeo> &active_volumes);
47 
48 /**
49  * Calculate length of an MCParticle trajectory
50  *
51  * \param particle the MCParticle
52  * \return The length travelled by the particle. Returns 0 if the
53  * particle does not contain trajectory points.
54  */
55 double MCParticleLength(const simb::MCParticle &particle);
56 
57 } // namespace util
58 
59 #endif // __sbnanalysis_util_Interaction__
60 
double ContainedLength(const TVector3 &v0, const TVector3 &v1, const std::vector< geo::BoxBoundedGeo > &boxes)
Definition: Interaction.cxx:28
double MCParticleLength(const simb::MCParticle &particle)
Definition: Interaction.cxx:65
double ECCQE(const TVector3 &l_momentum, double l_energy)
Definition: Interaction.cxx:7
Access the description of detector geometry.
double MCParticleContainedLength(const simb::MCParticle &particle, const std::vector< geo::BoxBoundedGeo > &active_volumes)
Definition: Interaction.cxx:77
Provides a base class aware of world box coordinates.