~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/common_cpp/Recon/Global/TrackPoint.hh

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of MAUS: http://  micewww.pp.rl.ac.uk:8080/projects/maus
2
 
 * 
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.
7
 
 * 
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.
12
 
 * 
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/>.
15
 
 */
16
 
 
17
 
/* Author: Peter Lane
18
 
 */
19
 
 
20
 
#ifndef COMMON_CPP_RECONSTRUCTION_TRACK_POINT_HH
21
 
#define COMMON_CPP_RECONSTRUCTION_TRACK_POINT_HH
22
 
 
23
 
#include <iostream>
24
 
 
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"
30
 
 
31
 
namespace MAUS {
32
 
 
33
 
class CovarianceMatrix;
34
 
class Vector<double>;
35
 
 
36
 
namespace recon {
37
 
namespace global {
38
 
 
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
41
 
 * measured it.
42
 
 *
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
48
 
 * the mass.
49
 
 */
50
 
class TrackPoint : public MAUS::PhaseSpaceVector {
51
 
 public:
52
 
  /* @brief  Construct with all elements initialized to zero and
53
 
   *         phase space type temporal.
54
 
   */
55
 
  TrackPoint();
56
 
 
57
 
  /* @brief  Copy constructor.
58
 
   */
59
 
  TrackPoint(const TrackPoint & original_instance);
60
 
 
61
 
  /* @brief  Base class copy constructor.
62
 
   */
63
 
  explicit TrackPoint(const PhaseSpaceVector & original_instance,
64
 
                      const double z = 0.0,
65
 
                      const MAUS::DataStructure::Global::PID pid =
66
 
                      MAUS::DataStructure::Global::kNoPID);
67
 
 
68
 
  /* @brief  Vector<double> copy constructor.
69
 
   */
70
 
  explicit TrackPoint(const Vector<double> & original_instance,
71
 
                      const double z = 0.0,
72
 
                      const MAUS::DataStructure::Global::PID pid =
73
 
                      MAUS::DataStructure::Global::kNoPID);
74
 
 
75
 
  /* @brief Create with coordinates from an array.  Order is t, E, x,
76
 
   *        Px, y, Py.
77
 
   */
78
 
  explicit TrackPoint(double const * const array, const double z = 0.0);
79
 
 
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
83
 
   *         kUndefined.
84
 
   */
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);
89
 
 
90
 
  /* @brief  Detector-generated track point constructor. The Detector
91
 
   *         reference is used to copy it's ID and uncertainty matrix.
92
 
   * 
93
 
   */
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);
98
 
 
99
 
  /* @brief  This constructor is used when to create well-defined
100
 
   *         particle tracks for simulating through MICE.
101
 
   */
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);
107
 
 
108
 
  ~TrackPoint();
109
 
 
110
 
  TrackPoint & operator=(const TrackPoint& rhs);
111
 
 
112
 
  const bool operator==(const TrackPoint& rhs) const;
113
 
 
114
 
  const bool operator!=(const TrackPoint& rhs) const;
115
 
 
116
 
  /* @brief  Determines if the track point occurs earlier in time than
117
 
   *         another.
118
 
   */
119
 
  const bool operator<(const TrackPoint& rhs) const;
120
 
 
121
 
  /* @brief  Determines if the track point occurs later in time than
122
 
   *         another.
123
 
   */
124
 
  const bool operator>(const TrackPoint& rhs) const;
125
 
 
126
 
  // *************************
127
 
  //       Accessors
128
 
  // *************************
129
 
 
130
 
  void set_particle_id(const MAUS::DataStructure::Global::PID id);
131
 
  MAUS::DataStructure::Global::PID particle_id() const;
132
 
 
133
 
  void set_detector_id(const MAUS::DataStructure::Global::DetectorPoint id);
134
 
  MAUS::DataStructure::Global::DetectorPoint detector_id() const;
135
 
 
136
 
  void set_uncertainties(const CovarianceMatrix & uncertainties);
137
 
  const CovarianceMatrix & uncertainties() const;
138
 
 
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;}
143
 
 
144
 
 protected:
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_;
149
 
  double z_;
150
 
};
151
 
 
152
 
MAUS::MAUSPrimaryGeneratorAction::PGParticle PrimaryGeneratorParticle(
153
 
    const TrackPoint & point);
154
 
 
155
 
std::ostream& operator<<(std::ostream& out, const TrackPoint& vector);
156
 
 
157
 
}  // namespace global
158
 
}  // namespace recon
159
 
}  // namespace MAUS
160
 
 
161
 
#endif