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 /// \file TimeStepAction.cc 28 /// \brief Implementation of the TimeStepActio 29 30 #include "TimeStepAction.hh" 31 #include "G4UnitsTable.hh" 32 #include "G4SystemOfUnits.hh" 33 34 #include "G4DNAChemistryManager.hh" 35 #include "G4MoleculeCounter.hh" 36 #include "G4MoleculeTable.hh" 37 #include "G4Scheduler.hh" 38 #include "UserMolecule.hh" 39 #include "G4ChemTimeStepModel.hh" 40 #include "G4EmParameters.hh" 41 #include "Analysis.hh" 42 #include "G4DNAMolecule.hh" 43 #include "G4H3O.hh" 44 #include "G4OH.hh" 45 #include "G4H2O2.hh" 46 #include "G4H2.hh" 47 #include "G4Hydrogen.hh" 48 #include "G4Electron_aq.hh" 49 #include "G4ParticleTable.hh" 50 #include "G4ParticleDefinition.hh" 51 //....oooOO0OOooo........oooOO0OOooo........oo 52 53 TimeStepAction::TimeStepAction() 54 : G4UserTimeStepAction() 55 { 56 auto param = G4EmParameters::Instance(); 57 if (param->GetTimeStepModel() == G4ChemTim 58 AddTimeStep(1*picosecond,0.1*picosecon 59 AddTimeStep(10*picosecond,1*picosecond 60 AddTimeStep(100*picosecond,3*picosecon 61 AddTimeStep(1000*picosecond,10*picosec 62 AddTimeStep(10000*picosecond,100*picos 63 } 64 } 65 66 //....oooOO0OOooo........oooOO0OOooo........oo 67 68 69 TimeStepAction::TimeStepAction(const TimeStepA 70 : G4UserTimeStepAction(other) 71 {} 72 73 //....oooOO0OOooo........oooOO0OOooo........oo 74 75 TimeStepAction& TimeStepAction::operator=(cons 76 { 77 if (this == &rhs) return *this; // handle 78 //assignment operator 79 return *this; 80 } 81 82 //....oooOO0OOooo........oooOO0OOooo........oo 83 84 void TimeStepAction::StartProcessing() 85 { 86 87 G4cout<<"Start chemistry "<<G4Scheduler::I 88 G4cout<<"Chemical endTime "<<G4Scheduler:: 89 } 90 91 //....oooOO0OOooo........oooOO0OOooo........oo 92 93 void TimeStepAction::UserReactionAction(const 94 const std::vector<G4Track*>* products) 95 { 96 97 // *************************************** 98 // Flag Part 99 // *************************************** 100 // 101 // set the flags 102 103 fReactif1 = 0; 104 fReactif2 = 0; 105 fProduct1 = 0; 106 fProduct2 = 0; 107 108 fReactif1 = SetParticleFlag(a.GetDynamicPa 109 fReactif2 = SetParticleFlag(b.GetDynamicPa 110 if(products) 111 { 112 for(unsigned int i=0;i<products->size( 113 { 114 switch(i) 115 { 116 case 0: 117 fProduct1 = SetParticleFlag((( 118 break; 119 case 1: 120 fProduct2 = SetParticleFlag((( 121 break; 122 default: 123 break; 124 } 125 } 126 } 127 128 // *************************************** 129 // Save Part 130 // *************************************** 131 // For DBScan 132 G4int base; 133 134 if( (fReactif1==3 || fReactif2 ==3) // OH 135 && ( 136 (fReactif1==8 || fReactif2 ==8) // 137 || (fReactif1==9 || fReactif2 138 || (fReactif1==10|| fReactif2 ==10) // Ade 139 || (fReactif1==11|| fReactif2 ==11) // 140 || (fReactif1==12|| fReactif2 ==12) // 141 || (fReactif1==13|| fReactif2 ==13) // 142 ) ) 143 { 144 // Retrieve the dna molecule 145 const G4Track* dnaMolecule = nullptr; 146 const G4Track* radical = nullptr; 147 // 148 if (a.GetDynamicParticle()->GetDefinit 149 dnaMolecule = &b; 150 radical = &a; 151 } 152 else { 153 dnaMolecule = &a; 154 radical = &b; 155 } 156 157 auto _dnaMolecule = dynamic_cast<UserM 158 if (_dnaMolecule) { 159 G4int copyNo = _dnaMolecule->GetCo 160 G4int strand = _dnaMolecule->GetSt 161 162 if((fReactif1==8 || fReactif2 ==8) 163 || (fReactif1==9 || fReactif2 164 { 165 base=0; 166 } 167 else 168 { 169 base=1; 170 } 171 172 // Retrieve the molecule coordinat 173 auto analysisManager = Analysis::G 174 analysisManager->FillNtupleIColumn 175 analysisManager->FillNtupleIColumn 176 analysisManager->FillNtupleDColumn 177 analysisManager->FillNtupleDColumn 178 analysisManager->FillNtupleDColumn 179 analysisManager->FillNtupleDColumn 180 analysisManager->FillNtupleIColumn 181 analysisManager->AddNtupleRow(1); 182 } else { 183 G4String msg = "Error in Downcasti 184 G4Exception("TimeStepAction::UserR 185 } 186 187 } 188 189 } 190 191 //....oooOO0OOooo........oooOO0OOooo........oo 192 193 G4int TimeStepAction::SetParticleFlag(const G4 194 { 195 G4int flag (0); 196 197 if(partDef == G4H3O::Definition()) flag = 198 else if(partDef == G4OH::Definition()) fla 199 else if(partDef == G4Electron_aq::Definiti 200 else if(partDef == G4Hydrogen::Definition( 201 else if(partDef == G4H2::Definition()) fla 202 else if(partDef == G4H2O2::Definition()) f 203 else if(partDef == G4Deoxyribose::Definiti 204 else if(partDef == G4Phosphate::Definition 205 else if(partDef == G4Adenine::Definition() 206 else if(partDef == G4Thymine::Definition() 207 else if(partDef == G4Guanine::Definition() 208 else if(partDef == G4Cytosine::Definition( 209 else if(partDef == G4Histone::Definition() 210 else if(partDef == G4DamagedDeoxyribose::D 211 else if(partDef == G4DamagedAdenine::Defin 212 else if(partDef == G4DamagedThymine::Defin 213 else if(partDef == G4DamagedCytosine::Defi 214 else if(partDef == G4DamagedGuanine::Defin 215 else { 216 G4ParticleDefinition* OHm =G4ParticleT 217 if (OHm && partDef == OHm) { 218 flag = 2; 219 } 220 } 221 return flag; 222 } 223 224 //....oooOO0OOooo........oooOO0OOooo........oo 225