| 1 | #cxx . . $ `<file>/ncrystal_core/include/NCrystal/internal/NCLCUtils.hh`/ifndef NCrystal_LCUtils_hh |
| 2 | #define NCrystal_LCUtils_hhcxx . . $ `ncrystal_core/include/NCrystal/internal/NCLCUtils.hh:2:9`! |
| 3 | |
| 4 | //////////////////////////////////////////////////////////////////////////////// |
| 5 | // // |
| 6 | // This file is part of NCrystal (see https://mctools.github.io/ncrystal/) // |
| 7 | // // |
| 8 | // Copyright 2015-2022 NCrystal developers // |
| 9 | // // |
| 10 | // Licensed under the Apache License, Version 2.0 (the "License"); // |
| 11 | // you may not use this file except in compliance with the License. // |
| 12 | // You may obtain a copy of the License at // |
| 13 | // // |
| 14 | // http://www.apache.org/licenses/LICENSE-2.0 // |
| 15 | // // |
| 16 | // Unless required by applicable law or agreed to in writing, software // |
| 17 | // distributed under the License is distributed on an "AS IS" BASIS, // |
| 18 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // |
| 19 | // See the License for the specific language governing permissions and // |
| 20 | // limitations under the License. // |
| 21 | // // |
| 22 | //////////////////////////////////////////////////////////////////////////////// |
| 23 | |
| 24 | #include "NCrystal/NCDefs.hh"cxx . . $ `<file>/ncrystal_core/include/NCrystal/NCDefs.hh`/ |
| 25 | #include "NCrystal/internal/NCGaussMos.hh"cxx . . $ `<file>/ncrystal_core/include/NCrystal/internal/NCGaussMos.hh`/ |
| 26 | #include "NCrystal/internal/NCVector.hh"cxx . . $ `<file>/ncrystal_core/include/NCrystal/internal/NCVector.hh`/ |
| 27 | #include "NCrystal/NCTypes.hh"cxx . . $ `<file>/ncrystal_core/include/NCrystal/NCTypes.hh`/ |
| 28 | |
| 29 | namespace NCrystalcxx . . $ NCrystal/ { |
| 30 | |
| 31 | //Utilities used to implement layered crystals, intended for internal usage in the LCBragg class. |
| 32 | |
| 33 | class PlaneProvidercxx . . $ NCrystal/PlaneProvider#; |
| 34 | |
| 35 | struct LCPlaneSetcxx . . $ NCrystal/LCPlaneSet# { |
| 36 | //Set of normals with same angle to lcaxis and d-spacing. |
| 37 | |
| 38 | //NB: The alpha passed in here is theta_n in the upcoming NCrystal Bragg paper: |
| 39 | LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#LCPlaneSet(52a61fa14d44b641).(double dspacing, double alpha, double truncangle, double fsquared = 0.0); |
| 40 | //Add contribution to LCPlaneSet: |
| 41 | void addFsqcxx . . $ NCrystal/LCPlaneSet#addFsq(ba8836b59fb42830).(double fsquared) { fsqcxx . . $ NCrystal/LCPlaneSet#fsq. += fsquared; } |
| 42 | double twodspcxx . . $ NCrystal/LCPlaneSet#twodsp.;// 2*dspacing |
| 43 | double inv_twodspcxx . . $ NCrystal/LCPlaneSet#inv_twodsp.;// 1/twodsp |
| 44 | double cosalphacxx . . $ NCrystal/LCPlaneSet#cosalpha.; |
| 45 | double sinalphacxx . . $ NCrystal/LCPlaneSet#sinalpha.; |
| 46 | double cosalphaminuscxx . . $ NCrystal/LCPlaneSet#cosalphaminus.;//cos(max[0,alpha-truncangle]) |
| 47 | double cosalphapluscxx . . $ NCrystal/LCPlaneSet#cosalphaplus.;//cos(alpha+truncangle) |
| 48 | double fsqcxx . . $ NCrystal/LCPlaneSet#fsq.;//Total FSquared of all normals in planeset. |
| 49 | bool isOnAxiscxx . . $ NCrystal/LCPlaneSet#isOnAxis(50ce9a9e25b4a850).() const { return !sinalphacxx . . $ NCrystal/LCPlaneSet#sinalpha.; } |
| 50 | }; |
| 51 | |
| 52 | class LCROIcxx . . $ NCrystal/LCROI# { |
| 53 | public: |
| 54 | //Region of interest. In the non-degenerate case this is a phi-rotation |
| 55 | //range (subset of [0,pi]) and associated PlaneSet for which a given neutron |
| 56 | //has non-zero (and supposedly smoothly varying) cross-sections. This is |
| 57 | //given in the standard frame, used by the LCStdFrame class. |
| 58 | |
| 59 | double rotmincxx . . $ NCrystal/LCROI#rotmin.; |
| 60 | double rotmaxcxx . . $ NCrystal/LCROI#rotmax.; |
| 61 | const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet# * planesetcxx . . $ NCrystal/LCROI#planeset.;//ptr must be valid for lifetime of LCROI object! |
| 62 | double normal_signcxx . . $ NCrystal/LCROI#normal_sign.;//1.0 for normal(s), -1.0 for anti-normal(s). |
| 63 | |
| 64 | //Standard non-degenerate cases: |
| 65 | LCROIcxx . . $ NCrystal/LCROI#LCROI(78ae0f765aab7e4d).(double rmin, double rmax,const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* ps, double normsign); |
| 66 | bool containscxx . . $ NCrystal/LCROI#contains(b32f3370ca1a96a1).(double t) const; |
| 67 | double lengthcxx . . $ NCrystal/LCROI#length(21b6c25e127938e2).() const; |
| 68 | |
| 69 | //degenerate cases, when either neutron or normal is on lcaxis: |
| 70 | LCROIcxx . . $ NCrystal/LCROI#LCROI(2ff890d487ac432d).(const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* ps, double normsign); |
| 71 | bool isDegeneratecxx . . $ NCrystal/LCROI#isDegenerate(50ce9a9e25b4a850).() const; |
| 72 | bool normalIsOnAxiscxx . . $ NCrystal/LCROI#normalIsOnAxis(50ce9a9e25b4a850).() const; |
| 73 | bool neutronIsOnAxiscxx . . $ NCrystal/LCROI#neutronIsOnAxis(50ce9a9e25b4a850).() const; |
| 74 | }; |
| 75 | |
| 76 | class LCROIFindercxx . . $ NCrystal/LCROIFinder# { |
| 77 | //Class able to search for ROI's for a given neutron, based on mosaicity |
| 78 | //bands in the provided planesets. If found by findROIs, they will be |
| 79 | //appended to roilist. It is slightly faster if subsequent calls to findROIs |
| 80 | //are ordered by d-spacing (i.e. it is optimised for the case where |
| 81 | //planesets are kept sorted by d-spacing and findROIs are called for all of |
| 82 | //them in turn. Note that the search happens in the standard frame, used by |
| 83 | //the LCStdFrame class. |
| 84 | |
| 85 | public: |
| 86 | //NB: Results are symmetric between neutron_angle_to_lcaxis -> pi - neutron_angle_to_lcaxis. |
| 87 | LCROIFindercxx . . $ NCrystal/LCROIFinder#LCROIFinder(52a61fa14d44b641).(double wavelength, double cos_neutron_angle_to_lcaxis, |
| 88 | double cos_truncation_angle, double sin_truncation_angle); |
| 89 | void findROIscxx . . $ NCrystal/LCROIFinder#findROIs(32a23ad270f230f0).(const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet# * planeset,stdcxx . . $ std/::vectorcxx . . $ std/vector#<LCROIcxx . . $ NCrystal/LCROI#>& roilist); |
| 90 | private: |
| 91 | const double m_wlcxx . . $ NCrystal/LCROIFinder#m_wl.; |
| 92 | const double m_c3cxx . . $ NCrystal/LCROIFinder#m_c3.; |
| 93 | const double m_s3cxx . . $ NCrystal/LCROIFinder#m_s3.; |
| 94 | const double m_ctacxx . . $ NCrystal/LCROIFinder#m_cta.; |
| 95 | const double m_stacxx . . $ NCrystal/LCROIFinder#m_sta.; |
| 96 | double m_prev2dcxx . . $ NCrystal/LCROIFinder#m_prev2d.; |
| 97 | double m_c2cxx . . $ NCrystal/LCROIFinder#m_c2.; |
| 98 | double m_c23cxx . . $ NCrystal/LCROIFinder#m_c23.; |
| 99 | double m_s2cxx . . $ NCrystal/LCROIFinder#m_s2.; |
| 100 | double m_s23cxx . . $ NCrystal/LCROIFinder#m_s23.; |
| 101 | bool m_s2approximatedcxx . . $ NCrystal/LCROIFinder#m_s2approximated.; |
| 102 | }; |
| 103 | |
| 104 | class LCStdFramecxx . . $ NCrystal/LCStdFrame# { |
| 105 | //Helper class use to evaluate cross-sections and scatterings in layered |
| 106 | //crystals, using an idealised frame where lcaxis=(0,0,1) and the neutron |
| 107 | //direction is (s3,0,c3). Internally, the GaussMos helper class is used, but |
| 108 | //wrapped appropriately. Note that this class does NOT apply any truncation |
| 109 | //cut, which is assumed to take place in the calling code. |
| 110 | public: |
| 111 | //Constructor takes same parameters as GaussMos. |
| 112 | LCStdFramecxx . . $ NCrystal/LCStdFrame#LCStdFrame(b0032d7c283f1ed1).(MosaicityFWHMcxx . . $ NCrystal/MosaicityFWHM#, double prec = 1e-3, double ntrunc = 0.0 ); |
| 113 | |
| 114 | //For reference, we provide const access to underlying GaussMos object |
| 115 | const GaussMoscxx . . $ NCrystal/GaussMos#& gaussMoscxx . . $ NCrystal/LCStdFrame#gaussMos(6ee5a76b6ffdb141).() const { return m_gmcxx . . $ NCrystal/LCStdFrame#m_gm.; } |
| 116 | |
| 117 | struct NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars# { |
| 118 | NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#NeutronPars(98dd472ac7e5c3d4).(double wl, double c3, double s3); |
| 119 | const double wlcxx . . $ NCrystal/LCStdFrame#NeutronPars#wl.; |
| 120 | const double c3cxx . . $ NCrystal/LCStdFrame#NeutronPars#c3.; |
| 121 | const double s3cxx . . $ NCrystal/LCStdFrame#NeutronPars#s3.; |
| 122 | }; |
| 123 | struct NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars# { |
| 124 | NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#NormalPars(2ff890d487ac432d).( const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* ps, double normal_sign ); |
| 125 | const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* planesetcxx . . $ NCrystal/LCStdFrame#NormalPars#planeset.; |
| 126 | const double signcxx . . $ NCrystal/LCStdFrame#NormalPars#sign.; |
| 127 | }; |
| 128 | |
| 129 | //When the normal is on-axis (e.g. parallel to lcaxis), the following two special methods can be used: |
| 130 | double calcXS_OnAxiscxx . . $ NCrystal/LCStdFrame#calcXS_OnAxis(e56d54cec086cb18).( const NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#&, const NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#&) const; |
| 131 | void genScat_OnAxiscxx . . $ NCrystal/LCStdFrame#genScat_OnAxis(ca3ef44f918eab21).(RNGcxx . . $ NCrystal/RNG#& rand, const NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#&, const NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#&, Vectorcxx . . $ NCrystal/Vector#& outdir ) const; |
| 132 | |
| 133 | //For off-axis normals, one must consider the particular rotation of the |
| 134 | //crystallite. We define phi so that at phi=0, the normal is given by |
| 135 | //(sinthn,0,costhn), where thn is the angle between the normals in the |
| 136 | //planeset and the lcaxis. For phi!=0, this normal is then rotated around |
| 137 | //lcaxis=(0,0,1), yielding the normal (sinthn*cosphi,sinthn*sinphi,costhn). |
| 138 | static Vectorcxx . . $ NCrystal/Vector# normalInStdFramecxx . . $ NCrystal/LCStdFrame#normalInStdFrame(76687d9b34dcd5a2).( const NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#&, double cosphi, double sinphi ); |
| 139 | |
| 140 | //The cross-section for off-axis normals can either be found for a |
| 141 | //particular crystallite orientation...: |
| 142 | double calcXScxx . . $ NCrystal/LCStdFrame#calcXS(5c05070906ebef0c).( const NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#&, const NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#&, double cosphi ) const; |
| 143 | //... or it can be integrated over a range of crystallite orientations (the |
| 144 | //collect object will be passed to the internal AdaptiveSimpsons |
| 145 | //integrator): |
| 146 | double calcXSIntegralcxx . . $ NCrystal/LCStdFrame#calcXSIntegral(782d3a2dac7b0456).( const NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#&, const NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#&, double phimin, double phimax ) const; |
| 147 | |
| 148 | //Scatterings (sinphi parameter required as well as cosphi, to allow calling |
| 149 | //code to select phi values in all of [-pi,pi] range): |
| 150 | void genScatcxx . . $ NCrystal/LCStdFrame#genScat(3b74bb41ca891883).( RNGcxx . . $ NCrystal/RNG#& rand, const NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#&, const NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#&, |
| 151 | double cosphi, double sinphi, Vectorcxx . . $ NCrystal/Vector#& outdir ) const; |
| 152 | |
| 153 | private: |
| 154 | const GaussMoscxx . . $ NCrystal/GaussMos# m_gmcxx . . $ NCrystal/LCStdFrame#m_gm.; |
| 155 | }; |
| 156 | |
| 157 | class LCHelpercxx . . $ NCrystal/LCHelper# : private MoveOnlycxx . . $ NCrystal/MoveOnly# { |
| 158 | //Class which can provide cross-sections and scatterings for planes with |
| 159 | //normals not parallel to the lcaxis. Prec and ntrunc parameters will be |
| 160 | //passed on directly to the internal GaussMos object. |
| 161 | public: |
| 162 | LCHelpercxx . . $ NCrystal/LCHelper#LCHelper(7d5a42ad38898e65).( LCAxiscxx . . $ NCrystal/LCAxis# lcaxis_crystalframe, |
| 163 | LCAxiscxx . . $ NCrystal/LCAxis# lcaxis_labframe, |
| 164 | MosaicityFWHMcxx . . $ NCrystal/MosaicityFWHM# mosaicity_fwhm, |
| 165 | double unitcell_volume_times_natoms, |
| 166 | PlaneProvidercxx . . $ NCrystal/PlaneProvider# * pp, |
| 167 | double prec = 1e-3, |
| 168 | double ntrunc = 0.0 ); |
| 169 | |
| 170 | //Usage happens via Cache objects (allowing users of the class to decide |
| 171 | //upon caching strategies themselves). One should not share Cache objects |
| 172 | //between different LCHelper instances, except if the cache is first reset |
| 173 | //via a call to Cache::reset(). |
| 174 | class Cachecxx . . $ NCrystal/LCHelper#Cache#; |
| 175 | bool isValidcxx . . $ NCrystal/LCHelper#isValid(f015f9cd345398af).(Cachecxx . . $ NCrystal/LCHelper#Cache#&, double wavelength, double c3 ) const; |
| 176 | bool isValidcxx . . $ NCrystal/LCHelper#isValid(f648e5bc54669956).(Cachecxx . . $ NCrystal/LCHelper#Cache#&, double wavelength, const Vectorcxx . . $ NCrystal/Vector#& indir) const; |
| 177 | void ensureValidcxx . . $ NCrystal/LCHelper#ensureValid(b9c35afbb0416169).(Cachecxx . . $ NCrystal/LCHelper#Cache#&, double wavelength, const Vectorcxx . . $ NCrystal/Vector#& indir) const; |
| 178 | |
| 179 | //Valid caches can be used to get cross-sections or generate scatterings: |
| 180 | double crossSectioncxx . . $ NCrystal/LCHelper#crossSection(44354730834dd057).( Cachecxx . . $ NCrystal/LCHelper#Cache#&, double wavelength, const Vectorcxx . . $ NCrystal/Vector#& indir ) const; |
| 181 | void genScattercxx . . $ NCrystal/LCHelper#genScatter(2c148ad7a5df672e).( Cachecxx . . $ NCrystal/LCHelper#Cache#&, RNGcxx . . $ NCrystal/RNG#&, double wavelength, const Vectorcxx . . $ NCrystal/Vector#& indir, Vectorcxx . . $ NCrystal/Vector#& outdir ) const; |
| 182 | |
| 183 | //Access without cache. |
| 184 | void genScatterNoCachecxx . . $ NCrystal/LCHelper#genScatterNoCache(cd7167e9be13ea76).( RNGcxx . . $ NCrystal/RNG#&, double wavelength, const Vectorcxx . . $ NCrystal/Vector#& indir, Vectorcxx . . $ NCrystal/Vector#& outdir ) const; |
| 185 | double crossSectionNoCachecxx . . $ NCrystal/LCHelper#crossSectionNoCache(cf4932ad0aa28c98).( double wavelength, const Vectorcxx . . $ NCrystal/Vector#& indir ) const; |
| 186 | |
| 187 | double braggThresholdcxx . . $ NCrystal/LCHelper#braggThreshold(21b6c25e127938e2).() const;//max wavelength, beyond which all cross-sections will be 0. |
| 188 | |
| 189 | const GaussMoscxx . . $ NCrystal/GaussMos#& gaussMoscxx . . $ NCrystal/LCHelper#gaussMos(c0647422407980ad).() { return m_lcstdframecxx . . $ NCrystal/LCHelper#m_lcstdframe..gaussMoscxx . . $ NCrystal/LCStdFrame#gaussMos(6ee5a76b6ffdb141).(); } |
| 190 | |
| 191 | private: |
| 192 | Vectorcxx . . $ NCrystal/Vector# m_lcaxislabcxx . . $ NCrystal/LCHelper#m_lcaxislab.; |
| 193 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#> m_planescxx . . $ NCrystal/LCHelper#m_planes.;//sorted by dspacing, largest first. |
| 194 | LCStdFramecxx . . $ NCrystal/LCStdFrame# m_lcstdframecxx . . $ NCrystal/LCHelper#m_lcstdframe.; |
| 195 | double m_xsfactcxx . . $ NCrystal/LCHelper#m_xsfact.; |
| 196 | void forceUpdateCachecxx . . $ NCrystal/LCHelper#forceUpdateCache(24c02f9fbbc5ad3b).( Cachecxx . . $ NCrystal/LCHelper#Cache#&, uint64_tcxx . . $ uint64_t# discr_wl, uint64_tcxx . . $ uint64_t# discr_c3 ) const; |
| 197 | struct Overlaycxx . . $ NCrystal/LCHelper#Overlay# : private MoveOnlycxx . . $ NCrystal/MoveOnly# { |
| 198 | static const unsigned ndatacxx . . $ NCrystal/LCHelper#Overlay#ndata. = 8; |
| 199 | Overlaycxx . . $ NCrystal/LCHelper#Overlay#Overlay(49f6e7a06ebc5aa8).(); |
| 200 | ~cxx . . $ NCrystal/LCHelper#Overlay#`~Overlay`(ced63f7c635d850d).Overlaycxx . . $ NCrystal/LCHelper#Overlay#(); |
| 201 | void clearcxx . . $ NCrystal/LCHelper#Overlay#clear(49f6e7a06ebc5aa8).(); |
| 202 | void prepareNullArraycxx . . $ NCrystal/LCHelper#Overlay#prepareNullArray(49f6e7a06ebc5aa8).(); |
| 203 | float * datacxx . . $ NCrystal/LCHelper#Overlay#data.; |
| 204 | double nonCommulValcxx . . $ NCrystal/LCHelper#Overlay#nonCommulVal(af0fcd400001c4eb).(unsigned i) const; |
| 205 | Overlaycxx . . $ NCrystal/LCHelper#Overlay#Overlay(cad5c16da5c602b7).(Overlaycxx . . $ NCrystal/LCHelper#Overlay#&& o); |
| 206 | Overlaycxx . . $ NCrystal/LCHelper#Overlay#& operatorcxx . . $ NCrystal/LCHelper#Overlay#`operator=`(c9f18b5cf464fce4).=(Overlaycxx . . $ NCrystal/LCHelper#Overlay#&& o); |
| 207 | }; |
| 208 | static void genPhiValcxx . . $ NCrystal/LCHelper#genPhiVal(a6da792a6ff87f0b).(RNGcxx . . $ NCrystal/RNG#& rand, const LCROIcxx . . $ NCrystal/LCROI#& roi, const Overlaycxx . . $ NCrystal/LCHelper#Overlay#& overlay, double& phi, double& overlay_at_phi); |
| 209 | |
| 210 | public: |
| 211 | class Cachecxx . . $ NCrystal/LCHelper#Cache# : public CacheBasecxx . . $ NCrystal/CacheBase# { |
| 212 | public: |
| 213 | Cachecxx . . $ NCrystal/LCHelper#Cache#Cache(49f6e7a06ebc5aa8).();//default constructs invalid cache object |
| 214 | void resetcxx . . $ NCrystal/LCHelper#Cache#reset(49f6e7a06ebc5aa8).();//invalidates cache, but retains dynamically acquired memory for later reuse. |
| 215 | void invalidateCachecxx . . $ NCrystal/LCHelper#Cache#invalidateCache(49f6e7a06ebc5aa8).() override { resetcxx . . $ NCrystal/LCHelper#Cache#reset(49f6e7a06ebc5aa8).(); } |
| 216 | private: |
| 217 | friend class LCHelpercxx . . $ NCrystal/LCHelper#; |
| 218 | stdcxx . . $ std/::pair<uint64_tcxx . . $ uint64_t#,uint64_tcxx . . $ uint64_t#> m_signaturecxx . . $ NCrystal/LCHelper#Cache#m_signature.;//discretised (wavelength,c3) |
| 219 | double m_wlcxx . . $ NCrystal/LCHelper#Cache#m_wl.;//<-- Neutron wavelength. Actually dediscretized m_signature.first |
| 220 | double m_c3cxx . . $ NCrystal/LCHelper#Cache#m_c3.;//<-- dot(indir,lcaxis). Actually dediscretized m_signature.second. |
| 221 | double m_s3cxx . . $ NCrystal/LCHelper#Cache#m_s3.;//sqrt(1-m_c3*m_c3) |
| 222 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<LCROIcxx . . $ NCrystal/LCROI#> m_roilistcxx . . $ NCrystal/LCHelper#Cache#m_roilist.; |
| 223 | VectDcxx . . $ NCrystal/VectD# m_roixs_commulcxx . . $ NCrystal/LCHelper#Cache#m_roixs_commul.;//for selecting |
| 224 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Overlaycxx . . $ NCrystal/LCHelper#Overlay#> m_roi_overlayscxx . . $ NCrystal/LCHelper#Cache#m_roi_overlays.;//for selecting |
| 225 | }; |
| 226 | }; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | //////////////////////////// |
| 231 | // Inline implementations // |
| 232 | //////////////////////////// |
| 233 | |
| 234 | namespace NCrystalcxx . . $ NCrystal/ { |
| 235 | |
| 236 | inline LCROIcxx . . $ NCrystal/LCROI#::LCROIcxx . . $ NCrystal/LCROI#LCROI(78ae0f765aab7e4d).(double rmin, double rmax,const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* ps, double normsign) |
| 237 | : rotmincxx . . $ NCrystal/LCROI#rotmin.(rmin), rotmaxcxx . . $ NCrystal/LCROI#rotmax.(rmax), planesetcxx . . $ NCrystal/LCROI#planeset.(ps), normal_signcxx . . $ NCrystal/LCROI#normal_sign.(normsign) |
| 238 | { |
| 239 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(ps); |
| 240 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(normsign==1.||normsign==-1.); |
| 241 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(rmax>rmin); |
| 242 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(rmin>=0.0&&rmax<=kPi); |
| 243 | } |
| 244 | |
| 245 | inline LCROIcxx . . $ NCrystal/LCROI#::LCROIcxx . . $ NCrystal/LCROI#LCROI(2ff890d487ac432d).(const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* ps, double normsign ) |
| 246 | : rotmincxx . . $ NCrystal/LCROI#rotmin.(ps->isOnAxiscxx . . $ NCrystal/LCPlaneSet#isOnAxis(50ce9a9e25b4a850).()?0:kPicxx . . $ NCrystal/kPi.), rotmaxcxx . . $ NCrystal/LCROI#rotmax.(ps->isOnAxiscxx . . $ NCrystal/LCPlaneSet#isOnAxis(50ce9a9e25b4a850).()?0:kPicxx . . $ NCrystal/kPi.), planesetcxx . . $ NCrystal/LCROI#planeset.(ps), normal_signcxx . . $ NCrystal/LCROI#normal_sign.(normsign) |
| 247 | { |
| 248 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(ps); |
| 249 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(normsign==1.||normsign==-1.); |
| 250 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(rotmin==rotmax); |
| 251 | } |
| 252 | inline bool LCROIcxx . . $ NCrystal/LCROI#::normalIsOnAxiscxx . . $ NCrystal/LCROI#normalIsOnAxis(50ce9a9e25b4a850).() const { nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(planeset->isOnAxis()==(rotmax==0.0)); return rotmaxcxx . . $ NCrystal/LCROI#rotmax.==0.0; } |
| 253 | inline bool LCROIcxx . . $ NCrystal/LCROI#::neutronIsOnAxiscxx . . $ NCrystal/LCROI#neutronIsOnAxis(50ce9a9e25b4a850).() const { nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(!normalIsOnAxis());/*if both on axis, classify as normal-is-on-axis*/ return rotmincxx . . $ NCrystal/LCROI#rotmin.==kPicxx . . $ NCrystal/kPi.; } |
| 254 | inline bool LCROIcxx . . $ NCrystal/LCROI#::isDegeneratecxx . . $ NCrystal/LCROI#isDegenerate(50ce9a9e25b4a850).() const { return rotmincxx . . $ NCrystal/LCROI#rotmin.==rotmaxcxx . . $ NCrystal/LCROI#rotmax.; } |
| 255 | inline double LCROIcxx . . $ NCrystal/LCROI#::lengthcxx . . $ NCrystal/LCROI#length(21b6c25e127938e2).() const { nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(!isDegenerate()); return rotmaxcxx . . $ NCrystal/LCROI#rotmax.-rotmincxx . . $ NCrystal/LCROI#rotmin.; } |
| 256 | inline bool LCROIcxx . . $ NCrystal/LCROI#::containscxx . . $ NCrystal/LCROI#contains(b32f3370ca1a96a1).(double t) const { nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(!isDegenerate()); return t>=rotmincxx . . $ NCrystal/LCROI#rotmin. && t<= rotmaxcxx . . $ NCrystal/LCROI#rotmax.; } |
| 257 | |
| 258 | |
| 259 | inline LCStdFramecxx . . $ NCrystal/LCStdFrame#::NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#::NeutronParscxx . . $ NCrystal/LCStdFrame#NeutronPars#NeutronPars(98dd472ac7e5c3d4).(double thewl, double thec3, double thes3) : wlcxx . . $ NCrystal/LCStdFrame#NeutronPars#wl.(thewl), c3cxx . . $ NCrystal/LCStdFrame#NeutronPars#c3.(thec3), s3cxx . . $ NCrystal/LCStdFrame#NeutronPars#s3.(thes3) {} |
| 260 | inline LCStdFramecxx . . $ NCrystal/LCStdFrame#::NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#::NormalParscxx . . $ NCrystal/LCStdFrame#NormalPars#NormalPars(2ff890d487ac432d).( const LCPlaneSetcxx . . $ NCrystal/LCPlaneSet#* ps, double normal_sign ) |
| 261 | : planesetcxx . . $ NCrystal/LCStdFrame#NormalPars#planeset.(ps), |
| 262 | signcxx . . $ NCrystal/LCStdFrame#NormalPars#sign.(normal_sign) |
| 263 | { |
| 264 | nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!( normal_sign==1. || normal_sign==-1. ); |
| 265 | } |
| 266 | |
| 267 | inline LCHelpercxx . . $ NCrystal/LCHelper#::Cachecxx . . $ NCrystal/LCHelper#Cache#::Cachecxx . . $ NCrystal/LCHelper#Cache#Cache(49f6e7a06ebc5aa8).() : m_signaturecxx . . $ NCrystal/LCHelper#Cache#m_signature.(stdcxx . . $ std/::numeric_limitscxx . . $ std/numeric_limits#<uint64_t>::maxcxx . . $ std/numeric_limits#max(cee159cc271e827).(), |
| 268 | stdcxx . . $ std/::numeric_limitscxx . . $ std/numeric_limits#<uint64_t>::maxcxx . . $ std/numeric_limits#max(cee159cc271e827).()), |
| 269 | m_wlcxx . . $ NCrystal/LCHelper#Cache#m_wl.(-99), m_c3cxx . . $ NCrystal/LCHelper#Cache#m_c3.(-99), m_s3cxx . . $ NCrystal/LCHelper#Cache#m_s3.(-99) |
| 270 | { |
| 271 | //Starts in same state as after calling Cache::reset() |
| 272 | } |
| 273 | inline LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#Overlay(49f6e7a06ebc5aa8).() : datacxx . . $ NCrystal/LCHelper#Overlay#data.(0) {} |
| 274 | inline LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::~cxx . . $ NCrystal/LCHelper#Overlay#`~Overlay`(ced63f7c635d850d).Overlaycxx . . $ NCrystal/LCHelper#Overlay#() { delete[] datacxx . . $ NCrystal/LCHelper#Overlay#data.; } |
| 275 | inline void LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::clearcxx . . $ NCrystal/LCHelper#Overlay#clear(49f6e7a06ebc5aa8).() { delete[] datacxx . . $ NCrystal/LCHelper#Overlay#data.; datacxx . . $ NCrystal/LCHelper#Overlay#data. = 0; } |
| 276 | inline void LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::prepareNullArraycxx . . $ NCrystal/LCHelper#Overlay#prepareNullArray(49f6e7a06ebc5aa8).() { if (!datacxx . . $ NCrystal/LCHelper#Overlay#data.) { datacxx . . $ NCrystal/LCHelper#Overlay#data. = new float[ndatacxx . . $ NCrystal/LCHelper#Overlay#ndata.]; } stdcxx . . $ std/::memset(datacxx . . $ NCrystal/LCHelper#Overlay#data.,0,sizeof(float)*ndatacxx . . $ NCrystal/LCHelper#Overlay#ndata.); } |
| 277 | inline double LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::nonCommulValcxx . . $ NCrystal/LCHelper#Overlay#nonCommulVal(af0fcd400001c4eb).(unsigned i) const { nc_assertcxx . . $ `ncrystal_core/include/NCrystal/NCException.hh:153:11`!(i<ndata); return i ? datacxx . . $ NCrystal/LCHelper#Overlay#data.[i]-(double)datacxx . . $ NCrystal/LCHelper#Overlay#data.[i-1] : (double)datacxx . . $ NCrystal/LCHelper#Overlay#data.[i]; } |
| 278 | inline LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#Overlay(cad5c16da5c602b7).(LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#&& o) { stdcxx . . $ std/::swap(datacxx . . $ NCrystal/LCHelper#Overlay#data.,o.datacxx . . $ NCrystal/LCHelper#Overlay#data.); } |
| 279 | inline LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#& LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#::operatorcxx . . $ NCrystal/LCHelper#Overlay#`operator=`(c9f18b5cf464fce4).=(LCHelpercxx . . $ NCrystal/LCHelper#::Overlaycxx . . $ NCrystal/LCHelper#Overlay#&& o) { stdcxx . . $ std/::swap(datacxx . . $ NCrystal/LCHelper#Overlay#data.,o.datacxx . . $ NCrystal/LCHelper#Overlay#data.); return *this; } |
| 280 | |
| 281 | } |
| 282 | |
| 283 | #endif |
| 284 |