first implementation of the single histo RRF fit (no plotting yet). Seems to work but the error estimate of the RRF asymmetry seems to be too large. Needs to be checked.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2014 by Andreas Suter *
|
||||
* Copyright (C) 2007-2016 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -37,6 +37,7 @@ using namespace std;
|
||||
#include "PMsrHandler.h"
|
||||
#include "PRunDataHandler.h"
|
||||
#include "PRunSingleHisto.h"
|
||||
#include "PRunSingleHistoRRF.h"
|
||||
#include "PRunAsymmetry.h"
|
||||
#include "PRunMuMinus.h"
|
||||
#include "PRunNonMusr.h"
|
||||
@ -58,6 +59,7 @@ class PRunListCollection
|
||||
virtual void SetFitRange(const TString fitRange);
|
||||
|
||||
virtual Double_t GetSingleHistoChisq(const std::vector<Double_t>& par) const;
|
||||
virtual Double_t GetSingleHistoRRFChisq(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;
|
||||
virtual Double_t GetNonMusrChisq(const std::vector<Double_t>& par) const;
|
||||
@ -66,6 +68,7 @@ class PRunListCollection
|
||||
virtual Double_t GetSingleRunChisq(const std::vector<Double_t>& par, const UInt_t idx) const;
|
||||
|
||||
virtual Double_t GetSingleHistoMaximumLikelihood(const std::vector<Double_t>& par) const;
|
||||
virtual Double_t GetSingleHistoRRFMaximumLikelihood(const std::vector<Double_t>& par) const;
|
||||
virtual Double_t GetAsymmetryMaximumLikelihood(const std::vector<Double_t>& par) const;
|
||||
virtual Double_t GetMuMinusMaximumLikelihood(const std::vector<Double_t>& par) const;
|
||||
virtual Double_t GetNonMusrMaximumLikelihood(const std::vector<Double_t>& par) const;
|
||||
@ -74,11 +77,13 @@ class PRunListCollection
|
||||
virtual UInt_t GetTotalNoOfBinsFitted() const;
|
||||
|
||||
virtual UInt_t GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); } ///< returns the number of single histogram data sets present in the msr-file
|
||||
virtual UInt_t GetNoOfSingleHistoRRF() const { return fRunSingleHistoRRFList.size(); } ///< returns the number of single histogram RRF data sets present in the msr-file
|
||||
virtual UInt_t GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); } ///< returns the number of asymmetry data sets present in the msr-file
|
||||
virtual UInt_t GetNoOfMuMinus() const { return fRunMuMinusList.size(); } ///< returns the number of mu minus data sets present in the msr-file
|
||||
virtual UInt_t GetNoOfNonMusr() const { return fRunNonMusrList.size(); } ///< returns the number of non-muSR data sets present in the msr-file
|
||||
|
||||
virtual PRunData* GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetSingleHistoRRF(UInt_t index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetMuMinus(UInt_t index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetNonMusr(UInt_t index, EDataSwitch tag=kIndex);
|
||||
@ -94,10 +99,11 @@ class PRunListCollection
|
||||
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
|
||||
PRunDataHandler *fData; ///< pointer to the run-data handler
|
||||
|
||||
vector<PRunSingleHisto*> fRunSingleHistoList; ///< stores all processed single histogram data
|
||||
vector<PRunAsymmetry*> fRunAsymmetryList; ///< stores all processed asymmetry data
|
||||
vector<PRunMuMinus*> fRunMuMinusList; ///< stores all processed mu-minus data
|
||||
vector<PRunNonMusr*> fRunNonMusrList; ///< stores all processed non-muSR data
|
||||
vector<PRunSingleHisto*> fRunSingleHistoList; ///< stores all processed single histogram data
|
||||
vector<PRunSingleHistoRRF*> fRunSingleHistoRRFList; ///< stores all processed single histogram RRF data
|
||||
vector<PRunAsymmetry*> fRunAsymmetryList; ///< stores all processed asymmetry data
|
||||
vector<PRunMuMinus*> fRunMuMinusList; ///< stores all processed mu-minus data
|
||||
vector<PRunNonMusr*> fRunNonMusrList; ///< stores all processed non-muSR data
|
||||
};
|
||||
|
||||
#endif // _PRUNLISTCOLLECTION_H_
|
||||
|
79
src/include/PRunSingleHistoRRF.h
Normal file
79
src/include/PRunSingleHistoRRF.h
Normal file
@ -0,0 +1,79 @@
|
||||
/***************************************************************************
|
||||
|
||||
PRunSingleHistoRRF.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2016 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PRUNSINGLEHISTORRF_H_
|
||||
#define _PRUNSINGLEHISTORRF_H_
|
||||
|
||||
#include "PRunBase.h"
|
||||
|
||||
/**
|
||||
* <p>Class handling single histogram fit type.
|
||||
*/
|
||||
class PRunSingleHistoRRF : public PRunBase
|
||||
{
|
||||
public:
|
||||
PRunSingleHistoRRF();
|
||||
PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag);
|
||||
virtual ~PRunSingleHistoRRF();
|
||||
|
||||
virtual Double_t CalcChiSquare(const std::vector<Double_t>& par);
|
||||
virtual Double_t CalcChiSquareExpected(const std::vector<Double_t>& par);
|
||||
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
|
||||
virtual void CalcTheory();
|
||||
|
||||
virtual UInt_t GetNoOfFitBins();
|
||||
|
||||
virtual void SetFitRangeBin(const TString fitRange);
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo);
|
||||
virtual Bool_t PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo);
|
||||
virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo);
|
||||
|
||||
private:
|
||||
static const Double_t N0EstimateEndTime = 2.0; ///< end time in (us) over which N0 is estimated. Should evetually go into the musrfit_startup.xml
|
||||
|
||||
UInt_t fNoOfFitBins; ///< number of bins to be fitted
|
||||
Double_t fBackground; ///< needed if background range is given (units: 1/bin)
|
||||
Int_t fPacking; ///< packing for this particular run. Either given in the RUN- or GLOBAL-block.
|
||||
|
||||
Int_t fGoodBins[2]; ///< keep first/last good bins. 0=fgb, 1=lgb
|
||||
|
||||
PDoubleVector fForward; ///< forward histo data
|
||||
|
||||
virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo);
|
||||
virtual Bool_t GetProperDataRange();
|
||||
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock);
|
||||
virtual Double_t EstimateN0();
|
||||
virtual Bool_t EstimateBkg(UInt_t histoNo);
|
||||
};
|
||||
|
||||
#endif // _PRUNSINGLEHISTORRF_H_
|
Reference in New Issue
Block a user