File indexing completed on 2025-01-18 09:58:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef G4CASCAD_PARTICLE_HH
0041 #define G4CASCAD_PARTICLE_HH
0042
0043 #include "G4InuclElementaryParticle.hh"
0044 #include "G4LorentzVector.hh"
0045 #include "G4ThreeVector.hh"
0046 #include <iosfwd>
0047
0048
0049 class G4CascadParticle {
0050
0051 public:
0052
0053 G4CascadParticle();
0054
0055 G4CascadParticle(const G4InuclElementaryParticle& particle,
0056 const G4ThreeVector& pos, G4int izone, G4double cpath,
0057 G4int gen);
0058
0059 ~G4CascadParticle() {;}
0060
0061
0062
0063 G4CascadParticle(const G4CascadParticle& cpart) { *this = cpart; }
0064 G4CascadParticle& operator=(const G4CascadParticle& cpart);
0065
0066
0067
0068 void fill(const G4InuclElementaryParticle& particle,
0069 const G4ThreeVector& pos, G4int izone, G4double cpath,
0070 G4int gen);
0071
0072
0073 const G4InuclElementaryParticle& getParticle() const { return theParticle; }
0074 G4InuclElementaryParticle& getParticle() { return theParticle; }
0075
0076 G4int getGeneration() const { return generation; }
0077 void setGeneration(G4int gen) { generation = gen; }
0078
0079 G4int getHistoryId() const { return historyId; }
0080 void setHistoryId(G4int id) { historyId = id; }
0081
0082 G4LorentzVector getMomentum() const {
0083 return theParticle.getMomentum();
0084 }
0085
0086 void updateParticleMomentum(const G4LorentzVector& mom) {
0087 theParticle.setMomentum(mom);
0088 }
0089
0090 const G4ThreeVector& getPosition() const { return position; }
0091 void updatePosition(const G4ThreeVector& pos) { position = pos; }
0092
0093 void incrementReflectionCounter() {
0094 reflectionCounter++;
0095 reflected = true;
0096 }
0097 G4int getNumberOfReflections() const { return reflectionCounter; }
0098
0099 void resetReflection() { reflected = false; }
0100 G4bool reflectedNow() const { return reflected; }
0101
0102 void initializePath(G4double npath) { current_path = npath; }
0103 void incrementCurrentPath(G4double npath) { current_path += npath; }
0104 G4double getCurrentPath() const { return current_path; }
0105
0106 void updateZone(G4int izone) { current_zone = izone; }
0107 G4int getCurrentZone() const { return current_zone; }
0108
0109 void setMovingInsideNuclei(G4bool isMovingIn=true) { movingIn = isMovingIn; }
0110 G4bool movingInsideNuclei() const { return movingIn; }
0111
0112 G4double getPathToTheNextZone(G4double rz_in, G4double rz_out);
0113 void propagateAlongThePath(G4double path);
0114
0115 G4bool young(G4double young_path_cut, G4double cpath) const {
0116 return ((current_path < 1000.) && (cpath < young_path_cut));
0117 }
0118
0119 void print(std::ostream& os) const;
0120
0121 private:
0122 G4int verboseLevel;
0123 G4InuclElementaryParticle theParticle;
0124 G4ThreeVector position;
0125 G4int current_zone;
0126 G4double current_path;
0127 G4bool movingIn;
0128 G4int reflectionCounter;
0129 G4bool reflected;
0130 G4int generation;
0131 G4int historyId;
0132 };
0133
0134
0135
0136 std::ostream& operator<<(std::ostream& os, const G4CascadParticle& part);
0137
0138 #endif