source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadParticle.hh@ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.3 KB
Line 
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// $Id: G4CascadParticle.hh,v 1.15 2010/06/25 09:41:50 gunter Exp $
27// Geant4 tag: $Name: geant4-09-04-beta-01 $
28//
29// 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
30// 20100126 M. Kelsey -- Replace vector<G4Double> position with G4ThreeVector,
31// move ::print() to .cc file, fix uninitialized data members
32
33#ifndef G4CASCAD_PARTICLE_HH
34#define G4CASCAD_PARTICLE_HH
35
36#include "G4InuclElementaryParticle.hh"
37#include "G4LorentzVector.hh"
38#include "G4ThreeVector.hh"
39
40
41class G4CascadParticle {
42
43public:
44 // NOTE: Default constructor does not make a functional object!
45 G4CascadParticle();
46
47 G4CascadParticle(const G4InuclElementaryParticle& particle,
48 const G4ThreeVector& pos,
49 G4int izone,
50 G4double cpath,
51 G4int gen)
52 : verboseLevel(0), theParticle(particle), position(pos),
53 current_zone(izone), current_path(cpath), movingIn(true),
54 reflectionCounter(0), reflected(false), generation(gen) {}
55
56 void updateParticleMomentum(const G4LorentzVector& mom) {
57 theParticle.setMomentum(mom);
58 }
59
60 void updatePosition(const G4ThreeVector& pos) {
61 position = pos;
62 }
63
64 void incrementReflectionCounter() {
65 reflectionCounter++;
66 reflected = true;
67 }
68
69 void resetReflection() {
70 reflected = false;
71 }
72
73 void incrementCurrentPath(G4double npath) {
74 current_path += npath;
75 }
76
77 void updateZone(G4int izone) {
78 current_zone = izone;
79 }
80
81 G4bool movingInsideNuclei() const {
82 return movingIn;
83 }
84
85 G4double getPathToTheNextZone(G4double rz_in,
86 G4double rz_out);
87
88 G4LorentzVector getMomentum() const { // Can't return ref; temporary
89 return theParticle.getMomentum();
90 }
91
92 const G4InuclElementaryParticle& getParticle() const {
93 return theParticle;
94 }
95
96 G4InuclElementaryParticle& getParticle() {
97 return theParticle;
98 }
99
100 const G4ThreeVector& getPosition() const {
101 return position;
102 }
103
104 G4int getCurrentZone() const {
105 return current_zone;
106 }
107
108 G4int getNumberOfReflections() const {
109 return reflectionCounter;
110 }
111
112 G4bool young(G4double young_path_cut,
113 G4double cpath) const {
114 return ((current_path < 1000.) && (cpath < young_path_cut));
115 }
116
117 G4bool reflectedNow() const {
118 return reflected;
119 }
120
121 void propagateAlongThePath(G4double path);
122
123 void print() const;
124
125 G4int getGeneration() {
126 return generation;
127 }
128
129private:
130 G4int verboseLevel;
131 G4InuclElementaryParticle theParticle;
132 G4ThreeVector position;
133 G4int current_zone;
134 G4double current_path;
135 G4bool movingIn;
136 G4int reflectionCounter;
137 G4bool reflected;
138 G4int generation;
139};
140
141#endif // G4CASCAD_PARTICLE_HH
Note: See TracBrowser for help on using the repository browser.