LauAbsPdf.cc
Go to the documentation of this file.
56 LauAbsPdf::LauAbsPdf(const std::vector<TString>& theVarNames, const std::vector<LauParameter*>& 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<LauParameter*>::iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
389 std::cerr << "ERROR in LauAbsPdf::findParameter : Parameter \"" << parName << "\" not found." << std::endl;
395 for ( std::vector<LauParameter*>::const_iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
401 std::cerr << "ERROR in LauAbsPdf::findParameter : Parameter \"" << parName << "\" not found." << std::endl;
515 for ( std::vector<LauParameter*>::const_iterator iter = param_.begin(); iter != param_.end(); ++iter ) {
524 for ( std::vector<LauParameter*>::iterator iter = params.begin(); iter != params.end(); ++iter ) {
534 std::cerr << "ERROR in LauAbsPdf::calcNorm : Numeric integration only works for 1D PDFs." << std::endl;
540 Double_t normFac = (sumMethod == GaussLegendre) ? this->integrGaussLegendre() : this->integTrapezoid();
573 std::cerr << "WARNING in LauAbsPdf::getNormWeights : Already calculated weights, not doing it again." << std::endl;
579 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:547 virtual void setParMax(const TString &parName, Double_t maxValue) Change the maximum value of the specified parameter. Definition: LauAbsPdf.cc:481 TRandom * randomFun() Access the singleton random number generator with a particular seed. Definition: LauRandom.cc:20 Bool_t fixed() const Check whether the parameter is fixed or floated. Definition: LauParameter.hh:192 virtual Double_t getMinAbscissa() const Retrieve the minimum value of the (primary) abscissa. Definition: LauAbsPdf.hh:158 virtual Bool_t normWeightsDone() const Check whether the normalisation weights have been calculated. Definition: LauAbsPdf.hh:532 virtual Bool_t heightUpToDate() const Check if the maximum height of the PDF is up to date. Definition: LauAbsPdf.hh:349 Double_t maxValue() const The maximum value allowed for the parameter. Definition: LauParameter.hh:180 virtual const TString & varName() const Retrieve the name of the abscissa. Definition: LauAbsPdf.hh:79 virtual void addParameters(std::vector< LauParameter * > ¶ms) Add parameters to the PDF. Definition: LauAbsPdf.cc:522 virtual UInt_t nParameters() const Retrieve the number of PDF parameters. Definition: LauAbsPdf.hh:91 virtual Double_t getUnNormLikelihood() const Retrieve the unnormalised likelihood value. Definition: LauAbsPdf.hh:278 virtual void calcPDFHeight(const LauKinematics *kinematics)=0 Calculate the maximum height of the PDF. Double_t minValue() const The minimum value allowed for the parameter. Definition: LauParameter.hh:174 virtual Bool_t checkRange(const LauAbscissas &abscissas) const Check that all abscissas are within their allowed ranges. Definition: LauAbsPdf.cc:213 virtual Double_t getParMin(const TString &parName) const Retrieve the minimum value of the specified parameter. Definition: LauAbsPdf.cc:415 virtual void setParMin(const TString &parName, Double_t minValue) Change the minimum value of the specified parameter. Definition: LauAbsPdf.cc:473 virtual Int_t nNormPoints() const Retrieve the number of points to integrate over when normalising. Definition: LauAbsPdf.hh:361 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:508 File containing declaration of LauKinematics class. Definition: LauAbsPdf.hh:48 virtual void setParRange(const TString &parName, Double_t minValue, Double_t maxValue) Change the range of the specified parameter. Definition: LauAbsPdf.cc:489 virtual void setMaxAbscissa(const TString &theVarName, Double_t maxAbscissa) Set the maximum value of the specified abscissa. Definition: LauAbsPdf.cc:199 virtual void setParValue(const TString &parName, Double_t value) Change the value of the specified parameter. Definition: LauAbsPdf.cc:465 virtual void fixPar(const TString &parName) Fix the specified parameter. Definition: LauAbsPdf.cc:497 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 virtual Bool_t parFixed(const TString &parName) const Retrieve whether the specified parameter is fixed. Definition: LauAbsPdf.cc:445 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:164 virtual Bool_t isDPDependent() const Specifies whether or not the PDF is DP dependent. Definition: LauAbsPdf.hh:110 std::vector< Double_t > unNormPDFValues_ Cached unnormalised likelihood values. Definition: LauAbsPdf.hh:584 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:520 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 Bool_t parClone(const TString &parName) const Retrieve whether the specified parameter is a clone. Definition: LauAbsPdf.cc:455 LauAbsPdf(const TString &theVarName, const std::vector< LauParameter * > ¶ms, Double_t minAbscissa, Double_t maxAbscissa) Constructor for a 1D PDF. Definition: LauAbsPdf.cc:30 virtual Double_t getParMax(const TString &parName) const Retrieve the maximum value of the specified parameter. Definition: LauAbsPdf.cc:425 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:569 virtual LauParameter * findParameter(const TString &parName) Retrieve the specified parameter. Definition: LauAbsPdf.cc:381 Bool_t haveBranch(const TString &name) const Check if the named branch is stored. Definition: LauFitDataTree.cc:237 virtual Double_t getParRange(const TString &parName) const Retrieve the range of the specified parameter. Definition: LauAbsPdf.cc:435 virtual IntMethod integMethod() const Retrieve the integration method used to normalise the PDF. Definition: LauAbsPdf.hh:373 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 void floatPar(const TString &parName) Float the specified parameter. Definition: LauAbsPdf.cc:505 virtual Double_t getRange() const Retrieve the range of the (primary) abscissa. Definition: LauAbsPdf.hh:170 virtual Double_t getParValue(const TString &parName) const Retrieve the value of the specified parameter. Definition: LauAbsPdf.cc:405 virtual Double_t integTrapezoid() Integrate the PDF using the simple trapezoid method. Definition: LauAbsPdf.cc:620 std::vector< Double_t > LauAbscissas The type used for containing multiple abscissa values. Definition: LauAbsPdf.hh:44 Generated by 1.8.5 |