00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef G4CASCAD_PARTICLE_HH
00039 #define G4CASCAD_PARTICLE_HH
00040
00041 #include "G4InuclElementaryParticle.hh"
00042 #include "G4LorentzVector.hh"
00043 #include "G4ThreeVector.hh"
00044 #include <iosfwd>
00045
00046
00047 class G4CascadParticle {
00048
00049 public:
00050
00051 G4CascadParticle();
00052
00053 G4CascadParticle(const G4InuclElementaryParticle& particle,
00054 const G4ThreeVector& pos, G4int izone, G4double cpath,
00055 G4int gen)
00056 : verboseLevel(0), theParticle(particle), position(pos),
00057 current_zone(izone), current_path(cpath), movingIn(true),
00058 reflectionCounter(0), reflected(false), generation(gen) {}
00059
00060
00061 void fill(const G4InuclElementaryParticle& particle,
00062 const G4ThreeVector& pos, G4int izone, G4double cpath,
00063 G4int gen);
00064
00065 const G4InuclElementaryParticle& getParticle() const { return theParticle; }
00066 G4InuclElementaryParticle& getParticle() { return theParticle; }
00067
00068 G4int getGeneration() const { return generation; }
00069 void setGeneration(G4int gen) { generation = gen; }
00070
00071 G4LorentzVector getMomentum() const {
00072 return theParticle.getMomentum();
00073 }
00074
00075 void updateParticleMomentum(const G4LorentzVector& mom) {
00076 theParticle.setMomentum(mom);
00077 }
00078
00079 const G4ThreeVector& getPosition() const { return position; }
00080 void updatePosition(const G4ThreeVector& pos) { position = pos; }
00081
00082 void incrementReflectionCounter() {
00083 reflectionCounter++;
00084 reflected = true;
00085 }
00086 G4int getNumberOfReflections() const { return reflectionCounter; }
00087
00088 void resetReflection() { reflected = false; }
00089 G4bool reflectedNow() const { return reflected; }
00090
00091 void initializePath(G4double npath) { current_path = npath; }
00092 void incrementCurrentPath(G4double npath) { current_path += npath; }
00093 G4double getCurrentPath() const { return current_path; }
00094
00095 void updateZone(G4int izone) { current_zone = izone; }
00096 G4int getCurrentZone() const { return current_zone; }
00097
00098 void setMovingInsideNuclei(G4bool isMovingIn=true) { movingIn = isMovingIn; }
00099 G4bool movingInsideNuclei() const { return movingIn; }
00100
00101 G4double getPathToTheNextZone(G4double rz_in, G4double rz_out);
00102 void propagateAlongThePath(G4double path);
00103
00104 G4bool young(G4double young_path_cut, G4double cpath) const {
00105 return ((current_path < 1000.) && (cpath < young_path_cut));
00106 }
00107
00108 void print(std::ostream& os) const;
00109
00110 private:
00111 G4int verboseLevel;
00112 G4InuclElementaryParticle theParticle;
00113 G4ThreeVector position;
00114 G4int current_zone;
00115 G4double current_path;
00116 G4bool movingIn;
00117 G4int reflectionCounter;
00118 G4bool reflected;
00119 G4int generation;
00120 };
00121
00122
00123
00124 std::ostream& operator<<(std::ostream& os, const G4CascadParticle& part);
00125
00126 #endif // G4CASCAD_PARTICLE_HH