Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:39

0001 #pragma once
0002 
0003 /**
0004 QCerenkov : using ICDF lookup
0005 =================================
0006 
0007 Normally Cerenkov is simulated using rejection sampling, BUT that 
0008 is problematic on GPU as the rejection sampling of RINDEX is 
0009 very sensitive to the use of float or double. 
0010 
0011 Lookup sampling from ICDF is less sensitive. 
0012 
0013 Loads icdf and creates GPU texture from it ready for energy sampling. 
0014 
0015 See also:
0016 
0017 QCerenkovIntegral 
0018     time consuming integration of RINDEX s2 to form the icdf, to be done pre-cache
0019 QCK
0020     persisting QCerenkovIntegral results 
0021 ana/rindex.py
0022     prototyping/experimentation
0023 
0024 **/
0025 
0026 #include <string>
0027 #include "QUDARAP_API_EXPORT.hh"
0028 #include "plog/Severity.h"
0029 
0030 struct float4 ; 
0031 struct qcerenkov ; 
0032 
0033 struct NP ; 
0034 template <typename T> struct QTex ; 
0035 template <typename T> struct QTexLookup ; 
0036 struct dim3 ; 
0037 
0038 struct QUDARAP_API QCerenkov
0039 {
0040     static const plog::Severity LEVEL ; 
0041     static const QCerenkov*     INSTANCE ; 
0042     static const QCerenkov*     Get(); 
0043     static const char*          DEFAULT_FOLD ; 
0044     static NP*                  Load(const char* fold, const char* name) ; 
0045     static QTex<float4>*        MakeTex(const NP* icdf, char filterMode, bool normalizedCoords) ; 
0046 
0047     static qcerenkov* MakeInstance(); 
0048 
0049     const char*             fold ; 
0050     const NP*               icdf_ ; 
0051     const NP*               icdf ; 
0052     char                    filterMode ; 
0053     bool                    normalizedCoords ; 
0054     QTex<float4>*           tex ; 
0055     QTexLookup<float4>*     look ; 
0056     qcerenkov*              cerenkov ; 
0057     qcerenkov*              d_cerenkov ; 
0058 
0059     QCerenkov(); 
0060     QCerenkov(const char* fold); 
0061     void init(); 
0062     std::string desc() const ; 
0063 
0064     void configureLaunch( dim3& numBlocks, dim3& threadsPerBlock, unsigned width, unsigned height );
0065 
0066     void check();
0067     NP* lookup();
0068     void dump(   float* lookup, unsigned num_lookup, unsigned edgeitems=10 ); 
0069 
0070 };
0071 
0072