Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 #include "G4DNASmoluchowskiReactionModel.hh" 28 #include "Randomize.hh" 29 #include "G4Track.hh" 30 #include "G4DNAMolecularReactionTable.hh" 31 #include "G4UnitsTable.hh" 32 #include "G4Molecule.hh" 33 #include "G4Exp.hh" 34 35 G4DNASmoluchowskiReactionModel::G4DNASmoluchow 36 37 G4DNASmoluchowskiReactionModel::~G4DNASmolucho 38 39 void G4DNASmoluchowskiReactionModel::Initialis 40 41 { 42 fpReactionData = fpReactionTable->GetReact 43 } 44 45 void G4DNASmoluchowskiReactionModel::Initialis 46 { 47 fpReactionData = fpReactionTable->GetReact 48 } 49 50 G4double G4DNASmoluchowskiReactionModel::GetRe 51 52 { 53 G4double __output = fpReactionTable->GetRe 54 return __output; 55 } 56 57 G4double G4DNASmoluchowskiReactionModel::GetRe 58 { 59 G4double __output = (*fpReactionData)[__i] 60 return __output; 61 } 62 63 G4bool G4DNASmoluchowskiReactionModel::FindRea 64 65 66 67 68 { 69 const G4double R2 = __reactionRadius * __r 70 G4double postStepSeparation = 0.; 71 bool do_break = false; 72 int k = 0; 73 74 for (; k < 3; ++k) 75 { 76 postStepSeparation += std::pow( 77 __trackA.GetPosition()[k] - __trac 78 79 if (postStepSeparation > R2) 80 { 81 do_break = true; 82 break; 83 } 84 } 85 86 if (!do_break) 87 { 88 // The loop was not break 89 // => r^2 < R^2 90 __separationDistance = std::sqrt(postS 91 return true; 92 } 93 if (__alongStepReaction) 94 { 95 //Along step check and the loop has br 96 97 // Continue loop 98 for (; k < 3; ++k) 99 { 100 postStepSeparation += std::pow( 101 __trackA.GetPosition()[k] - __ 102 } 103 // Use Green approach : the Brownian b 104 __separationDistance = (postStepSepara 105 106 auto pMoleculeA = GetMolecule(__trackA 107 auto pMoleculeB = GetMolecule(__trackB 108 109 G4double D = pMoleculeA->GetDiffusionC 110 + pMoleculeB->GetDiffusio 111 112 const auto& preStepPositionA = __track 113 const auto& preStepPositionB = __track 114 115 G4double preStepSeparation = (preStepP 116 117 //=================================== 118 // Brownian bridge 119 G4double __probabiltyOfEncounter = G4E 120 121 122 ); 123 G4double __selectedPOE = G4UniformRand 124 125 if (__selectedPOE <= __probabiltyOfEnc 126 { 127 return true; 128 } 129 //=================================== 130 } 131 132 return false; 133 } 134