1
/* This file is part of MAUS: http:// micewww.pp.rl.ac.uk:8080/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http:// www.gnu.org/licenses/>.
20
#ifndef COMMON_CPP_RECONSTRUCTION_TRACK_POINT_HH
21
#define COMMON_CPP_RECONSTRUCTION_TRACK_POINT_HH
25
#include "DataStructure/Step.hh"
26
#include "src/common_cpp/Optics/PhaseSpaceVector.hh"
27
#include "src/common_cpp/Simulation/MAUSPrimaryGeneratorAction.hh"
28
#include "Recon/Global/Particle.hh"
29
#include "Recon/Global/Detector.hh"
33
class CovarianceMatrix;
39
/* @class TrackPoint a phase space vector with redundant t/E and z/Pz
40
* coordinates as well as an ID that links the track to the detector that
43
* The redundant sets of coordinates can be filled in by explicitly using the
44
* FillInCoordinates() function or by setting all of the coordinates at once
45
* using the array or parameterised constructors (which implicitly call
46
* FillInCoordinates()). If t < 0 it fills in t and E from z, Pz, and the given
47
* mass parameter. If t >= 0 and z < 0, it fills in z and Pz from t, E, and
50
class TrackPoint : public MAUS::PhaseSpaceVector {
52
/* @brief Construct with all elements initialized to zero and
53
* phase space type temporal.
57
/* @brief Copy constructor.
59
TrackPoint(const TrackPoint & original_instance);
61
/* @brief Base class copy constructor.
63
explicit TrackPoint(const PhaseSpaceVector & original_instance,
65
const MAUS::DataStructure::Global::PID pid =
66
MAUS::DataStructure::Global::kNoPID);
68
/* @brief Vector<double> copy constructor.
70
explicit TrackPoint(const Vector<double> & original_instance,
72
const MAUS::DataStructure::Global::PID pid =
73
MAUS::DataStructure::Global::kNoPID);
75
/* @brief Create with coordinates from an array. Order is t, E, x,
78
explicit TrackPoint(double const * const array, const double z = 0.0);
80
/* @brief Reconstructed track point constructor. The track point
81
* was not generated by a detector, so an uncertanty matrix
82
* must be supplied. The detector_id field is set to
85
TrackPoint(const double time, const double energy,
86
const double x, const double px,
87
const double y, const double py,
88
const CovarianceMatrix & uncertainties, const double z = 0.0);
90
/* @brief Detector-generated track point constructor. The Detector
91
* reference is used to copy it's ID and uncertainty matrix.
94
TrackPoint(const double time, const double energy,
95
const double x, const double px,
96
const double y, const double py,
97
const Detector & detector, const double z = 0.0);
99
/* @brief This constructor is used when to create well-defined
100
* particle tracks for simulating through MICE.
102
TrackPoint(const double time, const double energy,
103
const double x, const double px,
104
const double y, const double py,
105
const MAUS::DataStructure::Global::PID particle_id,
106
const double z = 0.0);
110
TrackPoint & operator=(const TrackPoint& rhs);
112
const bool operator==(const TrackPoint& rhs) const;
114
const bool operator!=(const TrackPoint& rhs) const;
116
/* @brief Determines if the track point occurs earlier in time than
119
const bool operator<(const TrackPoint& rhs) const;
121
/* @brief Determines if the track point occurs later in time than
124
const bool operator>(const TrackPoint& rhs) const;
126
// *************************
128
// *************************
130
void set_particle_id(const MAUS::DataStructure::Global::PID id);
131
MAUS::DataStructure::Global::PID particle_id() const;
133
void set_detector_id(const MAUS::DataStructure::Global::DetectorPoint id);
134
MAUS::DataStructure::Global::DetectorPoint detector_id() const;
136
void set_uncertainties(const CovarianceMatrix & uncertainties);
137
const CovarianceMatrix & uncertainties() const;
139
double z() const {return z_;}
140
double z_momentum() const;
141
double Pz() const {return z_momentum();}
142
void set_z(const double z) {z_ = z;}
145
// = 0 if this was not measured in a detector
146
MAUS::DataStructure::Global::DetectorPoint detector_id_;
147
CovarianceMatrix uncertainties_;
148
MAUS::DataStructure::Global::PID particle_id_;
152
MAUS::MAUSPrimaryGeneratorAction::PGParticle PrimaryGeneratorParticle(
153
const TrackPoint & point);
155
std::ostream& operator<<(std::ostream& out, const TrackPoint& vector);
157
} // namespace global