A single asymmetry plot allows to toggle the color of the theory function line by the key 't'.

This commit is contained in:
2020-07-27 18:36:27 +02:00
parent 8dc52a269b
commit ccb87e8b7a
23 changed files with 94 additions and 67 deletions

View File

@@ -127,6 +127,7 @@ PMusrCanvas::PMusrCanvas()
fValid = false;
fAveragedView = false;
fDifferenceView = false;
fToggleColor = false;
fCurrentPlotView = PV_DATA;
fPreviousPlotView = PV_DATA;
fPlotType = -1;
@@ -1184,6 +1185,19 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
fDataTheoryPad->SetCrosshair(0);
}
fMainCanvas->Update();
} else if (x == 't') { // toggle theory color
if (fData.size() == 1) { // only do something if there is a single data set
if (fToggleColor) {
fData[0].theory->SetLineColor(kRed);
fData[0].theory->SetLineWidth(2);
} else {
fData[0].theory->SetLineColor(fColorList[0]);
fData[0].theory->SetLineWidth(1);
}
fToggleColor = !fToggleColor;
fDataTheoryPad->Modified();
fMainCanvas->Update();
}
} else {
fMainCanvas->Update();
}
@@ -2386,6 +2400,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
fValid = false;
fAveragedView = false;
fDifferenceView = false;
fToggleColor = false;
fCurrentPlotView = PV_DATA;
fPreviousPlotView = PV_DATA;
fPlotType = -1;

View File

@@ -245,6 +245,7 @@ class PMusrCanvas : public TObject, public TQObject
Bool_t fValid; ///< if true, everything looks OK
Bool_t fAveragedView; ///< tag showing that the averaged view or normal view should be presented.
Bool_t fDifferenceView; ///< tag showing that the shown data, fourier, are the difference between data and theory
Bool_t fToggleColor; ///< tag showing if a single histo theory is color toggled
Int_t fCurrentPlotView; ///< tag showing what the current plot view is: data, fourier, ...
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_BNMR == beta-NMR asymmetry, MSR_PLOT_MU_MINUS == mu minus (not yet implemented), MSR_PLOT_NON_MUSR == non-muSR