6 #include <goofit/Version.h> 21 class FunctionMinimum;
54 void filter_arguments(std::vector<Observable> &oblist) {}
56 template <
typename... Args>
57 void filter_arguments(std::vector<Observable> &oblist,
const Observable &obs, Args... args) {
58 oblist.push_back(obs);
59 return filter_arguments(oblist, args...);
62 template <
typename... Args>
63 void filter_arguments(std::vector<Observable> &oblist,
const EventNumber &obs, Args... args) {
64 oblist.push_back(obs);
65 return filter_arguments(oblist, args...);
71 template <
typename... Args>
72 explicit PdfBase(std::string n, Args... args)
73 : name(
std::move(n)) {
74 std::vector<Observable> obs;
75 filter_arguments(obs, args...);
77 registerObservable(ob);
82 enum Specials { ForceSeparateNorm = 1, ForceCommonNorm = 2 };
84 __host__
virtual double calculateNLL()
const = 0;
86 __host__
void initializeIndices(std::vector<unsigned int> pindices);
89 __host__
void copyParams(
const std::vector<double> &pars)
const;
90 __host__
void copyParams();
91 __host__
void copyNormFactors()
const;
92 __host__
void generateNormRange();
93 __host__ std::string
getName()
const {
return name; }
95 __host__
virtual std::vector<Observable> getObservables()
const;
96 __host__
virtual std::vector<Variable> getParameters()
const;
98 __host__
Variable *getParameterByName(std::string n);
104 __host__
virtual void setFitControl(std::shared_ptr<FitControl>) = 0;
108 __host__ ROOT::Minuit2::FunctionMinimum fitTo(
DataSet *data,
int verbosity = 3);
112 __host__
unsigned int registerParameter(
Variable var);
113 __host__
unsigned int registerConstants(
unsigned int amount);
114 __host__
virtual void recursiveSetNormalisation(
fptype norm = 1)
const;
115 __host__
void unregisterParameter(
Variable var);
116 __host__
void registerObservable(
Observable obs);
117 __host__
void setIntegrationFineness(
int i);
118 __host__
void printProfileInfo(
bool topLevel =
true);
120 __host__
bool parametersChanged()
const;
122 __host__
void checkInitStatus(std::vector<std::string> &unInited)
const;
123 void clearCurrentFit();
129 unsigned int numEntries{0};
132 unsigned int parameters{0};
133 unsigned int cIndex{1};
138 int integrationBins{-1};
140 bool properlyInitialised{
true};
142 unsigned int functionIdx{0};
144 int m_iEventsPerTask{0};
147 void setNumPerTask(
PdfBase *p,
const int &c);
152 __host__
void recursiveSetIndices();
153 __host__
void setIndices();
__host__ unsigned int getParameterIndex() const
void normalize(TH1F *dat)
unsigned int host_indices[maxParams]
std::vector< Observable > observables
__host__ void SigGenSetIndices()
std::vector< PdfBase * > components
Special class for observables. Used in DataSets.
__host__ unsigned int getFunctionIndex() const
virtual __host__ bool hasAnalyticIntegral() const
std::vector< Variable > parameterList
TH1D * getData(DataSet *data, Observable var, std::string filename, size_t reduce=1, std::string keyw="data_hist")
std::shared_ptr< FitControl > fitControl
PdfBase(std::string n, Args... args)
fptype host_normalisation[maxParams]
__host__ std::string getName() const
__host__ void addSpecialMask(int m)
__host__ int getSpecialMask() const
fptype host_params[maxParams]