Changeset c451be9 in sasview for sansmodels/src/sans/models/c_models/parallelepiped.cpp
- Timestamp:
- Jan 7, 2010 5:04:25 PM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- dfa8832
- Parents:
- 4cbaf35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/parallelepiped.cpp
rf9bf661 rc451be9 84 84 double sum = 0.0; 85 85 double norm = 0.0; 86 double vol = 0.0; 86 87 87 88 // Loop over short_edgeA weight points … … 96 97 for(int k=0; k< (int)weights_long_c.size(); k++) { 97 98 dp[3] = weights_long_c[k].value; 99 //Un-normalize by volume 98 100 sum += weights_short_a[i].weight * weights_short_b[j].weight 99 * weights_long_c[k].weight * Parallelepiped(dp, q); 101 * weights_long_c[k].weight * Parallelepiped(dp, q) 102 * weights_short_a[i].value*weights_short_b[j].value 103 * weights_long_c[k].value; 104 //Find average volume 105 vol += weights_short_a[i].weight * weights_short_b[j].weight 106 * weights_long_c[k].weight 107 * weights_short_a[i].value * weights_short_b[j].value 108 * weights_long_c[k].value; 100 109 101 110 norm += weights_short_a[i].weight … … 104 113 } 105 114 } 115 if (vol != 0.0 && norm != 0.0) { 116 //Re-normalize by avg volume 117 sum = sum/(vol/norm);} 106 118 107 119 return sum/norm + background(); … … 155 167 double sum = 0.0; 156 168 double norm = 0.0; 169 double norm_vol = 0.0; 170 double vol = 0.0; 157 171 158 172 // Loop over radius weight points … … 179 193 for(int n=0; n< (int)weights_parallel_psi.size(); n++) { 180 194 dp.parallel_psi = weights_parallel_psi[n].value; 181 195 //Un-normalize by volume 182 196 double _ptvalue = weights_short_a[i].weight 183 197 * weights_short_b[j].weight … … 186 200 * weights_parallel_phi[m].weight 187 201 * weights_parallel_psi[n].weight 188 * parallelepiped_analytical_2DXY(&dp, qx, qy); 202 * parallelepiped_analytical_2DXY(&dp, qx, qy) 203 * weights_short_a[i].value*weights_short_b[j].value 204 * weights_long_c[k].value; 205 189 206 if (weights_parallel_theta.size()>1) { 190 207 _ptvalue *= sin(weights_parallel_theta[l].value); 191 208 } 192 209 sum += _ptvalue; 210 //Find average volume 211 vol += weights_short_a[i].weight 212 * weights_short_b[j].weight 213 * weights_long_c[k].weight 214 * weights_short_a[i].value*weights_short_b[j].value 215 * weights_long_c[k].value; 216 //Find norm for volume 217 norm_vol += weights_short_a[i].weight 218 * weights_short_b[j].weight 219 * weights_long_c[k].weight; 193 220 194 221 norm += weights_short_a[i].weight … … 209 236 // integration (see documentation). 210 237 if (weights_parallel_theta.size()>1) norm = norm / asin(1.0); 238 239 if (vol != 0.0 && norm_vol != 0.0) { 240 //Re-normalize by avg volume 241 sum = sum/(vol/norm_vol);} 242 211 243 return sum/norm + background(); 212 244 }
Note: See TracChangeset
for help on using the changeset viewer.