// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: G4MuBremsstrahlungModel.cc,v 1.33 2009/02/20 14:48:16 vnivanch Exp $ // GEANT4 tag $Name: geant4-09-02-ref-02 $ // // ------------------------------------------------------------------- // // GEANT4 Class file // // // File name: G4MuBremsstrahlungModel // // Author: Vladimir Ivanchenko on base of Laszlo Urban code // // Creation date: 24.06.2002 // // Modifications: // // 04-12-02 Change G4DynamicParticle constructor in PostStepDoIt (V.Ivanchenko) // 23-12-02 Change interface in order to move to cut per region (V.Ivanchenko) // 24-01-03 Fix for compounds (V.Ivanchenko) // 27-01-03 Make models region aware (V.Ivanchenko) // 13-02-03 Add name (V.Ivanchenko) // 10-02-04 Add lowestKinEnergy (V.Ivanchenko) // 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko) // 03-08-05 Angular correlations according to PRM (V.Ivanchenko) // 13-02-06 add ComputeCrossSectionPerAtom (mma) // 21-03-06 Fix problem of initialisation in case when cuts are not defined (VI) // 07-11-07 Improve sampling of final state (A.Bogdanov) // 28-02-08 Use precomputed Z^1/3 and Log(A) (V.Ivanchenko) // // // Class Description: // // // ------------------------------------------------------------------- // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "G4MuBremsstrahlungModel.hh" #include "G4Gamma.hh" #include "G4MuonMinus.hh" #include "G4MuonPlus.hh" #include "Randomize.hh" #include "G4Material.hh" #include "G4Element.hh" #include "G4ElementVector.hh" #include "G4ProductionCutsTable.hh" #include "G4ParticleChangeForLoss.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... using namespace std; G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition* p, const G4String& nam) : G4VEmModel(nam), particle(0), sqrte(sqrt(exp(1.))), bh(202.4), bh1(446.), btf(183.), btf1(1429.), fParticleChange(0), lowestKinEnergy(1.0*GeV), minThreshold(1.0*keV) { theGamma = G4Gamma::Gamma(); nist = G4NistManager::Instance(); if(p) SetParticle(p); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4MuBremsstrahlungModel::~G4MuBremsstrahlungModel() { size_t n = partialSumSigma.size(); if(n > 0) { for(size_t i=0; iGetTableSize(); // clear old data G4int nn = partialSumSigma.size(); G4int nc = cuts.size(); if(nn > 0) { for (G4int ii=0; ii0) { for (G4int i=0; iGetMaterialCutsCouple(i); const G4Material* material = couple->GetMaterial(); G4DataVector* dv = ComputePartialSumSigma(material,fixedEnergy,cute); partialSumSigma.push_back(dv); } } } // define pointer to G4ParticleChange if(!fParticleChange) { if(pParticleChange) fParticleChange = reinterpret_cast(pParticleChange); else fParticleChange = new G4ParticleChangeForLoss(); } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4double G4MuBremsstrahlungModel::ComputeDEDXPerVolume( const G4Material* material, const G4ParticleDefinition*, G4double kineticEnergy, G4double cutEnergy) { G4double dedx = 0.0; if (kineticEnergy <= lowestKinEnergy) return dedx; G4double tmax = kineticEnergy; G4double cut = std::min(cutEnergy,tmax); if(cut < minThreshold) cut = minThreshold; const G4ElementVector* theElementVector = material->GetElementVector(); const G4double* theAtomicNumDensityVector = material->GetAtomicNumDensityVector(); // loop for elements in the material for (size_t i=0; iGetNumberOfElements(); i++) { G4double loss = ComputMuBremLoss((*theElementVector)[i]->GetZ(), kineticEnergy, cut); dedx += loss*theAtomicNumDensityVector[i]; } // G4cout << "BR e= " << kineticEnergy << " dedx= " << dedx << G4endl; if(dedx < 0.) dedx = 0.; return dedx; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, G4double tkin, G4double cut) { G4double totalEnergy = mass + tkin; G4double ak1 = 0.05; G4int k2=5; G4double xgi[]={0.03377,0.16940,0.38069,0.61931,0.83060,0.96623}; G4double wgi[]={0.08566,0.18038,0.23396,0.23396,0.18038,0.08566}; G4double loss = 0.; G4double vcut = cut/totalEnergy; G4double vmax = tkin/totalEnergy; G4double aaa = 0.; G4double bbb = vcut; if(vcut>vmax) bbb=vmax ; G4int kkk = (G4int)((bbb-aaa)/ak1)+k2 ; G4double hhh=(bbb-aaa)/float(kkk) ; G4double aa = aaa; for(G4int l=0; l= tkin) return cross; G4double vcut = cut/totalEnergy; G4double vmax = tkin/totalEnergy; G4double aaa = log(vcut); G4double bbb = log(vmax); G4int kkk = (G4int)((bbb-aaa)/ak1)+k2 ; G4double hhh = (bbb-aaa)/G4double(kkk); G4double aa = aaa; for(G4int l=0; l