~maus-mappybeamlinesimulation/maus/devel

« back to all changes in this revision

Viewing changes to src/common_cpp/DataStructure/Hit.hh

  • Committer: Chris Rogers
  • Date: 2012-03-04 11:48:45 UTC
  • mfrom: (659.1.12 release-candidate)
  • Revision ID: chris.rogers@stfc.ac.uk-20120304114845-jfc1bof071ruyno4
Tags: MAUS-v0.1, MAUS-v0.1.4
ReleaseĀ 0.1.4

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/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
#ifndef _SRC_COMMON_CPP_DATASTRUCTURE_HIT_HH_
 
18
#define _SRC_COMMON_CPP_DATASTRUCTURE_HIT_HH_
 
19
 
 
20
#include <vector>
 
21
 
 
22
#include "Rtypes.h" // ROOT
 
23
 
 
24
#include "src/common_cpp/DataStructure/ThreeVector.hh"
 
25
 
 
26
namespace MAUS {
 
27
 
 
28
/** @class ChannelId contains information about the detector channel hit
 
29
 */
 
30
class ChannelId {
 
31
  public:
 
32
      virtual ChannelId* Clone() { return new ChannelId(); }
 
33
      virtual ~ChannelId() {}
 
34
};
 
35
 
 
36
/** @class Hit contains Monte Carlo sensitive detector hit data
 
37
 *
 
38
 *  This is really a placeholder - needs a bit more work on individual
 
39
 *  detectors. Probably it needs to be a template class in the end.
 
40
 *
 
41
 *  Hit holds information pertaining to a particle step in a sensitive detector
 
42
 *  Stores information on the Track number, particle type, energy of the 
 
43
 *  particle, charge, time, energy deposited by this step, position, momentum
 
44
 *  and channel hit (channel id) 
 
45
 */
 
46
class Hit {
 
47
  public:
 
48
    /** Initialises everything to 0
 
49
     */
 
50
    Hit();
 
51
 
 
52
    /** Copy constructor; deep copies channel ID
 
53
     */
 
54
    Hit(const Hit& md);
 
55
 
 
56
    /** Equality operator; deep copies channel ID
 
57
     */
 
58
    Hit& operator=(const Hit& md);
 
59
 
 
60
    /** Destructor - cleans memory associated with channel ID
 
61
     */
 
62
    virtual ~Hit();
 
63
 
 
64
    /** Returns the track number of the track that made the hit
 
65
     */
 
66
    int GetTrackId() const;
 
67
 
 
68
    /** Sets the track number of the track that made the hit
 
69
     */
 
70
    void SetTrackId(int id);
 
71
 
 
72
    /** Returns the PDG particle type of the track that made the hit
 
73
     */
 
74
    int GetParticleId() const;
 
75
 
 
76
    /** Sets the PDG particle type of the track that made the hit
 
77
     */
 
78
    void SetParticleId(int pid);
 
79
 
 
80
    /** Returns the total energy of the track that made the hit
 
81
     */
 
82
    double GetEnergy() const;
 
83
 
 
84
    /** Sets the total energy of the track that made the hit
 
85
     */
 
86
    void SetEnergy(double energy);
 
87
 
 
88
    /** Returns the charge of the track that made the hit
 
89
     */
 
90
    double GetCharge() const;
 
91
 
 
92
    /** Sets the charge of the track that made the hit
 
93
     */
 
94
    void SetCharge(double charge);
 
95
 
 
96
    /** Returns the time of the track when it made the hit
 
97
     */
 
98
    double GetTime() const;
 
99
 
 
100
    /** Sets the time of the track when it made the hit
 
101
     */
 
102
    void SetTime(double time);
 
103
 
 
104
    /** Returns the energy deposited by the track when it made the hit
 
105
     */
 
106
    double GetEnergyDeposited() const;
 
107
 
 
108
    /** Sets the energy deposited by the track when it made the hit
 
109
     */
 
110
    void SetEnergyDeposited(double edep);
 
111
 
 
112
    /** Returns the position of the track when it made the hit
 
113
     */
 
114
    ThreeVector GetPosition() const;
 
115
 
 
116
    /** Sets the position of the track when it made the hit
 
117
     */
 
118
    void SetPosition(ThreeVector pos);
 
119
 
 
120
    /** Returns the momentum of the track when it made the hit
 
121
     */
 
122
    ThreeVector GetMomentum() const;
 
123
 
 
124
    /** Sets the momentum of the track when it made the hit
 
125
     */
 
126
    void SetMomentum(ThreeVector mom);
 
127
 
 
128
    /** Returns the channel id that was hit by the track
 
129
     */
 
130
    ChannelId* GetChannelId() const;
 
131
 
 
132
    /** Sets the channel id that was hit by the track
 
133
     */
 
134
    void SetChannelId(ChannelId* id);
 
135
 
 
136
  private:
 
137
    int _track_id;
 
138
    int _particle_id;
 
139
    double _energy;
 
140
    double _charge;
 
141
    double _time;
 
142
    double _energy_deposited;
 
143
    ThreeVector _position;
 
144
    ThreeVector _momentum;
 
145
 
 
146
    ChannelId* _channel_id;
 
147
 
 
148
    ClassDef(Hit, 1)
 
149
};
 
150
}
 
151
 
 
152
#endif
 
153