Geant4_10
G4MuMinusCaptureCascade.hh
Go to the documentation of this file.
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 66367 2012-12-18 09:18:08Z gcosmo $
27 //
28 // G4MuMinusCaptureCascade physics process --------
29 // Vladimir Ivanchenko, April 2000
30 //
31 // Modified:
32 // 14.11.06 Add inline functions (V.Ivanchenko)
33 //
34 //-----------------------------------------------------------------------------
35 
36 #ifndef G4MuMinusCaptureCascade_h
37 #define G4MuMinusCaptureCascade_h 1
38 
40 
41 #include "globals.hh"
42 #include "Randomize.hh"
43 #include "G4ParticleDefinition.hh"
44 #include "G4ThreeVector.hh"
45 
47 
49 {
50 public:
51 
53 
55 
56  G4int DoCascade(const G4double Z, const G4double A,
57  G4GHEKinematicsVector* Cascade);
58 
60  G4int* nCascade, G4GHEKinematicsVector* Cascade);
61 
63 
65 
66 private:
67 
68  G4double GetLinApprox(G4int N, const G4double* X, const G4double* Y,
69  G4double Xuser);
70 
71  void AddNewParticle(G4ParticleDefinition* aParticle,
72  G4ThreeVector& Momentum,
73  G4double mass,
74  G4int* nParticle,
75  G4GHEKinematicsVector* Cascade);
76 
77  // hide assignment operator as private
80 
81  G4double Emass, MuMass;
82  G4ParticleDefinition* theElectron;
83  G4ParticleDefinition* theGamma;
84  G4ThreeVector randomVect;
85 };
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
88 
89 inline G4double G4MuMinusCaptureCascade::GetLinApprox(G4int N,
90  const G4double* X,
91  const G4double* Y,
92  G4double Xuser)
93 {
94  G4double Yuser;
95  if(Xuser <= X[0]) Yuser = Y[0];
96  else if(Xuser >= X[N-1]) Yuser = Y[N-1];
97  else {
98  G4int i;
99  for (i=1; i<N; i++){
100  if(Xuser <= X[i]) break;
101  }
102 
103  if(Xuser == X[i]) Yuser = Y[i];
104  else Yuser = Y[i-1] + (Y[i] - Y[i-1])*(Xuser - X[i-1])/(X[i] - X[i-1]);
105  }
106  return Yuser;
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
110 
112 {
113  //
114  // generate uniform vector
115  //
116  G4double cost = 2.0 * G4UniformRand() - 1.0;
117  G4double sint = std::sqrt((1.0 - cost)*(1.0 + cost));
118  G4double Phi = CLHEP::twopi * G4UniformRand();
119  randomVect = G4ThreeVector(sint * std::cos(Phi), sint * std::sin(Phi), cost);
120  return randomVect;
121 }
122 
123 #endif
124 
125 
CLHEP::Hep3Vector G4ThreeVector
Float_t Y
Definition: plot.C:39
int G4int
Definition: G4Types.hh:78
Float_t X
Definition: plot.C:39
#define G4UniformRand()
Definition: Randomize.hh:87
Float_t Z
Definition: plot.C:39
G4int DoCascade(const G4double Z, const G4double A, G4GHEKinematicsVector *Cascade)
G4double GetKShellEnergy(G4double Z)
void DoBoundMuonMinusDecay(G4double Z, G4int *nCascade, G4GHEKinematicsVector *Cascade)
**D E S C R I P T I O N
Definition: HEPEvtcom.cc:77
double G4double
Definition: G4Types.hh:76