More work towards implementation of beta-NMR asymmetry calculation

This commit is contained in:
Zaher Salman 2018-08-16 23:17:39 +02:00 committed by Zaher Salman
parent 8346e8debb
commit bcd1c98ad2
5 changed files with 76 additions and 4 deletions

View File

@ -1173,6 +1173,9 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
case MSR_PLOT_MU_MINUS: case MSR_PLOT_MU_MINUS:
fout << "PLOT " << fPlots[plotNo].fPlotType << " (mu minus plot)" << std::endl; fout << "PLOT " << fPlots[plotNo].fPlotType << " (mu minus plot)" << std::endl;
break; break;
case MSR_PLOT_BNMR:
fout << "PLOT " << fPlots[plotNo].fPlotType << " (beta-NMR asymmetry plot)" << endl;
break;
case MSR_PLOT_NON_MUSR: case MSR_PLOT_NON_MUSR:
fout << "PLOT " << fPlots[plotNo].fPlotType << " (non muSR plot)" << std::endl; fout << "PLOT " << fPlots[plotNo].fPlotType << " (non muSR plot)" << std::endl;
break; break;
@ -2275,6 +2278,9 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, std::map<UInt_t, TString
case MSR_PLOT_MU_MINUS: case MSR_PLOT_MU_MINUS:
fout << "PLOT " << fPlots[i].fPlotType << " (mu minus plot)" << std::endl; fout << "PLOT " << fPlots[i].fPlotType << " (mu minus plot)" << std::endl;
break; break;
case MSR_PLOT_BNMR:
fout << "PLOT " << fPlots[i].fPlotType << " (beta-NMR asymmetry plot)" << endl;
break;
case MSR_PLOT_NON_MUSR: case MSR_PLOT_NON_MUSR:
fout << "PLOT " << fPlots[i].fPlotType << " (non muSR plot)" << std::endl; fout << "PLOT " << fPlots[i].fPlotType << " (non muSR plot)" << std::endl;
break; break;
@ -4603,6 +4609,7 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
case MSR_PLOT_SINGLE_HISTO: // like: runs 1 5 13 case MSR_PLOT_SINGLE_HISTO: // like: runs 1 5 13
case MSR_PLOT_SINGLE_HISTO_RRF: case MSR_PLOT_SINGLE_HISTO_RRF:
case MSR_PLOT_ASYM: case MSR_PLOT_ASYM:
case MSR_PLOT_BNMR:
case MSR_PLOT_ASYM_RRF: case MSR_PLOT_ASYM_RRF:
case MSR_PLOT_NON_MUSR: case MSR_PLOT_NON_MUSR:
case MSR_PLOT_MU_MINUS: case MSR_PLOT_MU_MINUS:
@ -5020,6 +5027,7 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
std::cerr << std::endl << ">> 2=forward-backward asym,"; std::cerr << std::endl << ">> 2=forward-backward asym,";
std::cerr << std::endl << ">> 3=forward-backward RRF asym,"; std::cerr << std::endl << ">> 3=forward-backward RRF asym,";
std::cerr << std::endl << ">> 4=mu minus single histo,"; std::cerr << std::endl << ">> 4=mu minus single histo,";
std::cerr << std::endl << ">> 5=forward-backward beta-NMR asym,";
std::cerr << std::endl << ">> 8=non muSR."; std::cerr << std::endl << ">> 8=non muSR.";
std::cerr << std::endl << ">> <run_list> is the list of runs, e.g. runs 1 3"; std::cerr << std::endl << ">> <run_list> is the list of runs, e.g. runs 1 3";
std::cerr << std::endl << ">> range is optional"; std::cerr << std::endl << ">> range is optional";
@ -5871,6 +5879,58 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity()
fRuns[i].SetPacking(1); fRuns[i].SetPacking(1);
} }
break; break;
case PRUN_ASYMMETRY_BNMR:
// check alpha
if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> alpha parameter number missing which is needed for an asymmetry fit.";
cerr << endl << ">> Consider to check the manual ;-)" << endl;
return false;
}
// check that there is a forward parameter number
if (fRuns[i].GetForwardHistoNo() == -1) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> forward histogram number not defined. Necessary for asymmetry fits." << endl;
return false;
}
// check that there is a backward parameter number
if (fRuns[i].GetBackwardHistoNo() == -1) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> backward histogram number not defined. Necessary for asymmetry fits." << endl;
return false;
}
// check fit range
if (!fRuns[i].IsFitRangeInBin()) { // fit range given as times in usec
if ((fRuns[i].GetFitRange(0) == PMUSR_UNDEFINED) || (fRuns[i].GetFitRange(1) == PMUSR_UNDEFINED)) {
if ((fGlobal.GetFitRange(0) == PMUSR_UNDEFINED) || (fGlobal.GetFitRange(1) == PMUSR_UNDEFINED)) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> Fit range is not defined, also NOT present in the GLOBAL block. Necessary for asymmetry fits." << endl;
return false;
}
}
}
// check number of T0's provided
if ((fRuns[i].GetT0BinSize() > 2*fRuns[i].GetForwardHistoNoSize()) &&
(fGlobal.GetT0BinSize() > 2*fRuns[i].GetForwardHistoNoSize())) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetForwardHistoNoSize() << " in forward. Needs to be fixed." << endl;
cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl;
return false;
}
if ((fRuns[i].GetT0BinSize() > 2*fRuns[i].GetBackwardHistoNoSize()) &&
(fGlobal.GetT0BinSize() > 2*fRuns[i].GetBackwardHistoNoSize())) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetBackwardHistoNoSize() << " in backward. Needs to be fixed." << endl;
cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetBackwardHistoNoSize() << ". Needs to be fixed." << endl;
return false;
}
// check packing
if ((fRuns[i].GetPacking() == -1) && (fGlobal.GetPacking() == -1)) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **WARNING** in RUN block number " << i+1;
cerr << endl << ">> Packing is neither defined here, nor in the GLOBAL block, will set it to 1." << endl;
fRuns[i].SetPacking(1);
}
break;
case PRUN_ASYMMETRY_RRF: case PRUN_ASYMMETRY_RRF:
// check alpha // check alpha
if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) { if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) {

View File

@ -1610,6 +1610,7 @@ void PMusrCanvas::ExportData(const Char_t *fileName)
case MSR_PLOT_SINGLE_HISTO: case MSR_PLOT_SINGLE_HISTO:
case MSR_PLOT_SINGLE_HISTO_RRF: case MSR_PLOT_SINGLE_HISTO_RRF:
case MSR_PLOT_ASYM: case MSR_PLOT_ASYM:
case MSR_PLOT_BNMR:
case MSR_PLOT_ASYM_RRF: case MSR_PLOT_ASYM_RRF:
case MSR_PLOT_MU_MINUS: case MSR_PLOT_MU_MINUS:
if (fDifferenceView) { // difference view plot if (fDifferenceView) { // difference view plot
@ -2771,6 +2772,8 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
// make sure that for asymmetry the y-range is initialized reasonably // make sure that for asymmetry the y-range is initialized reasonably
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM) if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM)
dataSet.dataRange->SetYRange(-0.4, 0.4); dataSet.dataRange->SetYRange(-0.4, 0.4);
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_BNMR)
dataSet.dataRange->SetYRange(-0.4, 0.4);
// extract necessary range information // extract necessary range information
if ((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() == 0) && if ((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() == 0) &&
!fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { // no range information at all !fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { // no range information at all
@ -2785,6 +2788,7 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
fXmax = end; fXmax = end;
} }
if ((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM) || if ((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM) ||
(fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_BNMR) ||
(fMsrHandler->GetMsrRunList()->at(runNo).IsLifetimeCorrected())) { (fMsrHandler->GetMsrRunList()->at(runNo).IsLifetimeCorrected())) {
fYRangePresent = true; fYRangePresent = true;
fYmin = -0.4; fYmin = -0.4;
@ -2833,6 +2837,7 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
// make sure that for asymmetry the y-range is initialized reasonably // make sure that for asymmetry the y-range is initialized reasonably
if ((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM) || if ((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM) ||
(fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_BNMR) ||
(fMsrHandler->GetMsrRunList()->at(runNo).IsLifetimeCorrected())) { (fMsrHandler->GetMsrRunList()->at(runNo).IsLifetimeCorrected())) {
dataSet.dataRange->SetYRange(-0.4, 0.4); dataSet.dataRange->SetYRange(-0.4, 0.4);
} }
@ -4721,6 +4726,9 @@ void PMusrCanvas::PlotData(Bool_t unzoom)
case MSR_PLOT_ASYM: case MSR_PLOT_ASYM:
yAxisTitle = "Asymmetry"; yAxisTitle = "Asymmetry";
break; break;
case MSR_PLOT_BNMR:
yAxisTitle = "Asymmetry";
break;
case MSR_PLOT_MU_MINUS: case MSR_PLOT_MU_MINUS:
yAxisTitle = "N(t) per bin"; yAxisTitle = "N(t) per bin";
break; break;
@ -6146,6 +6154,9 @@ void PMusrCanvas::PlotAverage(Bool_t unzoom)
case MSR_PLOT_ASYM: case MSR_PLOT_ASYM:
yAxisTitle = "<asymmetry>"; yAxisTitle = "<asymmetry>";
break; break;
case MSR_PLOT_BNMR:
yAxisTitle = "<asymmetry>";
break;
case MSR_PLOT_MU_MINUS: case MSR_PLOT_MU_MINUS:
yAxisTitle = "<N(t)> per bin"; yAxisTitle = "<N(t)> per bin";
break; break;

View File

@ -535,6 +535,7 @@ Bool_t PRunAsymmetryBNMR::PrepareData()
} }
// keep the time resolution in (us) // keep the time resolution in (us)
// possibility to rescale for betaNMR
fTimeResolution = runData->GetTimeResolution()/1.0e3; fTimeResolution = runData->GetTimeResolution()/1.0e3;
cout.precision(10); cout.precision(10);
cout << endl << ">> PRunAsymmetryBNMR::PrepareData(): time resolution=" << fixed << runData->GetTimeResolution() << "(ns)" << endl; cout << endl << ">> PRunAsymmetryBNMR::PrepareData(): time resolution=" << fixed << runData->GetTimeResolution() << "(ns)" << endl;

View File

@ -24,7 +24,7 @@ fun1 = 0.5 * map1 * map2
############################################################### ###############################################################
RUN 045674 BNMR TRIUMF MUD (name beamline institute data-file-format) RUN 045674 BNMR TRIUMF MUD (name beamline institute data-file-format)
fittype 2 (asymmetry fit) fittype 5 (asymmetry fit)
alpha 1 alpha 1
forward 3 forward 3
backward 4 backward 4
@ -37,7 +37,7 @@ fit 0.5 8
packing 5 packing 5
RUN 045674 BNMR TRIUMF MUD (name beamline institute data-file-format) RUN 045674 BNMR TRIUMF MUD (name beamline institute data-file-format)
fittype 2 (asymmetry fit) fittype 5 (asymmetry fit)
alpha 1 alpha 1
forward 5 forward 5
backward 6 backward 6
@ -57,7 +57,7 @@ HESSE
SAVE SAVE
############################################################### ###############################################################
PLOT 2 (asymmetry plot) PLOT 5 (asymmetry plot)
runs 1 2 runs 1 2
use_fit_ranges use_fit_ranges
view_packing 10 view_packing 10

View File

@ -246,7 +246,7 @@ class PMusrCanvas : public TObject, public TQObject
Bool_t fDifferenceView; ///< tag showing that the shown data, fourier, are the difference between data and theory Bool_t fDifferenceView; ///< tag showing that the shown data, fourier, are the difference between data and theory
Int_t fCurrentPlotView; ///< tag showing what the current plot view is: data, fourier, ... Int_t fCurrentPlotView; ///< tag showing what the current plot view is: data, fourier, ...
Int_t fPreviousPlotView; ///< tag showing the previous plot view Int_t fPreviousPlotView; ///< tag showing the previous plot view
Int_t fPlotType; ///< plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry, MSR_PLOT_MU_MINUS == mu minus (not yet implemented), MSR_PLOT_NON_MUSR == non-muSR Int_t fPlotType; ///< plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry, MSR_PLOT_BNMR == beta-NMR asymmetry, MSR_PLOT_MU_MINUS == mu minus (not yet implemented), MSR_PLOT_NON_MUSR == non-muSR
Int_t fPlotNumber; ///< plot number Int_t fPlotNumber; ///< plot number
Bool_t fXRangePresent, fYRangePresent; ///< flag indicating if x-/y-range is present Bool_t fXRangePresent, fYRangePresent; ///< flag indicating if x-/y-range is present