Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7877551
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
View Options
diff --git a/CepGen/StructureFunctions/GenericLHAPDF.cpp b/CepGen/StructureFunctions/GenericLHAPDF.cpp
index bf569e0..5a0ecae 100644
--- a/CepGen/StructureFunctions/GenericLHAPDF.cpp
+++ b/CepGen/StructureFunctions/GenericLHAPDF.cpp
@@ -1,50 +1,48 @@
#include "GenericLHAPDF.h"
namespace CepGen
{
namespace SF
{
+ constexpr std::array<double,6> GenericLHAPDF::qtimes3_;
GenericLHAPDF::GenericLHAPDF( const char* set )
{
initialise( set );
}
void
GenericLHAPDF::initialise( const char* set )
{
#if LHAPDF_MAJOR_VERSION==6
pdf_set_ = LHAPDF::PDFSet( set );
pdfs_ = pdf_set_.mkPDFs();
#else
LHAPDF::initPDFSet( set, LHAPDF::LHGRID, 0 );
#endif
}
StructureFunctions
- GenericLHAPDF::operator()( double q2, double xbj ) const
+ GenericLHAPDF::operator()( double q2, double xbj, unsigned short num_flavours ) const
{
StructureFunctions pdf;
- //const LHAPDF::PDFSet set( "MRST2004qed_proton" );
- std::array<double,6> qtimes3 = { -1.0 /*d*/, 2.0 /*u*/, -1.0 /*s*/, 2.0 /*c*/, -1.0 /*b*/, 2.0 /*t*/ };
+ if ( num_flavours == 0 || num_flavours > 6 ) return pdf;
- double sf = 0.;
//if ( q2 < 1.69 ) return pdf;
- for ( int i = 0; i < 4; ++i ) {
+ for ( int i = 0; i < num_flavours; ++i ) {
double xq = 0., xqbar = 0.;
#if LHAPDF_MAJOR_VERSION==6
xq = pdfs_[0]->xfxQ2( i, xbj, q2 );
xqbar = pdfs_[0]->xfxQ2( -i, xbj, q2 );
#else
xq = LHAPDF::xfx( xbj, q2, i+1 );
xqbar = LHAPDF::xfx( xbj, q2, -i-1 );
#endif
- sf += qtimes3[i]*qtimes3[i]/9. * ( xq + xqbar );
+ pdf.F2 += qtimes3_[i]*qtimes3_[i]/9. * ( xq + xqbar );
}
- pdf.F2 = sf;
return pdf;
}
}
}
diff --git a/CepGen/StructureFunctions/GenericLHAPDF.h b/CepGen/StructureFunctions/GenericLHAPDF.h
index d30db51..c7aa46e 100644
--- a/CepGen/StructureFunctions/GenericLHAPDF.h
+++ b/CepGen/StructureFunctions/GenericLHAPDF.h
@@ -1,28 +1,35 @@
#ifndef CepGen_StructureFunctions_CTEQ_h
#define CepGen_StructureFunctions_CTEQ_h
#include "StructureFunctions.h"
+
#include "LHAPDF/LHAPDF.h"
+#include <array>
namespace CepGen
{
namespace SF
{
class GenericLHAPDF
{
public:
GenericLHAPDF( const char* set );
- StructureFunctions operator()( double q2, double xbj ) const;
+ StructureFunctions operator()( double q2, double xbj, unsigned short num_flavours = 4 ) const;
private:
void initialise( const char* set );
#if LHAPDF_MAJOR_VERSION==6
LHAPDF::PDFSet pdf_set_;
std::vector<LHAPDF::PDF*> pdfs_;
#endif
+ static constexpr std::array<double,6> qtimes3_ = { {
+ -1.0 /*d*/, 2.0 /*u*/,
+ -1.0 /*s*/, 2.0 /*c*/,
+ -1.0 /*b*/, 2.0 /*t*/
+ } };
};
}
}
#endif
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 3:42 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805007
Default Alt Text
(2 KB)
Attached To
rCEPGEN CepGen - public repository
Event Timeline
Log In to Comment