Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 26 27 #include "globals.hh" 27 #include "globals.hh" 28 #include "G4DNAMakeReaction.hh" 28 #include "G4DNAMakeReaction.hh" 29 #include <G4DNAMolecularReactionTable.hh> 29 #include <G4DNAMolecularReactionTable.hh> 30 #include <memory> << 31 #include "G4DNAIndependentReactionTimeModel.hh 30 #include "G4DNAIndependentReactionTimeModel.hh" 32 #include "G4DNAIndependentReactionTimeStepper. 31 #include "G4DNAIndependentReactionTimeStepper.hh" 33 #include "G4DiffusionControlledReactionModel.h 32 #include "G4DiffusionControlledReactionModel.hh" 34 #include "G4Molecule.hh" 33 #include "G4Molecule.hh" >> 34 #include "G4ReferenceCast.hh" 35 #include "G4VDNAReactionModel.hh" 35 #include "G4VDNAReactionModel.hh" >> 36 #include "G4DNAReactionTypeManager.hh" 36 #include "G4ChemicalMoleculeFinder.hh" 37 #include "G4ChemicalMoleculeFinder.hh" 37 38 38 G4DNAIndependentReactionTimeModel::G4DNAIndepe << 39 G4DNAIndependentReactionTimeModel::G4DNAIndependentReactionTimeModel(const G4String& name) 39 const G4String& name) << 40 : G4DNAIndependentReactionTimeModel(name, 40 : G4DNAIndependentReactionTimeModel( << 41 std::unique_ptr<G4DNAIndependentReactionTimeStepper> 41 name, std::make_unique<G4DNAIndependentR << 42 (new G4DNAIndependentReactionTimeStepper()), 42 std::make_unique<G4DNAMakeReaction>()) << 43 std::unique_ptr<G4DNAMakeReaction> >> 44 (new G4DNAMakeReaction())) 43 {} 45 {} 44 46 45 G4DNAIndependentReactionTimeModel::G4DNAIndepe << 47 G4DNAIndependentReactionTimeModel::G4DNAIndependentReactionTimeModel(const G4String& name, 46 const G4String& name, std::unique_ptr<G4VITT << 48 std::unique_ptr<G4VITTimeStepComputer> pTimeStepper, 47 std::unique_ptr<G4VITReactionProcess> pReact << 49 std::unique_ptr<G4VITReactionProcess> pReactionProcess) 48 : G4VITStepModel(std::move(pTimeStepper), st << 50 : G4VITStepModel(std::move(pTimeStepper), >> 51 std::move(pReactionProcess), >> 52 name) >> 53 , fMolecularReactionTable(reference_cast<const G4DNAMolecularReactionTable*>(fpReactionTable)) 49 { 54 { 50 fType1 = G4Molecule::ITType(); << 55 fType1 = G4Molecule::ITType(); 51 fType2 = G4Molecule::ITType(); << 56 fType2 = G4Molecule::ITType(); 52 } 57 } 53 58 54 G4DNAIndependentReactionTimeModel::~G4DNAIndep << 59 G4DNAIndependentReactionTimeModel::~G4DNAIndependentReactionTimeModel() = default; 55 default; << 56 60 57 void G4DNAIndependentReactionTimeModel::Initia 61 void G4DNAIndependentReactionTimeModel::Initialize() 58 { 62 { 59 if(fpReactionTable == nullptr) << 63 if(fpReactionTable == nullptr) 60 { << 64 { 61 SetReactionTable(G4DNAMolecularReactionTab << 65 SetReactionTable(G4DNAMolecularReactionTable::GetReactionTable()); 62 } << 66 } 63 << 67 64 if(!fpReactionModel) << 68 if(!fpReactionModel) 65 { << 69 { 66 fpReactionModel = std::make_unique<G4Diffu << 70 fpReactionModel.reset(new G4DiffusionControlledReactionModel()); 67 } << 71 } 68 << 72 69 fpReactionModel->SetReactionTable( << 73 fpReactionModel->SetReactionTable((const G4DNAMolecularReactionTable*) fpReactionTable); 70 (const G4DNAMolecularReactionTable*) fpRea << 74 71 << 75 ((G4DiffusionControlledReactionModel*) fpReactionModel.get())->SetReactionTypeManager(fReactionTypeManager.get()); 72 ((G4DNAMakeReaction*) fpReactionProcess.get( << 76 73 ->SetReactionModel(fpReactionModel.get()); << 77 ((G4DNAMakeReaction*) fpReactionProcess.get())->SetReactionModel(fpReactionModel.get()); 74 << 78 75 ((G4DNAMakeReaction*) fpReactionProcess.get( << 79 ((G4DNAMakeReaction*) fpReactionProcess.get())->SetTimeStepComputer(fpTimeStepper.get()); 76 ->SetTimeStepComputer(fpTimeStepper.get()) << 80 77 << 81 ((G4DNAIndependentReactionTimeStepper*) fpTimeStepper.get())->SetReactionModel(fpReactionModel.get()); 78 ((G4DNAIndependentReactionTimeStepper*) fpTi << 82 79 ->SetReactionModel(fpReactionModel.get()); << 83 ((G4DNAIndependentReactionTimeStepper*) fpTimeStepper.get())->SetReactionTypeManager(fReactionTypeManager.get()); 80 << 84 81 ((G4DNAIndependentReactionTimeStepper*) fpTi << 85 ((G4DNAIndependentReactionTimeStepper*) fpTimeStepper.get())->SetReactionProcess((fpReactionProcess).get()); 82 ->SetReactionProcess((fpReactionProcess).g << 86 83 << 87 G4ChemicalMoleculeFinder::Instance()->Clear(); 84 G4ChemicalMoleculeFinder::Instance()->Clear( << 88 G4VITStepModel::Initialize(); 85 G4ChemicalMoleculeFinder::Instance()->SetOct << 86 G4VITStepModel::Initialize(); << 87 } 89 } 88 void G4DNAIndependentReactionTimeModel::PrintI 90 void G4DNAIndependentReactionTimeModel::PrintInfo() 89 { 91 { 90 #ifdef G4VERBOSE 92 #ifdef G4VERBOSE 91 if(G4Threading::IsMultithreadedApplication() << 93 if(G4Threading::IsMultithreadedApplication()) 92 { << 94 { 93 if(G4Threading::G4GetThreadId() == 0) << 95 if(G4Threading::G4GetThreadId() == 0) >> 96 { >> 97 G4VITStepModel::PrintInfo(); >> 98 G4cout<<G4endl; >> 99 G4cout << fName << " will be used ==========================" << G4endl; >> 100 G4cout<<G4endl; >> 101 G4cout << "===============================" >> 102 "========================================"<<G4endl; >> 103 G4cout<<G4endl; >> 104 >> 105 } >> 106 } >> 107 else 94 { 108 { 95 G4VITStepModel::PrintInfo(); << 109 G4VITStepModel::PrintInfo(); 96 G4cout << G4endl; << 110 G4cout<<G4endl; 97 G4cout << fName << " will be used ====== << 111 G4cout << fName << " will be used ==========================" << G4endl; 98 G4cout << G4endl; << 112 G4cout<<G4endl; 99 G4cout << "============================= << 113 G4cout << "===============================" 100 "============================= << 114 "========================================"<<G4endl; 101 << G4endl; << 115 G4cout<<G4endl; 102 G4cout << G4endl; << 116 103 } 117 } 104 } << 105 else << 106 { << 107 G4VITStepModel::PrintInfo(); << 108 G4cout << G4endl; << 109 G4cout << fName << " will be used ======== << 110 G4cout << G4endl; << 111 G4cout << "=============================== << 112 "=============================== << 113 << G4endl; << 114 G4cout << G4endl; << 115 } << 116 #endif 118 #endif 117 } 119 } 118 120 119 void G4DNAIndependentReactionTimeModel::SetRea << 121 void G4DNAIndependentReactionTimeModel::SetReactionModel(G4VDNAReactionModel* pReactionModel) 120 G4VDNAReactionModel* pReactionModel) << 121 { 122 { 122 fpReactionModel.reset(pReactionModel); << 123 fpReactionModel.reset(pReactionModel); 123 } 124 } 124 125 125 G4VDNAReactionModel* G4DNAIndependentReactionT 126 G4VDNAReactionModel* G4DNAIndependentReactionTimeModel::GetReactionModel() 126 { 127 { 127 return fpReactionModel.get(); << 128 return fpReactionModel.get(); 128 } << 129 } >> 130 >> 131 void G4DNAIndependentReactionTimeModel::SetReactionTypeManager(G4VReactionTypeManager* pReactionProcessManager) >> 132 { >> 133 fReactionTypeManager.reset(pReactionProcessManager); >> 134 } 135