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);
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++)
static const G4double pos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static constexpr double eV
virtual size_t NumberOfComponents(void) const
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
static G4MaterialTable * GetMaterialTable()
virtual ~G4VDNAModel()
~G4VDNAModel
G4bool IsMaterialExistingInModel(const G4String &materialName)
IsMaterialExistingInModel Check if the given material is defined in the current model class.
G4int RandomSelectShell(G4double k, const G4String &particle, const G4String &materialName)
RandomSelectShell Method to randomely select a shell from the data table uploaded....
std::vector< G4String > fModelDiffCSFiles
List the differential corss section data files.
G4bool IsParticleExistingInModelForMaterial(const G4String &particleName, const G4String &materialName)
IsParticleExistingInModelForMaterial To check two things: 1- is the material existing in model ?...
TableMapData * GetTableData()
GetTableData.
G4String GetName()
GetName.
G4VDNAModel(const G4String &nam, const G4String &applyToMaterial)
G4VDNAModel Constructeur of the G4VDNAModel class.
const G4String fStringOfMaterials
fStringOfMaterials The user can decide to specify by hand which are the materials the be activated am...
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...
std::map< G4String, std::map< G4String, G4DNACrossSectionDataSet *, std::less< G4String > > > TableMapData
TableMapData fTableData
fTableData It contains the cross section data and can be used like: dataTable=fTableData[material][pa...
std::vector< G4double > fModelScaleFactors
List the model scale factors (they could change with material)
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....
G4bool IsMaterialDefine(const G4String &materialName)
IsMaterialDefine Check if the given material is defined in the simulation.
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...
std::vector< G4String > BuildApplyToMatVect(const G4String &materials)
BuildApplyToMatVect Build the material name vector which is used to know the materials the user want ...
std::vector< G4String > fModelCSFiles
List the cross section data files.
std::vector< G4String > fModelMaterials
List the materials that can be activated (and will be by default) within the model.
std::vector< G4String > fModelParticles
List the particles that can be activated within the model.
void LoadCrossSectionData(const G4String &particleName)
LoadCrossSectionData Method to loop on all the registered materials in the model and load the corresp...
void EnableForMaterialAndParticle(const G4String &materialName, const G4String &particleName)
EnableMaterialAndParticle.
virtual G4double FindValue(G4double x, G4int componentId=0) const =0