adoped to master branch
This commit is contained in:
@@ -99,7 +99,7 @@ AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@
|
||||
CLEANFILES = *Dict.cpp *Dict.h *~ core
|
||||
|
||||
%Dict.cpp %Dict.h: ../include/%.h ../include/%LinkDef.h
|
||||
@ROOTCINT@ -v -f $*Dict.cpp -c -p -I$(BOOST_INCLUDE) $(INCLUDES) $^
|
||||
@ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^
|
||||
|
||||
lib_LTLIBRARIES = libPUserFcnBase.la libPMusr.la
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3698,20 +3698,26 @@ Bool_t PMsrHandler::HandleFourierEntry(PMsrLines &lines)
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||
str = ostr->GetString();
|
||||
if (str.BeginsWith("par", TString::kIgnoreCase)) { // parameter value
|
||||
Int_t no = 0;
|
||||
if (FilterNumber(str, "par", 0, no)) {
|
||||
// check that the parameter is in range
|
||||
if ((Int_t)fParam.size() < no) {
|
||||
if (fFourierOnly) {
|
||||
cerr << endl << ">> PMsrHandler::HandleFourierEntry: **WARNING** Found phase parameter for Fourier only.";
|
||||
cerr << endl << ">> This is currently not supported. Will set the phase to 0." << endl;
|
||||
fourier.fPhase = 0.0;
|
||||
} else {
|
||||
Int_t no = 0;
|
||||
if (FilterNumber(str, "par", 0, no)) {
|
||||
// check that the parameter is in range
|
||||
if ((Int_t)fParam.size() < no) {
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
// keep the parameter number
|
||||
fourier.fPhaseParamNo = no;
|
||||
// get parameter value
|
||||
fourier.fPhase = fParam[no-1].fValue;
|
||||
} else {
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
// keep the parameter number
|
||||
fourier.fPhaseParamNo = no;
|
||||
// get parameter value
|
||||
fourier.fPhase = fParam[no-1].fValue;
|
||||
} else {
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
} else if (str.IsFloat()) { // phase value
|
||||
fourier.fPhase = str.Atof();
|
||||
|
||||
@@ -79,7 +79,7 @@ PPrepFourier::~PPrepFourier()
|
||||
*/
|
||||
void PPrepFourier::SetBkgRange(const Int_t *bkgRange)
|
||||
{
|
||||
int err=0;
|
||||
Int_t err=0;
|
||||
if (bkgRange[0] >= -1) {
|
||||
fBkgRange[0] = bkgRange[0];
|
||||
} else {
|
||||
@@ -125,7 +125,7 @@ void PPrepFourier::SetBkgRange(const Int_t *bkgRange)
|
||||
*/
|
||||
void PPrepFourier::SetBkg(PDoubleVector bkg)
|
||||
{
|
||||
for (unsigned int i=0; i<bkg.size(); i++)
|
||||
for (UInt_t i=0; i<bkg.size(); i++)
|
||||
fBkg.push_back(bkg[i]);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ void PPrepFourier::DoBkgCorrection()
|
||||
|
||||
if ((fBkgRange[0] != -1) && (fBkgRange[1] != -1)) { // background range is given
|
||||
// make sure that the bkg range is ok
|
||||
for (unsigned int i=0; i<fRawData.size(); i++) {
|
||||
for (UInt_t i=0; i<fRawData.size(); i++) {
|
||||
if ((fBkgRange[0] >= fRawData[i].rawData.size()) || (fBkgRange[1] >= fRawData[i].rawData.size())) {
|
||||
cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!";
|
||||
return;
|
||||
@@ -188,16 +188,16 @@ void PPrepFourier::DoBkgCorrection()
|
||||
}
|
||||
|
||||
Double_t bkg=0.0;
|
||||
for (unsigned int i=0; i<fRawData.size(); i++) {
|
||||
for (UInt_t i=0; i<fRawData.size(); i++) {
|
||||
// calculate the bkg for the given range
|
||||
for (int j=fBkgRange[0]; j<=fBkgRange[1]; j++) {
|
||||
for (Int_t j=fBkgRange[0]; j<=fBkgRange[1]; j++) {
|
||||
bkg += fRawData[i].rawData[j];
|
||||
}
|
||||
bkg /= (fBkgRange[1]-fBkgRange[0]+1);
|
||||
cout << "debug> background " << i << ": " << bkg << endl;
|
||||
cout << "info> background " << i << ": " << bkg << endl;
|
||||
|
||||
// correct data
|
||||
for (unsigned int j=0; j<fData[i].size(); j++)
|
||||
for (UInt_t j=0; j<fData[i].size(); j++)
|
||||
fData[i][j] -= bkg;
|
||||
}
|
||||
} else { // there might be an explicit background list
|
||||
@@ -211,8 +211,8 @@ void PPrepFourier::DoBkgCorrection()
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned int i=0; i<fData.size(); i++)
|
||||
for (unsigned int j=0; j<fData[i].size(); j++)
|
||||
for (UInt_t i=0; i<fData.size(); i++)
|
||||
for (UInt_t j=0; j<fData[i].size(); j++)
|
||||
fData[i][j] -= fBkg[i];
|
||||
}
|
||||
}
|
||||
@@ -235,10 +235,10 @@ void PPrepFourier::DoPacking()
|
||||
|
||||
PDoubleVector tmpData;
|
||||
Double_t dval = 0.0;
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
for (UInt_t i=0; i<fData.size(); i++) {
|
||||
tmpData.clear();
|
||||
dval = 0.0;
|
||||
for (unsigned int j=0; j<fData[i].size(); j++) {
|
||||
for (UInt_t j=0; j<fData[i].size(); j++) {
|
||||
if ((j % fPacking == 0) && (j != 0)) {
|
||||
tmpData.push_back(dval);
|
||||
dval = 0.0;
|
||||
@@ -271,9 +271,9 @@ void PPrepFourier::DoLifeTimeCorrection(Double_t fudge)
|
||||
|
||||
// calc exp(+t/tau)*N(t), where N(t) is already background corrected
|
||||
Double_t scale;
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
for (UInt_t i=0; i<fData.size(); i++) {
|
||||
scale = fRawData[i].timeResolution / PMUON_LIFETIME;
|
||||
for (unsigned int j=0; j<fData[i].size(); j++) {
|
||||
for (UInt_t j=0; j<fData[i].size(); j++) {
|
||||
fData[i][j] *= exp(j*scale);
|
||||
}
|
||||
}
|
||||
@@ -281,14 +281,14 @@ void PPrepFourier::DoLifeTimeCorrection(Double_t fudge)
|
||||
// calc N0
|
||||
Double_t dval;
|
||||
Double_t N0;
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
for (UInt_t i=0; i<fData.size(); i++) {
|
||||
dval = 0.0;
|
||||
for (unsigned int j=0; j<fData[i].size(); j++) {
|
||||
for (UInt_t j=0; j<fData[i].size(); j++) {
|
||||
dval += fData[i][j];
|
||||
}
|
||||
N0 = dval/fData[i].size();
|
||||
N0 *= fudge;
|
||||
for (unsigned int j=0; j<fData[i].size(); j++) {
|
||||
for (UInt_t j=0; j<fData[i].size(); j++) {
|
||||
fData[i][j] -= N0;
|
||||
fData[i][j] /= N0;
|
||||
}
|
||||
@@ -313,6 +313,24 @@ TString PPrepFourier::GetInfo(const UInt_t idx)
|
||||
return info;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetDataSetTag
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Returns the data set tag of the object
|
||||
*
|
||||
* \param idx index of the object
|
||||
*/
|
||||
Int_t PPrepFourier::GetDataSetTag(const UInt_t idx)
|
||||
{
|
||||
Int_t result = -1;
|
||||
|
||||
if (idx < fRawData.size())
|
||||
result = fRawData[idx].dataSetTag;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetData
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -337,7 +355,7 @@ vector<TH1F*> PPrepFourier::GetData()
|
||||
UInt_t startIdx;
|
||||
UInt_t endIdx;
|
||||
|
||||
for (unsigned int i=0; i<fData.size(); i++) {
|
||||
for (UInt_t i=0; i<fData.size(); i++) {
|
||||
name = TString::Format("histo%2d", i);
|
||||
dt = fRawData[i].timeResolution*fPacking;
|
||||
start = fRawData[i].timeRange[0];
|
||||
@@ -373,7 +391,7 @@ vector<TH1F*> PPrepFourier::GetData()
|
||||
}
|
||||
|
||||
data[i] = new TH1F(name.Data(), fRawData[i].info.Data(), size, start, end);
|
||||
for (unsigned int j=startIdx; j<endIdx; j++)
|
||||
for (UInt_t j=startIdx; j<endIdx; j++)
|
||||
data[i]->SetBinContent(j-startIdx+1, fData[i][j]);
|
||||
}
|
||||
|
||||
@@ -430,7 +448,7 @@ TH1F *PPrepFourier::GetData(const UInt_t idx)
|
||||
}
|
||||
|
||||
TH1F *data = new TH1F(name.Data(), fRawData[idx].info.Data(), size, start, end);
|
||||
for (unsigned int i=startIdx; i<endIdx; i++)
|
||||
for (UInt_t i=startIdx; i<endIdx; i++)
|
||||
data->SetBinContent(i-startIdx+1, fData[idx][i]);
|
||||
|
||||
return data;
|
||||
@@ -445,13 +463,13 @@ TH1F *PPrepFourier::GetData(const UInt_t idx)
|
||||
void PPrepFourier::InitData()
|
||||
{
|
||||
fData.resize(fRawData.size());
|
||||
unsigned int t0;
|
||||
for (unsigned int i=0; i<fRawData.size(); i++) {
|
||||
UInt_t t0;
|
||||
for (UInt_t i=0; i<fRawData.size(); i++) {
|
||||
if (fRawData[i].t0 >= 0)
|
||||
t0 = fRawData[i].t0;
|
||||
else
|
||||
t0 = 0;
|
||||
for (unsigned int j=t0; j<fRawData[i].rawData.size(); j++) {
|
||||
for (UInt_t j=t0; j<fRawData[i].rawData.size(); j++) {
|
||||
fData[i].push_back(fRawData[i].rawData[j]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,8 @@ void PRunDataHandler::ReadData()
|
||||
fAllDataAvailable = ReadRootFile();
|
||||
} else if ((fFileFormat == "NeXus") || (fFileFormat == "nexus")) {
|
||||
fAllDataAvailable = ReadNexusFile();
|
||||
} else if ((fFileFormat == "PsiBin") || (fFileFormat == "psibin")) {
|
||||
} else if ((fFileFormat == "PsiBin") || (fFileFormat == "psibin") ||
|
||||
(fFileFormat == "PsiMdu") || (fFileFormat == "psimdu")) {
|
||||
fAllDataAvailable = ReadPsiBinFile();
|
||||
} else if ((fFileFormat == "Mud") || (fFileFormat == "mud")) {
|
||||
fAllDataAvailable = ReadMudFile();
|
||||
@@ -5436,7 +5437,7 @@ Bool_t PRunDataHandler::WriteMudFile(TString fln)
|
||||
noOfEvents = 0;
|
||||
k = 0;
|
||||
for (UInt_t j=0; j<dataSet->GetData()->size(); j++) {
|
||||
if ((j != 0) && (j % fAny2ManyInfo->rebin == 0)) {
|
||||
if ((j > 0) && (j % fAny2ManyInfo->rebin == 0)) {
|
||||
data[k] = ival;
|
||||
noOfEvents += ival;
|
||||
k++;
|
||||
@@ -5621,7 +5622,7 @@ Bool_t PRunDataHandler::WriteAsciiFile(TString fln)
|
||||
}
|
||||
|
||||
for (UInt_t i=0; i<length; i++) {
|
||||
if ((i % fAny2ManyInfo->rebin) == 0) {
|
||||
if ((i > 0) && ((i % fAny2ManyInfo->rebin) == 0)) {
|
||||
cout << endl;
|
||||
for (UInt_t j=0; j<dataRebin.size(); j++) {
|
||||
cout.width(8);
|
||||
|
||||
Reference in New Issue
Block a user