1 | #ifndef G4CASCAD_PARTICLE_HH |
---|
2 | #define G4CASCAD_PARTICLE_HH |
---|
3 | // |
---|
4 | // ******************************************************************** |
---|
5 | // * License and Disclaimer * |
---|
6 | // * * |
---|
7 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
8 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
9 | // * conditions of the Geant4 Software License, included in the file * |
---|
10 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
11 | // * include a list of copyright holders. * |
---|
12 | // * * |
---|
13 | // * Neither the authors of this software system, nor their employing * |
---|
14 | // * institutes,nor the agencies providing financial support for this * |
---|
15 | // * work make any representation or warranty, express or implied, * |
---|
16 | // * regarding this software system or assume any liability for its * |
---|
17 | // * use. Please see the license in the file LICENSE and URL above * |
---|
18 | // * for the full disclaimer and the limitation of liability. * |
---|
19 | // * * |
---|
20 | // * This code implementation is the result of the scientific and * |
---|
21 | // * technical work of the GEANT4 collaboration. * |
---|
22 | // * By using, copying, modifying or distributing the software (or * |
---|
23 | // * any work based on the software) you agree to acknowledge its * |
---|
24 | // * use in resulting scientific publications, and indicate your * |
---|
25 | // * acceptance of all terms of the Geant4 Software license. * |
---|
26 | // ******************************************************************** |
---|
27 | // $Id: G4CascadParticle.hh,v 1.14 2010/03/16 22:10:26 mkelsey Exp $ |
---|
28 | // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ |
---|
29 | // |
---|
30 | // 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly |
---|
31 | // 20100126 M. Kelsey -- Replace vector<G4Double> position with G4ThreeVector, |
---|
32 | // move ::print() to .cc file, fix uninitialized data members |
---|
33 | |
---|
34 | #include "G4InuclElementaryParticle.hh" |
---|
35 | #include "G4LorentzVector.hh" |
---|
36 | #include "G4ThreeVector.hh" |
---|
37 | |
---|
38 | |
---|
39 | class G4CascadParticle { |
---|
40 | |
---|
41 | public: |
---|
42 | // NOTE: Default constructor does not make a functional object! |
---|
43 | G4CascadParticle(); |
---|
44 | |
---|
45 | G4CascadParticle(const G4InuclElementaryParticle& particle, |
---|
46 | const G4ThreeVector& pos, |
---|
47 | G4int izone, |
---|
48 | G4double cpath, |
---|
49 | G4int gen) |
---|
50 | : verboseLevel(0), theParticle(particle), position(pos), |
---|
51 | current_zone(izone), current_path(cpath), movingIn(true), |
---|
52 | reflectionCounter(0), reflected(false), generation(gen) {} |
---|
53 | |
---|
54 | void updateParticleMomentum(const G4LorentzVector& mom) { |
---|
55 | theParticle.setMomentum(mom); |
---|
56 | } |
---|
57 | |
---|
58 | void updatePosition(const G4ThreeVector& pos) { |
---|
59 | position = pos; |
---|
60 | } |
---|
61 | |
---|
62 | void incrementReflectionCounter() { |
---|
63 | reflectionCounter++; |
---|
64 | reflected = true; |
---|
65 | } |
---|
66 | |
---|
67 | void resetReflection() { |
---|
68 | reflected = false; |
---|
69 | } |
---|
70 | |
---|
71 | void incrementCurrentPath(G4double npath) { |
---|
72 | current_path += npath; |
---|
73 | } |
---|
74 | |
---|
75 | void updateZone(G4int izone) { |
---|
76 | current_zone = izone; |
---|
77 | } |
---|
78 | |
---|
79 | G4bool movingInsideNuclei() const { |
---|
80 | return movingIn; |
---|
81 | } |
---|
82 | |
---|
83 | G4double getPathToTheNextZone(G4double rz_in, |
---|
84 | G4double rz_out); |
---|
85 | |
---|
86 | G4LorentzVector getMomentum() const { // Can't return ref; temporary |
---|
87 | return theParticle.getMomentum(); |
---|
88 | } |
---|
89 | |
---|
90 | const G4InuclElementaryParticle& getParticle() const { |
---|
91 | return theParticle; |
---|
92 | } |
---|
93 | |
---|
94 | G4InuclElementaryParticle& getParticle() { |
---|
95 | return theParticle; |
---|
96 | } |
---|
97 | |
---|
98 | const G4ThreeVector& getPosition() const { |
---|
99 | return position; |
---|
100 | } |
---|
101 | |
---|
102 | G4int getCurrentZone() const { |
---|
103 | return current_zone; |
---|
104 | } |
---|
105 | |
---|
106 | G4int getNumberOfReflections() const { |
---|
107 | return reflectionCounter; |
---|
108 | } |
---|
109 | |
---|
110 | G4bool young(G4double young_path_cut, |
---|
111 | G4double cpath) const { |
---|
112 | return ((current_path < 1000.) && (cpath < young_path_cut)); |
---|
113 | } |
---|
114 | |
---|
115 | G4bool reflectedNow() const { |
---|
116 | return reflected; |
---|
117 | } |
---|
118 | |
---|
119 | void propagateAlongThePath(G4double path); |
---|
120 | |
---|
121 | void print() const; |
---|
122 | |
---|
123 | G4int getGeneration() { |
---|
124 | return generation; |
---|
125 | } |
---|
126 | |
---|
127 | private: |
---|
128 | G4int verboseLevel; |
---|
129 | G4InuclElementaryParticle theParticle; |
---|
130 | G4ThreeVector position; |
---|
131 | G4int current_zone; |
---|
132 | G4double current_path; |
---|
133 | G4bool movingIn; |
---|
134 | G4int reflectionCounter; |
---|
135 | G4bool reflected; |
---|
136 | G4int generation; |
---|
137 | }; |
---|
138 | |
---|
139 | #endif // G4CASCAD_PARTICLE_HH |
---|