/* * PndLmdLumiFitOptions.h * * Created on: Jun 27, 2012 * Author: steve */ #ifndef PNDLMDLUMIFITOPTIONS_H_ #define PNDLMDLUMIFITOPTIONS_H_ #include "../LumiFitStructs.h" // .. is needed for rootcint to find the header #include "TObject.h" #include "TString.h" #include "TMath.h" /** * \brief This class contains the various fit options which are independent of the fit model itself. * * The user can choose between * - ROOT or ROOFIT * - acceptance correction or not * - 1d or 2d fit * - smearing or not * - theta and phi fit range * - use t instead theta * * These fit options objects should be generated by the user in the following two ways: * - using the #PndLmdLumiFitOptions(int, double, double, double, double) constructor * while these objects are passed to the PndLmdData::Fit() method. * - using the #PndLmdLumiFitOptions(int) constructor, which can be useful when one is searching the fit results * for more general fit options * */ class PndLmdLumiFitOptions: public TObject { private: /** * Binary fit options of the model. See #LumiFit::LmdBinaryFitOptions for a * detailed description. */ LumiFit::LmdBinaryFitOptions model_binary_options; /** * Same options as above, to determine which data will be used to fit. * Default setting will be the same as the #model_binary_options to ensure * appropriate fitting. However this can be changed with # for test purposes. */ LumiFit::LmdBinaryFitOptions data_binary_options; unsigned int free_parameters_code; int smearing_type; int acc_intpol_type; int dpm_elastic_model_parts; double theta_fit_range_low; /** Lower boundary of the fit for the theta variable */ double theta_fit_range_high; /** Upper boundary of the fit for the theta variable */ double phi_fit_range_low; /** Lower boundary of the fit for the phi variable. This will only be used if fit dimension equals 2. */ double phi_fit_range_high; /** Upper boundary of the fit for the phi variable. This will only be used if fit dimension equals 2. */ double t_fit_range_low; /** Lower boundary of the fit for the t variable (calculated automatically from the @see theta_fit_range_low) */ double t_fit_range_high; /** Upper boundary of the fit for the t variable (calculated automatically from the @see theta_fit_range_high) */ void initBinaryOptions(unsigned long bit_flag_options); TString resolution_parametrization_file_url; public: /** * @param smearing_type is a */ PndLmdLumiFitOptions(LumiFit::LmdBinaryFitOptions bit_flag_options, int smearing_type_, int acc_intpol_type_); /** * Constructor * @param bit_flag_options is a number in which each digit represents a binary flag @see PndLmdLumiFitOptions(int) * @param free_parameters_code_ is a bitcode specifying which parameter is free in the fit procedure * @param smearing_type_ specifies which model is used for the smearing (0 = gaussian, 1 = double gaussian) * @param acc_intpol_type_ specifies the interpolation type of the acceptance (D * @param plab * @param theta_fit_range_low_ used as the new lower fit range for theta * @param theta_fit_range_high_ used as the new upper fit range for theta * @param phi_fit_range_low_ used as the new lower fit range for phi * @param phi_fit_range_high_ used as the new upper fit range for phi */ PndLmdLumiFitOptions(LumiFit::LmdBinaryFitOptions bit_flag_options, unsigned int free_parameters_code_, int smearing_type_, int acc_intpol_type_, double plab, double theta_fit_range_low_, double theta_fit_range_high_, double phi_fit_range_low_ = -TMath::Pi(), double phi_fit_range_high_ = TMath::Pi()); /** * Constructor * empty constructor only required by ROOT IO */ PndLmdLumiFitOptions(); /** * Get method for the smearing function type * @returns smearing model type (atm: 0 = single gaussian, 1 = double gaussian) */ int getSmearingModelType() const; /** * Get method for the smearing function name * @returns smearing model name (i.e: "single gaussian" or "double gaussian") */ std::string getSmearingModelName() const; int getAcceptanceInterpolationType() const; /** * Get method for the model binary fit options * @returns integer format of the binary fit options */ const LumiFit::LmdBinaryFitOptions & getModelBinaryOptions() const; /** * Get method for the data binary fit options * @returns integer format of the binary fit options */ const LumiFit::LmdBinaryFitOptions & getDataBinaryOptions() const; LumiFit::LmdBinaryFitOptions & getDataBinaryOptions(); /** * @returns the code for which parameter is free in the fit */ unsigned int getFreeParametersCode() const; /** * @returns the lower fit boundary for the theta variable */ double getThetaFitRangeLow() const; /** * @returns the upper fit boundary for the theta variable */ double getThetaFitRangeHigh() const; /** * @returns the lower fit boundary for the phi variable */ double getPhiFitRangeLow() const; /** * @returns the upper fit boundary for the phi variable */ double getPhiFitRangeHigh() const; /** * @returns the lower fit boundary for the t variable */ double getTFitRangeLow() const; /** * @returns the upper fit boundary for the t variable */ double getTFitRangeHigh() const; int getDpmElasticModelParts() const; void setAcceptanceInterpolationType(int acc_intpol_type_); void setSmearingModelType(int smearing_type_); /** * This function will set the #free_parameters_code field. This code decides * which parameters will be set free in the fit later on. * @param free_parameters_code_ is new value of #free_parameters_code */ void setFreeParametersOfModel(unsigned int free_parameters_code_); void setThetaFitRange(const double fit_range_low_, const double fit_range_high_); void setDpmElasticModelParts(int dpm_elastic_model_parts_); /** * Less then operator for NON binary options (so fit range etc). * Will return true "this" fit options are "less" in value. */ bool lessThanNonBinaryOptions(const PndLmdLumiFitOptions &rhs) const; /** * Less then operator. Will return true "this" fit options are "less" in value. */ bool operator <(const PndLmdLumiFitOptions & rhs) const; /** * Greater then operator. Will return true "this" fit options are "greater" in value. */ bool operator >(const PndLmdLumiFitOptions & rhs) const; /** * Comparison operator. Will return true only if all fit options are equal in value. */ bool operator ==(const PndLmdLumiFitOptions & fit_options) const; /** * Inverse comparison operator @see operator==() */ bool operator !=(const PndLmdLumiFitOptions & fit_options) const; /** * Output stream operator for printing out fit options for information. */ friend std::ostream & operator <<(std::ostream & os, const PndLmdLumiFitOptions & fit_options); TString makeName() const; TString getResolutionParametrizationFileUrl() const; void setResolutionParametrizationFileUrl( TString resolution_parametrization_file_url_); ClassDef(PndLmdLumiFitOptions,1) }; #endif /* PNDLMDLUMIFITOPTIONS_H_ */