Changeset c451be9 in sasview for sansmodels/src/sans/models/c_models/hollowcylinder.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/hollowcylinder.cpp
rf9bf661 rc451be9 78 78 double sum = 0.0; 79 79 double norm = 0.0; 80 double vol = 0.0; 80 81 81 82 // Loop over core radius weight points … … 90 91 for(int k=0; k< (int)weights_radius.size(); k++) { 91 92 dp[2] = weights_radius[k].value; 92 93 //Un-normalize by volume 93 94 sum += weights_core_radius[i].weight 94 95 * weights_length[j].weight 95 96 * weights_radius[k].weight 96 * HollowCylinder(dp, q); 97 * HollowCylinder(dp, q) 98 * (pow(weights_radius[k].value,2)-pow(weights_core_radius[i].value,2)) 99 * weights_length[j].value; 100 //Find average volume 101 vol += weights_core_radius[i].weight 102 * weights_length[j].weight 103 * weights_radius[k].weight 104 * (pow(weights_radius[k].value,2)-pow(weights_core_radius[i].value,2)) 105 * weights_length[j].value; 106 97 107 norm += weights_core_radius[i].weight 98 * weights_length[j].weight99 * weights_radius[k].weight;108 * weights_length[j].weight 109 * weights_radius[k].weight; 100 110 } 101 111 } 102 112 } 113 if (vol != 0.0 && norm != 0.0) { 114 //Re-normalize by avg volume 115 sum = sum/(vol/norm);} 116 103 117 return sum/norm + background(); 104 118 } … … 145 159 double sum = 0.0; 146 160 double norm = 0.0; 161 double norm_vol = 0.0; 162 double vol = 0.0; 147 163 148 164 // Loop over core radius weight points … … 166 182 for(int l=0; l< (int)weights_phi.size(); l++) { 167 183 dp.axis_phi = weights_phi[l].value; 168 184 //Un-normalize by volume 169 185 double _ptvalue = weights_core_radius[i].weight 170 186 * weights_length[j].weight … … 172 188 * weights_theta[k].weight 173 189 * weights_phi[l].weight 174 * hollow_cylinder_analytical_2DXY(&dp, qx, qy); 190 * hollow_cylinder_analytical_2DXY(&dp, qx, qy) 191 * (pow(weights_radius[m].value,2)-pow(weights_core_radius[i].value,2)) 192 * weights_length[j].value; 175 193 if (weights_theta.size()>1) { 176 194 _ptvalue *= sin(weights_theta[k].value); 177 195 } 178 196 sum += _ptvalue; 197 //Find average volume 198 vol += weights_core_radius[i].weight 199 * weights_length[j].weight 200 * weights_radius[k].weight 201 * (pow(weights_radius[m].value,2)-pow(weights_core_radius[i].value,2)) 202 * weights_length[j].value; 203 //Find norm for volume 204 norm_vol += weights_core_radius[i].weight 205 * weights_length[j].weight 206 * weights_radius[m].weight; 179 207 180 208 norm += weights_core_radius[i].weight … … 193 221 // integration (see documentation). 194 222 if (weights_theta.size()>1) norm = norm / asin(1.0); 223 if (vol != 0.0 && norm_vol != 0.0) { 224 //Re-normalize by avg volume 225 sum = sum/(vol/norm_vol);} 195 226 return sum/norm + background(); 196 227 }
Note: See TracChangeset
for help on using the changeset viewer.