[819] | 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: G4MuMinusCaptureCascade.hh,v 1.10 2007/07/05 18:19:14 dennis Exp $ |
---|
[1007] | 27 | // GEANT4 tag $Name: geant4-09-02 $ |
---|
[819] | 28 | // |
---|
| 29 | // G4MuMinusCaptureCascade physics process -------- |
---|
| 30 | // Vladimir Ivanchenko, April 2000 |
---|
| 31 | // |
---|
| 32 | // Modified: |
---|
| 33 | // 14.11.06 Add inline functions (V.Ivanchenko) |
---|
| 34 | // |
---|
| 35 | //----------------------------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | #ifndef G4MuMinusCaptureCascade_h |
---|
| 38 | #define G4MuMinusCaptureCascade_h 1 |
---|
| 39 | |
---|
| 40 | #include "globals.hh" |
---|
| 41 | #include "Randomize.hh" |
---|
| 42 | #include "G4ParticleDefinition.hh" |
---|
| 43 | #include "G4ThreeVector.hh" |
---|
| 44 | |
---|
| 45 | class G4GHEKinematicsVector; |
---|
| 46 | |
---|
| 47 | class G4MuMinusCaptureCascade |
---|
| 48 | { |
---|
| 49 | public: |
---|
| 50 | |
---|
| 51 | G4MuMinusCaptureCascade(); |
---|
| 52 | |
---|
| 53 | ~G4MuMinusCaptureCascade(); |
---|
| 54 | |
---|
| 55 | G4int DoCascade(const G4double Z, const G4double A, |
---|
| 56 | G4GHEKinematicsVector* Cascade); |
---|
| 57 | |
---|
| 58 | void DoBoundMuonMinusDecay(G4double Z, |
---|
| 59 | G4int* nCascade, G4GHEKinematicsVector* Cascade); |
---|
| 60 | |
---|
| 61 | G4double GetKShellEnergy(G4double Z); |
---|
| 62 | |
---|
| 63 | G4ThreeVector& GetRandomVec(); |
---|
| 64 | |
---|
| 65 | private: |
---|
| 66 | |
---|
| 67 | G4double GetLinApprox(G4int N, const G4double* X, const G4double* Y, |
---|
| 68 | G4double Xuser); |
---|
| 69 | |
---|
| 70 | void AddNewParticle(G4ParticleDefinition* aParticle, |
---|
| 71 | G4ThreeVector& Momentum, |
---|
| 72 | G4double mass, |
---|
| 73 | G4int* nParticle, |
---|
| 74 | G4GHEKinematicsVector* Cascade); |
---|
| 75 | |
---|
| 76 | // hide assignment operator as private |
---|
| 77 | G4MuMinusCaptureCascade& operator=(const G4MuMinusCaptureCascade &right); |
---|
| 78 | G4MuMinusCaptureCascade(const G4MuMinusCaptureCascade& ); |
---|
| 79 | |
---|
| 80 | G4double Emass, MuMass; |
---|
| 81 | G4ParticleDefinition* theElectron; |
---|
| 82 | G4ParticleDefinition* theGamma; |
---|
| 83 | G4ThreeVector randomVect; |
---|
| 84 | }; |
---|
| 85 | |
---|
| 86 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 87 | |
---|
| 88 | inline G4double G4MuMinusCaptureCascade::GetLinApprox(G4int N, |
---|
| 89 | const G4double* X, |
---|
| 90 | const G4double* Y, |
---|
| 91 | G4double Xuser) |
---|
| 92 | { |
---|
| 93 | G4double Yuser; |
---|
| 94 | if(Xuser <= X[0]) Yuser = Y[0]; |
---|
| 95 | else if(Xuser >= X[N-1]) Yuser = Y[N-1]; |
---|
| 96 | else { |
---|
| 97 | G4int i; |
---|
| 98 | for (i=1; i<N; i++){ |
---|
| 99 | if(Xuser <= X[i]) break; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | if(Xuser == X[i]) Yuser = Y[i]; |
---|
| 103 | else Yuser = Y[i-1] + (Y[i] - Y[i-1])*(Xuser - X[i-1])/(X[i] - X[i-1]); |
---|
| 104 | } |
---|
| 105 | return Yuser; |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 109 | |
---|
| 110 | inline G4ThreeVector& G4MuMinusCaptureCascade::GetRandomVec() |
---|
| 111 | { |
---|
| 112 | // |
---|
| 113 | // generate uniform vector |
---|
| 114 | // |
---|
| 115 | G4double cost = 2.0 * G4UniformRand() - 1.0; |
---|
| 116 | G4double sint = std::sqrt((1.0 - cost)*(1.0 + cost)); |
---|
| 117 | G4double Phi = twopi * G4UniformRand(); |
---|
| 118 | randomVect = G4ThreeVector(sint * std::cos(Phi), sint * std::sin(Phi), cost); |
---|
| 119 | return randomVect; |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | #endif |
---|
| 123 | |
---|
| 124 | |
---|