~maus-mappybeamlinesimulation/maus/devel

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
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/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/>.
 */

#ifndef _SRC_COMMON_CPP_DATASTRUCTURE_HIT_HH_
#define _SRC_COMMON_CPP_DATASTRUCTURE_HIT_HH_

#include <vector>

#include "Rtypes.h" // ROOT

#include "src/common_cpp/DataStructure/ThreeVector.hh"

namespace MAUS {

/** @class ChannelId contains information about the detector channel hit
 */
class ChannelId {
  public:
      virtual ChannelId* Clone() { return new ChannelId(); }
      virtual ~ChannelId() {}
};

/** @class Hit contains Monte Carlo sensitive detector hit data
 *
 *  This is really a placeholder - needs a bit more work on individual
 *  detectors. Probably it needs to be a template class in the end.
 *
 *  Hit holds information pertaining to a particle step in a sensitive detector
 *  Stores information on the Track number, particle type, energy of the 
 *  particle, charge, time, energy deposited by this step, position, momentum
 *  and channel hit (channel id) 
 */
class Hit {
  public:
    /** Initialises everything to 0
     */
    Hit();

    /** Copy constructor; deep copies channel ID
     */
    Hit(const Hit& md);

    /** Equality operator; deep copies channel ID
     */
    Hit& operator=(const Hit& md);

    /** Destructor - cleans memory associated with channel ID
     */
    virtual ~Hit();

    /** Returns the track number of the track that made the hit
     */
    int GetTrackId() const;

    /** Sets the track number of the track that made the hit
     */
    void SetTrackId(int id);

    /** Returns the PDG particle type of the track that made the hit
     */
    int GetParticleId() const;

    /** Sets the PDG particle type of the track that made the hit
     */
    void SetParticleId(int pid);

    /** Returns the total energy of the track that made the hit
     */
    double GetEnergy() const;

    /** Sets the total energy of the track that made the hit
     */
    void SetEnergy(double energy);

    /** Returns the charge of the track that made the hit
     */
    double GetCharge() const;

    /** Sets the charge of the track that made the hit
     */
    void SetCharge(double charge);

    /** Returns the time of the track when it made the hit
     */
    double GetTime() const;

    /** Sets the time of the track when it made the hit
     */
    void SetTime(double time);

    /** Returns the energy deposited by the track when it made the hit
     */
    double GetEnergyDeposited() const;

    /** Sets the energy deposited by the track when it made the hit
     */
    void SetEnergyDeposited(double edep);

    /** Returns the position of the track when it made the hit
     */
    ThreeVector GetPosition() const;

    /** Sets the position of the track when it made the hit
     */
    void SetPosition(ThreeVector pos);

    /** Returns the momentum of the track when it made the hit
     */
    ThreeVector GetMomentum() const;

    /** Sets the momentum of the track when it made the hit
     */
    void SetMomentum(ThreeVector mom);

    /** Returns the channel id that was hit by the track
     */
    ChannelId* GetChannelId() const;

    /** Sets the channel id that was hit by the track
     */
    void SetChannelId(ChannelId* id);

  private:
    int _track_id;
    int _particle_id;
    double _energy;
    double _charge;
    double _time;
    double _energy_deposited;
    ThreeVector _position;
    ThreeVector _momentum;

    ChannelId* _channel_id;

    ClassDef(Hit, 1)
};
}

#endif