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 #include "DamageModelMessenger.hh"
0028 
0029 #include "DamageModel.hh"
0030 
0031 #include "G4UIcmdWith3VectorAndUnit.hh"
0032 #include "G4UIcmdWithABool.hh"
0033 #include "G4UIcmdWithADouble.hh"
0034 #include "G4UIcmdWithADoubleAndUnit.hh"
0035 #include "G4UIcmdWithAString.hh"
0036 #include "G4UIcmdWithAnInteger.hh"
0037 #include "G4UIcmdWithoutParameter.hh"
0038 #include "G4UIdirectory.hh"
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 
0042 DamageModelMessenger::DamageModelMessenger(DamageModel* damageModel)
0043   : fpDamageModel(damageModel),
0044     fpDamageDirectory(nullptr),
0045     fpIntEnergyLower(nullptr),
0046     fpIntEnergyUpper(nullptr),
0047     fpOHBaseChance(nullptr),
0048     fpOHStrandChance(nullptr),
0049     fpOHInductionChance(nullptr),
0050     fpHBaseChance(nullptr),
0051     fpHStrandChance(nullptr),
0052     fpHInductionChance(nullptr),
0053     fpEaqBaseChance(nullptr),
0054     fpEaqStrandChance(nullptr),
0055     fpEaqInductionChance(nullptr)
0056 {
0057   fpDamageDirectory = new G4UIdirectory("/dnadamage/");
0058   fpDamageDirectory->SetGuidance("Damage Model Parameters");
0059 
0060   fpIntEnergyLower = new G4UIcmdWithADoubleAndUnit("/dnadamage/directDamageLower", this);
0061   fpIntEnergyLower->SetGuidance("Minimum Energy required for an SSB");
0062   fpIntEnergyLower->SetGuidance("Chance grows linearly until it reaches the upper value");
0063   fpIntEnergyLower->SetParameterName("Energy", false);
0064 
0065   fpIntEnergyUpper = new G4UIcmdWithADoubleAndUnit("/dnadamage/directDamageUpper", this);
0066   fpIntEnergyUpper->SetGuidance("Energy required for an SSB to definitely occur");
0067   fpIntEnergyUpper->SetParameterName("Energy", false);
0068 
0069   // OH
0070 
0071   fpOHBaseChance = new G4UIcmdWithADouble("/dnadamage/indirectOHBaseChance", this);
0072   fpOHBaseChance->SetGuidance("Chance [0,1] of a OH damaging a base");
0073   fpOHBaseChance->SetParameterName("Energy", false);
0074 
0075   fpOHStrandChance = new G4UIcmdWithADouble("/dnadamage/indirectOHStrandChance", this);
0076   fpOHStrandChance->SetGuidance("Chance [0,1] of a OH damaging sugar-phosphate");
0077   fpOHStrandChance->SetParameterName("Energy", false);
0078 
0079   fpOHInductionChance = new G4UIcmdWithADouble("/dnadamage/inductionOHChance", this);
0080   fpOHInductionChance->SetGuidance("Chance [0,1] of a Base + OH -> strand break");
0081   fpOHInductionChance->SetParameterName("Energy", false);
0082 
0083   // H
0084 
0085   fpHBaseChance = new G4UIcmdWithADouble("/dnadamage/indirectHBaseChance", this);
0086   fpHBaseChance->SetGuidance("Chance [0,1] of a H damaging a base");
0087   fpHBaseChance->SetParameterName("Energy", false);
0088 
0089   fpHStrandChance = new G4UIcmdWithADouble("/dnadamage/indirectHStrandChance", this);
0090   fpHStrandChance->SetGuidance("Chance [0,1] of a H damaging sugar-phosphate");
0091   fpHStrandChance->SetParameterName("Energy", false);
0092 
0093   fpHInductionChance = new G4UIcmdWithADouble("/dnadamage/inductionHChance", this);
0094   fpHInductionChance->SetGuidance("Chance [0,1] of a Base + H -> strand break");
0095   fpHInductionChance->SetParameterName("Energy", false);
0096 
0097   // E_aq
0098 
0099   fpEaqBaseChance = new G4UIcmdWithADouble("/dnadamage/indirectEaqBaseChance", this);
0100   fpEaqBaseChance->SetGuidance("Chance [0,1] of a Eaq damaging a base");
0101   fpEaqBaseChance->SetParameterName("Energy", false);
0102 
0103   fpEaqStrandChance = new G4UIcmdWithADouble("/dnadamage/indirectEaqStrandChance", this);
0104   fpEaqStrandChance->SetGuidance("Chance [0,1] of a Eaq damaging sugar-phosphate");
0105   fpEaqStrandChance->SetParameterName("Energy", false);
0106 
0107   fpEaqInductionChance = new G4UIcmdWithADouble("/dnadamage/inductionEaqChance", this);
0108   fpEaqInductionChance->SetGuidance("Chance [0,1] of a Base + Eaq -> strand break");
0109   fpEaqInductionChance->SetParameterName("Energy", false);
0110 }
0111 
0112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0113 
0114 DamageModelMessenger::~DamageModelMessenger()
0115 {
0116   // interaction model
0117   delete fpOHStrandChance;
0118   delete fpOHInductionChance;
0119   delete fpOHBaseChance;
0120   delete fpHStrandChance;
0121   delete fpHInductionChance;
0122   delete fpHBaseChance;
0123   delete fpEaqStrandChance;
0124   delete fpEaqInductionChance;
0125   delete fpEaqBaseChance;
0126   delete fpIntEnergyLower;
0127   delete fpIntEnergyUpper;
0128   delete fpIntRangeDirect;
0129   delete fpDamageDirectory;
0130 }
0131 
0132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0133 
0134 void DamageModelMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0135 {
0136   if (command == fpIntEnergyUpper) {
0137     fpDamageModel->SetDirectDamageUpper(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(newValue));
0138   }
0139   else if (command == fpIntEnergyLower) {
0140     fpDamageModel->SetDirectDamageLower(G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(newValue));
0141   }
0142   else if (command == fpOHBaseChance) {
0143     fpDamageModel->SetIndirectOHBaseChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0144   }
0145   else if (command == fpOHStrandChance) {
0146     fpDamageModel->SetIndirectOHStrandChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0147   }
0148   else if (command == fpOHInductionChance) {
0149     fpDamageModel->SetInductionOHChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0150   }
0151   else if (command == fpHBaseChance) {
0152     fpDamageModel->SetIndirectHBaseChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0153   }
0154   else if (command == fpHStrandChance) {
0155     fpDamageModel->SetIndirectHStrandChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0156   }
0157   else if (command == fpHInductionChance) {
0158     fpDamageModel->SetInductionHChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0159   }
0160   else if (command == fpEaqBaseChance) {
0161     fpDamageModel->SetIndirectEaqBaseChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0162   }
0163   else if (command == fpEaqStrandChance) {
0164     fpDamageModel->SetIndirectEaqStrandChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0165   }
0166   else if (command == fpEaqInductionChance) {
0167     fpDamageModel->SetInductionEaqChance(G4UIcmdWithADouble::GetNewDoubleValue(newValue));
0168   }
0169 }
0170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......