added FIT_RANGE RESET | start end | s1 e1 s2 e2 .. sN eN command to the COMMAND block

This commit is contained in:
nemu
2010-10-20 09:24:12 +00:00
parent 616740f299
commit 5cd4283d30
16 changed files with 416 additions and 66 deletions

View File

@@ -43,22 +43,23 @@
#define PMN_INTERACTIVE 0
#define PMN_CONTOURS 1
#define PMN_EIGEN 2
#define PMN_FIX 3
#define PMN_HESSE 4
#define PMN_MACHINE_PRECISION 5
#define PMN_MIGRAD 6
#define PMN_MINIMIZE 7
#define PMN_MINOS 8
#define PMN_PLOT 9
#define PMN_RELEASE 10
#define PMN_RESTORE 11
#define PMN_SAVE 12
#define PMN_SCAN 13
#define PMN_SIMPLEX 14
#define PMN_STRATEGY 15
#define PMN_USER_COVARIANCE 16
#define PMN_USER_PARAM_STATE 17
#define PMN_PRINT 18
#define PMN_FIT_RANGE 3
#define PMN_FIX 4
#define PMN_HESSE 5
#define PMN_MACHINE_PRECISION 6
#define PMN_MIGRAD 7
#define PMN_MINIMIZE 8
#define PMN_MINOS 9
#define PMN_PLOT 10
#define PMN_RELEASE 11
#define PMN_RESTORE 12
#define PMN_SAVE 13
#define PMN_SCAN 14
#define PMN_SIMPLEX 15
#define PMN_STRATEGY 16
#define PMN_USER_COVARIANCE 17
#define PMN_USER_PARAM_STATE 18
#define PMN_PRINT 19
/**
* <p>Interface class to minuit2.
@@ -84,6 +85,7 @@ class PFitter
UInt_t fStrategy; ///< fitting strategy (see minuit2 manual).
PMsrHandler *fRunInfo; ///< pointer to the msr-file handler
PRunListCollection *fRunListCollection; ///< pointer to the run list collection
PMsrParamList fParams; ///< msr-file parameters
@@ -103,11 +105,14 @@ class PFitter
Double_t fScanHigh; ///< scan range high. default=0.0 which means 2 std dev. (see MnScan/MnContours in the minuit2 user manual)
PDoublePairVector fScanData; ///< keeps the scan/contour data
PDoublePairVector fOriginalFitRange; ///< keeps the original fit range in case there is a range command in the COMMAND block
// commands
Bool_t CheckCommands();
Bool_t SetParameters();
Bool_t ExecuteContours();
Bool_t ExecuteFitRange(UInt_t lineNo);
Bool_t ExecuteFix(UInt_t lineNo);
Bool_t ExecuteHesse();
Bool_t ExecuteMigrad();

View File

@@ -49,7 +49,7 @@ class PRunAsymmetry : public PRunBase
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
virtual void CalcTheory();
virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } ///< returns the number of bins to be fitted.
virtual UInt_t GetNoOfFitBins();
protected:
virtual Bool_t PrepareData();
@@ -60,8 +60,6 @@ class PRunAsymmetry : public PRunBase
private:
UInt_t fAlphaBetaTag; ///< \f$ 1 \to \alpha = \beta = 1\f$; \f$ 2 \to \alpha \neq 1, \beta = 1\f$; \f$ 3 \to \alpha = 1, \beta \neq 1\f$; \f$ 4 \to \alpha \neq 1, \beta \neq 1\f$.
Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; ///< fit stop time
UInt_t fNoOfFitBins; ///< number of bins to be be fitted
PDoubleVector fForward; ///< forward histo data

View File

@@ -55,6 +55,7 @@ class PRunBase
virtual Double_t CalcChiSquare(const vector<Double_t>& par) = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
virtual Double_t CalcMaxLikelihood(const vector<Double_t>& par) = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
virtual void SetFitRange(PDoublePairVector fitRange);
virtual void CalcTheory() = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
@@ -79,6 +80,9 @@ class PRunBase
Double_t fTimeResolution; ///< time resolution in (us)
PIntVector fT0s; ///< all t0's of a run! The derived classes will handle it
Double_t fFitStartTime; ///< fit start time
Double_t fFitEndTime; ///< fit end time
PDoubleVector fFuncValues; ///< is keeping the values of the functions from the FUNCTIONS block
PTheory *fTheory; ///< theory needed to calculate chi-square

View File

@@ -56,6 +56,8 @@ class PRunListCollection
virtual Bool_t Add(Int_t runNo, EPMusrHandleTag tag);
virtual void SetFitRange(const PDoublePairVector fitRange);
virtual Double_t GetSingleHistoChisq(const std::vector<Double_t>& par) const;
virtual Double_t GetAsymmetryChisq(const std::vector<Double_t>& par) const;
virtual Double_t GetMuMinusChisq(const std::vector<Double_t>& par) const;

View File

@@ -48,14 +48,12 @@ class PRunMuMinus : public PRunBase
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
virtual void CalcTheory();
virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; }
virtual UInt_t GetNoOfFitBins();
protected:
virtual Bool_t PrepareData();
private:
Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; ///< fit end time
UInt_t fNoOfFitBins; ///< number of bins to be fitted
};

View File

@@ -49,7 +49,7 @@ class PRunNonMusr : public PRunBase
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
virtual void CalcTheory();
virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } ///< returns the number of fitted bins
virtual UInt_t GetNoOfFitBins();
virtual UInt_t GetXIndex();
virtual UInt_t GetYIndex();
@@ -62,8 +62,6 @@ class PRunNonMusr : public PRunBase
private:
PRawRunData *fRawRunData; ///< raw run data handler
Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; ///< fit stop time
UInt_t fNoOfFitBins; ///< number of bins to be be fitted
};

View File

@@ -48,7 +48,7 @@ class PRunSingleHisto : public PRunBase
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
virtual void CalcTheory();
virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } ///< returns the number of bins fitted
virtual UInt_t GetNoOfFitBins();
protected:
virtual Bool_t PrepareData();
@@ -57,8 +57,6 @@ class PRunSingleHisto : public PRunBase
virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo);
private:
Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; ///< fit stop time
UInt_t fNoOfFitBins; ///< number of bins to be fitted
Double_t fBackground; ///< needed if background range is given (units: 1/bin)