LauAbsFitModel.cc
Go to the documentation of this file.
161 std::cerr << "WARNING in LauAbsFitModel::doSFit : sWeight branch name is empty string, not setting-up sFit."
174 std::cerr << "WARNING in LauAbsFitModel::setBkgndClassNames : Names already stored, not changing them."
209 std::cerr << "ERROR in LauAbsFitModel::bkgndClassID : Request for ID for invalid background class \""
232 std::cerr << "ERROR in LauAbsFitModel::bkgndClassName : Request for name of invalid background class ID "
252 std::cout << "INFO in LauAbsFitModel::clearExtraVarVectors : Clearing extra ntuple variable vectors"
272 std::cerr << "ERROR in LauAbsFitModel::writeSPlotData : Already have an sPlot ntuple setup, not doing it again."
337 std::cerr << "WARNING in LauAbsFitModel::generate : Problem in toy MC generation. Starting again with updated parameters..."
361 std::cout << "INFO in LauAbsFitModel::generate : Building experiment:event index." << std::endl;
550 void LauAbsFitModel::setupResultsOutputs( const TString& histFileName, const TString& tableFileName )
557 Bool_t LauAbsFitModel::verifyFitData( const TString& dataFileName, const TString& dataTreeName )
578 std::cerr << "ERROR in LauAbsFitModel::cacheInputSWeights : Input data does not contain variable \""
621 std::cerr << "WARNING in LauAbsFitModel:fitExpt : Not running second stage fit since first stage failed."
729 std::cerr << "WARNING in LauAbsFitModel::createFitToyMC : One or more parameters are blind but the toy will be created using the unblind values - use with caution!!"
736 // TODO - this obviously depends on the number of events per experiment as well, so should do this properly
785 std::cout << "INFO in LauAbsFitModel::createFitToyMC : Finished in createFitToyMC." << std::endl;
852 std::cerr << "WARNING in LauAbsFitModel::getLogLikelihood : Strange likelihood value for event "
855 this->printVarsInfo(); //Write the values of the floated variables for which the likelihood is zero
881 std::cerr << "ERROR in LauAbsFitModel::setParsFromMinuit : Unexpected number of free parameters: "
1027 std::cout << "INFO in LauAbsFitModel::addConParameters : Added Gaussian constraint to parameter "
1046 std::cerr << "WARNING in LauAbsFitModel::addConParameters: Could not find parameters to constrain in the formula... skipping"
1057 std::cout << "INFO in LauAbsFitModel::addConParameters : Added Gaussian constraint to formula\n";
1074 std::cerr << "ERROR in LauAbsFitModel::addConParameters: parameter in n-dimensional constraint already has a 1d constraint applied"
1083 std::cerr << "Error in LauAbsFitModel::addConParameters : Could not match parameter names for n-dimensional constraint"
1092 for ( LauPdfPList::iterator pdf_iter = pdfList.begin(); pdf_iter != pdfList.end(); ++pdf_iter ) {
1097 void LauAbsFitModel::printFitParameters( const LauPdfPList& pdfList, std::ostream& fout ) const
1127 for ( LauPdfPList::iterator pdf_iter = pdfList.begin(); pdf_iter != pdfList.end(); ++pdf_iter ) {
1135 for ( LauPdfPList::iterator pdf_iter = pdfList.begin(); pdf_iter != pdfList.end(); ++pdf_iter ) {
1194 std::cerr << "ERROR in LauAbsFitModel::finaliseExperiment : Unexpected number of parameters received from coordinator"
1204 std::cerr << "ERROR in LauAbsFitModel::finaliseExperiment : Error reading parameter from coordinator"
File containing declaration of LauAbsPdf class. File containing declaration of LauAbsFitModel class. virtual UInt_t readExperimentData() Read in the data for the current experiment. Definition: LauAbsFitModel.cc:1238 Bool_t doEMLFit() const Determine whether an extended maximum likelihood fit it being performed. Definition: LauAbsFitModel.hh:117 void setDoubleBranchValue(const TString &name, Double_t value) Set value of a double branch. Definition: LauGenNtuple.cc:113 virtual Int_t getGenNtupleIntegerBranchValue(const TString &name) const Get the value of an integer branch in the gen tree. Definition: LauAbsFitModel.cc:392 UInt_t addResonanceParameters(LauParameter *param) Add the given parameter to the list of resonance parameters and the list of all fit parameters. Definition: LauAbsFitModel.cc:994 File containing declaration of LauFitter class. Int_t getIntegerBranchValue(const TString &name) const Get value of an integer branch. Definition: LauGenNtuple.cc:118 virtual void writeOutTable(const TString &outputFile)=0 Write the latex table. Bool_t doPoissonSmearing() const Determine whether Poisson smearing is enabled for the toy MC generation. Definition: LauAbsFitModel.hh:126 Bool_t doSFit() const Return the flag to store the status of using an sFit or not. Definition: LauAbsFitModel.hh:107 virtual Double_t getTotEvtLikelihood(UInt_t iEvt)=0 Calculates the likelihood for a given event. void readExperimentData(UInt_t iExpt) Read events only for the given experiment. Definition: LauFitDataTree.cc:169 virtual Double_t getGenNtupleDoubleBranchValue(const TString &name) const Get the value of a double branch in the gen tree. Definition: LauAbsFitModel.cc:397 virtual void setGenNtupleIntegerBranchValue(const TString &name, Int_t value) Set the value of an integer branch in the gen tree. Definition: LauAbsFitModel.cc:382 virtual void savePDFPlots(const TString &label)=0 Save the pdf Plots for all the resonances of experiment number fitExp. void setParametersFromMap(const std::map< TString, Double_t > ¶meters, const Bool_t fix) Set model parameters from a given std::map. Definition: LauAbsFitModel.cc:1257 Bool_t writeSPlotData() const Determine whether the sPlot data is to be written out. Definition: LauAbsFitModel.hh:174 File containing declaration of LauAbsFitter class. LauParameterPSet fitVarsSet_ Internal set of the same fit parameters (used to check uniqueness) Definition: LauAbsFitModel.hh:855 virtual Bool_t verifyFitData(const TString &dataFileName, const TString &dataTreeName) Open the input file and verify that all required variables are present. Definition: LauAbsFitModel.cc:557 const LauFitData & getData(UInt_t iEvt) const Retrieve the data for a given event. Definition: LauFitDataTree.cc:376 virtual void printEventInfo(UInt_t iEvt) const Prints the values of all the fit variables for the specified event - useful for diagnostics. Definition: LauAbsFitModel.cc:1142 virtual Double_t getEventSum() const =0 Returns the sum of the expected events over all hypotheses; used in the EML fit scenario. File containing declaration of LauParamFixed class. void runCalculations(const TString &option="q") Method to calculate the sWeights and cN coeffs. Definition: LauSPlot.cc:703 File containing declaration of LauSPlot class. File containing declaration of LauParameter class. virtual void propagateParUpdates()=0 This function (specific to each model) calculates anything that depends on the fit parameter values. void cacheInfo(LauPdfPList &pdfList, const LauFitDataTree &theData) Have all PDFs in the list cache the data. Definition: LauAbsFitModel.cc:1125 void setParametersFileFallback(const TString &fileName, const TString &treeName, const std::map< TString, Double_t > ¶meters, const Bool_t fix) Set named model parameters from a given std::map, with fallback to those from a file. Definition: LauAbsFitModel.cc:1275 Bool_t enableEmbedding() const Determine whether embedding of events is enabled in the generation. Definition: LauAbsFitModel.hh:135 virtual void generate(const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileNameBase) Generate toy MC. Definition: LauAbsFitModel.cc:287 virtual Bool_t genExpt()=0 The method that actually generates the toy MC events for the given experiment. Bool_t useAsymmFitErrors() const Report whether or not calculation of asymmetric errors is enabled. Definition: LauFitObject.hh:60 virtual void addGenNtupleDoubleBranch(const TString &name) Add a branch to the gen tree for storing a double. Definition: LauAbsFitModel.cc:377 File containing declaration of LauFitDataTree class. virtual void printVarsInfo() const Same as printEventInfo, but printing out the values of the variables in the fit. Definition: LauAbsFitModel.cc:1152 const TString & bkgndClassName(UInt_t classID) const Get the name of a background class from the number. Definition: LauAbsFitModel.cc:227 static LauAbsFitter & fitter() Method that provides access to the singleton fitter. Definition: LauFitter.cc:75 void storeFitStatus(const LauAbsFitter::FitStatus &status, const TMatrixD &covMatrix) Store fit status information. Definition: LauFitObject.cc:93 virtual void finaliseExperiment(const LauAbsFitter::FitStatus &fitStat, const TObjArray *parsFromCoordinator, const TMatrixD *covMat, TObjArray &parsToCoordinator) Perform all finalisation actions. Definition: LauAbsFitModel.cc:1182 UInt_t bkgndClassID(const TString &className) const The number assigned to a background class. Definition: LauAbsFitModel.cc:206 virtual std::vector< LauParameter * > getPars()=0 Return the list of LauParameters on which the LauAbsRValue depends. std::vector< LauParameter * > LauParameterPList List of parameter pointers. Definition: LauAbsFitModel.hh:339 virtual Double_t getTotNegLogLikelihood() Calculates the total negative log-likelihood. Definition: LauAbsFitModel.cc:788 virtual void weightEvents(const TString &dataFileName, const TString &dataTreeName)=0 Weighting - allows e.g. MC events to be weighted by the DP model. LauParameterList extraVars_ Extra variables that aren't in the fit but are stored in the ntuple. Definition: LauAbsFitModel.hh:861 virtual Bool_t useAsymmFitErrors() const =0 Determine whether calculation of asymmetric errors is enabled. Bool_t haveBranch(const TString &name) const Check if the named branch is stored. Definition: LauFitDataTree.cc:293 virtual void cacheInputSWeights() Cache the value of the sWeights to be used in the sFit. Definition: LauAbsFitModel.cc:574 const std::vector< MultiDimConstraint > & multiDimConstraints() const Const access to the ND constraints store. Definition: LauFitObject.hh:271 Bool_t secondStage() const Check whether the parameter should be floated only in the second stage of a two stage fit. Definition: LauParameter.hh:241 Bool_t storeDPEff_ Option to store DP efficiencies in the sPlot ntuple. Definition: LauAbsFitModel.hh:835 virtual Bool_t twoStageFit() const =0 Determine whether the two-stage fit is enabled. void generateConstraintMeans(std::vector< LauAbsRValue * > &conVars) Generate per-experiment mean for each Gaussian constraint. Definition: LauFitObject.cc:154 void addConParameters() Add parameters to the list of Gaussian constrained parameters. Definition: LauAbsFitModel.cc:1019 void setIntegerBranchValue(const TString &name, Int_t value) Set value of an integer branch. Definition: LauGenNtuple.cc:108 virtual void setupSPlotNtupleBranches()=0 Setup the branches of the sPlot tuple. UInt_t addFitParameters(LauParameter *param, const Bool_t addFixed=kFALSE) Add the given parameter to the list of all fit parameters. Definition: LauAbsFitModel.cc:918 virtual void cacheInputFitVars()=0 Cache the input data values to calculate the likelihood during the fit. void createFitToyMC(const TString &mcFileName, const TString &tableFileName) Create a toy MC sample from the fitted parameters. Definition: LauAbsFitModel.cc:673 virtual const FitStatus & minimise()=0 Perform the minimisation of the fit function. const std::vector< FormulaConstraint > & formulaConstraints() const Const access to the formula constraints store. Definition: LauFitObject.hh:265 virtual const TMatrixD & covarianceMatrix() const =0 Retrieve the fit covariance matrix. void addFriendTree(const TString &rootFileName, const TString &rootTreeName) Add a friend tree. Definition: LauGenNtuple.cc:220 std::vector< LauAbsRValue * > LauAbsRValuePList List of parameter pointers. Definition: LauAbsFitModel.hh:341 Bool_t withinAsymErrorCalc() const Query whether the fit is calculating the asymmetric errors. Definition: LauFitObject.hh:94 virtual void setSPlotNtupleDoubleBranchValue(const TString &name, Double_t value) Set the value of a double branch in the sPlot tree. Definition: LauAbsFitModel.cc:422 File containing declaration of LauComplex class. virtual void setupGenNtupleBranches()=0 Setup the generation ntuple branches. Double_t prodPdfValue(LauPdfPList &pdfList, UInt_t iEvt) Calculate the product of the per-event likelihoods of the PDFs in the list. Definition: LauAbsFitModel.cc:1132 void setParametersFromFile(const TString &fileName, const TString &treeName, const Bool_t fix) Set model parameters from a file. Definition: LauAbsFitModel.cc:1248 File containing declaration of LauGenNtuple class. virtual void addSPlotNtupleIntegerBranch(const TString &name) Add a branch to the sPlot tree for storing an integer. Definition: LauAbsFitModel.cc:407 virtual void prepareInitialParArray(TObjArray &array) Package the initial fit parameters for transmission to the coordinator. Definition: LauAbsFitModel.cc:1162 virtual void setBkgndClassNames(const std::vector< TString > &names) Setup the background class names. Definition: LauAbsFitModel.cc:171 virtual void setGenNtupleDoubleBranchValue(const TString &name, Double_t value) Set the value of a double branch in the gen tree. Definition: LauAbsFitModel.cc:387 void fit(const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileNameBase) Perform the total fit. Definition: LauAbsFitModel.cc:432 Double_t getDoubleBranchValue(const TString &name) const Get value of a double branch. Definition: LauGenNtuple.cc:130 void compareFitData(UInt_t toyMCScale=10, const TString &mcFileName="fitToyMC.root", const TString &tableFileName="fitToyMCTable.tex", Bool_t poissonSmearing=kTRUE) Specify that a toy MC sample should be created for a successful fit to an experiment. Definition: LauAbsFitModel.cc:661 void setGenValues() Make sure all parameters hold their genValue as the current value. Definition: LauAbsFitModel.cc:257 Bool_t pdfsDependOnDP() const Do any of the PDFs have a dependence on the DP? Definition: LauAbsFitModel.hh:756 Bool_t writeLatexTable() const Determine whether writing out of the latex table is enabled. Definition: LauAbsFitModel.hh:144 void run(const TString &applicationCode, const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileName="") Start the toy generation / fitting. Definition: LauAbsFitModel.cc:92 Int_t buildIndex(const TString &majorName, const TString &minorName="0") Create an index table using leaves of the tree. Definition: LauGenNtuple.cc:187 Pure abstract base class for defining a parameter containing an R value. Definition: LauAbsRValue.hh:45 std::map< TString, Double_t > fixParamMap_ Map from imported parameter name to value. Definition: LauAbsFitModel.hh:804 virtual void setupResultsOutputs(const TString &histFileName, const TString &tableFileName) Setup saving of fit results to ntuple/LaTeX table etc. Definition: LauAbsFitModel.cc:550 virtual void addSPlotNtupleDoubleBranch(const TString &name) Add a branch to the sPlot tree for storing a double. Definition: LauAbsFitModel.cc:412 void clearFitParVectors() Clear the vectors containing fit parameters. Definition: LauAbsFitModel.cc:240 virtual void storePerEvtLlhds()=0 Store the per-event likelihood values. void startNewFit(const UInt_t nPars, const UInt_t nFreePars) Indicate the start of a new fit. Definition: LauFitObject.cc:83 std::map< TString, Double_t > LauFitData Type for holding event data. Definition: LauFitDataTree.hh:45 virtual void addGenNtupleIntegerBranch(const TString &name) Add a branch to the gen tree for storing an integer. Definition: LauAbsFitModel.cc:372 File containing declaration of LauPrint class and LauOutputLevel enum. virtual void setupResultsOutputs(const TString &histFileName, const TString &tableFileName) Setup saving of fit results to ntuple/LaTeX table etc. Definition: LauSimFitTask.cc:102 virtual void setSPlotNtupleIntegerBranchValue(const TString &name, Int_t value) Set the value of an integer branch in the sPlot tree. Definition: LauAbsFitModel.cc:417 void clearExtraVarVectors() Clear the vectors containing extra ntuple variables. Definition: LauAbsFitModel.cc:250 Bool_t fixParams_ Whether to fix the loaded parameters (kTRUE) or leave them floating (kFALSE) Definition: LauAbsFitModel.hh:810 void writeOutResults() Save the sWeight results as a friend tree to the input tree (in the same file) Definition: LauSPlot.cc:1359 void printFitParameters(const LauPdfPList &pdfList, std::ostream &fout) const Print the fit parameters for all PDFs in the list. Definition: LauAbsFitModel.cc:1097 UInt_t eventsPerExpt() const Obtain the total number of events in the current experiment. Definition: LauFitObject.hh:109 void printFormat(std::ostream &stream, Double_t value) const Method to choose the printing format to a specified level of precision. Definition: LauPrint.cc:43 virtual void finaliseFitResults(const TString &tableFileName)=0 Write the results of the fit into the ntuple. void setNamedParameters(const TString &fileName, const TString &treeName, const std::set< TString > ¶meters, const Bool_t fix) Set named model parameters from a file. Definition: LauAbsFitModel.cc:1264 virtual void initialise(LauFitObject *fitObj, const std::vector< LauParameter * > ¶meters)=0 Initialise the fitter, setting the information on the parameters. virtual void checkInitFitParams()=0 Update initial fit parameters if required. Double_t getLogLikelihoodPenalty() Calculate the penalty terms to the log likelihood from Gaussian constraints. Definition: LauAbsFitModel.cc:812 Bool_t twoStageFit() const Report whether the two-stage fit is enabled. Definition: LauFitObject.hh:76 Double_t getLogLikelihood(UInt_t iStart, UInt_t iEnd) Calculate the sum of the log-likelihood over the specified events. Definition: LauAbsFitModel.cc:828 void updateFitParameters(LauPdfPList &pdfList) Update the fit parameters for all PDFs in the list. Definition: LauAbsFitModel.cc:1090 void fitExpt() Routine to perform the actual fit for a given experiment. Definition: LauAbsFitModel.cc:599 Bool_t validBkgndClass(const TString &className) const Check if the given background class is in the list. Definition: LauAbsFitModel.cc:187 void setCurrentExperiment(const UInt_t curExpt) Set the ID of the current experiment. Definition: LauFitObject.hh:298 Bool_t compareFitData_ Option to make toy from 1st successful experiment. Definition: LauAbsFitModel.hh:827 virtual void setParsFromMinuit(Double_t *par, Int_t npar) This function sets the parameter values from Minuit. Definition: LauAbsFitModel.cc:871 virtual void releaseSecondStageParameters()=0 Release parameters marked as "second stage". Class to store the results from the toy MC generation into an ntuple. Definition: LauGenNtuple.hh:45 virtual void updateParameters()=0 Update the values and errors of the parameters based on the fit minimum. LauParameterPSet resVars_ Internal set of fit parameters upon which the DP normalisation depends. Definition: LauAbsFitModel.hh:858 Double_t worstLogLike() const Access the worst log likelihood found so far. Definition: LauFitObject.hh:311 virtual void recalculateNormalisation()=0 Recalculate normalisation the signal DP model(s) void setNExpts(UInt_t nExperiments, UInt_t firstExperiment, Bool_t toyExpts) Set the number of experiments, the first experiment, and whether this is toy. Definition: LauFitObject.cc:61 virtual void setupBkgndVectors()=0 Method to set up the storage for background-related quantities called by setBkgndClassNames. Generated by ![]() |