LHAPDF  6.5.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Factories.h
1 // -*- C++ -*-
2 //
3 // This file is part of LHAPDF
4 // Copyright (C) 2012-2022 The LHAPDF collaboration (see AUTHORS for details)
5 //
6 #pragma once
7 #ifndef LHAPDF_Factories_H
8 #define LHAPDF_Factories_H
9 
10 #include <string>
11 
12 namespace LHAPDF {
13 
14 
15  // Forward declarations to avoid circular dependencies
16  class PDF;
17  class Info;
18  class PDFSet;
19  class PDFInfo;
20  class Config;
21  class Interpolator;
22  class Extrapolator;
23  class AlphaS;
24 
25 
28 
31 
36  PDF* mkPDF(const std::string& setname, int member);
37 
42  PDF* mkPDF(int lhaid);
43 
55  PDF* mkPDF(const std::string& setname_nmem);
56 
58 
59 
62 
78  PDFSet& getPDFSet(const std::string& setname);
79 
81  void mkPDFs(const std::string& setname, std::vector<PDF*>& pdfs);
82 
84  std::vector<PDF*> mkPDFs(const std::string& setname);
85 
89  template <typename PTR>
90  void mkPDFs(const std::string& setname, std::vector<PTR>& pdfs) {
91  std::vector<PDF*> rawptrs;
92  mkPDFs(setname, rawptrs);
93  pdfs.clear();
94  pdfs.reserve(rawptrs.size());
95  // for (const PDF* p : rawptrs) pdfs.push_back(PTR(p)); //< Reinstate when C++11 is guaranteed, without flags
96  for (size_t i = 0; i < rawptrs.size(); ++i) pdfs.push_back(PTR(rawptrs[i]));
97  }
98 
100 
101 
104 
114  // Config& getConfig();
115  Info& getConfig();
116 
121  PDFInfo* mkPDFInfo(const std::string& setname, int member);
122 
127  PDFInfo* mkPDFInfo(int lhaid);
128 
130 
131 
134 
139  Interpolator* mkInterpolator(const std::string& name);
140 
141 
146  Extrapolator* mkExtrapolator(const std::string& name);
147 
149 
150 
153 
161  AlphaS* mkAlphaS(const Info& info);
162 
170  AlphaS* mkAlphaS(const std::string& setname);
171 
179  AlphaS* mkAlphaS(const std::string& setname, int member);
180 
188  AlphaS* mkAlphaS(int lhaid);
189 
197  AlphaS* mkBareAlphaS(const std::string& type);
198 
200 
202 
203 }
204 #endif
PDFSet & getPDFSet(const std::string &setname)
Info & getConfig()
PDF * mkPDF(const std::string &setname, int member)
Extrapolator * mkExtrapolator(const std::string &name)
PDFInfo * mkPDFInfo(const std::string &setname, int member)
AlphaS * mkAlphaS(const Info &info)
Make an AlphaS object from an Info object.
void mkPDFs(const std::string &setname, std::vector< PDF * > &pdfs)
Get all PDFs in a named set (return by filling the supplied vector).
Interpolator * mkInterpolator(const std::string &name)
AlphaS * mkBareAlphaS(const std::string &type)
Make an AlphaS object of the requested type without a PDF reference.