~maus-maintainers/maus/merge

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
 *
 * MAUS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * MAUS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MAUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

/** @class MAUS::DataStructure::Global::TrackPoint
 *  @ingroup globalrecon
 *  @brief TrackPoint object for the global reconstruction.
 *  @author Ian Taylor, University of Warwick
 *  @date 2013/03/01
 *
 *  A reconstructed track point, produced by the global
 *  reconstruction.  It represents a single point in space through
 *  which the reconstruction has determined the
 *  MAUS::DataStructure::Global::Track passed, defined by a position and
 *  momentum measurement, with associated errors.

 *  Most TrackPoints will correspond to a detector measurement (with a
 *  MAUS::DataStructure::Global::SpacePoint object), but some will be virtual
 *  (MAUS::DataStructure::Global::DetectorPoint kVirtual), matching a
 *  projected point.
 *
 */

#ifndef _SRC_COMMON_CPP_DATASTRUCTURE_GLOBALTRACKPOINT_HH_
#define _SRC_COMMON_CPP_DATASTRUCTURE_GLOBALTRACKPOINT_HH_


// C++ headers
#include <string>
#include <vector>
#include <iostream>

// ROOT headers
#include "Rtypes.h"
#include "TLorentzVector.h"
#include "TRef.h"

// MAUS headers
#include "src/common_cpp/Utils/VersionNumber.hh"
#include "src/common_cpp/DataStructure/Global/ReconEnums.hh"
#include "src/common_cpp/DataStructure/Global/BasePoint.hh"
#include "src/common_cpp/DataStructure/Global/SpacePoint.hh"

namespace MAUS {
namespace DataStructure {
namespace Global {

// Only elements in the DataStructure should inherit from TObject.
class TrackPoint : public BasePoint {
 public:

  /// Default constructor - initialises to 0/NULL
  TrackPoint();

  /// Copy constructor - any pointers are deep copied
  TrackPoint(const TrackPoint &track_point);

  /// Destructor
  virtual ~TrackPoint();

  /// Assignment operator - any pointers are deep copied
  TrackPoint& operator=(const TrackPoint &track_point);

  /// Clone method.  This allows us to create a new object and change
  /// that object, without changing the original.  This should be the
  /// standard copy method within a mapper.
  TrackPoint* Clone();

  // Getters and Setters for the member variables

  /// Set the index of the particle event that created this track point.
  void set_particle_event(const int particle_event);

  /// Get the name for the mapper which produced the track, #_mapper_name.
  int get_particle_event() const;

  /// Set the name for the mapper which produced the track, #_mapper_name.
  void set_mapper_name(std::string mapper_name);

  /// Get the name for the mapper which produced the track, #_mapper_name.
  std::string get_mapper_name() const;

  /// Set the calibrated 'charge' or energy deposit of the track at
  /// this point, based on detector measurements.  This will be
  /// undefined for MAUS::DataStructure::Global::kVirtual points.
  void set_charge(double charge);

  /// Get the calibrated 'charge' or energy deposit at this point,
  /// #_charge.
  double get_charge() const;

  /// Set the 4-momentum of the reconstructed
  /// MAUS::DataStructure::Global::Track at this point.
  void set_momentum(TLorentzVector momentum);

  /// Get the 4-momentum of the reconstructed
  /// MAUS::DataStructure::Global::Track at this point.
  TLorentzVector get_momentum() const;

  /// Set the error on the 4-momentum of the reconstructed
  /// MAUS::DataStructure::Global::Track at this point.
  void set_momentum_error(TLorentzVector momentum_error);

  /// Get the error on the 4-momentum of the reconstructed
  /// MAUS::DataStructure::Global::Track at this point.
  TLorentzVector get_momentum_error() const;

  /// Set the component MAUS::DataStructure::Global::SpacePoint, the detector
  /// measurement matching this reconstructed position.
  void set_space_point_tref(TRef space_point);

  /// Get the component MAUS::DataStructure::Global::SpacePoint, the detector
  /// measurement matching this reconstructed position.
  TRef get_space_point_tref() const;

  /// Set the component MAUS::DataStructure::Global::SpacePoint, the detector
  /// measurement matching this reconstructed position.
  void set_space_point(MAUS::DataStructure::Global::SpacePoint* space_point);

  /// Get the component MAUS::DataStructure::Global::SpacePoint, the detector
  /// measurement matching this reconstructed position.
  MAUS::DataStructure::Global::SpacePoint* get_space_point() const;

 private:

  /// The index of the particle event that produced this track point. If
  /// creation of the TrackPoint was not due to a particle event the value
  /// should remain at the default value of -1.
  int _particle_event;

  /// The name of the mapper which produced this track.
  std::string    _mapper_name;

  /// The calibrated 'charge' or energy deposit of this point.
  ///
  /// \todo It is possible that this should simply be the matching
  /// SpacePoint's charge, in which case it may be removed the and
  /// Set/Get functions changed to access the underlieing SpacePoint.
  double         _charge;

  /// The 4-momentum of the reconstructed Track at this point.
  TLorentzVector  _momentum;
  /// The error on the 4-momentum of the reconstructed Track at this
  /// point.
  TLorentzVector  _momentum_error;

  /// The reconstruction object defining the matching detector
  /// measurement.
  TRef _space_point;

  MAUS_VERSIONED_CLASS_DEF(TrackPoint);
}; // ~class TrackPoint

typedef std::vector<MAUS::DataStructure::Global::TrackPoint> TrackPointArray;
typedef std::vector<MAUS::DataStructure::Global::TrackPoint *>
  TrackPointPArray;
typedef std::vector<const MAUS::DataStructure::Global::TrackPoint *>
  TrackPointCPArray;
typedef std::vector<const MAUS::DataStructure::Global::TrackPoint *>
  ConstTrackPointPArray;
} // ~namespace Global
} // ~namespace DataStructure
} // ~namespace MAUS

#endif