1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // -------------------------------------------------------------- |
---|
28 | // GEANT 4 - Underground Dark Matter Detector Advanced Example |
---|
29 | // |
---|
30 | // For information related to this code contact: Alex Howard |
---|
31 | // e-mail: a.s.howard@ic.ac.uk |
---|
32 | // -------------------------------------------------------------- |
---|
33 | // Comments |
---|
34 | // |
---|
35 | // |
---|
36 | // TrackerHit header |
---|
37 | // -------------------------------------------------------------- |
---|
38 | |
---|
39 | #ifndef ExN04TrackerHit_h |
---|
40 | #define ExN04TrackerHit_h 1 |
---|
41 | |
---|
42 | |
---|
43 | //MSH_include_begin |
---|
44 | #include "MarshaledG4String.h" |
---|
45 | //MSH_include_end |
---|
46 | |
---|
47 | #include "G4VHit.hh" |
---|
48 | #include "G4THitsCollection.hh" |
---|
49 | #include "G4Allocator.hh" |
---|
50 | #include "G4ThreeVector.hh" |
---|
51 | |
---|
52 | |
---|
53 | //MSH_BEGIN |
---|
54 | class ExN04TrackerHit : public G4VHit |
---|
55 | { |
---|
56 | public: |
---|
57 | |
---|
58 | ExN04TrackerHit(); |
---|
59 | ~ExN04TrackerHit(); |
---|
60 | |
---|
61 | ExN04TrackerHit(const ExN04TrackerHit &right); |
---|
62 | const ExN04TrackerHit& operator=(const ExN04TrackerHit &right); |
---|
63 | int operator==(const ExN04TrackerHit &right) const; |
---|
64 | |
---|
65 | inline void* operator new(size_t); |
---|
66 | inline void operator delete(void* aHit); |
---|
67 | |
---|
68 | void Draw(); |
---|
69 | void Print(); |
---|
70 | |
---|
71 | |
---|
72 | private: |
---|
73 | G4ThreeVector pos; /*MSH: primitive |
---|
74 | [elementGet: { $ELEMENT = $THIS->GetPos(); }] |
---|
75 | [elementSet: { $THIS->SetPos($ELEMENT); }] */ |
---|
76 | |
---|
77 | G4double edep; /*MSH: primitive |
---|
78 | [elementGet: { $ELEMENT = $THIS->GetEdep(); }] |
---|
79 | [elementSet: { $THIS->SetEdep($ELEMENT); }] */ |
---|
80 | |
---|
81 | |
---|
82 | public: |
---|
83 | |
---|
84 | |
---|
85 | inline void SetEdep(G4double de) {edep=de;}; |
---|
86 | inline void SetPos(G4ThreeVector xyz) {pos=xyz;}; |
---|
87 | |
---|
88 | inline G4double GetEdep() const {return edep;}; |
---|
89 | inline G4ThreeVector GetPos() const {return pos;}; |
---|
90 | |
---|
91 | }; |
---|
92 | //MSH_END |
---|
93 | |
---|
94 | // vector collection of one type of hits |
---|
95 | typedef G4THitsCollection<ExN04TrackerHit> ExN04TrackerHitsCollection; |
---|
96 | |
---|
97 | |
---|
98 | extern G4Allocator<ExN04TrackerHit> ExN04TrackerHitAllocator; |
---|
99 | |
---|
100 | |
---|
101 | inline void* ExN04TrackerHit::operator new(size_t) { |
---|
102 | void* aHit; |
---|
103 | aHit = (void*) ExN04TrackerHitAllocator.MallocSingle(); |
---|
104 | return aHit; |
---|
105 | } |
---|
106 | |
---|
107 | |
---|
108 | inline void ExN04TrackerHit::operator delete(void* aHit) { |
---|
109 | ExN04TrackerHitAllocator.FreeSingle((ExN04TrackerHit*) aHit); |
---|
110 | } |
---|
111 | |
---|
112 | #endif |
---|
113 | |
---|
114 | |
---|
115 | |
---|
116 | |
---|
117 | |
---|