36 : fStringOfMaterials(applyToMaterial),
fName(nam)
44 std::map<G4String, std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > >::iterator posOuter;
45 std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator posInner;
50 for(posInner = posOuter->second.begin(); posInner != posOuter->second.end(); ++posInner)
53 if(table != 0)
delete table;
77 G4String fileElectron, fileDiffElectron;
78 G4String materialName, modelParticleName;
85 for(
unsigned int i=0;i<applyToMatVect.size();++i)
97 if(applyToMatVect[i] ==
fModelMaterials[j] || applyToMatVect[i] ==
"all")
116 std::ostringstream oss;
117 oss << applyToMatVect[i] <<
" material was not found. It means the material specified in the UserPhysicsList is not a model material for ";
119 G4Exception(
"G4VDNAModel::LoadCrossSectionData",
"em0003",
128 G4String text(
"ReadDiffCSFile must be implemented in the model class using a differential cross section data file");
130 G4Exception(
"G4VDNAModel::ReadDiffCSFile",
"em0003",
142 std::vector<G4String> materialVect;
145 if(materials.find(
"/")==std::string::npos)
148 materialVect.push_back(materials);
153 G4String materialsNonIdentified = materials;
155 while(materialsNonIdentified.find_first_of(
"/") != std::string::npos)
158 G4String mat = materialsNonIdentified.substr(0, materialsNonIdentified.find_first_of(
"/"));
159 materialVect.push_back(mat);
162 materialsNonIdentified = materialsNonIdentified.substr(materialsNonIdentified.find_first_of(
"/")+1,
163 materialsNonIdentified.size()-materialsNonIdentified.find_first_of(
"/"));
168 materialVect.push_back(materialsNonIdentified);
179 fTableData[materialName][particleName]->LoadData(file);
188 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
189 pos = (*tableData)[materialName].find(particle);
191 if (pos != (*tableData)[materialName].end())
206 value += valuesBuffer[i];
217 if (valuesBuffer[i] > value)
219 delete[] valuesBuffer;
222 value -= valuesBuffer[i];
225 if (valuesBuffer)
delete[] valuesBuffer;
231 G4Exception(
"G4VDNAModel::RandomSelectShell",
"em0002",
245 for(
int i=0;i<matTableSize;i++)
virtual void ReadDiffCSFile(const G4String &materialName, const G4String &particleName, const G4String &path, const G4double scaleFactor)
ReadDiffCSFile Virtual method that need to be implemented if one wish to use the differential cross s...
void ReadAndSaveCSFile(const G4String &materialName, const G4String &particleName, const G4String &file, G4double scaleFactor)
ReadAndSaveCSFile Read and save a "simple" cross section file : use of G4DNACrossSectionDataSet->load...
const G4String fStringOfMaterials
fStringOfMaterials The user can decide to specify by hand which are the materials the be activated am...
static const G4double pos
std::vector< G4String > fModelCSFiles
List the cross section data files.
static G4MaterialTable * GetMaterialTable()
virtual size_t NumberOfComponents(void) const
virtual ~G4VDNAModel()
~G4VDNAModel
void AddCrossSectionData(G4String materialName, G4String particleName, G4String fileCS, G4String fileDiffCS, G4double scaleFactor)
AddCrossSectionData Method used during the initialization of the model class to add a new material...
void LoadCrossSectionData(const G4String &particleName)
LoadCrossSectionData Method to loop on all the registered materials in the model and load the corresp...
std::vector< G4String > fModelMaterials
List the materials that can be activated (and will be by default) within the model.
G4bool IsMaterialExistingInModel(const G4String &materialName)
IsMaterialExistingInModel Check if the given material is defined in the current model class...
const XML_Char int const XML_Char * value
static constexpr double eV
std::vector< G4String > fModelParticles
List the particles that can be activated within the model.
G4bool IsParticleExistingInModelForMaterial(const G4String &particleName, const G4String &materialName)
IsParticleExistingInModelForMaterial To check two things: 1- is the material existing in model ...
std::vector< G4double > fModelScaleFactors
List the model scale factors (they could change with material)
std::vector< G4String > BuildApplyToMatVect(const G4String &materials)
BuildApplyToMatVect Build the material name vector which is used to know the materials the user want ...
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
TableMapData * GetTableData()
GetTableData.
void EnableForMaterialAndParticle(const G4String &materialName, const G4String &particleName)
EnableMaterialAndParticle.
G4VDNAModel(const G4String &nam, const G4String &applyToMaterial)
G4VDNAModel Constructeur of the G4VDNAModel class.
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
std::vector< G4String > fModelDiffCSFiles
List the differential corss section data files.
G4int RandomSelectShell(G4double k, const G4String &particle, const G4String &materialName)
RandomSelectShell Method to randomely select a shell from the data table uploaded. The size of the table (number of columns) is used to determine the total number of possible shells.
TableMapData fTableData
fTableData It contains the cross section data and can be used like: dataTable=fTableData[material][pa...
std::map< G4String, std::map< G4String, G4DNACrossSectionDataSet *, std::less< G4String > > > TableMapData
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
G4String GetName()
GetName.
G4bool IsMaterialDefine(const G4String &materialName)
IsMaterialDefine Check if the given material is defined in the simulation.