G4MuMinusCaptureCascade.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 //   G4MuMinusCaptureCascade physics process --------
00029 //   Vladimir Ivanchenko, April 2000
00030 //
00031 // Modified:
00032 // 14.11.06 Add inline functions (V.Ivanchenko)
00033 //
00034 //-----------------------------------------------------------------------------
00035 
00036 #ifndef G4MuMinusCaptureCascade_h
00037 #define G4MuMinusCaptureCascade_h 1
00038 
00039 #include <CLHEP/Units/PhysicalConstants.h>
00040 
00041 #include "globals.hh"
00042 #include "Randomize.hh" 
00043 #include "G4ParticleDefinition.hh"
00044 #include "G4ThreeVector.hh"
00045 
00046 class G4GHEKinematicsVector;
00047 
00048 class G4MuMinusCaptureCascade 
00049 { 
00050 public:
00051  
00052   G4MuMinusCaptureCascade();
00053  
00054   ~G4MuMinusCaptureCascade();
00055 
00056   G4int DoCascade(const G4double Z, const G4double A,
00057                   G4GHEKinematicsVector* Cascade);
00058 
00059   void DoBoundMuonMinusDecay(G4double Z, 
00060                              G4int* nCascade, G4GHEKinematicsVector* Cascade);
00061 
00062   G4double GetKShellEnergy(G4double Z);
00063 
00064   G4ThreeVector& GetRandomVec();
00065 
00066 private:
00067 
00068   G4double GetLinApprox(G4int N, const G4double* X, const G4double* Y, 
00069                         G4double Xuser);
00070 
00071   void AddNewParticle(G4ParticleDefinition* aParticle,
00072                       G4ThreeVector& Momentum,
00073                       G4double mass,
00074                       G4int* nParticle,
00075                       G4GHEKinematicsVector* Cascade);
00076 
00077   // hide assignment operator as private 
00078   G4MuMinusCaptureCascade& operator=(const G4MuMinusCaptureCascade &right);
00079   G4MuMinusCaptureCascade(const G4MuMinusCaptureCascade& );
00080 
00081   G4double Emass, MuMass;
00082   G4ParticleDefinition* theElectron;
00083   G4ParticleDefinition* theGamma;
00084   G4ThreeVector randomVect;
00085 };
00086 
00087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00088 
00089 inline G4double G4MuMinusCaptureCascade::GetLinApprox(G4int N, 
00090                                                       const G4double* X, 
00091                                                       const G4double* Y, 
00092                                                       G4double Xuser)
00093 {
00094   G4double Yuser;
00095   if(Xuser <= X[0])        Yuser = Y[0];
00096   else if(Xuser >= X[N-1]) Yuser = Y[N-1];
00097   else {
00098     G4int i;
00099     for (i=1; i<N; i++){
00100       if(Xuser <= X[i]) break; 
00101     }    
00102 
00103     if(Xuser == X[i]) Yuser = Y[i];
00104     else Yuser = Y[i-1] + (Y[i] - Y[i-1])*(Xuser - X[i-1])/(X[i] - X[i-1]);
00105   }
00106   return Yuser;
00107 }
00108 
00109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00110 
00111 inline G4ThreeVector& G4MuMinusCaptureCascade::GetRandomVec() 
00112 {
00113   //
00114   // generate uniform vector
00115   //
00116   G4double cost = 2.0 * G4UniformRand() - 1.0;
00117   G4double sint = std::sqrt((1.0 - cost)*(1.0 + cost));
00118   G4double Phi  = CLHEP::twopi * G4UniformRand();
00119   randomVect = G4ThreeVector(sint * std::cos(Phi), sint * std::sin(Phi), cost);
00120   return randomVect;
00121 }
00122 
00123 #endif
00124 
00125 

Generated on Mon May 27 17:48:54 2013 for Geant4 by  doxygen 1.4.7