Changeset c451be9 in sasview for sansmodels/src/sans/models/c_models/stackeddisks.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/stackeddisks.cpp
rf9bf661 rc451be9 89 89 double sum = 0.0; 90 90 double norm = 0.0; 91 double vol = 0.0; 91 92 92 93 // Loop over length weight points … … 101 102 for(int k=0; k< (int)weights_layer_thick.size(); k++) { 102 103 dp[3] = weights_layer_thick[k].value; 103 104 //Un-normalize by volume 104 105 sum += weights_radius[i].weight 105 * weights_core_thick[j].weight * weights_layer_thick[k].weight* StackedDiscs(dp, q); 106 * weights_core_thick[j].weight * weights_layer_thick[k].weight* StackedDiscs(dp, q) 107 *pow(weights_radius[i].value,2)*(weights_core_thick[j].value+2*weights_layer_thick[k].value); 108 //Find average volume 109 vol += weights_radius[i].weight 110 * weights_core_thick[j].weight * weights_layer_thick[k].weight 111 *pow(weights_radius[i].value,2)*(weights_core_thick[j].value+2*weights_layer_thick[k].value); 106 112 norm += weights_radius[i].weight 107 113 * weights_core_thick[j].weight* weights_layer_thick[k].weight; … … 109 115 } 110 116 } 117 if (vol != 0.0 && norm != 0.0) { 118 //Re-normalize by avg volume 119 sum = sum/(vol/norm);} 120 111 121 return sum/norm + background(); 112 122 } … … 157 167 double sum = 0.0; 158 168 double norm = 0.0; 169 double norm_vol = 0.0; 170 double vol = 0.0; 159 171 160 172 // Loop over length weight points … … 177 189 dp.axis_phi = weights_phi[m].value; 178 190 191 //Un-normalize by volume 179 192 double _ptvalue = weights_core_thick[i].weight 180 193 * weights_radius[j].weight … … 182 195 * weights_theta[l].weight 183 196 * weights_phi[m].weight 184 * stacked_disks_analytical_2DXY(&dp, qx, qy); 197 * stacked_disks_analytical_2DXY(&dp, qx, qy) 198 *pow(weights_radius[j].value,2)*(weights_core_thick[i].value+2*weights_layer_thick[k].value); 185 199 if (weights_theta.size()>1) { 186 200 _ptvalue *= sin(weights_theta[l].value); 187 201 } 188 202 sum += _ptvalue; 203 //Find average volume 204 vol += weights_radius[j].weight 205 * weights_core_thick[i].weight * weights_layer_thick[k].weight 206 *pow(weights_radius[j].value,2)*(weights_core_thick[i].value+2*weights_layer_thick[k].value); 207 //Find norm for volume 208 norm_vol += weights_radius[j].weight 209 * weights_core_thick[i].weight * weights_layer_thick[k].weight; 189 210 190 211 norm += weights_core_thick[i].weight … … 202 223 // integration (see documentation). 203 224 if (weights_theta.size()>1) norm = norm / asin(1.0); 225 if (vol != 0.0 && norm_vol != 0.0) { 226 //Re-normalize by avg volume 227 sum = sum/(vol/norm_vol);} 204 228 return sum/norm + background(); 205 229 }
Note: See TracChangeset
for help on using the changeset viewer.