LauAbsPdf.cc
Go to the documentation of this file.
56 LauAbsPdf::LauAbsPdf(const std::vector<TString>& theVarNames, const std::vector<LauAbsRValue*>& params,
89 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
95 std::cerr << "ERROR in LauAbsPdf::LauAbsPdf : Either min or max abscissa not provided for variable \"" << theVarName << "\"." << std::endl;
107 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
121 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
129 std::cerr << "ERROR in LauAbsPdf::getMinAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
135 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
143 std::cerr << "ERROR in LauAbsPdf::getMaxAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
150 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
161 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
187 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
196 std::cerr << "ERROR in LauAbsPdf::setMinAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
201 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
210 std::cerr << "ERROR in LauAbsPdf::setMaxAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
221 nVars = abscissas.size() - 2; // if we depend on the DP we'll have been provided with the DP co-ordinates as well
224 std::cerr << "ERROR in LauAbsPdf::checkRange : Unexpected number of absicssas: " << nVars << std::endl;
225 std::cerr << " : " << this->IsA()->GetName() << " expects " << minAbscissas_.size() << std::endl;
234 std::cerr << "ERROR in LauAbsPdf::checkRange : " << abscissa << " outside allowed range: [" << minVal << "," << maxVal << "]" << std::endl;
244 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
247 std::cerr << "ERROR in LauAbsPdf::cacheInfo : Input data does not contain variable \"" << iter->second << "\"." << std::endl;
267 for ( std::map<UInt_t,TString>::const_iterator var_iter = varNames_.begin(); var_iter != varNames_.end(); ++var_iter ) {
309 std::cerr << "ERROR in LauAbsPdf::generate : Please set the random number generator for this PDF by using the setRandomFun(TRandom*) function." << std::endl;
315 std::cerr << "ERROR in LauAbsPdf::generate : PDF depends on the DP and an invalid kinematics pointer has been provided." << std::endl;
341 std::cerr << "WARNING in LauAbsPdf::generate : genPDFVal = " << genPDFVal << " is larger than the maximum PDF height " << this->getMaxHeight() << " for the abscissa = " << genAbscissa[0] << "." << std::endl;
342 std::cerr << " : Need to reset height to be larger than " << genPDFVal << " by using the setMaxHeight(Double_t) function and re-run the Monte Carlo generation!" << std::endl;
366 std::cerr << "ERROR in LauAbsPdf::getLikelihood : Unrecognised variable name \"" << theVarName << "\", cannot determine likelihood." << std::endl;
383 for ( std::vector<LauAbsRValue*>::iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
385 // for (std::vector<LauParameter*>::iterator params_iter = params.begin(); params_iter != params.end(); ++params_iter ) {
392 std::cerr << "ERROR in LauAbsPdf::findParameter : Parameter \"" << parName << "\" not found." << std::endl;
398 for ( std::vector<LauAbsRValue*>::const_iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
400 // for (std::vector<LauParameter*>::iterator params_iter = params.begin(); params_iter != params.end(); ++params_iter ) {
407 std::cerr << "ERROR in LauAbsPdf::findParameter : Parameter \"" << parName << "\" not found." << std::endl;
413 for ( std::vector<LauAbsRValue*>::iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
415 for (std::vector<LauParameter*>::iterator params_iter = params.begin(); params_iter != params.end(); ++params_iter ) {
425 for ( std::vector<LauAbsRValue*>::iterator iter = params.begin(); iter != params.end(); ++iter ) {
435 std::cerr << "ERROR in LauAbsPdf::calcNorm : Numeric integration only works for 1D PDFs." << std::endl;
441 Double_t normFac = (sumMethod == GaussLegendre) ? this->integrGaussLegendre() : this->integTrapezoid();
474 std::cerr << "WARNING in LauAbsPdf::getNormWeights : Already calculated weights, not doing it again." << std::endl;
480 std::cerr << "ERROR in LauAbsPdf::getNormWeights : Zero points specified, this is daft!" << std::endl;
virtual Double_t integrGaussLegendre() Integrate the PDF using the Gauss-Legendre method. Definition: LauAbsPdf.cc:448 TRandom * randomFun() Access the singleton random number generator with a particular seed. Definition: LauRandom.cc:20 virtual Double_t getMinAbscissa() const Retrieve the minimum value of the (primary) abscissa. Definition: LauAbsPdf.hh:117 virtual Bool_t normWeightsDone() const Check whether the normalisation weights have been calculated. Definition: LauAbsPdf.hh:447 virtual Bool_t heightUpToDate() const Check if the maximum height of the PDF is up to date. Definition: LauAbsPdf.hh:264 virtual const TString & varName() const Retrieve the name of the abscissa. Definition: LauAbsPdf.hh:80 ClassImp(LauAbsCoeffSet) virtual LauAbsRValue * findParameter(const TString &parName) Retrieve the specified parameter. Definition: LauAbsPdf.cc:381 virtual UInt_t nParameters() const Retrieve the number of PDF parameters. Definition: LauAbsPdf.hh:92 virtual Double_t getUnNormLikelihood() const Retrieve the unnormalised likelihood value. Definition: LauAbsPdf.hh:196 virtual void calcPDFHeight(const LauKinematics *kinematics)=0 Calculate the maximum height of the PDF. virtual Bool_t checkRange(const LauAbscissas &abscissas) const Check that all abscissas are within their allowed ranges. Definition: LauAbsPdf.cc:213 virtual Int_t nNormPoints() const Retrieve the number of points to integrate over when normalising. Definition: LauAbsPdf.hh:282 virtual void setMinAbscissa(const TString &theVarName, Double_t minAbscissa) Set the minimum value of the specified abscissa. Definition: LauAbsPdf.cc:185 virtual LauFitData generate(const LauKinematics *kinematics) Generate an event from the PDF. Definition: LauAbsPdf.cc:298 std::map< TString, Double_t > LauFitData Type for holding event data. Definition: LauFitDataTree.hh:31 virtual Bool_t withinNormCalc() const Check whether the calcNorm method is running. Definition: LauAbsPdf.hh:423 LauAbsPdf(const TString &theVarName, const std::vector< LauAbsRValue * > ¶ms, Double_t minAbscissa, Double_t maxAbscissa) Constructor for a 1D PDF. Definition: LauAbsPdf.cc:30 File containing declaration of LauKinematics class. Definition: LauAbsPdf.hh:49 virtual void setMaxAbscissa(const TString &theVarName, Double_t maxAbscissa) Set the maximum value of the specified abscissa. Definition: LauAbsPdf.cc:199 virtual LauFitData getMinAbscissas() const Retrieve the minimum values of all the abscissas. Definition: LauAbsPdf.cc:147 virtual LauFitData getRanges() const Retrieve the ranges of all the abscissas. Definition: LauAbsPdf.cc:169 void calcGaussLegendreWeights(const Int_t numPoints, std::vector< Double_t > &abscissas, std::vector< Double_t > &weights) Calculate the Gauss-Legendre weights. Definition: LauIntegrals.cc:37 Predicate to allow counting of the number of fixed parameters. Definition: LauParamFixed.hh:24 virtual std::vector< TString > varNames() const Retrieve the names of the abscissas. Definition: LauAbsPdf.cc:103 virtual Double_t getMaxAbscissa() const Retrieve the maximum value of the (primary) abscissa. Definition: LauAbsPdf.hh:123 virtual Bool_t isDPDependent() const Specifies whether or not the PDF is DP dependent. Definition: LauAbsPdf.hh:111 virtual void addParameters(std::vector< LauAbsRValue * > ¶ms) Add parameters to the PDF. Definition: LauAbsPdf.cc:423 std::vector< Double_t > unNormPDFValues_ Cached unnormalised likelihood values. Definition: LauAbsPdf.hh:499 File containing declaration of LauAbsPdf class. const LauFitData & getData(UInt_t iEvt) const Retrieve the data for a given event. Definition: LauFitDataTree.cc:312 virtual Bool_t withinGeneration() const Check whether the generate method is running. Definition: LauAbsPdf.hh:435 File containing LauRandom namespace. virtual LauFitData getMaxAbscissas() const Retrieve the maximum values of all the abscissas. Definition: LauAbsPdf.cc:158 virtual Double_t getLikelihood() const Retrieve the normalised likelihood value. Definition: LauAbsPdf.cc:354 virtual void calcLikelihoodInfo(const LauAbscissas &abscissas)=0 Calculate the likelihood (and all associated information) given value(s) of the abscissa(s) ... virtual void getNormWeights() Calculate the weights and abscissas used for normalisation. Definition: LauAbsPdf.cc:470 Bool_t haveBranch(const TString &name) const Check if the named branch is stored. Definition: LauFitDataTree.cc:237 virtual IntMethod integMethod() const Retrieve the integration method used to normalise the PDF. Definition: LauAbsPdf.hh:294 File containing declaration of LauIntegrals class. virtual UInt_t nFixedParameters() const Retrieve the number of fixed PDF parameters. Definition: LauAbsPdf.cc:113 virtual void cacheInfo(const LauFitDataTree &inputData) Cache information from data. Definition: LauAbsPdf.cc:241 virtual Double_t getRange() const Retrieve the range of the (primary) abscissa. Definition: LauAbsPdf.hh:129 Pure abstract base class for defining a parameter containing an R value. Definition: LauAbsRValue.hh:29 virtual Double_t integTrapezoid() Integrate the PDF using the simple trapezoid method. Definition: LauAbsPdf.cc:521 std::vector< Double_t > LauAbscissas The type used for containing multiple abscissa values. Definition: LauAbsPdf.hh:45 Generated by 1.8.5 |