second attempt to improve the unzoom option after "improvement" in root-5.27.04.
This commit is contained in:
parent
8ab827cafc
commit
937a26d704
@ -3204,6 +3204,11 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
|
|||||||
param.fLogX = false; // i.e. if not overwritten use linear x-axis
|
param.fLogX = false; // i.e. if not overwritten use linear x-axis
|
||||||
param.fLogY = false; // i.e. if not overwritten use linear y-axis
|
param.fLogY = false; // i.e. if not overwritten use linear y-axis
|
||||||
param.fViewPacking = -1; // i.e. if not overwritten use the packing of the run blocks
|
param.fViewPacking = -1; // i.e. if not overwritten use the packing of the run blocks
|
||||||
|
param.fRuns.clear();
|
||||||
|
param.fTmin.clear();
|
||||||
|
param.fTmax.clear();
|
||||||
|
param.fYmin.clear();
|
||||||
|
param.fYmax.clear();
|
||||||
param.fRRFPacking = 0; // i.e. if not overwritten it will not be a valid RRF
|
param.fRRFPacking = 0; // i.e. if not overwritten it will not be a valid RRF
|
||||||
param.fRRFFreq = 0.0; // i.e. no RRF whished
|
param.fRRFFreq = 0.0; // i.e. no RRF whished
|
||||||
param.fRRFUnit = RRF_UNIT_MHz;
|
param.fRRFUnit = RRF_UNIT_MHz;
|
||||||
|
@ -1190,7 +1190,7 @@ void PMsrRunBlock::SetAddT0(Int_t ival, UInt_t addRunIdx, UInt_t histoNoIdx)
|
|||||||
// GetFitRange
|
// GetFitRange
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p> get fit range value at position idx
|
* <p> get fit range value at position idx. idx: 0=fit range start, 1=fit range end.
|
||||||
*
|
*
|
||||||
* <b>return:</b>
|
* <b>return:</b>
|
||||||
* - fit range value, if idx is within proper boundaries
|
* - fit range value, if idx is within proper boundaries
|
||||||
|
@ -41,6 +41,70 @@ using namespace std;
|
|||||||
#include "PMusrCanvas.h"
|
#include "PMusrCanvas.h"
|
||||||
#include "PFourier.h"
|
#include "PFourier.h"
|
||||||
|
|
||||||
|
ClassImp(PMusrCanvas)
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Constructor
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>Constructor
|
||||||
|
*/
|
||||||
|
PMusrCanvasPlotRange::PMusrCanvasPlotRange()
|
||||||
|
{
|
||||||
|
fXRangePresent = false;
|
||||||
|
fYRangePresent = false;
|
||||||
|
|
||||||
|
fXmin = 0.0;
|
||||||
|
fXmax = 0.0;
|
||||||
|
fYmin = 0.0;
|
||||||
|
fYmax = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// SetXRange (public)
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>Sets the x-range values.
|
||||||
|
*
|
||||||
|
* \param xmin minimum range value
|
||||||
|
* \param xmax maximum range value
|
||||||
|
*/
|
||||||
|
void PMusrCanvasPlotRange::SetXRange(Double_t xmin, Double_t xmax)
|
||||||
|
{
|
||||||
|
if (xmin > xmax) {
|
||||||
|
cerr << endl << "PMusrCanvasPlotRange::SetXRange: **WARNING** xmin > xmax, will swap them." << endl;
|
||||||
|
fXmin = xmax;
|
||||||
|
fXmax = xmin;
|
||||||
|
} else {
|
||||||
|
fXmin = xmin;
|
||||||
|
fXmax = xmax;
|
||||||
|
}
|
||||||
|
fXRangePresent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// SetYRange (public)
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>Sets the y-range values.
|
||||||
|
*
|
||||||
|
* \param ymin minimum range value
|
||||||
|
* \param ymax maximum range value
|
||||||
|
*/
|
||||||
|
void PMusrCanvasPlotRange::SetYRange(Double_t ymin, Double_t ymax)
|
||||||
|
{
|
||||||
|
if (ymin > ymax) {
|
||||||
|
cerr << endl << "PMusrCanvasPlotRange::SetYRange: **WARNING** ymin > ymax, will swap them." << endl;
|
||||||
|
fYmin = ymax;
|
||||||
|
fYmax = ymin;
|
||||||
|
} else {
|
||||||
|
fYmin = ymin;
|
||||||
|
fYmax = ymax;
|
||||||
|
}
|
||||||
|
fYRangePresent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ClassImpQ(PMusrCanvas)
|
ClassImpQ(PMusrCanvas)
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -84,6 +148,11 @@ PMusrCanvas::PMusrCanvas()
|
|||||||
|
|
||||||
fRRFText = 0;
|
fRRFText = 0;
|
||||||
fRRFLatexText = 0;
|
fRRFLatexText = 0;
|
||||||
|
|
||||||
|
fXmin = 0.0;
|
||||||
|
fXmax = 0.0;
|
||||||
|
fYmin = 0.0;
|
||||||
|
fYmax = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -120,6 +189,11 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
|||||||
|
|
||||||
fRRFText = 0;
|
fRRFText = 0;
|
||||||
fRRFLatexText = 0;
|
fRRFLatexText = 0;
|
||||||
|
|
||||||
|
fXmin = 0.0;
|
||||||
|
fXmax = 0.0;
|
||||||
|
fYmin = 0.0;
|
||||||
|
fYmax = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -162,6 +236,11 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
|
|||||||
|
|
||||||
fRRFText = 0;
|
fRRFText = 0;
|
||||||
fRRFLatexText = 0;
|
fRRFLatexText = 0;
|
||||||
|
|
||||||
|
fXmin = 0.0;
|
||||||
|
fXmax = 0.0;
|
||||||
|
fYmin = 0.0;
|
||||||
|
fYmax = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -760,7 +839,7 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
|||||||
PlotData();
|
PlotData();
|
||||||
} else if ((fCurrentPlotView == PV_DATA) && fDifferenceView) {
|
} else if ((fCurrentPlotView == PV_DATA) && fDifferenceView) {
|
||||||
CleanupFourierDifference();
|
CleanupFourierDifference();
|
||||||
HandleDifference();
|
HandleDifference(true);
|
||||||
} else if ((fCurrentPlotView != PV_DATA) && !fDifferenceView) {
|
} else if ((fCurrentPlotView != PV_DATA) && !fDifferenceView) {
|
||||||
HandleFourier();
|
HandleFourier();
|
||||||
} else if ((fCurrentPlotView != PV_DATA) && fDifferenceView) {
|
} else if ((fCurrentPlotView != PV_DATA) && fDifferenceView) {
|
||||||
@ -1332,6 +1411,7 @@ void PMusrCanvas::InitDataSet(PMusrCanvasDataSet &dataSet)
|
|||||||
dataSet.diffFourierIm = 0;
|
dataSet.diffFourierIm = 0;
|
||||||
dataSet.diffFourierPwr = 0;
|
dataSet.diffFourierPwr = 0;
|
||||||
dataSet.diffFourierPhase = 0;
|
dataSet.diffFourierPhase = 0;
|
||||||
|
dataSet.dataRange = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1359,6 +1439,7 @@ void PMusrCanvas::InitDataSet(PMusrCanvasNonMusrDataSet &dataSet)
|
|||||||
dataSet.diffFourierIm = 0;
|
dataSet.diffFourierIm = 0;
|
||||||
dataSet.diffFourierPwr = 0;
|
dataSet.diffFourierPwr = 0;
|
||||||
dataSet.diffFourierPhase = 0;
|
dataSet.diffFourierPhase = 0;
|
||||||
|
dataSet.dataRange = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1431,6 +1512,10 @@ void PMusrCanvas::CleanupDataSet(PMusrCanvasDataSet &dataSet)
|
|||||||
delete dataSet.diffFourierPhase;
|
delete dataSet.diffFourierPhase;
|
||||||
dataSet.diffFourierPhase = 0;
|
dataSet.diffFourierPhase = 0;
|
||||||
}
|
}
|
||||||
|
if (dataSet.dataRange) {
|
||||||
|
delete dataSet.dataRange;
|
||||||
|
dataSet.dataRange = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1503,6 +1588,10 @@ void PMusrCanvas::CleanupDataSet(PMusrCanvasNonMusrDataSet &dataSet)
|
|||||||
delete dataSet.diffFourierPhase;
|
delete dataSet.diffFourierPhase;
|
||||||
dataSet.diffFourierPhase = 0;
|
dataSet.diffFourierPhase = 0;
|
||||||
}
|
}
|
||||||
|
if (dataSet.dataRange) {
|
||||||
|
delete dataSet.dataRange;
|
||||||
|
dataSet.dataRange = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1521,13 +1610,17 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
|
|||||||
TH1F *dataHisto;
|
TH1F *dataHisto;
|
||||||
TH1F *theoHisto;
|
TH1F *theoHisto;
|
||||||
|
|
||||||
TString name;
|
TString name;
|
||||||
double start;
|
Double_t start;
|
||||||
double end;
|
Double_t end;
|
||||||
|
Double_t xmin, xmax, ymin, ymax;
|
||||||
Int_t size;
|
Int_t size;
|
||||||
|
|
||||||
InitDataSet(dataSet);
|
InitDataSet(dataSet);
|
||||||
|
|
||||||
|
// create plot range object for the data set
|
||||||
|
dataSet.dataRange = new PMusrCanvasPlotRange();
|
||||||
|
|
||||||
// dataHisto -------------------------------------------------------------
|
// dataHisto -------------------------------------------------------------
|
||||||
// create histo specific infos
|
// create histo specific infos
|
||||||
name = *fMsrHandler->GetMsrRunList()->at(runNo).GetRunName() + "_DataRunNo";
|
name = *fMsrHandler->GetMsrRunList()->at(runNo).GetRunName() + "_DataRunNo";
|
||||||
@ -1537,6 +1630,28 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
|
|||||||
start = data->GetDataTimeStart() - data->GetDataTimeStep()/2.0;
|
start = data->GetDataTimeStart() - data->GetDataTimeStep()/2.0;
|
||||||
end = start + data->GetValue()->size()*data->GetDataTimeStep();
|
end = start + data->GetValue()->size()*data->GetDataTimeStep();
|
||||||
size = data->GetValue()->size();
|
size = data->GetValue()->size();
|
||||||
|
dataSet.dataRange->SetXRange(start, end); // full possible range
|
||||||
|
// make sure that for asymmetry the y-range is initialized reasonably
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM)
|
||||||
|
dataSet.dataRange->SetYRange(-0.4, 0.4);
|
||||||
|
fPlotRangeTag = PR_NONE; // keep the proper plot range tag
|
||||||
|
|
||||||
|
// check if plot range is given in the msr-file, and if yes keep the values
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() != 0) {
|
||||||
|
// keep x-range
|
||||||
|
xmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[0];
|
||||||
|
xmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0];
|
||||||
|
dataSet.dataRange->SetXRange(xmin, xmax);
|
||||||
|
// check if y-range is given as well
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin.size() != 0) {
|
||||||
|
ymin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin[0];
|
||||||
|
ymax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmax[0];
|
||||||
|
dataSet.dataRange->SetYRange(ymin, ymax);
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep the proper plot range tag
|
||||||
|
fPlotRangeTag = PR_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
// check if 'use_fit_range' plotting is whished
|
// check if 'use_fit_range' plotting is whished
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) {
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) {
|
||||||
@ -1547,6 +1662,14 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
|
|||||||
(Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() -
|
(Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() -
|
||||||
data->GetDataTimeStep()/2.0; // closesd start value compatible with the user given
|
data->GetDataTimeStep()/2.0; // closesd start value compatible with the user given
|
||||||
end = start + size * data->GetDataTimeStep(); // closesd end value compatible with the user given
|
end = start + size * data->GetDataTimeStep(); // closesd end value compatible with the user given
|
||||||
|
dataSet.dataRange->SetXRange(start, end);
|
||||||
|
|
||||||
|
// make sure that for asymmetry the y-range is initialized reasonably
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fPlotType == MSR_PLOT_ASYM)
|
||||||
|
dataSet.dataRange->SetYRange(-0.4, 0.4);
|
||||||
|
|
||||||
|
// keep the proper plot range tag
|
||||||
|
fPlotRangeTag = PR_FIT_RANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if 'sub_ranges' plotting is whished
|
// check if 'sub_ranges' plotting is whished
|
||||||
@ -1558,6 +1681,17 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
|
|||||||
(Int_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() -
|
(Int_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() -
|
||||||
data->GetDataTimeStep()/2.0; // closesd start value compatible with the user given
|
data->GetDataTimeStep()/2.0; // closesd start value compatible with the user given
|
||||||
end = start + size * data->GetDataTimeStep(); // closesd end value compatible with the user given
|
end = start + size * data->GetDataTimeStep(); // closesd end value compatible with the user given
|
||||||
|
dataSet.dataRange->SetXRange(start, end);
|
||||||
|
|
||||||
|
// check if y-range is given as well
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin.size() != 0) {
|
||||||
|
ymin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin[0];
|
||||||
|
ymax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmax[0];
|
||||||
|
dataSet.dataRange->SetYRange(ymin, ymax);
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep the proper plot range tag
|
||||||
|
fPlotRangeTag = PR_SUB_RANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// invoke histo
|
// invoke histo
|
||||||
@ -1694,6 +1828,9 @@ void PMusrCanvas::HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *da
|
|||||||
|
|
||||||
InitDataSet(dataSet);
|
InitDataSet(dataSet);
|
||||||
|
|
||||||
|
// create plot range object for the data set and fill it
|
||||||
|
dataSet.dataRange = new PMusrCanvasPlotRange();
|
||||||
|
|
||||||
// dataHisto -------------------------------------------------------------
|
// dataHisto -------------------------------------------------------------
|
||||||
|
|
||||||
// invoke graph
|
// invoke graph
|
||||||
@ -1749,6 +1886,89 @@ void PMusrCanvas::HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *da
|
|||||||
dataSet.data = dataHisto;
|
dataSet.data = dataHisto;
|
||||||
dataSet.theory = theoHisto;
|
dataSet.theory = theoHisto;
|
||||||
|
|
||||||
|
// check the plot range options
|
||||||
|
Double_t xmin=0.0, xmax=0.0, ymin=0.0, ymax=0.0, x=0.0, y=0.0;
|
||||||
|
|
||||||
|
// initialize the plot range to the maximal possible given the data. This is needed if there is no plot-range style entry present
|
||||||
|
dataSet.data->GetPoint(0, xmin, y); // get xmin
|
||||||
|
dataSet.data->GetPoint(dataSet.data->GetN()-1, xmax, y); // get xmax
|
||||||
|
dataSet.data->GetPoint(0, x, y); // init ymin/ymax
|
||||||
|
ymin = y;
|
||||||
|
ymax = y;
|
||||||
|
for (Int_t i=1; i<dataSet.data->GetN(); i++) {
|
||||||
|
dataSet.data->GetPoint(i, x, y);
|
||||||
|
if (y < ymin)
|
||||||
|
ymin = y;
|
||||||
|
if (y > ymax)
|
||||||
|
ymax = y;
|
||||||
|
}
|
||||||
|
Double_t dx = 0.025*(xmax-xmin);
|
||||||
|
Double_t dy = 0.025*(ymax-ymin);
|
||||||
|
dataSet.dataRange->SetXRange(xmin-dx, xmax+dx);
|
||||||
|
dataSet.dataRange->SetYRange(ymin-dy, ymax+dy);
|
||||||
|
fPlotRangeTag = PR_NONE;
|
||||||
|
|
||||||
|
// check if plot range is given in the msr-file, and if yes keep the values
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() != 0) {
|
||||||
|
// keep x-range
|
||||||
|
xmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[0];
|
||||||
|
xmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0];
|
||||||
|
dataSet.dataRange->SetXRange(xmin, xmax);
|
||||||
|
// check if y-range is given as well
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin.size() != 0) {
|
||||||
|
ymin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin[0];
|
||||||
|
ymax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmax[0];
|
||||||
|
dataSet.dataRange->SetYRange(ymin, ymax);
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep the proper plot range tag
|
||||||
|
fPlotRangeTag = PR_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if 'use_fit_range' plotting is whished
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) {
|
||||||
|
xmin = fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0); // needed to estimate size
|
||||||
|
xmax = fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1); // needed to estimate size
|
||||||
|
dataSet.dataRange->SetXRange(xmin, xmax);
|
||||||
|
|
||||||
|
// keep the proper plot range tag
|
||||||
|
fPlotRangeTag = PR_FIT_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if 'sub_ranges' plotting is whished
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) {
|
||||||
|
xmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo]; // needed to estimate size
|
||||||
|
xmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo]; // needed to estimate size
|
||||||
|
dataSet.dataRange->SetXRange(xmin, xmax);
|
||||||
|
|
||||||
|
// check if y-range is given as well
|
||||||
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin.size() != 0) {
|
||||||
|
ymin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin[0];
|
||||||
|
ymax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmax[0];
|
||||||
|
dataSet.dataRange->SetYRange(ymin, ymax);
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep the proper plot range tag
|
||||||
|
fPlotRangeTag = PR_SUB_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep maximal range of all plot present
|
||||||
|
if (plotNo == 0) {
|
||||||
|
fXmin = dataSet.dataRange->GetXMin();
|
||||||
|
fXmax = dataSet.dataRange->GetXMax();
|
||||||
|
fYmin = dataSet.dataRange->GetYMin();
|
||||||
|
fYmax = dataSet.dataRange->GetYMax();
|
||||||
|
} else {
|
||||||
|
if (fXmin > dataSet.dataRange->GetXMin())
|
||||||
|
fXmin = dataSet.dataRange->GetXMin();
|
||||||
|
if (fXmax < dataSet.dataRange->GetXMax())
|
||||||
|
fXmax = dataSet.dataRange->GetXMax();
|
||||||
|
if (fYmin > dataSet.dataRange->GetYMin())
|
||||||
|
fYmin = dataSet.dataRange->GetYMin();
|
||||||
|
if (fYmax < dataSet.dataRange->GetYMax())
|
||||||
|
fYmax = dataSet.dataRange->GetYMax();
|
||||||
|
}
|
||||||
|
|
||||||
fNonMusrData.push_back(dataSet);
|
fNonMusrData.push_back(dataSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1759,8 +1979,10 @@ void PMusrCanvas::HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *da
|
|||||||
* <p>Handles the calculation of the difference spectra (i.e. data-theory).
|
* <p>Handles the calculation of the difference spectra (i.e. data-theory).
|
||||||
* It allocates the necessary objects if they are not already present. At the
|
* It allocates the necessary objects if they are not already present. At the
|
||||||
* end it calls the plotting routine.
|
* end it calls the plotting routine.
|
||||||
|
*
|
||||||
|
* \param unzoom if set to true, change ranges to the original msr-file values
|
||||||
*/
|
*/
|
||||||
void PMusrCanvas::HandleDifference()
|
void PMusrCanvas::HandleDifference(Bool_t unzoom)
|
||||||
{
|
{
|
||||||
// check if it is necessary to calculate diff data
|
// check if it is necessary to calculate diff data
|
||||||
if ((fPlotType != MSR_PLOT_NON_MUSR) && (fData[0].diff == 0)) {
|
if ((fPlotType != MSR_PLOT_NON_MUSR) && (fData[0].diff == 0)) {
|
||||||
@ -1802,6 +2024,9 @@ void PMusrCanvas::HandleDifference()
|
|||||||
TString name;
|
TString name;
|
||||||
// loop over all histos
|
// loop over all histos
|
||||||
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
||||||
|
// make sure data exists
|
||||||
|
assert(fNonMusrData[i].data);
|
||||||
|
|
||||||
// create difference histos
|
// create difference histos
|
||||||
diffHisto = new TGraphErrors(fNonMusrData[i].data->GetN());
|
diffHisto = new TGraphErrors(fNonMusrData[i].data->GetN());
|
||||||
|
|
||||||
@ -1838,17 +2063,34 @@ void PMusrCanvas::HandleDifference()
|
|||||||
Int_t xminBin, xmaxBin;
|
Int_t xminBin, xmaxBin;
|
||||||
Double_t xmin, xmax;
|
Double_t xmin, xmax;
|
||||||
if (fPlotType != MSR_PLOT_NON_MUSR) { // muSR Data
|
if (fPlotType != MSR_PLOT_NON_MUSR) { // muSR Data
|
||||||
xminBin = fData[0].data->GetXaxis()->GetFirst(); // first bin of the zoomed range
|
if (unzoom) {
|
||||||
xmaxBin = fData[0].data->GetXaxis()->GetLast(); // last bin of the zoomed range
|
fHistoFrame->GetXaxis()->SetRangeUser(fXmin, fXmax);
|
||||||
xmin = fData[0].data->GetXaxis()->GetBinCenter(xminBin);
|
for (UInt_t i=0; i<fData.size(); i++)
|
||||||
xmax = fData[0].data->GetXaxis()->GetBinCenter(xmaxBin);
|
fData[i].diff->GetXaxis()->SetRangeUser(fXmin, fXmax);
|
||||||
fData[0].diff->GetXaxis()->SetRangeUser(xmin, xmax);
|
} else {
|
||||||
|
xminBin = fData[0].data->GetXaxis()->GetFirst(); // first bin of the zoomed range
|
||||||
|
xmaxBin = fData[0].data->GetXaxis()->GetLast(); // last bin of the zoomed range
|
||||||
|
xmin = fData[0].data->GetXaxis()->GetBinCenter(xminBin);
|
||||||
|
xmax = fData[0].data->GetXaxis()->GetBinCenter(xmaxBin);
|
||||||
|
fData[0].diff->GetXaxis()->SetRangeUser(xmin, xmax);
|
||||||
|
}
|
||||||
} else { // non-muSR Data
|
} else { // non-muSR Data
|
||||||
xminBin = fNonMusrData[0].data->GetXaxis()->GetFirst(); // first bin of the zoomed range
|
if (unzoom) {
|
||||||
xmaxBin = fNonMusrData[0].data->GetXaxis()->GetLast(); // last bin of the zoomed range
|
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
||||||
xmin = fNonMusrData[0].data->GetXaxis()->GetBinCenter(xminBin);
|
fNonMusrData[0].diff->GetXaxis()->SetRangeUser(fNonMusrData[0].dataRange->GetXMin(),
|
||||||
xmax = fNonMusrData[0].data->GetXaxis()->GetBinCenter(xmaxBin);
|
fNonMusrData[0].dataRange->GetXMin());
|
||||||
fNonMusrData[0].diff->GetXaxis()->SetRangeUser(xmin, xmax);
|
if (fNonMusrData[0].dataRange->IsYRangePresent()) {
|
||||||
|
fNonMusrData[0].diff->GetYaxis()->SetRangeUser(fNonMusrData[0].dataRange->GetYMin(),
|
||||||
|
fNonMusrData[0].dataRange->GetYMax());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
xminBin = fNonMusrData[0].data->GetXaxis()->GetFirst(); // first bin of the zoomed range
|
||||||
|
xmaxBin = fNonMusrData[0].data->GetXaxis()->GetLast(); // last bin of the zoomed range
|
||||||
|
xmin = fNonMusrData[0].data->GetXaxis()->GetBinCenter(xminBin);
|
||||||
|
xmax = fNonMusrData[0].data->GetXaxis()->GetBinCenter(xmaxBin);
|
||||||
|
fNonMusrData[0].diff->GetXaxis()->SetRangeUser(xmin, xmax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlotDifference();
|
PlotDifference();
|
||||||
@ -2443,7 +2685,7 @@ Int_t PMusrCanvas::FindBin(const Double_t x, TGraphErrors *graph)
|
|||||||
*
|
*
|
||||||
* \param histo pointer of the histogram
|
* \param histo pointer of the histogram
|
||||||
*/
|
*/
|
||||||
double PMusrCanvas::GetGlobalMaximum(TH1F* histo)
|
Double_t PMusrCanvas::GetGlobalMaximum(TH1F* histo)
|
||||||
{
|
{
|
||||||
if (histo == 0)
|
if (histo == 0)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
@ -2470,7 +2712,7 @@ double PMusrCanvas::GetGlobalMaximum(TH1F* histo)
|
|||||||
*
|
*
|
||||||
* \param histo pointer of the histogram
|
* \param histo pointer of the histogram
|
||||||
*/
|
*/
|
||||||
double PMusrCanvas::GetGlobalMinimum(TH1F* histo)
|
Double_t PMusrCanvas::GetGlobalMinimum(TH1F* histo)
|
||||||
{
|
{
|
||||||
if (histo == 0)
|
if (histo == 0)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
@ -2512,64 +2754,67 @@ void PMusrCanvas::PlotData()
|
|||||||
if (fPlotType != MSR_PLOT_NON_MUSR) {
|
if (fPlotType != MSR_PLOT_NON_MUSR) {
|
||||||
if (fData.size() > 0) {
|
if (fData.size() > 0) {
|
||||||
|
|
||||||
// data range min/max
|
// delete old fHistoFrame if present
|
||||||
|
if (fHistoFrame) {
|
||||||
|
delete fHistoFrame;
|
||||||
|
fHistoFrame = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get full possible data range min/max
|
||||||
Double_t dataXmin = fData[0].data->GetXaxis()->GetXmin();
|
Double_t dataXmin = fData[0].data->GetXaxis()->GetXmin();
|
||||||
Double_t dataXmax = fData[0].data->GetXaxis()->GetXmax();
|
Double_t dataXmax = fData[0].data->GetXaxis()->GetXmax();
|
||||||
Double_t dataYmin = fData[0].data->GetMinimum();
|
Double_t dataYmin = GetGlobalMaximum(fData[0].data); // fData[0].data->GetMinimum();
|
||||||
Double_t dataYmax = fData[0].data->GetMaximum();
|
Double_t dataYmax = GetGlobalMinimum(fData[0].data); // fData[0].data->GetMaximum();
|
||||||
for (UInt_t i=1; i<fData.size(); i++) {
|
for (UInt_t i=1; i<fData.size(); i++) {
|
||||||
if (fData[i].data->GetXaxis()->GetXmin() < dataXmin)
|
if (fData[i].data->GetXaxis()->GetXmin() < dataXmin)
|
||||||
dataXmin = fData[i].data->GetXaxis()->GetXmin();
|
dataXmin = fData[i].data->GetXaxis()->GetXmin();
|
||||||
if (fData[i].data->GetXaxis()->GetXmax() > dataXmax)
|
if (fData[i].data->GetXaxis()->GetXmax() > dataXmax)
|
||||||
dataXmax = fData[i].data->GetXaxis()->GetXmax();
|
dataXmax = fData[i].data->GetXaxis()->GetXmax();
|
||||||
if (fData[i].data->GetMinimum() < dataYmin)
|
if (GetGlobalMinimum(fData[i].data) < dataYmin)
|
||||||
dataYmin = fData[i].data->GetMinimum();
|
dataYmin = GetGlobalMinimum(fData[i].data);
|
||||||
if (fData[i].data->GetMaximum() > dataYmax)
|
if (GetGlobalMaximum(fData[i].data) > dataYmax)
|
||||||
dataYmax = fData[i].data->GetMaximum();
|
dataYmax = GetGlobalMaximum(fData[i].data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { // use fit ranges
|
fXmin=dataXmin;
|
||||||
fXmin = dataXmin;
|
fXmax=dataXmax;
|
||||||
fXmax = dataXmax;
|
fYmin=dataYmin;
|
||||||
fYmin = dataYmin;
|
fYmax=dataYmax;
|
||||||
fYmax = dataYmax;
|
switch (fPlotRangeTag) {
|
||||||
} else if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) { // sub range plot
|
case PR_NONE:
|
||||||
fXmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[0];
|
// in case of the asymmetry plot some default y-ranges were set, i.e. [-0.4, 0.4]
|
||||||
fXmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0];
|
if (fData[0].dataRange->IsYRangePresent()) {
|
||||||
fYmin = fData[0].data->GetMinimum();
|
fYmin = fData[0].dataRange->GetYMin();
|
||||||
fYmax = fData[0].data->GetMaximum();
|
fYmax = fData[0].dataRange->GetYMax();
|
||||||
for (UInt_t i=1; i<fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size(); i++) {
|
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[i] < fXmin)
|
|
||||||
fXmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[i];
|
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[i] > fXmax)
|
|
||||||
fXmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[i];
|
|
||||||
}
|
|
||||||
// check if it is necessary to set the y-axis range
|
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin.size() > 0) {
|
|
||||||
fYmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin[0];
|
|
||||||
fYmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmax[0];
|
|
||||||
}
|
|
||||||
} else { // standard range plot
|
|
||||||
// set time range if present
|
|
||||||
fXmin = fData[0].data->GetXaxis()->GetXmin();
|
|
||||||
fXmax = fData[0].data->GetXaxis()->GetXmax();
|
|
||||||
fYmin = fData[0].data->GetMinimum();
|
|
||||||
fYmax = fData[0].data->GetMaximum();
|
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 0) {
|
|
||||||
fXmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[0];
|
|
||||||
fXmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0];
|
|
||||||
// check if it is necessary to set the y-axis range
|
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin.size() > 0) {
|
|
||||||
fYmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmin[0];
|
|
||||||
fYmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fYmax[0];
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
}
|
case PR_RANGE:
|
||||||
|
fXmin = fData[0].dataRange->GetXMin();
|
||||||
// delete old fHistoFrame if present
|
fXmax = fData[0].dataRange->GetXMax();
|
||||||
if (fHistoFrame) {
|
if (fData[0].dataRange->IsYRangePresent()) {
|
||||||
delete fHistoFrame;
|
fYmin = fData[0].dataRange->GetYMin();
|
||||||
fHistoFrame = 0;
|
fYmax = fData[0].dataRange->GetYMax();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PR_FIT_RANGE:
|
||||||
|
fXmin = fData[0].dataRange->GetXMin();
|
||||||
|
fXmax = fData[0].dataRange->GetXMax();
|
||||||
|
// in case of the asymmetry plot some default y-ranges were set, i.e. [-0.4, 0.4]
|
||||||
|
if (fData[0].dataRange->IsYRangePresent()) {
|
||||||
|
fYmin = fData[0].dataRange->GetYMin();
|
||||||
|
fYmax = fData[0].dataRange->GetYMax();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PR_SUB_RANGE:
|
||||||
|
fXmin = fData[0].dataRange->GetXMin();
|
||||||
|
fXmax = fData[0].dataRange->GetXMax();
|
||||||
|
if (fData[0].dataRange->IsYRangePresent()) {
|
||||||
|
fYmin = fData[0].dataRange->GetYMin();
|
||||||
|
fYmax = fData[0].dataRange->GetYMax();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create histo frame in order to plot histograms possibly with different x-frames
|
// create histo frame in order to plot histograms possibly with different x-frames
|
||||||
@ -2626,6 +2871,7 @@ void PMusrCanvas::PlotData()
|
|||||||
} else { // fPlotType == MSR_PLOT_NO_MUSR
|
} else { // fPlotType == MSR_PLOT_NO_MUSR
|
||||||
// ugly workaround since multigraphs axis are not going away when switching TMultiGraphs
|
// ugly workaround since multigraphs axis are not going away when switching TMultiGraphs
|
||||||
delete fDataTheoryPad;
|
delete fDataTheoryPad;
|
||||||
|
fDataTheoryPad = 0;
|
||||||
fDataTheoryPad = new TPad("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE);
|
fDataTheoryPad = new TPad("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE);
|
||||||
fDataTheoryPad->SetFillColor(TColor::GetColor(255,255,255));
|
fDataTheoryPad->SetFillColor(TColor::GetColor(255,255,255));
|
||||||
fDataTheoryPad->Draw();
|
fDataTheoryPad->Draw();
|
||||||
@ -2664,6 +2910,7 @@ void PMusrCanvas::PlotData()
|
|||||||
fMultiGraphData->Draw("a");
|
fMultiGraphData->Draw("a");
|
||||||
|
|
||||||
// set x-range
|
// set x-range
|
||||||
|
/*
|
||||||
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 0) {
|
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 0) {
|
||||||
Double_t xmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[0];
|
Double_t xmin = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[0];
|
||||||
Double_t xmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0];
|
Double_t xmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0];
|
||||||
@ -2677,6 +2924,9 @@ void PMusrCanvas::PlotData()
|
|||||||
fMultiGraphData->GetYaxis()->UnZoom();
|
fMultiGraphData->GetYaxis()->UnZoom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
fMultiGraphData->GetXaxis()->SetRangeUser(fXmin, fXmax);
|
||||||
|
fMultiGraphData->GetYaxis()->SetRangeUser(fYmin, fYmax);
|
||||||
|
|
||||||
// set x-, y-axis label only if there is just one data set
|
// set x-, y-axis label only if there is just one data set
|
||||||
if (fNonMusrData.size() == 1) {
|
if (fNonMusrData.size() == 1) {
|
||||||
@ -2788,6 +3038,9 @@ void PMusrCanvas::PlotDifference()
|
|||||||
|
|
||||||
fMultiGraphDiff->Draw("a");
|
fMultiGraphDiff->Draw("a");
|
||||||
|
|
||||||
|
fMultiGraphDiff->GetXaxis()->SetRangeUser(fXmin, fXmax);
|
||||||
|
fMultiGraphDiff->GetYaxis()->SetRangeUser(fYmin, fYmax);
|
||||||
|
|
||||||
// set x-axis label
|
// set x-axis label
|
||||||
fMultiGraphDiff->GetXaxis()->SetTitle(xAxisTitle.Data());
|
fMultiGraphDiff->GetXaxis()->SetTitle(xAxisTitle.Data());
|
||||||
// set y-axis label
|
// set y-axis label
|
||||||
|
@ -289,35 +289,84 @@ Bool_t PRunNonMusr::PrepareViewData()
|
|||||||
PMsrPlotStructure plotBlock;
|
PMsrPlotStructure plotBlock;
|
||||||
plotList = fMsrInfo->GetMsrPlotList();
|
plotList = fMsrInfo->GetMsrPlotList();
|
||||||
// find the proper plot block
|
// find the proper plot block
|
||||||
// Here a small complication has to be handled: there are potentially multiple
|
// Here a small complication to be handled: there are potentially multiple
|
||||||
// run blocks and the run might be present in various of these run blocks. In
|
// run blocks and the run might be present in various of these run blocks. In
|
||||||
// order to get a nice resolution on the theory the following procedure will be
|
// order to get a nice resolution on the theory the following procedure will be
|
||||||
// followed: the smallest x-interval found will be used to for the fXTheory resolution
|
// followed: the smallest x-interval found will be used to for the fXTheory resolution
|
||||||
// which is 1000 function points. The function will be calculated from the smallest
|
// which is 1000 function points. The function will be calculated from the smallest
|
||||||
// xmin found up to the largest xmax found.
|
// xmin found up to the largest xmax found.
|
||||||
Double_t xMin = 0.0, xMax = 0.0;
|
Double_t xMin = 0.0, xMax = 0.0;
|
||||||
Double_t xAbsMin = 0.0, xAbsMax = 0.0;
|
|
||||||
Bool_t first = true;
|
// init xMin/xMax, xAbsMin/xAbsMax
|
||||||
for (UInt_t i=0; i<plotList->size(); i++) {
|
plotBlock = plotList->at(0);
|
||||||
|
if (plotBlock.fTmin.size() == 0) { // check if no range information is present
|
||||||
|
PMsrRunList *runList = fMsrInfo->GetMsrRunList();
|
||||||
|
xMin = runList->at(0).GetFitRange(0);
|
||||||
|
xMax = runList->at(0).GetFitRange(1);
|
||||||
|
for (UInt_t i=1; i<runList->size(); i++) {
|
||||||
|
if (runList->at(i).GetFitRange(0) < xMin)
|
||||||
|
xMin = runList->at(i).GetFitRange(0);
|
||||||
|
if (runList->at(i).GetFitRange(1) > xMax)
|
||||||
|
xMax = runList->at(i).GetFitRange(1);
|
||||||
|
}
|
||||||
|
} else if (plotBlock.fTmin.size() == 1) { // check if 'range' information is present
|
||||||
|
xMin = plotBlock.fTmin[0];
|
||||||
|
xMax = plotBlock.fTmax[0];
|
||||||
|
} else if (plotBlock.fTmin.size() > 1) { // check if 'sub_ranges' information is present
|
||||||
|
xMin = plotBlock.fTmin[0];
|
||||||
|
xMax = plotBlock.fTmax[0];
|
||||||
|
for (UInt_t i=1; i<plotBlock.fTmin.size(); i++) {
|
||||||
|
if (plotBlock.fTmin[i] < xMin)
|
||||||
|
xMin = plotBlock.fTmin[i];
|
||||||
|
if (plotBlock.fTmax[i] > xMax)
|
||||||
|
xMax = plotBlock.fTmax[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plotBlock.fUseFitRanges) { // check if 'use_fit_ranges' information is present
|
||||||
|
PMsrRunList *runList = fMsrInfo->GetMsrRunList();
|
||||||
|
xMin = runList->at(0).GetFitRange(0);
|
||||||
|
xMax = runList->at(0).GetFitRange(1);
|
||||||
|
for (UInt_t i=1; i<runList->size(); i++) {
|
||||||
|
if (runList->at(i).GetFitRange(0) < xMin)
|
||||||
|
xMin = runList->at(i).GetFitRange(0);
|
||||||
|
if (runList->at(i).GetFitRange(1) > xMax)
|
||||||
|
xMax = runList->at(i).GetFitRange(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (UInt_t i=1; i<plotList->size(); i++) { // go through all the plot blocks
|
||||||
plotBlock = plotList->at(i);
|
plotBlock = plotList->at(i);
|
||||||
for (UInt_t j=0; j<plotBlock.fRuns.size(); j++) {
|
|
||||||
if (fRunNo == plotBlock.fRuns[j]-1) { // run found
|
if (plotBlock.fTmin.size() == 0) { // check if no range information is present
|
||||||
if (first) {
|
PMsrRunList *runList = fMsrInfo->GetMsrRunList();
|
||||||
first = false;
|
for (UInt_t i=0; i<runList->size(); i++) {
|
||||||
xMin = plotBlock.fTmin[0];
|
if (runList->at(i).GetFitRange(0) < xMin)
|
||||||
xMax = plotBlock.fTmax[0];
|
xMin = runList->at(i).GetFitRange(0);
|
||||||
xAbsMin = xMin;
|
if (runList->at(i).GetFitRange(1) > xMax)
|
||||||
xAbsMax = xMax;
|
xMax = runList->at(i).GetFitRange(1);
|
||||||
} else {
|
}
|
||||||
if (fabs(xMax-xMin) > fabs(plotBlock.fTmax[0]-plotBlock.fTmin[0])) {
|
} else if (plotBlock.fTmin.size() == 1) { // check if 'range' information is present
|
||||||
xMin = plotBlock.fTmin[0];
|
if (plotBlock.fTmin[0] < xMin)
|
||||||
xMax = plotBlock.fTmax[0];
|
xMin = plotBlock.fTmin[0];
|
||||||
}
|
if (plotBlock.fTmax[0] > xMax)
|
||||||
if (xMin < xAbsMin)
|
xMax = plotBlock.fTmax[0];
|
||||||
xAbsMin = xMin;
|
} else if (plotBlock.fTmin.size() > 1) { // check if 'sub_ranges' information is present
|
||||||
if (xMax > xAbsMax)
|
for (UInt_t i=0; i<plotBlock.fTmin.size(); i++) {
|
||||||
xAbsMax = xMax;
|
if (plotBlock.fTmin[i] < xMin)
|
||||||
}
|
xMin = plotBlock.fTmin[i];
|
||||||
|
if (plotBlock.fTmax[i] > xMax)
|
||||||
|
xMax = plotBlock.fTmax[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plotBlock.fUseFitRanges) { // check if 'use_fit_ranges' information is present
|
||||||
|
PMsrRunList *runList = fMsrInfo->GetMsrRunList();
|
||||||
|
for (UInt_t i=0; i<runList->size(); i++) {
|
||||||
|
if (runList->at(i).GetFitRange(0) < xMin)
|
||||||
|
xMin = runList->at(i).GetFitRange(0);
|
||||||
|
if (runList->at(i).GetFitRange(1) > xMax)
|
||||||
|
xMax = runList->at(i).GetFitRange(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +378,7 @@ Bool_t PRunNonMusr::PrepareViewData()
|
|||||||
else
|
else
|
||||||
xStep = (xMax-xMin)/1000.0;
|
xStep = (xMax-xMin)/1000.0;
|
||||||
|
|
||||||
Double_t xx = xAbsMin;
|
Double_t xx = xMin;
|
||||||
do {
|
do {
|
||||||
// fill x-vector
|
// fill x-vector
|
||||||
fData.AppendXTheoryValue(xx);
|
fData.AppendXTheoryValue(xx);
|
||||||
@ -337,7 +386,7 @@ Bool_t PRunNonMusr::PrepareViewData()
|
|||||||
fData.AppendTheoryValue(fTheory->Func(xx, par, fFuncValues));
|
fData.AppendTheoryValue(fTheory->Func(xx, par, fFuncValues));
|
||||||
// calculate next xx
|
// calculate next xx
|
||||||
xx += xStep;
|
xx += xStep;
|
||||||
} while (xx < xAbsMax);
|
} while (xx < xMax);
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
par.clear();
|
par.clear();
|
||||||
|
@ -56,6 +56,12 @@
|
|||||||
#define YTITLE 0.95
|
#define YTITLE 0.95
|
||||||
#define XTHEO 0.75
|
#define XTHEO 0.75
|
||||||
|
|
||||||
|
// Current Plot Range
|
||||||
|
#define PR_NONE 0
|
||||||
|
#define PR_RANGE 1
|
||||||
|
#define PR_SUB_RANGE 2
|
||||||
|
#define PR_FIT_RANGE 3
|
||||||
|
|
||||||
// Current Plot Views
|
// Current Plot Views
|
||||||
#define PV_DATA 1
|
#define PV_DATA 1
|
||||||
#define PV_FOURIER_REAL 2
|
#define PV_FOURIER_REAL 2
|
||||||
@ -82,6 +88,38 @@
|
|||||||
|
|
||||||
#define P_MENU_ID_SAVE_ASCII 200
|
#define P_MENU_ID_SAVE_ASCII 200
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
class PMusrCanvasPlotRange : public TObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PMusrCanvasPlotRange();
|
||||||
|
virtual ~PMusrCanvasPlotRange() {}
|
||||||
|
|
||||||
|
virtual void SetXRange(Double_t xmin, Double_t xmax);
|
||||||
|
virtual void SetYRange(Double_t ymin, Double_t ymax);
|
||||||
|
|
||||||
|
virtual Bool_t IsXRangePresent() { return fXRangePresent; }
|
||||||
|
virtual Bool_t IsYRangePresent() { return fYRangePresent; }
|
||||||
|
|
||||||
|
virtual Double_t GetXMin() { return fXmin; }
|
||||||
|
virtual Double_t GetXMax() { return fXmax; }
|
||||||
|
virtual Double_t GetYMin() { return fYmin; }
|
||||||
|
virtual Double_t GetYMax() { return fYmax; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
Bool_t fXRangePresent;
|
||||||
|
Bool_t fYRangePresent;
|
||||||
|
Double_t fXmin;
|
||||||
|
Double_t fXmax;
|
||||||
|
Double_t fYmin;
|
||||||
|
Double_t fYmax;
|
||||||
|
|
||||||
|
ClassDef(PMusrCanvasPlotRange, 1)
|
||||||
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Structure holding all necessary histograms for a single plot block entry for
|
* <p>Structure holding all necessary histograms for a single plot block entry for
|
||||||
@ -103,6 +141,7 @@ typedef struct {
|
|||||||
TH1F *diffFourierIm; ///< imaginary part of the Fourier transform of the diff histogram
|
TH1F *diffFourierIm; ///< imaginary part of the Fourier transform of the diff histogram
|
||||||
TH1F *diffFourierPwr; ///< power spectrum of the Fourier transform of the diff histogram
|
TH1F *diffFourierPwr; ///< power spectrum of the Fourier transform of the diff histogram
|
||||||
TH1F *diffFourierPhase; ///< phase spectrum of the Fourier transform of the diff histogram
|
TH1F *diffFourierPhase; ///< phase spectrum of the Fourier transform of the diff histogram
|
||||||
|
PMusrCanvasPlotRange *dataRange; ///< keep the msr-file plot data range
|
||||||
} PMusrCanvasDataSet;
|
} PMusrCanvasDataSet;
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
@ -132,6 +171,7 @@ typedef struct {
|
|||||||
TGraphErrors *diffFourierIm; ///< imaginary part of the Fourier transform of the diff error graph
|
TGraphErrors *diffFourierIm; ///< imaginary part of the Fourier transform of the diff error graph
|
||||||
TGraphErrors *diffFourierPwr; ///< power spectrum of the Fourier transform of the diff error graph
|
TGraphErrors *diffFourierPwr; ///< power spectrum of the Fourier transform of the diff error graph
|
||||||
TGraphErrors *diffFourierPhase; ///< phase spectrum of the Fourier transform of the diff error graph
|
TGraphErrors *diffFourierPhase; ///< phase spectrum of the Fourier transform of the diff error graph
|
||||||
|
PMusrCanvasPlotRange *dataRange; ///< keep the msr-file plot data range
|
||||||
} PMusrCanvasNonMusrDataSet;
|
} PMusrCanvasNonMusrDataSet;
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
@ -195,12 +235,13 @@ class PMusrCanvas : public TObject, public TQObject
|
|||||||
virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat);
|
virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Bool_t fBatchMode; ///< musrview in ROOT batch mode
|
Bool_t fBatchMode; ///< musrview in ROOT batch mode
|
||||||
Bool_t fValid; ///< if true, everything looks OK
|
Bool_t fValid; ///< if true, everything looks OK
|
||||||
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 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_MU_MINUS == mu minus (not yet implemented), MSR_PLOT_NON_MUSR == non-muSR
|
||||||
Int_t fPlotNumber; ///< plot number
|
Int_t fPlotNumber; ///< plot number
|
||||||
|
UInt_t fPlotRangeTag; ///< plot range tag: 0=no range given, 1=range, 2=sub_ranges, 3=use_fit_ranges.
|
||||||
|
|
||||||
Double_t fXmin, fXmax, fYmin, fYmax; ///< data/theory frame range
|
Double_t fXmin, fXmax, fYmin, fYmax; ///< data/theory frame range
|
||||||
|
|
||||||
@ -252,7 +293,7 @@ class PMusrCanvas : public TObject, public TQObject
|
|||||||
virtual void CleanupDataSet(PMusrCanvasNonMusrDataSet &dataSet);
|
virtual void CleanupDataSet(PMusrCanvasNonMusrDataSet &dataSet);
|
||||||
virtual void HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data);
|
virtual void HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data);
|
||||||
virtual void HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data);
|
virtual void HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data);
|
||||||
virtual void HandleDifference();
|
virtual void HandleDifference(Bool_t unzoom=false);
|
||||||
virtual void HandleFourier();
|
virtual void HandleFourier();
|
||||||
virtual void HandleDifferenceFourier();
|
virtual void HandleDifferenceFourier();
|
||||||
virtual void HandleFourierDifference();
|
virtual void HandleFourierDifference();
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#pragma link off all classes;
|
#pragma link off all classes;
|
||||||
#pragma link off all functions;
|
#pragma link off all functions;
|
||||||
|
|
||||||
|
#pragma link C++ class PMusrCanvasPlotRange+;
|
||||||
#pragma link C++ class PMusrCanvas+;
|
#pragma link C++ class PMusrCanvas+;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user