~mbogomilov/maus/devel3

« back to all changes in this revision

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

  • Committer: Durga Rajaram
  • Date: 2014-01-14 07:07:02 UTC
  • mfrom: (659.1.80 relcand)
  • Revision ID: durga@fnal.gov-20140114070702-2l1fuj1w6rraw7xe
Tags: MAUS-v0.7.6
MAUS-v0.7.6

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_PARTICLE_OPTICAL_VECTOR_HH
 
21
#define COMMON_CPP_RECONSTRUCTION_PARTICLE_OPTICAL_VECTOR_HH
 
22
 
 
23
#include <iostream>
 
24
 
 
25
#include "DataStructure/Step.hh"
 
26
#include "src/common_cpp/Optics/PhaseSpaceVector.hh"
 
27
#include "Recon/Global/Particle.hh"
 
28
#include "Recon/Global/Detector.hh"
 
29
 
 
30
namespace MAUS {
 
31
namespace recon {
 
32
namespace global {
 
33
 
 
34
/* @class ParticleOpticalVector a phase space vector with redundant t/E and z/Pz
 
35
 * coordinates as well as an ID that links the track to the detector that
 
36
 * measured it.
 
37
 *
 
38
 * The redundant sets of coordinates can be filled in by explicitly using the
 
39
 * FillInCoordinates() function or by setting all of the coordinates at once
 
40
 * using the array or parameterised constructors (which implicitly call
 
41
 * FillInCoordinates()). If t < 0 it fills in t and E from z, Pz, and the given
 
42
 * mass parameter. If t >= 0 and z < 0, it fills in z and Pz from t, E, and
 
43
 * the mass.
 
44
 */
 
45
class ParticleOpticalVector : public MAUS::PhaseSpaceVector {
 
46
 public:
 
47
  /* @brief     Construct with all elements initialized to zero and phase space type
 
48
   *        temporal.
 
49
   */
 
50
  ParticleOpticalVector();
 
51
 
 
52
  ParticleOpticalVector(
 
53
      const MAUS::PhaseSpaceVector& vector,
 
54
      const double t0, const double E0, const double P0);
 
55
 
 
56
  /* @brief  Copy constructor.
 
57
   */
 
58
  ParticleOpticalVector(const ParticleOpticalVector & original_instance);
 
59
 
 
60
  /* @brief Create with coordinates from an array.
 
61
     Order is t, E, x, Px, y, Py.
 
62
   */
 
63
  explicit ParticleOpticalVector(double const * const array);
 
64
 
 
65
  /* @brief     Reconstructed track point constructor. The track point was not
 
66
   * generated by a detector, so an uncertanty matrix must be supplied. The
 
67
   * detector_id field is set to Detector::None. 
 
68
   */
 
69
  ParticleOpticalVector(const double l, const double delta,
 
70
             const double x, const double a,
 
71
             const double y, const double b);
 
72
 
 
73
  ~ParticleOpticalVector();
 
74
 
 
75
  // *************************
 
76
  //  Assignment Operators
 
77
  // *************************
 
78
  ParticleOpticalVector& operator =(
 
79
    const ParticleOpticalVector&                  rhs);
 
80
  ParticleOpticalVector& operator+=(
 
81
    const ParticleOpticalVector&                  rhs);
 
82
  ParticleOpticalVector& operator-=(
 
83
    const ParticleOpticalVector&                  rhs);
 
84
  ParticleOpticalVector& operator*=(
 
85
    const ParticleOpticalVector&                  rhs);
 
86
  ParticleOpticalVector& operator/=(
 
87
    const ParticleOpticalVector&                  rhs);
 
88
  ParticleOpticalVector& operator+=(const double& rhs);
 
89
  ParticleOpticalVector& operator-=(const double& rhs);
 
90
  ParticleOpticalVector& operator*=(const double& rhs);
 
91
  ParticleOpticalVector& operator/=(const double& rhs);
 
92
 
 
93
  // *************************
 
94
  //  Algebraic Operators
 
95
  // *************************
 
96
  const ParticleOpticalVector operator+(
 
97
    const ParticleOpticalVector&                      rhs) const;
 
98
  const ParticleOpticalVector operator-(
 
99
    const ParticleOpticalVector&                      rhs) const;
 
100
  const ParticleOpticalVector operator*(
 
101
    const ParticleOpticalVector&                      rhs) const;
 
102
  const ParticleOpticalVector operator/(
 
103
    const ParticleOpticalVector&                      rhs) const;
 
104
  const ParticleOpticalVector operator+(const double& rhs) const;
 
105
  const ParticleOpticalVector operator-(const double& rhs) const;
 
106
  const ParticleOpticalVector operator*(const double& rhs) const;
 
107
  const ParticleOpticalVector operator/(const double& rhs) const;
 
108
 
 
109
  // *************************
 
110
  //  Comparison Operators
 
111
  // *************************
 
112
  const bool operator==(const ParticleOpticalVector& rhs) const;
 
113
  const bool operator!=(const ParticleOpticalVector& rhs) const;
 
114
 
 
115
  double l()            const {return (*this)[0];}
 
116
  double delta()        const {return (*this)[1];}
 
117
  double x()            const {return (*this)[2];}
 
118
  double a()            const {return (*this)[3];}
 
119
  double y()            const {return (*this)[4];}
 
120
  double b()            const {return (*this)[5];}
 
121
 
 
122
  // mutators
 
123
  void set_l(double l)                    {(*this)[0] = l;}
 
124
  void set_delta(double delta)            {(*this)[1] = delta;}
 
125
  void set_x(double x)                    {(*this)[2] = x;}
 
126
  void set_a(double a)                    {(*this)[3] = a;}
 
127
  void set_y(double y)                    {(*this)[4] = y;}
 
128
  void set_b(double b)                    {(*this)[5] = b;}
 
129
};
 
130
 
 
131
std::ostream& operator<<(std::ostream& out, const ParticleOpticalVector& vector);
 
132
 
 
133
}  // namespace global
 
134
}  // namespace recon
 
135
}  // namespace MAUS
 
136
 
 
137
#endif