LauAbsPdf.cc
Go to the documentation of this file.
70 LauAbsPdf::LauAbsPdf(const std::vector<TString>& theVarNames, const std::vector<LauAbsRValue*>& params,
103 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
109 std::cerr << "ERROR in LauAbsPdf::LauAbsPdf : Either min or max abscissa not provided for variable \"" << theVarName << "\"." << std::endl;
121 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
135 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
143 std::cerr << "ERROR in LauAbsPdf::getMinAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
149 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
157 std::cerr << "ERROR in LauAbsPdf::getMaxAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
164 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
175 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
201 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
210 std::cerr << "ERROR in LauAbsPdf::setMinAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
215 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
224 std::cerr << "ERROR in LauAbsPdf::setMaxAbscissa : Variable \"" << theVarName << "\" not found." << std::endl;
235 nVars = abscissas.size() - 2; // if we depend on the DP we'll have been provided with the DP co-ordinates as well
238 std::cerr << "ERROR in LauAbsPdf::checkRange : Unexpected number of absicssas: " << nVars << std::endl;
239 std::cerr << " : " << this->IsA()->GetName() << " expects " << minAbscissas_.size() << std::endl;
248 std::cerr << "ERROR in LauAbsPdf::checkRange : " << abscissa << " outside allowed range: [" << minVal << "," << maxVal << "]" << std::endl;
258 for ( std::map<UInt_t,TString>::const_iterator iter = varNames_.begin(); iter != varNames_.end(); ++iter ) {
261 std::cerr << "ERROR in LauAbsPdf::cacheInfo : Input data does not contain variable \"" << iter->second << "\"." << std::endl;
281 for ( std::map<UInt_t,TString>::const_iterator var_iter = varNames_.begin(); var_iter != varNames_.end(); ++var_iter ) {
323 std::cerr << "ERROR in LauAbsPdf::generate : Please set the random number generator for this PDF by using the setRandomFun(TRandom*) function." << std::endl;
329 std::cerr << "ERROR in LauAbsPdf::generate : PDF depends on the DP and an invalid kinematics pointer has been provided." << std::endl;
355 std::cerr << "WARNING in LauAbsPdf::generate : genPDFVal = " << genPDFVal << " is larger than the maximum PDF height " << this->getMaxHeight() << " for the abscissa = " << genAbscissa[0] << "." << std::endl;
356 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;
380 std::cerr << "ERROR in LauAbsPdf::getLikelihood : Unrecognised variable name \"" << theVarName << "\", cannot determine likelihood." << std::endl;
397 for ( std::vector<LauAbsRValue*>::iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
399 // for (std::vector<LauParameter*>::iterator params_iter = params.begin(); params_iter != params.end(); ++params_iter ) {
406 std::cerr << "ERROR in LauAbsPdf::findParameter : Parameter \"" << parName << "\" not found." << std::endl;
412 for ( std::vector<LauAbsRValue*>::const_iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
414 // for (std::vector<LauParameter*>::iterator params_iter = params.begin(); params_iter != params.end(); ++params_iter ) {
421 std::cerr << "ERROR in LauAbsPdf::findParameter : Parameter \"" << parName << "\" not found." << std::endl;
427 for ( std::vector<LauAbsRValue*>::iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
429 for (std::vector<LauParameter*>::iterator params_iter = params.begin(); params_iter != params.end(); ++params_iter ) {
439 for ( std::vector<LauAbsRValue*>::iterator iter = params.begin(); iter != params.end(); ++iter ) {
449 std::cerr << "ERROR in LauAbsPdf::calcNorm : Numeric integration only works for 1D PDFs." << std::endl;
455 Double_t normFac = (sumMethod == GaussLegendre) ? this->integrGaussLegendre() : this->integTrapezoid();
488 std::cerr << "WARNING in LauAbsPdf::getNormWeights : Already calculated weights, not doing it again." << std::endl;
494 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:462 TRandom * randomFun() Access the singleton random number generator with a particular seed. Definition: LauRandom.cc:34 virtual Double_t getMinAbscissa() const Retrieve the minimum value of the (primary) abscissa. Definition: LauAbsPdf.hh:131 virtual Bool_t normWeightsDone() const Check whether the normalisation weights have been calculated. Definition: LauAbsPdf.hh:461 virtual Bool_t heightUpToDate() const Check if the maximum height of the PDF is up to date. Definition: LauAbsPdf.hh:278 virtual const TString & varName() const Retrieve the name of the abscissa. Definition: LauAbsPdf.hh:94 ClassImp(LauAbsCoeffSet) virtual LauAbsRValue * findParameter(const TString &parName) Retrieve the specified parameter. Definition: LauAbsPdf.cc:395 virtual UInt_t nParameters() const Retrieve the number of PDF parameters. Definition: LauAbsPdf.hh:106 virtual Double_t getUnNormLikelihood() const Retrieve the unnormalised likelihood value. Definition: LauAbsPdf.hh:210 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:227 virtual Int_t nNormPoints() const Retrieve the number of points to integrate over when normalising. Definition: LauAbsPdf.hh:296 virtual void setMinAbscissa(const TString &theVarName, Double_t minAbscissa) Set the minimum value of the specified abscissa. Definition: LauAbsPdf.cc:199 virtual LauFitData generate(const LauKinematics *kinematics) Generate an event from the PDF. Definition: LauAbsPdf.cc:312 std::map< TString, Double_t > LauFitData Type for holding event data. Definition: LauFitDataTree.hh:45 virtual Bool_t withinNormCalc() const Check whether the calcNorm method is running. Definition: LauAbsPdf.hh:437 LauAbsPdf(const TString &theVarName, const std::vector< LauAbsRValue * > ¶ms, Double_t minAbscissa, Double_t maxAbscissa) Constructor for a 1D PDF. Definition: LauAbsPdf.cc:44 File containing declaration of LauKinematics class. Definition: LauAbsPdf.hh:63 virtual void setMaxAbscissa(const TString &theVarName, Double_t maxAbscissa) Set the maximum value of the specified abscissa. Definition: LauAbsPdf.cc:213 virtual LauFitData getMinAbscissas() const Retrieve the minimum values of all the abscissas. Definition: LauAbsPdf.cc:161 virtual LauFitData getRanges() const Retrieve the ranges of all the abscissas. Definition: LauAbsPdf.cc:183 void calcGaussLegendreWeights(const Int_t numPoints, std::vector< Double_t > &abscissas, std::vector< Double_t > &weights) Calculate the Gauss-Legendre weights. Definition: LauIntegrals.cc:64 Predicate to allow counting of the number of fixed parameters. Definition: LauParamFixed.hh:38 virtual std::vector< TString > varNames() const Retrieve the names of the abscissas. Definition: LauAbsPdf.cc:117 virtual Double_t getMaxAbscissa() const Retrieve the maximum value of the (primary) abscissa. Definition: LauAbsPdf.hh:137 virtual Bool_t isDPDependent() const Specifies whether or not the PDF is DP dependent. Definition: LauAbsPdf.hh:125 virtual void addParameters(std::vector< LauAbsRValue * > ¶ms) Add parameters to the PDF. Definition: LauAbsPdf.cc:437 std::vector< Double_t > unNormPDFValues_ Cached unnormalised likelihood values. Definition: LauAbsPdf.hh:519 File containing declaration of LauAbsPdf class. const LauFitData & getData(UInt_t iEvt) const Retrieve the data for a given event. Definition: LauFitDataTree.cc:348 virtual Bool_t withinGeneration() const Check whether the generate method is running. Definition: LauAbsPdf.hh:449 File containing LauRandom namespace. virtual LauFitData getMaxAbscissas() const Retrieve the maximum values of all the abscissas. Definition: LauAbsPdf.cc:172 virtual Double_t getLikelihood() const Retrieve the normalised likelihood value. Definition: LauAbsPdf.cc:368 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:484 Bool_t haveBranch(const TString &name) const Check if the named branch is stored. Definition: LauFitDataTree.cc:273 virtual IntMethod integMethod() const Retrieve the integration method used to normalise the PDF. Definition: LauAbsPdf.hh:308 File containing declaration of LauIntegrals class. virtual UInt_t nFixedParameters() const Retrieve the number of fixed PDF parameters. Definition: LauAbsPdf.cc:127 virtual void cacheInfo(const LauFitDataTree &inputData) Cache information from data. Definition: LauAbsPdf.cc:255 virtual Double_t getRange() const Retrieve the range of the (primary) abscissa. Definition: LauAbsPdf.hh:143 Pure abstract base class for defining a parameter containing an R value. Definition: LauAbsRValue.hh:43 virtual Double_t integTrapezoid() Integrate the PDF using the simple trapezoid method. Definition: LauAbsPdf.cc:535 std::vector< Double_t > LauAbscissas The type used for containing multiple abscissa values. Definition: LauAbsPdf.hh:59 Generated by 1.8.5 |