Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:00

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 /// file: DamageModel.cc
0028 /// brief: Parameters related to the DNA Damage model
0029 
0030 #include "DamageModel.hh"
0031 
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 DamageModel::DamageModel()
0035 {
0036   fpDamageMessenger = new DamageModelMessenger(this);
0037 }
0038 
0039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0040 
0041 G4bool DamageModel::IsDirectStrandBreak(const G4double& d) const
0042 {
0043   G4bool bool_val = false;
0044   if (d < fDirectDmgLower) {
0045     bool_val = false;
0046   }
0047   else if (d >= fDirectDmgUpper) {
0048     bool_val = true;
0049   }
0050   else {
0051     bool_val = (G4UniformRand() < ((d - fDirectDmgLower) / (fDirectDmgUpper - fDirectDmgLower)));
0052   }
0053   return bool_val;
0054 }
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 G4bool DamageModel::IsIndirectBaseDamage(const G4MolecularConfiguration* mol) const
0059 {
0060   G4bool bool_val = false;
0061   if (mol->GetDefinition() == fOH) {
0062     bool_val = (G4UniformRand() < fBaseOH);
0063   }
0064   else if (mol->GetDefinition() == fH) {
0065     bool_val = (G4UniformRand() < fBaseH);
0066   }
0067   else if (mol->GetDefinition() == fe_aq) {
0068     bool_val = (G4UniformRand() < fBaseEaq);
0069   }
0070   else {
0071     bool_val = false;
0072   }
0073   return bool_val;
0074 }
0075 
0076 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0077 
0078 G4bool DamageModel::IsIndirectStrandDamage(const G4MolecularConfiguration* mol) const
0079 {
0080   G4bool bool_val = false;
0081   if (mol->GetDefinition() == fOH) {
0082     bool_val = (G4UniformRand() < fStrandOH);
0083   }
0084   else if (mol->GetDefinition() == G4Hydrogen::Definition()) {
0085     bool_val = (G4UniformRand() < fStrandH);
0086   }
0087   else if (mol->GetDefinition() == G4Electron_aq::Definition()) {
0088     bool_val = (G4UniformRand() < fStrandEaq);
0089   }
0090   else {
0091     bool_val = false;
0092   }
0093   return bool_val;
0094 }
0095 
0096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0097 
0098 G4bool DamageModel::IsInducedStrandBreak(const G4MolecularConfiguration* mol) const
0099 {
0100   G4bool bool_val = false;
0101   if (mol->GetDefinition() == fOH) {
0102     bool_val = (G4UniformRand() < fInductionOH);
0103   }
0104   else if (mol->GetDefinition() == G4Hydrogen::Definition()) {
0105     bool_val = (G4UniformRand() < fInductionH);
0106   }
0107   else if (mol->GetDefinition() == G4Electron_aq::Definition()) {
0108     bool_val = (G4UniformRand() < fInductionEaq);
0109   }
0110   else {
0111     bool_val = false;
0112   }
0113   return bool_val;
0114 }
0115 
0116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0117 
0118 void DamageModel::CheckValidProbability(const G4String& str, G4double p)
0119 {
0120   if ((p < 0) || (p > 1)) {
0121     G4ExceptionDescription errmsg;
0122     errmsg << "Invalid probability for " << str;
0123     G4Exception("DamageModel", "ERR_INVALID_PROB", FatalException, errmsg);
0124   }
0125 }