Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // >> 23 // $Id: G4eeToTwoPiModel.cc,v 1.3 2005/11/29 08:13:07 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-08-00 $ 26 // 25 // 27 // ------------------------------------------- 26 // ------------------------------------------------------------------- 28 // 27 // 29 // GEANT4 Class header file 28 // GEANT4 Class header file 30 // 29 // 31 // 30 // 32 // File name: G4eeToTwoPiModel 31 // File name: G4eeToTwoPiModel 33 // 32 // 34 // Author: Vladimir Ivanchenko 33 // Author: Vladimir Ivanchenko 35 // 34 // 36 // Creation date: 25.10.2003 35 // Creation date: 25.10.2003 37 // 36 // 38 // Modifications: 37 // Modifications: 39 // 38 // 40 // 39 // 41 // ------------------------------------------- 40 // ------------------------------------------------------------------- 42 // 41 // 43 42 44 43 45 //....oooOO0OOooo........oooOO0OOooo........oo 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 46 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 47 46 48 #include "G4eeToTwoPiModel.hh" 47 #include "G4eeToTwoPiModel.hh" 49 #include "Randomize.hh" 48 #include "Randomize.hh" 50 #include "G4PhysicalConstants.hh" << 51 #include "G4SystemOfUnits.hh" << 52 #include "G4PionPlus.hh" 49 #include "G4PionPlus.hh" 53 #include "G4PionMinus.hh" 50 #include "G4PionMinus.hh" 54 #include "G4DynamicParticle.hh" 51 #include "G4DynamicParticle.hh" 55 #include "G4PhysicsVector.hh" 52 #include "G4PhysicsVector.hh" 56 #include "G4PhysicsLinearVector.hh" 53 #include "G4PhysicsLinearVector.hh" 57 #include "G4eeCrossSections.hh" 54 #include "G4eeCrossSections.hh" 58 55 59 //....oooOO0OOooo........oooOO0OOooo........oo 56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 57 61 using namespace std; 58 using namespace std; 62 59 63 G4eeToTwoPiModel::G4eeToTwoPiModel(G4eeCrossSe << 60 G4eeToTwoPiModel::G4eeToTwoPiModel(G4eeCrossSections* cr): 64 G4double maxkinEnergy, << 61 cross(cr) 65 G4double binWidth) << 66 : G4Vee2hadrons(cr, << 67 2.0*G4PionPlus::PionPlus()->GetPDGMass() << 68 maxkinEnergy, << 69 binWidth) << 70 { 62 { 71 G4cout << "#####G4eeToTwoPiModel####" << G4e << 63 Initialise(); 72 << 73 massPi = G4PionPlus::PionPlus()->GetPDGMass( << 74 massRho = 775.5*CLHEP::MeV; << 75 } 64 } 76 65 77 //....oooOO0OOooo........oooOO0OOooo........oo 66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 78 67 79 G4eeToTwoPiModel::~G4eeToTwoPiModel() 68 G4eeToTwoPiModel::~G4eeToTwoPiModel() 80 {} 69 {} 81 70 82 //....oooOO0OOooo........oooOO0OOooo........oo 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 83 72 84 G4double G4eeToTwoPiModel::PeakEnergy() const << 73 void G4eeToTwoPiModel::Initialise() 85 { 74 { 86 return massRho; << 75 massPi = G4PionPlus::PionPlus()->GetPDGMass(); >> 76 massRho = 770.*MeV; >> 77 highEnergy = 1.*GeV; >> 78 cross = new G4eeCrossSections(); 87 } 79 } 88 80 89 //....oooOO0OOooo........oooOO0OOooo........oo 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 90 82 91 G4double G4eeToTwoPiModel::ComputeCrossSection << 83 G4PhysicsVector* G4eeToTwoPiModel::PhysicsVector(G4double emin, >> 84 G4double emax) const 92 { 85 { 93 return cross->CrossSection2pi(e); << 86 G4double tmin = max(emin, 2.0*massPi); >> 87 G4double tmax = max(tmin, emax); >> 88 G4int nbins = (G4int)((tmax - tmin)/(5.*MeV)); >> 89 G4PhysicsVector* v = new G4PhysicsLinearVector(emin,emax,nbins); >> 90 return v; 94 } 91 } 95 92 96 //....oooOO0OOooo........oooOO0OOooo........oo 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 97 94 98 void G4eeToTwoPiModel::SampleSecondaries(std:: << 95 vector<G4DynamicParticle*>* G4eeToTwoPiModel::SampleSecondaries( 99 G4double e, const G4ThreeVector& directi << 96 G4double e, const G4ThreeVector& direction) const 100 { 97 { 101 << 98 vector<G4DynamicParticle*>* newp = new vector<G4DynamicParticle*>; 102 G4double tkin = 0.5*e - massPi; 99 G4double tkin = 0.5*e - massPi; 103 if(tkin < 0.0) tkin = 0.0; 100 if(tkin < 0.0) tkin = 0.0; 104 G4double cost; 101 G4double cost; 105 do { 102 do { 106 cost = 2.0*G4UniformRand() - 1.0; 103 cost = 2.0*G4UniformRand() - 1.0; 107 // Loop checking, 07-Aug-2015, Vladimir Iv << 108 } while( G4UniformRand() > 1.0 - cost*cost ) 104 } while( G4UniformRand() > 1.0 - cost*cost ); 109 105 110 G4double sint = sqrt(1.0 - cost*cost); 106 G4double sint = sqrt(1.0 - cost*cost); 111 G4double phi = twopi * G4UniformRand(); 107 G4double phi = twopi * G4UniformRand(); 112 108 113 G4ThreeVector dir(sint*cos(phi),sint*sin(phi 109 G4ThreeVector dir(sint*cos(phi),sint*sin(phi), cost); 114 dir.rotateUz(direction); 110 dir.rotateUz(direction); 115 111 116 // create G4DynamicParticle objects << 112 // create G4DynamicParticle object for delta ray 117 G4DynamicParticle* pip = 113 G4DynamicParticle* pip = 118 new G4DynamicParticle(G4PionPlus::PionPlu 114 new G4DynamicParticle(G4PionPlus::PionPlus(),dir,tkin); 119 G4DynamicParticle* pin = 115 G4DynamicParticle* pin = 120 new G4DynamicParticle(G4PionMinus::PionMi 116 new G4DynamicParticle(G4PionMinus::PionMinus(),-dir,tkin); 121 newp->push_back(pip); 117 newp->push_back(pip); 122 newp->push_back(pin); 118 newp->push_back(pin); >> 119 return newp; 123 } 120 } 124 121 125 //....oooOO0OOooo........oooOO0OOooo........oo 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 126 123 127 124