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4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 // Authors: S. Meylan and C. Villagrasa (IRSN, France)
 26 // Models come from
 27 // M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
 28 
 29 #include "G4DNAPTBIonisationStructure.hh"
 30 #include "G4Material.hh"
 31 #include "G4SystemOfUnits.hh"
 32 
 33 G4DNAPTBIonisationStructure::G4DNAPTBIonisationStructure()
 34 {
 35   fpTHF = G4Material::GetMaterial("THF", false);
 36   fpPY = G4Material::GetMaterial("PY", false);
 37   fpPU = G4Material::GetMaterial("PU", false);
 38   fpTMP = G4Material::GetMaterial("TMP", false);
 39   fpG4_WATER = G4Material::GetMaterial("G4_WATER", false);
 40   fpBackbone_THF = G4Material::GetMaterial("backbone_THF", false);
 41   fpCytosine_PY = G4Material::GetMaterial("cytosine_PY", false);
 42   fpThymine_PY = G4Material::GetMaterial("thymine_PY", false);
 43   fpAdenine_PU = G4Material::GetMaterial("adenine_PU", false);
 44   fpBackbone_TMP = G4Material::GetMaterial("backbone_TMP", false);
 45   fpGuanine_PU = G4Material::GetMaterial("guanine_PU", false);
 46   fpN2 = G4Material::GetMaterial("N2", false);
 47 
 48   // MPietrzak
 49   if (fpN2 != nullptr) {
 50     auto index = fpN2->GetIndex();
 51     energyConstant[index].push_back(15.58 * eV);
 52     energyConstant[index].push_back(17.07 * eV);
 53     energyConstant[index].push_back(21.00 * eV);
 54     energyConstant[index].push_back(41.72 * eV);
 55     energyConstant[index].push_back(409.9*eV);
 56   }
 57 
 58   // MPietrzak
 59   if (fpG4_WATER != nullptr) {
 60     auto index = fpG4_WATER->GetIndex();
 61     energyConstant[index].push_back(10.79 * eV);
 62     energyConstant[index].push_back(13.39 * eV);
 63     energyConstant[index].push_back(16.05 * eV);
 64     energyConstant[index].push_back(32.30 * eV);
 65     energyConstant[index].push_back(539.0 * eV);
 66   }
 67   if (fpTHF != nullptr) {
 68     auto index = fpTHF->GetIndex();
 69     energyConstant[index].push_back(9.74 * eV);
 70     energyConstant[index].push_back(12.31 * eV);
 71     energyConstant[index].push_back(12.99 * eV);
 72     energyConstant[index].push_back(13.57 * eV);
 73     energyConstant[index].push_back(13.60 * eV);
 74     energyConstant[index].push_back(15.11 * eV);
 75     energyConstant[index].push_back(15.97 * eV);
 76     energyConstant[index].push_back(16.28 * eV);
 77     energyConstant[index].push_back(18.19 * eV);
 78     energyConstant[index].push_back(18.69 * eV);
 79     energyConstant[index].push_back(22.14 * eV);
 80     energyConstant[index].push_back(22.25 * eV);
 81     energyConstant[index].push_back(27.21 * eV);
 82     energyConstant[index].push_back(28.97 * eV);
 83     energyConstant[index].push_back(36.97 * eV);
 84     energyConstant[index].push_back(305.07 * eV);
 85     energyConstant[index].push_back(305.08 * eV);
 86     energyConstant[index].push_back(306.17 * eV);
 87     energyConstant[index].push_back(306.17 * eV);
 88     energyConstant[index].push_back(557.94 * eV);
 89   }
 90 
 91   if (fpPY != nullptr) {
 92     auto index = fpPY->GetIndex();
 93     energyConstant[index].push_back(9.73 * eV);
 94     energyConstant[index].push_back(10.96 * eV);
 95     energyConstant[index].push_back(11.54 * eV);
 96     energyConstant[index].push_back(12.58 * eV);
 97     energyConstant[index].push_back(15.96 * eV);
 98     energyConstant[index].push_back(16.27 * eV);
 99     energyConstant[index].push_back(16.53 * eV);
100     energyConstant[index].push_back(17.98 * eV);
101     energyConstant[index].push_back(19.37 * eV);
102     energyConstant[index].push_back(20.52 * eV);
103     energyConstant[index].push_back(24.55 * eV);
104     energyConstant[index].push_back(24.64 * eV);
105     energyConstant[index].push_back(29.75 * eV);
106     energyConstant[index].push_back(33.02 * eV);
107     energyConstant[index].push_back(36.57 * eV);
108     energyConstant[index].push_back(305.92 * eV);
109     energyConstant[index].push_back(307.09 * eV);
110     energyConstant[index].push_back(307.09 * eV);
111     energyConstant[index].push_back(307.52 * eV);
112     energyConstant[index].push_back(423.44 * eV);
113     energyConstant[index].push_back(423.44 * eV);
114   }
115 
116   if (fpPU != nullptr) {
117     auto index = fpPU->GetIndex();
118     energyConstant[index].push_back(9.58 * eV);
119     energyConstant[index].push_back(10.57 * eV);
120     energyConstant[index].push_back(10.97 * eV);
121     energyConstant[index].push_back(12.22 * eV);
122     energyConstant[index].push_back(12.92 * eV);
123     energyConstant[index].push_back(13.44 * eV);
124     energyConstant[index].push_back(15.05 * eV);
125     energyConstant[index].push_back(16.56 * eV);
126     energyConstant[index].push_back(17.18 * eV);
127     energyConstant[index].push_back(17.88 * eV);
128     energyConstant[index].push_back(17.90 * eV);
129     energyConstant[index].push_back(19.11 * eV);
130     energyConstant[index].push_back(20.09 * eV);
131     energyConstant[index].push_back(21.70 * eV);
132     energyConstant[index].push_back(23.52 * eV);
133     energyConstant[index].push_back(24.35 * eV);
134     energyConstant[index].push_back(25.41 * eV);
135     energyConstant[index].push_back(29.34 * eV);
136     energyConstant[index].push_back(32.44 * eV);
137     energyConstant[index].push_back(33.67 * eV);
138     energyConstant[index].push_back(36.26 * eV);
139     energyConstant[index].push_back(38.22 * eV);
140     energyConstant[index].push_back(306.53 * eV);
141     energyConstant[index].push_back(307.19 * eV);
142     energyConstant[index].push_back(307.64 * eV);
143     energyConstant[index].push_back(308.14 * eV);
144     energyConstant[index].push_back(308.17 * eV);
145     energyConstant[index].push_back(423.31 * eV);
146     energyConstant[index].push_back(423.43 * eV);
147     energyConstant[index].push_back(423.64 * eV);
148     energyConstant[index].push_back(423.98 * eV);
149   }
150 
151   if (fpTMP != nullptr) {
152     auto index = fpTMP->GetIndex();
153     energyConstant[index].push_back(10.81 * eV);
154     energyConstant[index].push_back(10.81 * eV);
155     energyConstant[index].push_back(12.90 * eV);
156     energyConstant[index].push_back(13.32 * eV);
157     energyConstant[index].push_back(13.32 * eV);
158     energyConstant[index].push_back(13.59 * eV);
159     energyConstant[index].push_back(14.33 * eV);
160     energyConstant[index].push_back(14.33 * eV);
161     energyConstant[index].push_back(15.90 * eV);
162     energyConstant[index].push_back(17.09 * eV);
163     energyConstant[index].push_back(17.09 * eV);
164     energyConstant[index].push_back(17.13 * eV);
165     energyConstant[index].push_back(17.85 * eV);
166     energyConstant[index].push_back(17.85 * eV);
167     energyConstant[index].push_back(18.44 * eV);
168     energyConstant[index].push_back(19.37 * eV);
169     energyConstant[index].push_back(19.37 * eV);
170     energyConstant[index].push_back(21.40 * eV);
171     energyConstant[index].push_back(26.20 * eV);
172     energyConstant[index].push_back(26.20 * eV);
173     energyConstant[index].push_back(27.43 * eV);
174     energyConstant[index].push_back(35.23 * eV);
175     energyConstant[index].push_back(37.67 * eV);
176     energyConstant[index].push_back(37.67 * eV);
177     energyConstant[index].push_back(39.64 * eV);
178     energyConstant[index].push_back(152.42 * eV);
179     energyConstant[index].push_back(152.42 * eV);
180     energyConstant[index].push_back(152.44 * eV);
181     energyConstant[index].push_back(209.59 * eV);
182     energyConstant[index].push_back(306.92 * eV);
183     energyConstant[index].push_back(306.92 * eV);
184     energyConstant[index].push_back(306.92 * eV);
185     energyConstant[index].push_back(557.34 * eV);
186     energyConstant[index].push_back(559.40 * eV);
187     energyConstant[index].push_back(559.40 * eV);
188     energyConstant[index].push_back(559.41 * eV);
189     energyConstant[index].push_back(2178.05 * eV);
190   }
191 
192   for (const auto& [index, levels] : energyConstant) {
193     nLevels[index] = (G4int)levels.size();
194   }
195 }
196 
197 G4double G4DNAPTBIonisationStructure::IonisationEnergy(G4int level, const size_t& materialID)
198 {
199   size_t matNameModif = ReplaceMaterial(materialID);
200 
201   // check if the material exist in the map
202   if (energyConstant.find(matNameModif) == energyConstant.end()) {
203     std::ostringstream oss;
204     oss << "Material name was not found in energyConstantMap. Problematic material is: "
205         << materialID;
206     G4Exception(
207       "G4DNAPTBIonisationStructure::IonisationEnergy", "em0002", FatalException, oss.str().c_str());
208   }
209 
210   G4double ionisation = 0.;
211 
212   if (level >= 0 && level < nLevels[matNameModif]) ionisation = energyConstant[matNameModif][level];
213 
214   return ionisation;
215 }
216 
217 G4int G4DNAPTBIonisationStructure::NumberOfLevels(const size_t& materialID)
218 {
219   auto matNameModif = ReplaceMaterial(materialID);
220 
221   // check if the material exist in the map
222   if (nLevels.find(matNameModif) == nLevels.end()) {
223     std::ostringstream oss;
224     oss << "Material name was not found in energyConstantMap. Problematic material is: "
225         << matNameModif;
226     G4Exception(
227       "G4DNAPTBIonisationStructure::NumberOfLevels", "em0002", FatalException, oss.str().c_str());
228   }
229 
230   return nLevels[matNameModif];
231 }
232 
233 size_t G4DNAPTBIonisationStructure::ReplaceMaterial(const size_t& materialID)
234 {
235   if (fpBackbone_THF != nullptr && materialID == fpBackbone_THF->GetIndex()) {
236     return fpTHF->GetIndex();
237   }
238   if (fpBackbone_TMP != nullptr && materialID == fpBackbone_TMP->GetIndex()) {
239     return fpTMP->GetIndex();
240   }
241   if (fpAdenine_PU != nullptr && materialID == fpAdenine_PU->GetIndex()) {
242     return fpPU->GetIndex();
243   }
244   if (fpGuanine_PU != nullptr && materialID == fpGuanine_PU->GetIndex()) {
245     return fpPU->GetIndex();
246   }
247   if (fpThymine_PY != nullptr && materialID == fpThymine_PY->GetIndex()) {
248     return fpPY->GetIndex();
249   }
250   if (fpCytosine_PY != nullptr && materialID == fpCytosine_PY->GetIndex()) {
251     return fpPY->GetIndex();
252   }
253   return materialID;
254 }
255