summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/thepeg/thepeg-1.9.2.patch
blob: 556b6835608801d4efe0b325ab1b88abef2284b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff -r 2d8e0f74b65e PDF/LHAPDF6.cc
--- PDF/LHAPDF6.cc.orig	Mon Jul 07 09:16:48 2014 +0100
+++ PDF/LHAPDF6.cc	Fri Sep 26 14:41:55 2014 +0100
@@ -54,8 +54,8 @@
   return new_ptr(*this);
 }
 
-void ThePEG::LHAPDF::doinit() {
-  PDFBase::doinit();
+void ThePEG::LHAPDF::initPDFptr() {
+  if ( thePDF ) return;
   thePDF = ::LHAPDF::mkPDF(thePDFName, theMember);
   xMin = thePDF->xMin();
   xMax = thePDF->xMax();
@@ -63,6 +63,11 @@
   Q2Max = thePDF->q2Max() * GeV2;
 }
 
+void ThePEG::LHAPDF::doinit() {
+  PDFBase::doinit();
+  initPDFptr();
+}
+
 void ThePEG::LHAPDF::dofinish() {
   PDFBase::dofinish();
   delete thePDF;
@@ -71,11 +76,7 @@
 
 void ThePEG::LHAPDF::doinitrun() {
   PDFBase::doinitrun();
-  thePDF = ::LHAPDF::mkPDF(thePDFName, theMember);
-  xMin = thePDF->xMin();
-  xMax = thePDF->xMax();
-  Q2Min = thePDF->q2Min() * GeV2;
-  Q2Max = thePDF->q2Max() * GeV2;
+  initPDFptr();
 }
 
 void ThePEG::LHAPDF::setPDFName(string name) {
@@ -387,6 +388,7 @@
   lastQ2 = -1.0*GeV2;
   lastX = -1.0;
   lastP2 = -1.0*GeV2;
+  initPDFptr();
 }
 
 ThePEG::ClassDescription<ThePEG::LHAPDF> ThePEG::LHAPDF::initLHAPDF;
diff -r 2d8e0f74b65e PDF/LHAPDF6.h
--- PDF/LHAPDF6.h.orig	Mon Jul 07 09:16:48 2014 +0100
+++ PDF/LHAPDF6.h	Fri Sep 26 14:41:55 2014 +0100
@@ -147,6 +147,12 @@
   void checkUpdate(double x, Energy2 Q2, Energy2 P2) const;
 
   /**
+   * Initialize the LHAPDF library for the chosen PDF set if it has
+   * not been done before.
+   */
+  void initPDFptr();
+
+  /**
    * Used by the interface to select a set according to a file name.
    */
   void setPDFName(string name);
--- Persistency/PersistentOStream.h.orig	2018-11-07 14:46:59.055432275 +0100
+++ Persistency/PersistentOStream.h	2018-11-07 14:47:20.639293703 +0100
@@ -219,7 +219,7 @@
    * Write a double.
    */
   PersistentOStream & operator<<(double d) {
-    if ( isnan(d) || isinf(d) )
+    if ( std::isnan(d) || std::isinf(d) )
       throw WriteError()
 	<< "Tried to write a NaN or Inf double to a persistent stream."
 	<< Exception::runerror;
@@ -232,7 +232,7 @@
    * Write a float.
    */
   PersistentOStream & operator<<(float f) {
-    if ( isnan(f) || isinf(f) )
+    if ( std::isnan(f) || std::isinf(f) )
       throw WriteError()
 	<< "Tried to write a NaN or Inf float to a persistent stream."
 	<< Exception::runerror;