some more bug fixing for average per data set.
This commit is contained in:
parent
59525a787e
commit
8cc07318eb
@ -1170,6 +1170,8 @@ void PFourierCanvas::HandleAverage()
|
|||||||
currentTag = fDataSetTag[j];
|
currentTag = fDataSetTag[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (start == -1)
|
||||||
|
start = fDataSetTag.size()-1;
|
||||||
if (end == -1)
|
if (end == -1)
|
||||||
end = fDataSetTag.size()-1;
|
end = fDataSetTag.size()-1;
|
||||||
|
|
||||||
@ -1197,7 +1199,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
// real average
|
// real average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
|
||||||
dval = 0.0;
|
dval = 0.0;
|
||||||
for (Int_t k=start; k<end; k++) {
|
for (Int_t k=start; k<=end; k++) {
|
||||||
if (j < fFourierHistos[k].dataFourierRe->GetNbinsX())
|
if (j < fFourierHistos[k].dataFourierRe->GetNbinsX())
|
||||||
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierRe, fFourierHistos[0].dataFourierRe->GetBinCenter(j));
|
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierRe, fFourierHistos[0].dataFourierRe->GetBinCenter(j));
|
||||||
}
|
}
|
||||||
@ -1212,7 +1214,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
// imaginary average
|
// imaginary average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
|
||||||
dval = 0.0;
|
dval = 0.0;
|
||||||
for (Int_t k=start; k<end; k++) {
|
for (Int_t k=start; k<=end; k++) {
|
||||||
if (j < fFourierHistos[k].dataFourierIm->GetNbinsX())
|
if (j < fFourierHistos[k].dataFourierIm->GetNbinsX())
|
||||||
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierIm, fFourierHistos[0].dataFourierIm->GetBinCenter(j));
|
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierIm, fFourierHistos[0].dataFourierIm->GetBinCenter(j));
|
||||||
}
|
}
|
||||||
@ -1227,7 +1229,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
// power average
|
// power average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
|
||||||
dval = 0.0;
|
dval = 0.0;
|
||||||
for (Int_t k=start; k<end; k++) {
|
for (Int_t k=start; k<=end; k++) {
|
||||||
if (j < fFourierHistos[k].dataFourierPwr->GetNbinsX())
|
if (j < fFourierHistos[k].dataFourierPwr->GetNbinsX())
|
||||||
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPwr, fFourierHistos[0].dataFourierPwr->GetBinCenter(j));
|
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPwr, fFourierHistos[0].dataFourierPwr->GetBinCenter(j));
|
||||||
}
|
}
|
||||||
@ -1242,7 +1244,7 @@ void PFourierCanvas::HandleAverage()
|
|||||||
// phase average
|
// phase average
|
||||||
for (Int_t j=0; j<fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
|
for (Int_t j=0; j<fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
|
||||||
dval = 0.0;
|
dval = 0.0;
|
||||||
for (Int_t k=start; k<end; k++) {
|
for (Int_t k=start; k<=end; k++) {
|
||||||
if (j < fFourierHistos[k].dataFourierPhase->GetNbinsX())
|
if (j < fFourierHistos[k].dataFourierPhase->GetNbinsX())
|
||||||
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPhase, fFourierHistos[0].dataFourierPhase->GetBinCenter(j));
|
dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPhase, fFourierHistos[0].dataFourierPhase->GetBinCenter(j));
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,8 @@ void PRunDataHandler::ReadData()
|
|||||||
fAllDataAvailable = ReadRootFile();
|
fAllDataAvailable = ReadRootFile();
|
||||||
} else if ((fFileFormat == "NeXus") || (fFileFormat == "nexus")) {
|
} else if ((fFileFormat == "NeXus") || (fFileFormat == "nexus")) {
|
||||||
fAllDataAvailable = ReadNexusFile();
|
fAllDataAvailable = ReadNexusFile();
|
||||||
} else if ((fFileFormat == "PsiBin") || (fFileFormat == "psibin")) {
|
} else if ((fFileFormat == "PsiBin") || (fFileFormat == "psibin") ||
|
||||||
|
(fFileFormat == "PsiMdu") || (fFileFormat == "psimdu")) {
|
||||||
fAllDataAvailable = ReadPsiBinFile();
|
fAllDataAvailable = ReadPsiBinFile();
|
||||||
} else if ((fFileFormat == "Mud") || (fFileFormat == "mud")) {
|
} else if ((fFileFormat == "Mud") || (fFileFormat == "mud")) {
|
||||||
fAllDataAvailable = ReadMudFile();
|
fAllDataAvailable = ReadMudFile();
|
||||||
|
@ -61,7 +61,7 @@ class PRunDataHandler
|
|||||||
virtual Bool_t IsAllDataAvailable() const { return fAllDataAvailable; }
|
virtual Bool_t IsAllDataAvailable() const { return fAllDataAvailable; }
|
||||||
virtual PRawRunData* GetRunData(const TString &runName);
|
virtual PRawRunData* GetRunData(const TString &runName);
|
||||||
virtual PRawRunData* GetRunData(const UInt_t idx=0);
|
virtual PRawRunData* GetRunData(const UInt_t idx=0);
|
||||||
virtual TString GetRunPathName() {return fRunPathName; }
|
virtual Int_t GetNoOfRunData() {return fData.size(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
|
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
|
||||||
|
@ -1151,12 +1151,6 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get meta info, time resolution, time range, raw data sets
|
// get meta info, time resolution, time range, raw data sets
|
||||||
// check if the data set path-name has changed
|
|
||||||
if (prevDataSetPathName.CompareTo(runDataHandler[i]->GetRunPathName())) { // i.e. data set path-name changed
|
|
||||||
rd.dataSetTag = dataSetTagCounter++;
|
|
||||||
prevDataSetPathName = runDataHandler[i]->GetRunPathName();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i < msrHandler.size()) { // obtain info from msr-files
|
if (i < msrHandler.size()) { // obtain info from msr-files
|
||||||
// keep title if not overwritten by the command line
|
// keep title if not overwritten by the command line
|
||||||
if (startupParam.title.Length() == 0)
|
if (startupParam.title.Length() == 0)
|
||||||
@ -1212,7 +1206,20 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
startupParam.fourierPower = fourierBlock->fFourierPower;
|
startupParam.fourierPower = fourierBlock->fFourierPower;
|
||||||
}
|
}
|
||||||
// get apodization tag
|
// get apodization tag
|
||||||
apodTag = fourierBlock->fApodization;
|
switch (fourierBlock->fApodization) {
|
||||||
|
case FOURIER_APOD_WEAK:
|
||||||
|
startupParam.apodization = "weak";
|
||||||
|
break;
|
||||||
|
case FOURIER_APOD_MEDIUM:
|
||||||
|
startupParam.apodization = "medium";
|
||||||
|
break;
|
||||||
|
case FOURIER_APOD_STRONG:
|
||||||
|
startupParam.apodization = "strong";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
startupParam.apodization = "none";
|
||||||
|
break;
|
||||||
|
}
|
||||||
// get range
|
// get range
|
||||||
if ((startupParam.fourierRange[0] == -1) && (startupParam.fourierRange[1] == -1)) { // no Fourier range given from the command line
|
if ((startupParam.fourierRange[0] == -1) && (startupParam.fourierRange[1] == -1)) { // no Fourier range given from the command line
|
||||||
startupParam.fourierRange[0] = fourierBlock->fPlotRange[0];
|
startupParam.fourierRange[0] = fourierBlock->fPlotRange[0];
|
||||||
@ -1231,6 +1238,13 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
// loop over all runs listed in the msr-file PLOT block
|
// loop over all runs listed in the msr-file PLOT block
|
||||||
for (UInt_t j=0; j<runList.size(); j++) {
|
for (UInt_t j=0; j<runList.size(); j++) {
|
||||||
|
|
||||||
|
// check if the data set name has changed
|
||||||
|
str = *(runs->at(runList[j]-1).GetRunName()); // get the name from the msr-file RUN block
|
||||||
|
if (prevDataSetPathName.CompareTo(str)) { // i.e. data set name changed
|
||||||
|
rd.dataSetTag = dataSetTagCounter++;
|
||||||
|
prevDataSetPathName = str;
|
||||||
|
}
|
||||||
|
|
||||||
// keep forward histo list
|
// keep forward histo list
|
||||||
PIntVector histoList;
|
PIntVector histoList;
|
||||||
for (UInt_t k=0; k<runs->at(runList[j]-1).GetForwardHistoNoSize(); k++) {
|
for (UInt_t k=0; k<runs->at(runList[j]-1).GetForwardHistoNoSize(); k++) {
|
||||||
@ -1238,7 +1252,7 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle meta information
|
// handle meta information
|
||||||
fln = runDataHandler[i]->GetRunPathName();
|
fln = *(runs->at(runList[j]-1).GetRunName()); // get the name from the msr-file RUN block
|
||||||
musrFT_getMetaInfo(fln, rawRunData, str);
|
musrFT_getMetaInfo(fln, rawRunData, str);
|
||||||
TString hh("");
|
TString hh("");
|
||||||
hh = TString::Format("h%d", histoList[0]);
|
hh = TString::Format("h%d", histoList[0]);
|
||||||
@ -1294,6 +1308,14 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
data.SetBkgRange(startupParam.bkg_range);
|
data.SetBkgRange(startupParam.bkg_range);
|
||||||
}
|
}
|
||||||
} else { // obtain info from command line options for direct data-file read
|
} else { // obtain info from command line options for direct data-file read
|
||||||
|
// check if the data set name has changed
|
||||||
|
// since data-files are given, each PRunDataHandler object contains only a SINGLE data file.
|
||||||
|
str = *(runDataHandler[i]->GetRunData()->GetFileName()); // get the data set name
|
||||||
|
if (prevDataSetPathName.CompareTo(str)) { // i.e. data set name changed
|
||||||
|
rd.dataSetTag = dataSetTagCounter++;
|
||||||
|
prevDataSetPathName = str;
|
||||||
|
}
|
||||||
|
|
||||||
musrFT_getMetaInfo(startupParam.dataFln[i-msrHandler.size()], rawRunData, str);
|
musrFT_getMetaInfo(startupParam.dataFln[i-msrHandler.size()], rawRunData, str);
|
||||||
for (UInt_t j=0; j<startupParam.histo.size(); j++) {
|
for (UInt_t j=0; j<startupParam.histo.size(); j++) {
|
||||||
idx = startupParam.histo[j];
|
idx = startupParam.histo[j];
|
||||||
|
@ -552,6 +552,7 @@ void PGetMusrFTOptionsDialog::resetAll()
|
|||||||
fFourierRangeStart_lineEdit->setText("");
|
fFourierRangeStart_lineEdit->setText("");
|
||||||
fFourierRangeEnd_lineEdit->setText("");
|
fFourierRangeEnd_lineEdit->setText("");
|
||||||
fAveragedView_checkBox->setCheckState(Qt::Unchecked);
|
fAveragedView_checkBox->setCheckState(Qt::Unchecked);
|
||||||
|
fAveragePerDataSet_checkBox->setCheckState(Qt::Unchecked);
|
||||||
fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked);
|
fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked);
|
||||||
fFourierTitle_lineEdit->setText("");
|
fFourierTitle_lineEdit->setText("");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user