CrossSectionPerVolume Method called by the process and used to call the CrossSectionPerVolume method of the registered models. The method also calculates through G4DNAMolecularMaterial the number of molecule per volume unit for the current material or (component of a composite material).
76{
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 fSampledMat = 0;
95
96
97 G4double crossSectionTimesNbMolPerVol(0.);
98
99
100
101
102 fMaterialCS.clear();
103
104
105 fCSsumTot = 0;
106
107
108
109
110
112
113 const size_t & materialID = material->
GetIndex();
114
115
116 auto model = SelectModel(materialID, p, ekin);
117
118
119
120
121 if (model != nullptr) {
122 if (
dynamic_cast<G4VDNAModel*
>(model) ==
nullptr) {
123
124 crossSectionTimesNbMolPerVol = model->CrossSectionPerVolume(material, p, ekin, emin, emax);
125 }
126 else {
127 crossSectionTimesNbMolPerVol = model->CrossSectionPerVolume(material, p, ekin, emin, emax);
128 }
129 }
130 else
131 crossSectionTimesNbMolPerVol = 0.;
132 }
133
134
135
136
137
138 else {
139
140
141
143
145
146
147 for (const auto& it : componentsMap) {
148
149 auto component = it.first;
150
151
152
153
154 G4double nbMoleculeOfComponentInCompositeMat =
155 GetNumMolPerVolUnitForComponentInComposite(component, material);
156 G4cout <<
" ==========>component : " << component->GetName()
157 << " nbMoleculeOfComponentInCompositeMat: " << nbMoleculeOfComponentInCompositeMat
159
160
161 const std::size_t & componentID = component->GetIndex();
162
163
164 auto model = SelectModel(componentID, p, ekin);
165
166
167
168
170 if (model != nullptr) {
171 if (
dynamic_cast<G4VDNAModel*
>(model) ==
nullptr) {
172
173 crossSection =
174 model->CrossSectionPerVolume(component, p, ekin, emin, emax)
175 / GetNumMoleculePerVolumeUnitForMaterial(fpG4_WATER);
176 }
177 else {
178 crossSection = model->CrossSectionPerVolume(component, p, ekin, emin, emax)
179 / GetNumMoleculePerVolumeUnitForMaterial(component);
180 }
181 crossSectionTimesNbMolPerVol = nbMoleculeOfComponentInCompositeMat * crossSection;
182 }
183 else
184 {
185 crossSectionTimesNbMolPerVol = 0.;
186 }
187
188
189
190 fMaterialCS[componentID] = crossSectionTimesNbMolPerVol;
191
192
193
194 fCSsumTot += crossSectionTimesNbMolPerVol;
195 }
196 crossSectionTimesNbMolPerVol = fCSsumTot;
197 }
198
199
200
201 return crossSectionTimesNbMolPerVol;
202}
G4GLOB_DLL std::ostream G4cout
const std::map< G4Material *, G4double > & GetMatComponents() const
std::size_t GetIndex() const
const G4String & GetName() const