first steps towards asymmetry RRF fit.

This commit is contained in:
suter_a 2016-01-15 17:16:07 +01:00
parent 782eb4e1a4
commit 8e399fa04e
55 changed files with 253 additions and 86 deletions

View File

@ -15,6 +15,7 @@ h_sources = \
../include/PMusrT0.h \
../include/PPrepFourier.h \
../include/PRunAsymmetry.h \
../include/PRunAsymmetryRRF.h \
../include/PRunBase.h \
../include/PRunDataHandler.h \
../include/PRunListCollection.h \
@ -60,6 +61,7 @@ cpp_sources = \
PMusrT0.cpp \
PPrepFourier.cpp \
PRunAsymmetry.cpp \
PRunAsymmetryRRF.cpp \
PRunBase.cpp \
PRunDataHandler.cpp \
PRunListCollection.cpp \

View File

@ -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 *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2015 by Bastian M. Wojek / Andreas Suter *
* Copyright (C) 2009-2016 by Bastian M. Wojek / Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *
@ -623,6 +623,9 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
case MSR_FITTYPE_ASYM:
fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ;
break;
case MSR_FITTYPE_ASYM_RRF:
fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ;
break;
case MSR_FITTYPE_MU_MINUS:
fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ;
break;
@ -778,9 +781,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
case MSR_FITTYPE_SINGLE_HISTO:
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl;
break;
case MSR_FITTYPE_SINGLE_HISTO_RRF:
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl;
break;
case MSR_FITTYPE_ASYM:
fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ;
break;
case MSR_FITTYPE_ASYM_RRF:
fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ;
break;
case MSR_FITTYPE_MU_MINUS:
fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ;
break;
@ -1636,9 +1645,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map<UInt_t, TString> *co
case MSR_FITTYPE_SINGLE_HISTO:
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl;
break;
case MSR_FITTYPE_SINGLE_HISTO_RRF:
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl;
break;
case MSR_FITTYPE_ASYM:
fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ;
break;
case MSR_FITTYPE_ASYM_RRF:
fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ;
break;
case MSR_FITTYPE_MU_MINUS:
fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ;
break;
@ -1821,9 +1836,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map<UInt_t, TString> *co
case MSR_FITTYPE_SINGLE_HISTO:
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl;
break;
case MSR_FITTYPE_SINGLE_HISTO_RRF:
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl;
break;
case MSR_FITTYPE_ASYM:
fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ;
break;
case MSR_FITTYPE_ASYM_RRF:
fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ;
break;
case MSR_FITTYPE_MU_MINUS:
fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ;
break;
@ -2889,6 +2910,7 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines)
if ((fittype == MSR_FITTYPE_SINGLE_HISTO) ||
(fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) ||
(fittype == MSR_FITTYPE_ASYM) ||
(fittype == MSR_FITTYPE_ASYM_RRF) ||
(fittype == MSR_FITTYPE_MU_MINUS) ||
(fittype == MSR_FITTYPE_NON_MUSR)) {
global.SetFitType(fittype);
@ -3224,6 +3246,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
if ((fittype == MSR_FITTYPE_SINGLE_HISTO) ||
(fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) ||
(fittype == MSR_FITTYPE_ASYM) ||
(fittype == MSR_FITTYPE_ASYM_RRF) ||
(fittype == MSR_FITTYPE_MU_MINUS) ||
(fittype == MSR_FITTYPE_NON_MUSR)) {
param.SetFitType(fittype);
@ -4139,6 +4162,7 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
case MSR_PLOT_SINGLE_HISTO: // like: runs 1 5 13
case MSR_PLOT_SINGLE_HISTO_RRF:
case MSR_PLOT_ASYM:
case MSR_PLOT_ASYM_RRF:
case MSR_PLOT_NON_MUSR:
case MSR_PLOT_MU_MINUS:
rl = new PStringNumberList(iter1->fLine.Data());
@ -4550,8 +4574,10 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
cerr << endl << ">> [use_fit_ranges [ymin ymax]]";
cerr << endl << ">> [view_packing n]";
cerr << endl;
cerr << endl << ">> where <plot_type> is: 0=single histo asym,";
cerr << endl << ">> where <plot_type> is: 0=single histo,";
cerr << endl << ">> 1=RRF single histo,";
cerr << endl << ">> 2=forward-backward asym,";
cerr << endl << ">> 3=forward-backward RRF asym,";
cerr << endl << ">> 4=mu minus single histo,";
cerr << endl << ">> 8=non muSR.";
cerr << endl << ">> <run_list> is the list of runs, e.g. runs 1 3";
@ -5359,6 +5385,9 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity()
fRuns[i].SetPacking(1);
}
break;
case PRUN_ASYMMETRY_RRF:
// STILL MISSING
break;
case PRUN_MU_MINUS:
// needs eventually to be implemented
break;
@ -5760,7 +5789,8 @@ Bool_t PMsrHandler::CheckRRFSettings()
// first set of tests: if RRF parameters are set, check if RRF fit is chosen.
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) != 0.0) {
if (fittype != -1) { // check if GLOBAL fittype is set
if (fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) {
if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) &&
(fittype != MSR_FITTYPE_ASYM_RRF)) {
cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** found GLOBAL fittype " << fittype << " and";
cerr << endl << ">> RRF settings in the GLOBAL section. This is NOT compatible. Fix it first.";
result = false;
@ -5768,7 +5798,8 @@ Bool_t PMsrHandler::CheckRRFSettings()
} else { // GLOBAL fittype is NOT set
for (UInt_t i=0; i<fRuns.size(); i++) {
fittype = fRuns[i].GetFitType();
if (fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) {
if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) &&
(fittype != MSR_FITTYPE_ASYM_RRF)) {
cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** found RUN with fittype " << fittype << " and";
cerr << endl << ">> RRF settings in the GLOBAL section. This is NOT compatible. Fix it first.";
result = false;
@ -5792,13 +5823,15 @@ Bool_t PMsrHandler::CheckRRFSettings()
}
// if not a RRF fit, done at this point
if (fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) {
if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) &&
(fittype != MSR_FITTYPE_ASYM_RRF)) {
return true;
}
// second set of tests: if RRF fit is chosen, do I find the necessary RRF parameters?
fittype = fGlobal.GetFitType();
if (fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) { // make sure RRF freq and RRF packing are set
if ((fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) ||
(fittype == MSR_FITTYPE_ASYM_RRF)) { // make sure RRF freq and RRF packing are set
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == 0.0) {
cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but";
cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it.";
@ -5813,7 +5846,8 @@ Bool_t PMsrHandler::CheckRRFSettings()
UInt_t rrfFitCounter = 0;
for (UInt_t i=0; i<fRuns.size(); i++) {
fittype = fRuns[i].GetFitType();
if (fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) { // make sure RRF freq and RRF packing are set
if ((fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) ||
(fittype == MSR_FITTYPE_ASYM_RRF)) { // make sure RRF freq and RRF packing are set
rrfFitCounter++;
}
}

View File

@ -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 *

View File

@ -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 *
@ -713,6 +713,18 @@ void PMusrCanvas::UpdateDataTheoryPad()
// handle data
HandleDataSet(i, runNo, data);
break;
case MSR_FITTYPE_ASYM_RRF:
data = fRunList->GetAsymmetryRRF(runNo, PRunListCollection::kRunNo);
if (!data) { // something wrong
fValid = false;
// error message
cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a asymmetry RRF plot";
cerr << endl;
return;
}
// handle data
HandleDataSet(i, runNo, data);
break;
case MSR_FITTYPE_MU_MINUS:
data = fRunList->GetMuMinus(runNo, PRunListCollection::kRunNo);
if (!data) { // something wrong
@ -873,13 +885,15 @@ void PMusrCanvas::UpdateInfoPad()
else
tstr = *runs[runNo].GetRunName() + TString(","); // run_name
// histo info (depending on the fittype
if (runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) {
if ((runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) ||
(runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) {
tstr += TString("h:");
TString grouping;
fMsrHandler->GetGroupingString(runNo, "forward", grouping);
tstr += grouping;
tstr += TString(",");
} else if (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) {
} else if ((runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) ||
(runs[runNo].GetFitType() == MSR_FITTYPE_ASYM_RRF)) {
tstr += TString("h:");
TString grouping;
fMsrHandler->GetGroupingString(runNo, "forward", grouping);

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -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 *
@ -87,7 +87,7 @@ PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UIn
fPacking = fMsrInfo->GetMsrGlobal()->GetPacking();
}
if (fPacking == -1) { // this should NOT happen, somethin is severely wrong
cerr << endl << ">> PRunAsymmetry::PRunAsymmetry: **SEVERE ERROR**: Couldn't find any packing information!";
cerr << endl << ">> PRunAsymmetry::PRunAsymmetry(): **SEVERE ERROR**: Couldn't find any packing information!";
cerr << endl << ">> This is very bad :-(, will quit ...";
cerr << endl;
fValid = false;
@ -342,7 +342,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange)
Int_t pos = 2*(fRunNo+1)-1;
if (pos + 1 >= tok->GetEntries()) {
cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
cerr << endl << ">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
cerr << endl << ">> will ignore it. Sorry ..." << endl;
} else {
// handle fgb+n0 entry
@ -370,7 +370,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange)
fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution;
}
} else { // error
cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
cerr << endl << ">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
cerr << endl << ">> will ignore it. Sorry ..." << endl;
}

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *
@ -70,6 +70,12 @@ PRunListCollection::~PRunListCollection()
}
fRunAsymmetryList.clear();
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++) {
fRunAsymmetryRRFList[i]->CleanUp();
fRunAsymmetryRRFList[i]->~PRunAsymmetryRRF();
}
fRunAsymmetryRRFList.clear();
for (UInt_t i=0; i<fRunMuMinusList.size(); i++) {
fRunMuMinusList[i]->CleanUp();
fRunMuMinusList[i]->~PRunMuMinus();
@ -122,6 +128,11 @@ Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag)
if (!fRunAsymmetryList[fRunAsymmetryList.size()-1]->IsValid())
success = false;
break;
case PRUN_ASYMMETRY_RRF:
fRunAsymmetryRRFList.push_back(new PRunAsymmetryRRF(fMsrInfo, fData, runNo, tag));
if (!fRunAsymmetryRRFList[fRunAsymmetryRRFList.size()-1]->IsValid())
success = false;
break;
case PRUN_MU_MINUS:
fRunMuMinusList.push_back(new PRunMuMinus(fMsrInfo, fData, runNo, tag));
if (!fRunMuMinusList[fRunMuMinusList.size()-1]->IsValid())
@ -162,6 +173,8 @@ void PRunListCollection::SetFitRange(const TString fitRange)
fRunSingleHistoRRFList[i]->SetFitRangeBin(fitRange);
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++)
fRunAsymmetryList[i]->SetFitRangeBin(fitRange);
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++)
fRunAsymmetryRRFList[i]->SetFitRangeBin(fitRange);
for (UInt_t i=0; i<fRunMuMinusList.size(); i++)
fRunMuMinusList[i]->SetFitRangeBin(fitRange);
for (UInt_t i=0; i<fRunNonMusrList.size(); i++)
@ -186,6 +199,8 @@ void PRunListCollection::SetFitRange(const PDoublePairVector fitRange)
fRunSingleHistoRRFList[i]->SetFitRange(fitRange);
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++)
fRunAsymmetryList[i]->SetFitRange(fitRange);
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++)
fRunAsymmetryRRFList[i]->SetFitRange(fitRange);
for (UInt_t i=0; i<fRunMuMinusList.size(); i++)
fRunMuMinusList[i]->SetFitRange(fitRange);
for (UInt_t i=0; i<fRunNonMusrList.size(); i++)
@ -255,6 +270,27 @@ Double_t PRunListCollection::GetAsymmetryChisq(const std::vector<Double_t>& par)
return chisq;
}
//--------------------------------------------------------------------------
// GetAsymmetryRRFChisq (public)
//--------------------------------------------------------------------------
/**
* <p>Calculates chi-square of <em>all</em> asymmetry RRF runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all asymmetry RRF runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetAsymmetryRRFChisq(const std::vector<Double_t>& par) const
{
Double_t chisq = 0.0;
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++)
chisq += fRunAsymmetryRRFList[i]->CalcChiSquare(par);
return chisq;
}
//--------------------------------------------------------------------------
// GetMuMinusChisq (public)
//--------------------------------------------------------------------------
@ -341,6 +377,9 @@ Double_t PRunListCollection::GetSingleHistoChisqExpected(const std::vector<Doubl
case PRUN_ASYMMETRY:
expectedChisq = fRunAsymmetryList[subIdx]->CalcChiSquareExpected(par);
break;
case PRUN_ASYMMETRY_RRF:
expectedChisq = fRunAsymmetryRRFList[subIdx]->CalcChiSquareExpected(par);
break;
case PRUN_MU_MINUS:
expectedChisq = fRunMuMinusList[subIdx]->CalcChiSquareExpected(par);
break;
@ -399,6 +438,9 @@ Double_t PRunListCollection::GetSingleRunChisq(const std::vector<Double_t>& par,
case PRUN_ASYMMETRY:
chisq = fRunAsymmetryList[subIdx]->CalcChiSquare(par);
break;
case PRUN_ASYMMETRY_RRF:
chisq = fRunAsymmetryRRFList[subIdx]->CalcChiSquare(par);
break;
case PRUN_MU_MINUS:
chisq = fRunMuMinusList[subIdx]->CalcChiSquare(par);
break;
@ -476,6 +518,28 @@ Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector<Dou
return mlh;
}
//--------------------------------------------------------------------------
// GetAsymmetryRRFMaximumLikelihood (public)
//--------------------------------------------------------------------------
/**
* <p> Since it is not clear yet how to handle asymmetry fits with max likelihood
* the chi square will be used!
*
* <b>return:</b>
* - chi-square of all asymmetry RRF runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetAsymmetryRRFMaximumLikelihood(const std::vector<Double_t>& par) const
{
Double_t mlh = 0.0;
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++)
mlh += fRunAsymmetryRRFList[i]->CalcChiSquare(par);
return mlh;
}
//--------------------------------------------------------------------------
// GetMuMinusMaximumLikelihood (public)
//--------------------------------------------------------------------------
@ -563,6 +627,9 @@ UInt_t PRunListCollection::GetNoOfBinsFitted(const UInt_t idx) const
case PRUN_ASYMMETRY:
result = fRunAsymmetryList[subIdx]->GetNoOfFitBins();
break;
case PRUN_ASYMMETRY_RRF:
result = fRunAsymmetryRRFList[subIdx]->GetNoOfFitBins();
break;
case PRUN_MU_MINUS:
result = fRunMuMinusList[subIdx]->GetNoOfFitBins();
break;
@ -599,6 +666,9 @@ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++)
counts += fRunAsymmetryList[i]->GetNoOfFitBins();
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++)
counts += fRunAsymmetryRRFList[i]->GetNoOfFitBins();
for (UInt_t i=0; i<fRunMuMinusList.size(); i++)
counts += fRunMuMinusList[i]->GetNoOfFitBins();
@ -628,7 +698,7 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag)
switch (tag) {
case kIndex:
if ((index < 0) || (index >= fRunSingleHistoList.size())) {
cerr << endl << "PRunListCollection::GetSingleHisto: **ERROR** index = " << index << " out of bounds";
cerr << endl << ">> PRunListCollection::GetSingleHisto(): **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
}
@ -671,7 +741,7 @@ PRunData* PRunListCollection::GetSingleHistoRRF(UInt_t index, EDataSwitch tag)
switch (tag) {
case kIndex:
if ((index < 0) || (index >= fRunSingleHistoRRFList.size())) {
cerr << endl << "PRunListCollection::GetSingleHistoRRF: **ERROR** index = " << index << " out of bounds";
cerr << endl << ">> PRunListCollection::GetSingleHistoRRF(): **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
}
@ -714,7 +784,7 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag)
switch (tag) {
case kIndex: // called from musrfit when dumping the data
if ((index < 0) || (index > fRunAsymmetryList.size())) {
cerr << endl << "PRunListCollection::GetAsymmetry: **ERROR** index = " << index << " out of bounds";
cerr << endl << ">> PRunListCollection::GetAsymmetry(): **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
}
@ -737,6 +807,49 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag)
return data;
}
//--------------------------------------------------------------------------
// GetAsymmetryRRF (public)
//--------------------------------------------------------------------------
/**
* <p>Get a processed asymmetry RRF data set.
*
* <b>return:</b>
* - pointer to the run data set (processed data) if data set is found
* - null pointer otherwise
*
* \param index msr-file run index
* \param tag kIndex -> data at index, kRunNo -> data of given run no
*/
PRunData* PRunListCollection::GetAsymmetryRRF(UInt_t index, EDataSwitch tag)
{
PRunData *data = 0;
switch (tag) {
case kIndex: // called from musrfit when dumping the data
if ((index < 0) || (index > fRunAsymmetryRRFList.size())) {
cerr << endl << ">> PRunListCollection::GetAsymmetryRRF(): **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
}
fRunAsymmetryList[index]->CalcTheory();
data = fRunAsymmetryList[index]->GetData();
break;
case kRunNo: // called from PMusrCanvas
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++) {
if (fRunAsymmetryRRFList[i]->GetRunNo() == index) {
data = fRunAsymmetryRRFList[i]->GetData();
break;
}
}
break;
default: // error
break;
}
return data;
}
//--------------------------------------------------------------------------
// GetMuMinus (public)
//--------------------------------------------------------------------------
@ -757,7 +870,7 @@ PRunData* PRunListCollection::GetMuMinus(UInt_t index, EDataSwitch tag)
switch (tag) {
case kIndex:
if ((index < 0) || (index > fRunMuMinusList.size())) {
cerr << endl << "PRunListCollection::GetMuMinus: **ERROR** index = " << index << " out of bounds";
cerr << endl << ">> PRunListCollection::GetMuMinus(): **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
}
@ -799,7 +912,7 @@ PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag)
switch (tag) {
case kIndex:
if ((index < 0) || (index > fRunNonMusrList.size())) {
cerr << endl << "PRunListCollection::GetNonMusr: **ERROR** index = " << index << " out of bounds";
cerr << endl << ">> PRunListCollection::GetNonMusr(): **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
}

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -645,20 +645,6 @@ Bool_t PRunSingleHistoRRF::PrepareFitData(PRawRunData* runData, const UInt_t his
fForward[i] = fForward[i] / n0 - 1.0;
}
/*
// make a DC correction of A(t) --> this is introduced to reduce ghost lines.
// This is a dirty trick and should be put on a better quantitative base!
Double_t dc_offset=0.0;
for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) {
dc_offset += fForward[i];
}
dc_offset /= (Double_t)(fGoodBins[1]-fGoodBins[0]+1);
cout << "info> dc_offset = " << dc_offset << endl;
for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) {
fForward[i] -= dc_offset;
}
*/
// 4b) error estimate of A(t): errA(t) = exp(+t/tau)/N0 sqrt( N(t) + ([N(t)-N_bkg]/N0)^2 errN0^2 )
for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) {
time_tau = (startTime + fTimeResolution * (i - fGoodBins[0])) / PMUON_LIFETIME;

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -1,5 +1,14 @@
/***************************************************************************
* Copyright (C) 2007-2015 by Andreas Suter *
PFourierCanvas.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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2014 by Bastian M. Wojek / Andreas Suter *
* Copyright (C) 2009-2016 by Bastian M. Wojek / Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *
@ -55,6 +55,7 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it
#define PRUN_SINGLE_HISTO 0
#define PRUN_SINGLE_HISTO_RRF 1
#define PRUN_ASYMMETRY 2
#define PRUN_ASYMMETRY_RRF 3
#define PRUN_MU_MINUS 4
#define PRUN_NON_MUSR 8
@ -96,6 +97,7 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it
#define MSR_FITTYPE_SINGLE_HISTO 0
#define MSR_FITTYPE_SINGLE_HISTO_RRF 1
#define MSR_FITTYPE_ASYM 2
#define MSR_FITTYPE_ASYM_RRF 3
#define MSR_FITTYPE_MU_MINUS 4
#define MSR_FITTYPE_NON_MUSR 8
@ -104,6 +106,7 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it
#define MSR_PLOT_SINGLE_HISTO 0
#define MSR_PLOT_SINGLE_HISTO_RRF 1
#define MSR_PLOT_ASYM 2
#define MSR_PLOT_ASYM_RRF 3
#define MSR_PLOT_MU_MINUS 4
#define MSR_PLOT_NON_MUSR 8

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2015 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 *

View File

@ -39,6 +39,7 @@ using namespace std;
#include "PRunSingleHisto.h"
#include "PRunSingleHistoRRF.h"
#include "PRunAsymmetry.h"
#include "PRunAsymmetryRRF.h"
#include "PRunMuMinus.h"
#include "PRunNonMusr.h"
@ -61,6 +62,7 @@ class PRunListCollection
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 GetAsymmetryRRFChisq(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;
@ -70,6 +72,7 @@ class PRunListCollection
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 GetAsymmetryRRFMaximumLikelihood(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;
@ -79,12 +82,14 @@ class PRunListCollection
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 GetNoOfAsymmetryRRF() const { return fRunAsymmetryRRFList.size(); } ///< returns the number of asymmetry RRF 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* GetAsymmetryRRF(UInt_t index, EDataSwitch tag=kIndex);
virtual PRunData* GetMuMinus(UInt_t index, EDataSwitch tag=kIndex);
virtual PRunData* GetNonMusr(UInt_t index, EDataSwitch tag=kIndex);
@ -99,11 +104,12 @@ 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<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
vector<PRunAsymmetry*> fRunAsymmetryList; ///< stores all processed asymmetry data
vector<PRunAsymmetryRRF*> fRunAsymmetryRRFList; ///< stores all processed asymmetry RRF data
vector<PRunMuMinus*> fRunMuMinusList; ///< stores all processed mu-minus data
vector<PRunNonMusr*> fRunNonMusrList; ///< stores all processed non-muSR data
};
#endif // _PRUNLISTCOLLECTION_H_

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *

View File

@ -179,7 +179,7 @@ void analyticFakeData(const TString type, UInt_t runNo)
phase.push_back((5.0 + 2.0*rand.Rndm())*TMath::Pi()/180.0 + TMath::TwoPi()/noOfHistos * (Double_t)i);
const Double_t gamma = 0.0000135538817; // gamma/(2pi)
Double_t bb0 = 90000.0; // field in Gauss
Double_t bb0 = 5000.0; // field in Gauss
Double_t rate0 = 1.0/1000.0; // in 1/ns
// fake function parameters header info: only for test purposes