(i) add PRINT_LEVEL to the command block (0='nothing' to

3='everything'). This allows to tune the Minuit2 output. (ii) added the
possibilty to give the fit range in bins. For details see the docu.
This commit is contained in:
2012-10-25 14:44:16 +00:00
parent 8f057d9967
commit 6c8ce66e1d
34 changed files with 1084 additions and 247 deletions

View File

@@ -81,6 +81,7 @@ class PFitter
Bool_t fConverged; ///< flag. true: the fit has converged.
Bool_t fChisqOnly; ///< flag. true: calculate chi^2 only (no fitting).
Bool_t fUseChi2; ///< flag. true: chi^2 fit. false: log-max-likelihood
UInt_t fPrintLevel; ///< tag, showing the level of messages whished. 0=minimum, 1=standard, 2=maximum
UInt_t fStrategy; ///< fitting strategy (see minuit2 manual).
@@ -119,6 +120,7 @@ class PFitter
Bool_t ExecuteMinimize();
Bool_t ExecuteMinos();
Bool_t ExecutePlot();
Bool_t ExecutePrintLevel(UInt_t lineNo);
Bool_t ExecuteRelease(UInt_t lineNo);
Bool_t ExecuteRestore();
Bool_t ExecuteScan();

View File

@@ -559,7 +559,9 @@ class PMsrRunBlock {
virtual UInt_t GetAddT0BinEntries() { return fAddT0.size(); }
virtual Int_t GetAddT0BinSize(UInt_t addRunIdx);
virtual Double_t GetAddT0Bin(UInt_t addRunIdx, UInt_t histoIdx);
virtual Bool_t IsFitRangeInBin() { return fFitRangeInBins; }
virtual Double_t GetFitRange(UInt_t idx);
virtual Int_t GetFitRangeOffset(UInt_t idx);
virtual Int_t GetPacking() { return fPacking; }
virtual Int_t GetXDataIndex() { return fXYDataIndex[0]; }
virtual Int_t GetYDataIndex() { return fXYDataIndex[1]; }
@@ -588,7 +590,9 @@ class PMsrRunBlock {
virtual void SetDataRange(Int_t ival, Int_t idx);
virtual void SetT0Bin(Double_t dval, Int_t idx=-1);
virtual void SetAddT0Bin(Double_t dval, UInt_t addRunIdx, UInt_t histoNoIdx);
virtual void SetFitRangeInBins(Bool_t bval) { fFitRangeInBins = bval; }
virtual void SetFitRange(Double_t dval, UInt_t idx);
virtual void SetFitRangeOffset(Int_t ival, UInt_t idx);
virtual void SetPacking(Int_t ival) { fPacking = ival; }
virtual void SetXDataIndex(Int_t ival) { fXYDataIndex[0] = ival; }
virtual void SetYDataIndex(Int_t ival) { fXYDataIndex[1] = ival; }
@@ -618,7 +622,9 @@ class PMsrRunBlock {
Int_t fDataRange[4]; ///< data bin range (fit type 0, 2, 4)
PDoubleVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ...
vector<PDoubleVector> fAddT0; ///< t0 bins for addrun's
Bool_t fFitRangeInBins; ///< flag telling if fit range is given in time or in bins
Double_t fFitRange[2]; ///< fit range in (us)
Int_t fFitRangeOffset[2]; ///< if fit range is given in bins it can have the form fit fgb+n0 lgb-n1. This variable holds the n0 and n1.
Int_t fPacking; ///< packing/rebinning
Int_t fXYDataIndex[2]; ///< used to get the data indices when using db-files (fit type 8)
TString fXYDataLabel[2]; ///< used to get the indices via labels when using db-files (fit type 8)

View File

@@ -52,6 +52,8 @@ class PRunAsymmetry : public PRunBase
virtual UInt_t GetNoOfFitBins();
virtual void SetFitRangeBin(const TString fitRange);
protected:
virtual void CalcNoOfFitBins();
virtual Bool_t PrepareData();
@@ -69,6 +71,8 @@ class PRunAsymmetry : public PRunBase
PDoubleVector fBackward; ///< backward histo data
PDoubleVector fBackwardErr; ///< backward histo errors
Int_t fGoodBins[2]; ///< keep first/last good bins. 0=fgb, 1=lgb
Bool_t SubtractFixBkg();
Bool_t SubtractEstimatedBkg();
};

View File

@@ -78,8 +78,8 @@ class PRunBase
Double_t fTimeResolution; ///< time resolution in (us)
PDoubleVector fT0s; ///< all t0 bins of a run! The derived classes will handle it
Double_t fFitStartTime; ///< fit start time
Double_t fFitEndTime; ///< fit end time
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

@@ -46,14 +46,23 @@ using namespace std;
class PRunDataHandler
{
public:
PRunDataHandler();
PRunDataHandler(TString fileName, const TString fileFormat);
PRunDataHandler(TString fileName, const TString fileFormat, const PStringVector dataPath);
PRunDataHandler(TString fileName, const TString fileFormat, const TString dataPath, PRawRunData &runData);
PRunDataHandler(PAny2ManyInfo *any2ManyInfo);
PRunDataHandler(PAny2ManyInfo *any2ManyInfo, const PStringVector dataPath);
PRunDataHandler(PMsrHandler *msrInfo);
PRunDataHandler(PMsrHandler *msrInfo, const PStringVector dataPath);
virtual ~PRunDataHandler();
virtual void ReadData();
virtual void ConvertData();
virtual void WriteData();
virtual Bool_t IsAllDataAvailable() const { return fAllDataAvailable; }
virtual PRawRunData* GetRunData(const TString &runName);
virtual TString GetRunPathName() {return fRunPathName; }
private:
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
@@ -61,16 +70,19 @@ class PRunDataHandler
PStringVector fDataPath; ///< vector containing all the search paths where to look for data files
Bool_t fAllDataAvailable; ///< flag indicating if all data sets could be read
TString fFileFormat; ///< keeps the file format if explicitly given
TString fRunName; ///< current run name
TString fRunPathName; ///< current path file name
PRawRunDataList fData; ///< keeping all the raw data
PRawRunDataList fData; ///< keeping all the raw data
virtual void Init(const Int_t tag=0);
virtual Bool_t ReadFilesMsr();
virtual Bool_t ReadWriteFilesList();
virtual Bool_t FileAlreadyRead(TString runName);
virtual void TestFileName(TString &runName, const TString &ext);
virtual Bool_t FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx);
virtual Bool_t FileExistsCheck(const Bool_t fileName, const Int_t idx);
virtual Bool_t FileExistsCheck(const TString fileName);
virtual Bool_t ReadRootFile();
virtual Bool_t ReadNexusFile();
virtual Bool_t ReadWkmFile();

View File

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

View File

@@ -51,6 +51,8 @@ class PRunMuMinus : public PRunBase
virtual UInt_t GetNoOfFitBins();
virtual void SetFitRangeBin(const TString fitRange);
protected:
virtual void CalcNoOfFitBins();
virtual Bool_t PrepareData();
@@ -60,6 +62,8 @@ class PRunMuMinus : public PRunBase
private:
UInt_t fNoOfFitBins; ///< number of bins to be fitted
Int_t fGoodBins[2]; ///< keep first/last good bins. 0=fgb, 1=lgb
PDoubleVector fForward; ///< forward histo data
};

View File

@@ -52,6 +52,8 @@ class PRunNonMusr : public PRunBase
virtual UInt_t GetNoOfFitBins();
virtual void SetFitRangeBin(const TString fitRange) {}
virtual UInt_t GetXIndex();
virtual UInt_t GetYIndex();

View File

@@ -51,6 +51,8 @@ class PRunSingleHisto : public PRunBase
virtual UInt_t GetNoOfFitBins();
virtual void SetFitRangeBin(const TString fitRange);
protected:
virtual void CalcNoOfFitBins();
virtual Bool_t PrepareData();
@@ -63,7 +65,9 @@ class PRunSingleHisto : public PRunBase
UInt_t fNoOfFitBins; ///< number of bins to be fitted
Double_t fBackground; ///< needed if background range is given (units: 1/bin)
PDoubleVector fForward; ///< forward histo data
Int_t fGoodBins[2]; ///< keep first/last good bins. 0=fgb, 1=lgb
PDoubleVector fForward; ///< forward histo data
virtual Bool_t EstimateBkg(UInt_t histoNo);
virtual Bool_t IsScaleN0AndBkg();