[503a972] | 1 | #if !defined(cylinder_h) |
---|
| 2 | #define cylinder_h |
---|
| 3 | #include "parameters.hh" |
---|
| 4 | |
---|
| 5 | /** Structure definition for cylinder parameters |
---|
| 6 | * [PYTHONCLASS] = CylinderModel |
---|
| 7 | * [DISP_PARAMS] = radius, length, cyl_theta, cyl_phi |
---|
| 8 | [DESCRIPTION] = <text> f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2)) |
---|
| 9 | /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] |
---|
| 10 | |
---|
| 11 | P(q,alpha)= scale/V*f(q)^(2)+bkg |
---|
| 12 | V: Volume of the cylinder |
---|
| 13 | R: Radius of the cylinder |
---|
| 14 | L: Length of the cylinder |
---|
| 15 | J1: The bessel function |
---|
| 16 | alpha: angle betweenthe axis of the |
---|
| 17 | cylinder and the q-vector for 1D |
---|
| 18 | :the ouput is P(q)=scale/V*integral |
---|
| 19 | from pi/2 to zero of... |
---|
| 20 | f(q)^(2)*sin(alpha)*dalpha+ bkg |
---|
| 21 | </text> |
---|
| 22 | [FIXED]= <text>cyl_phi.width; cyl_theta.width; length.width;radius.width</text> |
---|
| 23 | [ORIENTATION_PARAMS]= <text>cyl_phi; cyl_theta; cyl_phi.width; cyl_theta.width</text> |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | **/ |
---|
| 27 | class CylinderModel{ |
---|
| 28 | public: |
---|
| 29 | // Model parameters |
---|
| 30 | |
---|
| 31 | /// Scale factor |
---|
| 32 | // [DEFAULT]=scale=1.0 |
---|
| 33 | Parameter scale; |
---|
| 34 | |
---|
| 35 | /// Radius of the cylinder [A] |
---|
| 36 | // [DEFAULT]=radius=20.0 [A] |
---|
| 37 | Parameter radius; |
---|
| 38 | |
---|
| 39 | /// Length of the cylinder [A] |
---|
| 40 | // [DEFAULT]=length=400.0 [A] |
---|
| 41 | Parameter length; |
---|
| 42 | |
---|
| 43 | /// Contrast [1/A^(2)] |
---|
| 44 | // [DEFAULT]=sldCyl=4.0e-6 [1/A^(2)] |
---|
| 45 | Parameter sldCyl; |
---|
| 46 | |
---|
| 47 | /// sldCyl [1/A^(2)] |
---|
| 48 | // [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] |
---|
| 49 | Parameter sldSolv; |
---|
| 50 | |
---|
| 51 | /// Incoherent Background [1/cm] 0.00 |
---|
| 52 | // [DEFAULT]=background=0.0 [1/cm] |
---|
| 53 | Parameter background; |
---|
| 54 | |
---|
| 55 | /// Orientation of the cylinder axis w/respect incoming beam [deg] |
---|
| 56 | // [DEFAULT]=cyl_theta=60.0 [deg] |
---|
| 57 | Parameter cyl_theta; |
---|
| 58 | |
---|
| 59 | /// Orientation of the cylinder in the plane of the detector [deg] |
---|
| 60 | // [DEFAULT]=cyl_phi=60.0 [deg] |
---|
| 61 | Parameter cyl_phi; |
---|
| 62 | |
---|
| 63 | // Constructor |
---|
| 64 | CylinderModel(); |
---|
| 65 | |
---|
| 66 | // Operators to get I(Q) |
---|
| 67 | double operator()(double q); |
---|
| 68 | double operator()(double qx, double qy); |
---|
| 69 | double calculate_ER(); |
---|
| 70 | double evaluate_rphi(double q, double phi); |
---|
| 71 | }; |
---|
| 72 | |
---|
| 73 | #endif |
---|