| 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 | #ifndef G4CASCAD_PARTICLE_HH
|
|---|
| 27 | #define G4CASCAD_PARTICLE_HH
|
|---|
| 28 |
|
|---|
| 29 | #include "G4InuclElementaryParticle.hh"
|
|---|
| 30 |
|
|---|
| 31 | class G4CascadParticle {
|
|---|
| 32 |
|
|---|
| 33 | public:
|
|---|
| 34 |
|
|---|
| 35 | G4CascadParticle();
|
|---|
| 36 |
|
|---|
| 37 | G4CascadParticle(const G4InuclElementaryParticle& particle,
|
|---|
| 38 | const std::vector<G4double>& pos,
|
|---|
| 39 | G4int izone,
|
|---|
| 40 | G4double cpath)
|
|---|
| 41 |
|
|---|
| 42 | : theParticle(particle),
|
|---|
| 43 | position(pos),
|
|---|
| 44 | current_zone(izone),
|
|---|
| 45 | current_path(cpath) {
|
|---|
| 46 | current_path = cpath;
|
|---|
| 47 | movingIn = true;
|
|---|
| 48 | reflectionCounter = 0;
|
|---|
| 49 | };
|
|---|
| 50 |
|
|---|
| 51 | void updateParticleMomentum(const G4CascadeMomentum& mom) {
|
|---|
| 52 | theParticle.setMomentum(mom);
|
|---|
| 53 | };
|
|---|
| 54 |
|
|---|
| 55 | void updatePosition(const std::vector<G4double>& pos) {
|
|---|
| 56 | position = pos;
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | void incrementReflectionCounter() {
|
|---|
| 60 | reflectionCounter++;
|
|---|
| 61 | reflected = true;
|
|---|
| 62 | };
|
|---|
| 63 |
|
|---|
| 64 | void resetReflection() {
|
|---|
| 65 | reflected = false;
|
|---|
| 66 | };
|
|---|
| 67 |
|
|---|
| 68 | void incrementCurrentPath(G4double npath) {
|
|---|
| 69 | current_path += npath;
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | void updateZone(G4int izone) {
|
|---|
| 73 | current_zone = izone;
|
|---|
| 74 | };
|
|---|
| 75 |
|
|---|
| 76 | G4bool movingInsideNuclei() const {
|
|---|
| 77 | return movingIn;
|
|---|
| 78 | };
|
|---|
| 79 |
|
|---|
| 80 | G4double getPathToTheNextZone(G4double rz_in,
|
|---|
| 81 | G4double rz_out);
|
|---|
| 82 |
|
|---|
| 83 | const G4CascadeMomentum& getMomentum() const {
|
|---|
| 84 | return theParticle.getMomentum();
|
|---|
| 85 | };
|
|---|
| 86 |
|
|---|
| 87 | G4InuclElementaryParticle getParticle() const {
|
|---|
| 88 | return theParticle;
|
|---|
| 89 | };
|
|---|
| 90 |
|
|---|
| 91 | const std::vector<G4double>& getPosition() const {
|
|---|
| 92 | return position;
|
|---|
| 93 | };
|
|---|
| 94 |
|
|---|
| 95 | G4int getCurrentZone() const {
|
|---|
| 96 | return current_zone;
|
|---|
| 97 | };
|
|---|
| 98 |
|
|---|
| 99 | G4int getNumberOfReflections() const {
|
|---|
| 100 | return reflectionCounter;
|
|---|
| 101 | };
|
|---|
| 102 |
|
|---|
| 103 | G4bool young(G4double young_path_cut,
|
|---|
| 104 | G4double cpath) const {
|
|---|
| 105 |
|
|---|
| 106 | if(current_path < 1000.0) {
|
|---|
| 107 | return cpath < young_path_cut;
|
|---|
| 108 | }
|
|---|
| 109 | else {
|
|---|
| 110 | return false;
|
|---|
| 111 | };
|
|---|
| 112 | // return current_path + 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 | theParticle.printParticle();
|
|---|
| 123 | G4cout << " zone " << current_zone << " current_path " << current_path
|
|---|
| 124 | << " reflectionCounter " << reflectionCounter << G4endl
|
|---|
| 125 | << " x " << position[0] << " y " << position[1]
|
|---|
| 126 | << " z " << position[2] << G4endl;
|
|---|
| 127 | };
|
|---|
| 128 |
|
|---|
| 129 | private:
|
|---|
| 130 |
|
|---|
| 131 | G4int verboseLevel;
|
|---|
| 132 | G4InuclElementaryParticle theParticle;
|
|---|
| 133 | std::vector<G4double> position;
|
|---|
| 134 | G4int current_zone;
|
|---|
| 135 | G4double current_path;
|
|---|
| 136 | G4bool movingIn;
|
|---|
| 137 | G4int reflectionCounter;
|
|---|
| 138 | G4bool reflected;
|
|---|
| 139 |
|
|---|
| 140 | };
|
|---|
| 141 |
|
|---|
| 142 | #endif // G4CASCAD_PARTICLE_HH
|
|---|