diff --git a/src/classes/PFitter.cpp b/src/classes/PFitter.cpp index 6349c37a..b78c0b0a 100644 --- a/src/classes/PFitter.cpp +++ b/src/classes/PFitter.cpp @@ -65,7 +65,7 @@ using namespace std; * \param runListCollection * \param chisq_only */ -PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, bool chisq_only) : +PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only) : fChisqOnly(chisq_only), fRunInfo(runInfo) { fConverged = false; @@ -128,22 +128,22 @@ PFitter::~PFitter() *

* */ -bool PFitter::DoFit() +Bool_t PFitter::DoFit() { // feed minuit parameters SetParameters(); // check if only chisq/maxLH shall be calculated once if (fChisqOnly) { - std::vector param = fMnUserParams.Params(); - std::vector error = fMnUserParams.Errors(); - int usedParams = 0; - for (unsigned int i=0; i param = fMnUserParams.Params(); + std::vector error = fMnUserParams.Errors(); + Int_t usedParams = 0; + for (UInt_t i=0; iGetTotalNoOfFittedBins() - usedParams; - double val = (*fFitterFcn)(param); + Int_t ndf = fFitterFcn->GetTotalNoOfFittedBins() - usedParams; + Double_t val = (*fFitterFcn)(param); if (fUseChi2) { cout << endl << endl << ">> chisq = " << val << ", NDF = " << ndf << ", chisq/NDF = " << val/ndf; } else { // max. log likelihood @@ -159,32 +159,32 @@ bool PFitter::DoFit() else cout << endl << "Maximum Likelihood fit will be executed" << endl; - bool status = true; + Bool_t status = true; // init positive errors to default false, if minos is called, it will be set true there - for (unsigned int i=0; iSetMsrParamPosErrorPresent(i, false); } - for (unsigned int i=0; iSetMsrParamPosErrorPresent(i, true); } } break; case PMN_PLOT: - cout << endl << "**WARNING** from PFitter::DoFit() : the command PLOT is not yet implemented."; - cout << endl; + cerr << endl << "**WARNING** from PFitter::DoFit() : the command PLOT is not yet implemented."; + cerr << endl; break; case PMN_SAVE: status = ExecuteSave(); @@ -214,19 +214,20 @@ bool PFitter::DoFit() status = ExecuteSimplex(); break; case PMN_USER_COVARIANCE: - cout << endl << "**WARNING** from PFitter::DoFit() : the command USER_COVARIANCE is not yet implemented."; - cout << endl; + cerr << endl << "**WARNING** from PFitter::DoFit() : the command USER_COVARIANCE is not yet implemented."; + cerr << endl; break; case PMN_USER_PARAM_STATE: - cout << endl << "**WARNING** from PFitter::DoFit() : the command USER_PARAM_STATE is not yet implemented."; - cout << endl; + cerr << endl << "**WARNING** from PFitter::DoFit() : the command USER_PARAM_STATE is not yet implemented."; + cerr << endl; break; case PMN_PRINT: - cout << endl << "**WARNING** from PFitter::DoFit() : the command PRINT is not yet implemented."; - cout << endl; + cerr << endl << "**WARNING** from PFitter::DoFit() : the command PRINT is not yet implemented."; + cerr << endl; break; default: - cout << endl << "**PANIC ERROR**: PFitter::DoFit(): You should never have reached this point" << endl; + cerr << endl << "**PANIC ERROR**: PFitter::DoFit(): You should never have reached this point"; + cerr << endl; exit(0); break; } @@ -252,7 +253,7 @@ bool PFitter::DoFit() *

* */ -bool PFitter::CheckCommands() +Bool_t PFitter::CheckCommands() { fIsValid = true; @@ -328,11 +329,11 @@ bool PFitter::CheckCommands() } else if (it->fLine.Contains("PRINT")) { fCmdList.push_back(PMN_PRINT); } else { // unkown command - cout << endl << "FATAL ERROR:"; - cout << endl << "PFitter::CheckCommands(): In line " << it->fLineNo << " an unkown command is found:"; - cout << endl << " " << it->fLine.Data(); - cout << endl << "Will stop ..."; - cout << endl; + cerr << endl << "**FATAL ERROR**"; + cerr << endl << "PFitter::CheckCommands(): In line " << it->fLineNo << " an unkown command is found:"; + cerr << endl << " " << it->fLine.Data(); + cerr << endl << "Will stop ..."; + cerr << endl; fIsValid = false; } } @@ -347,9 +348,9 @@ bool PFitter::CheckCommands() *

* */ -bool PFitter::SetParameters() +Bool_t PFitter::SetParameters() { - for (unsigned int i=0; iParameterInUse(i) == 0) && (fParams[i].fStep != 0.0)) { fMnUserParams.Fix(i); // fix the unused parameter so that minuit will not vary it - cout << endl << "**WARNING** : Parameter No " << i+1 << " is not used at all, will fix it" << endl; + cerr << endl << "**WARNING** : Parameter No " << i+1 << " is not used at all, will fix it"; + cerr << endl; } } @@ -398,7 +400,7 @@ bool PFitter::SetParameters() *

* */ -bool PFitter::ExecuteHesse() +Bool_t PFitter::ExecuteHesse() { cout << "PFitter::ExecuteHesse(): will call hesse ..." << endl; @@ -410,14 +412,14 @@ bool PFitter::ExecuteHesse() ROOT::Minuit2::MnHesse hesse; // specify maximal number of function calls - unsigned int maxfcn = numeric_limits::max(); + UInt_t maxfcn = numeric_limits::max(); // call hesse ROOT::Minuit2::MnUserParameterState mnState = hesse((*fFitterFcn), fMnUserParams, maxfcn); if (!mnState.IsValid()) { - cout << endl << "**WARNING** PFitter::ExecuteHesse(): Hesse encountered some problems!"; - cout << endl; + cerr << endl << "**WARNING** PFitter::ExecuteHesse(): Hesse encountered some problems!"; + cerr << endl; return false; } @@ -428,7 +430,7 @@ bool PFitter::ExecuteHesse() fMnUserParamState = new ROOT::Minuit2::MnUserParameterState(mnState); // fill parabolic errors - for (unsigned int i=0; iSetMsrParamStep(i, mnState.Error(i)); fRunInfo->SetMsrParamPosErrorPresent(i, false); } @@ -443,7 +445,7 @@ bool PFitter::ExecuteHesse() *

* */ -bool PFitter::ExecuteMigrad() +Bool_t PFitter::ExecuteMigrad() { cout << "PFitter::ExecuteMigrad(): will call migrad ..." << endl; @@ -457,12 +459,13 @@ bool PFitter::ExecuteMigrad() // minimize // maxfcn is MINUIT2 Default maxfcn - unsigned int maxfcn = numeric_limits::max(); + UInt_t maxfcn = numeric_limits::max(); // tolerance = MINUIT2 Default tolerance - double tolerance = 0.1; + Double_t tolerance = 0.1; ROOT::Minuit2::FunctionMinimum min = migrad(maxfcn, tolerance); if (!min.IsValid()) { - cout << endl << "**WARNING**: PFitter::ExecuteMigrad(): Fit did not converge, sorry ..."; + cerr << endl << "**WARNING**: PFitter::ExecuteMigrad(): Fit did not converge, sorry ..."; + cerr << endl; fIsValid = false; return false; } @@ -480,17 +483,17 @@ bool PFitter::ExecuteMigrad() fMnUserParamState = new ROOT::Minuit2::MnUserParameterState(min.UserState()); // fill run info - for (unsigned int i=0; iSetMsrParamValue(i, min.UserState().Value(i)); fRunInfo->SetMsrParamStep(i, min.UserState().Error(i)); fRunInfo->SetMsrParamPosErrorPresent(i, false); } // handle statistics - double minVal = min.Fval(); - unsigned int ndf = fFitterFcn->GetTotalNoOfFittedBins(); + Double_t minVal = min.Fval(); + UInt_t ndf = fFitterFcn->GetTotalNoOfFittedBins(); // subtract number of varied parameters from total no of fitted bins -> ndf - for (unsigned int i=0; i * */ -bool PFitter::ExecuteMinimize() +Bool_t PFitter::ExecuteMinimize() { cout << "PFitter::ExecuteMinimize(): will call minimize ..." << endl; @@ -525,13 +528,14 @@ bool PFitter::ExecuteMinimize() // minimize // maxfcn is MINUIT2 Default maxfcn - unsigned int maxfcn = numeric_limits::max(); + UInt_t maxfcn = numeric_limits::max(); //cout << endl << "maxfcn=" << maxfcn << endl; // tolerance = MINUIT2 Default tolerance - double tolerance = 0.1; + Double_t tolerance = 0.1; ROOT::Minuit2::FunctionMinimum min = minimize(maxfcn, tolerance); if (!min.IsValid()) { - cout << endl << "**WARNING**: PFitter::ExecuteMinimize(): Fit did not converge, sorry ..."; + cerr << endl << "**WARNING**: PFitter::ExecuteMinimize(): Fit did not converge, sorry ..."; + cerr << endl; fIsValid = false; return false; } @@ -549,17 +553,17 @@ bool PFitter::ExecuteMinimize() fMnUserParamState = new ROOT::Minuit2::MnUserParameterState(min.UserState()); // fill run info - for (unsigned int i=0; iSetMsrParamValue(i, min.UserState().Value(i)); fRunInfo->SetMsrParamStep(i, min.UserState().Error(i)); fRunInfo->SetMsrParamPosErrorPresent(i, false); } // handle statistics - double minVal = min.Fval(); - unsigned int ndf = fFitterFcn->GetTotalNoOfFittedBins(); + Double_t minVal = min.Fval(); + UInt_t ndf = fFitterFcn->GetTotalNoOfFittedBins(); // subtract number of varied parameters from total no of fitted bins -> ndf - for (unsigned int i=0; i * */ -bool PFitter::ExecuteMinos() +Bool_t PFitter::ExecuteMinos() { cout << "PFitter::ExecuteMinos(): will call minos ..." << endl; // if already some minimization is done use the minuit2 output as input if (!fFcnMin) { - cout << endl << "**ERROR**: MINOS musn't be called before any minimization (MINIMIZE/MIGRAD/SIMPLEX) is done!!"; - cout << endl; + cerr << endl << "**ERROR**: MINOS musn't be called before any minimization (MINIMIZE/MIGRAD/SIMPLEX) is done!!"; + cerr << endl; return false; } // check if minimum was valid if (!fFcnMin->IsValid()) { - cout << endl << "**ERROR**: MINOS cannot started since the previous minimization failed :-("; - cout << endl; + cerr << endl << "**ERROR**: MINOS cannot started since the previous minimization failed :-("; + cerr << endl; return false; } @@ -603,7 +607,7 @@ bool PFitter::ExecuteMinos() // make minos analysis ROOT::Minuit2::MnMinos minos((*fFitterFcn), (*fFcnMin)); - for (unsigned int i=0; i * */ -bool PFitter::ExecuteSave() +Bool_t PFitter::ExecuteSave() { // if any minimization was done, otherwise get out immediately if (!fFcnMin) { @@ -643,8 +647,8 @@ bool PFitter::ExecuteSave() // check if the user parameter state is valid if (!mnState.IsValid()) { - cout << endl << "**WARNING** Minuit2 User Parameter State is not valid, i.e. nothing to be saved"; - cout << endl; + cerr << endl << "**WARNING** Minuit2 User Parameter State is not valid, i.e. nothing to be saved"; + cerr << endl; return false; } @@ -655,8 +659,8 @@ bool PFitter::ExecuteSave() // open minuit2 output file fout.open("MINUIT2.OUTPUT", iostream::out); if (!fout.is_open()) { - cout << endl << "**ERROR** PFitter::ExecuteSave() couldn't open MINUIT2.OUTPUT file"; - cout << endl; + cerr << endl << "**ERROR** PFitter::ExecuteSave() couldn't open MINUIT2.OUTPUT file"; + cerr << endl; return false; } @@ -678,14 +682,14 @@ bool PFitter::ExecuteSave() fout << endl << "-------------------------------------------------------------------------"; fout << endl << " Parabolic Minos"; fout << endl << " No Name Value Error Negative Positive Limits"; - for (unsigned int i=0; i 0.0) { @@ -778,7 +782,7 @@ bool PFitter::ExecuteSave() ROOT::Minuit2::MnUserCovariance cov = mnState.Covariance(); PIntVector parNo; fout << endl << " No Global "; - for (unsigned int i=0; iParameterInUse(i) > 0) { fout.setf(ios::left, ios::adjustfield); @@ -789,8 +793,8 @@ bool PFitter::ExecuteSave() } // check that there is a correspondens between minuit2 and musrfit book keeping if (parNo.size() != cov.Nrow()) { - cout << endl << "**SEVERE ERROR** in PFitter::ExecuteSave(): minuit2 and musrfit book keeping to not correspond! Unable to write correlation matrix."; - cout << endl; + cerr << endl << "**SEVERE ERROR** in PFitter::ExecuteSave(): minuit2 and musrfit book keeping to not correspond! Unable to write correlation matrix."; + cerr << endl; } else { // book keeping is OK TString title("Minuit2 Output Correlation Matrix for "); title += fRunInfo->GetFileName(); @@ -798,8 +802,8 @@ bool PFitter::ExecuteSave() title += dt.AsSQLString(); TCanvas *ccorr = new TCanvas("ccorr", "title", 500, 500); TH2D *hcorr = new TH2D("hcorr", title, cov.Nrow(), 0.0, cov.Nrow(), cov.Nrow(), 0.0, cov.Nrow()); - double dval; - for (unsigned int i=0; iFill((double)i,(double)i,1.0); + hcorr->Fill((Double_t)i,(Double_t)i,1.0); } else { // check that errors are none zero if (fMnUserParams.Error(parNo[i]) == 0.0) { - cout << endl << "**SEVERE ERROR** in PFitter::ExecuteSave(): parameter no " << parNo[i]+1 << " has an error == 0. Cannot correctly handle the correlation matrix."; - cout << endl; + cerr << endl << "**SEVERE ERROR** in PFitter::ExecuteSave(): parameter no " << parNo[i]+1 << " has an error == 0. Cannot correctly handle the correlation matrix."; + cerr << endl; dval = 0.0; } else if (fMnUserParams.Error(parNo[j]) == 0.0) { - cout << endl << "**SEVERE ERROR** in PFitter::ExecuteSave(): parameter no " << parNo[j]+1 << " has an error == 0. Cannot correctly handle the correlation matrix."; - cout << endl; + cerr << endl << "**SEVERE ERROR** in PFitter::ExecuteSave(): parameter no " << parNo[j]+1 << " has an error == 0. Cannot correctly handle the correlation matrix."; + cerr << endl; dval = 0.0; } else { dval = cov(i,j)/(fMnUserParams.Error(parNo[i])*fMnUserParams.Error(parNo[j])); } - hcorr->Fill((double)i,(double)j,dval); + hcorr->Fill((Double_t)i,(Double_t)j,dval); // handle precision, ugly but ... if (dval < 1.0e-2) { fout.precision(2); @@ -886,7 +890,7 @@ bool PFitter::ExecuteSave() *

* */ -bool PFitter::ExecuteSimplex() +Bool_t PFitter::ExecuteSimplex() { cout << "PFitter::ExecuteSimplex(): will call simplex ..." << endl; @@ -900,12 +904,13 @@ bool PFitter::ExecuteSimplex() // minimize // maxfcn is 10*MINUIT2 Default maxfcn - unsigned int maxfcn = numeric_limits::max(); + UInt_t maxfcn = numeric_limits::max(); // tolerance = MINUIT2 Default tolerance - double tolerance = 0.1; + Double_t tolerance = 0.1; ROOT::Minuit2::FunctionMinimum min = simplex(maxfcn, tolerance); if (!min.IsValid()) { - cout << endl << "**WARNING**: PFitter::ExecuteSimplex(): Fit did not converge, sorry ..."; + cerr << endl << "**WARNING**: PFitter::ExecuteSimplex(): Fit did not converge, sorry ..."; + cerr << endl; fIsValid = false; return false; } @@ -917,17 +922,17 @@ bool PFitter::ExecuteSimplex() fFcnMin = new ROOT::Minuit2::FunctionMinimum(min); // fill run info - for (unsigned int i=0; iSetMsrParamValue(i, min.UserState().Value(i)); fRunInfo->SetMsrParamStep(i, min.UserState().Error(i)); fRunInfo->SetMsrParamPosErrorPresent(i, false); } // handle statistics - double minVal = min.Fval(); - unsigned int ndf = fFitterFcn->GetTotalNoOfFittedBins(); + Double_t minVal = min.Fval(); + UInt_t ndf = fFitterFcn->GetTotalNoOfFittedBins(); // subtract number of varied parameters from total no of fitted bins -> ndf - for (unsigned int i=0; iGetNoOfAsymmetry() > 0) || (fRunListCollection->GetNoOfRRF() > 0) || (fRunListCollection->GetNoOfNonMusr() > 0)) { - cout << endl << "**WARNING**: Maximum Log Likelihood Fit is only implemented for Single Histogram Fit"; - cout << endl << " Will fall back to Chi Square Fit."; - cout << endl; + cerr << endl << "**WARNING**: Maximum Log Likelihood Fit is only implemented for Single Histogram Fit"; + cerr << endl << " Will fall back to Chi Square Fit."; + cerr << endl; } } } @@ -84,9 +84,9 @@ PFitterFcn::~PFitterFcn() * * \param par */ -double PFitterFcn::operator()(const std::vector& par) const +Double_t PFitterFcn::operator()(const std::vector& par) const { - double value = 0.0; + Double_t value = 0.0; if (fUseChi2) { // chi square value += fRunListCollection->GetSingleHistoChisq(par); @@ -101,7 +101,7 @@ double PFitterFcn::operator()(const std::vector& par) const } // cout << endl; -// for (unsigned int i=0; i> fEndTime = " << fEndTime; } // swap start and end time if necessary if (fStartTime > fEndTime) { - double keep = fStartTime; + Double_t keep = fStartTime; fStartTime = fEndTime; fEndTime = keep; } @@ -98,15 +98,15 @@ for (unsigned int i=0; i<10; i++) { //cout << endl << "start time = " << fStartTime << endl; // calculate start and end bin - unsigned int start = (unsigned int)(fStartTime/fTimeResolution); - unsigned int end = (unsigned int)(fEndTime/fTimeResolution); + UInt_t start = (UInt_t)(fStartTime/fTimeResolution); + UInt_t end = (UInt_t)(fEndTime/fTimeResolution); fNoOfData = end-start; //cout << endl << ">> fNoOfData = " << fNoOfData; // check if zero padding is whished if (fZeroPaddingPower > 0) { - unsigned int noOfBins = static_cast(pow(2.0, static_cast(fZeroPaddingPower))); + UInt_t noOfBins = static_cast(pow(2.0, static_cast(fZeroPaddingPower))); if (noOfBins > fNoOfData) fNoOfBins = noOfBins; else @@ -118,7 +118,7 @@ for (unsigned int i=0; i<10; i++) { //cout << endl << ">> fNoOfBins = " << fNoOfBins; // calculate fourier resolution - double resolution = 1.0/(fTimeResolution*fNoOfBins); // in MHz + Double_t resolution = 1.0/(fTimeResolution*fNoOfBins); // in MHz switch (fUnitTag) { case FOURIER_UNIT_FIELD: fResolution = resolution/F_GAMMA_BAR_MUON; @@ -186,7 +186,7 @@ PFourier::~PFourier() * * \param apodizationTag 0=no apod., 1=weak apod., 2=medium apod., 3=strong apod. */ -void PFourier::Transform(unsigned int apodizationTag) +void PFourier::Transform(UInt_t apodizationTag) { if (!fValid) return; @@ -196,8 +196,8 @@ void PFourier::Transform(unsigned int apodizationTag) fftw_execute(fFFTwPlan); // correct the phase for tstart != 0.0 - double phase, re, im; - for (unsigned int i=0; iGetName()); snprintf(title, sizeof(title), "%s_Fourier_Re", fData->GetTitle()); - TH1F *realFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (double)fNoOfBins/2.0*fResolution+fResolution/2.0); + TH1F *realFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (Double_t)fNoOfBins/2.0*fResolution+fResolution/2.0); if (realFourier == 0) { fValid = false; - cout << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl; + cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl; return 0; } // fill realFourier vector - for (unsigned int i=0; iSetBinContent(i+1, scale*fOut[i][0]); realFourier->SetBinError(i+1, 0.0); } @@ -250,27 +250,27 @@ TH1F* PFourier::GetRealFourier(const double scale) * * \param scale */ -TH1F* PFourier::GetImaginaryFourier(const double scale) +TH1F* PFourier::GetImaginaryFourier(const Double_t scale) { // check if valid flag is set if (!fValid) return 0; // invoke imaginaryFourier - char name[256]; - char title[256]; + Char_t name[256]; + Char_t title[256]; snprintf(name, sizeof(name), "%s_Fourier_Im", fData->GetName()); snprintf(title, sizeof(title), "%s_Fourier_Im", fData->GetTitle()); - TH1F* imaginaryFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (double)fNoOfBins/2.0*fResolution+fResolution/2.0); + TH1F* imaginaryFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (Double_t)fNoOfBins/2.0*fResolution+fResolution/2.0); if (imaginaryFourier == 0) { fValid = false; - cout << endl << "**SEVERE ERROR** couldn't allocate memory for the imaginary part of the Fourier transform." << endl; + cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the imaginary part of the Fourier transform." << endl; return 0; } // fill imaginaryFourier vector - for (unsigned int i=0; iSetBinContent(i+1, scale*fOut[i][1]); imaginaryFourier->SetBinError(i+1, 0.0); } @@ -286,27 +286,27 @@ TH1F* PFourier::GetImaginaryFourier(const double scale) * * \param scale */ -TH1F* PFourier::GetPowerFourier(const double scale) +TH1F* PFourier::GetPowerFourier(const Double_t scale) { // check if valid flag is set if (!fValid) return 0; // invoke powerFourier - char name[256]; - char title[256]; + Char_t name[256]; + Char_t title[256]; snprintf(name, sizeof(name), "%s_Fourier_Pwr", fData->GetName()); snprintf(title, sizeof(title), "%s_Fourier_Pwr", fData->GetTitle()); - TH1F* pwrFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (double)fNoOfBins/2.0*fResolution+fResolution/2.0); + TH1F* pwrFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (Double_t)fNoOfBins/2.0*fResolution+fResolution/2.0); if (pwrFourier == 0) { fValid = false; - cout << endl << "**SEVERE ERROR** couldn't allocate memory for the power part of the Fourier transform." << endl; + cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the power part of the Fourier transform." << endl; return 0; } // fill powerFourier vector - for (unsigned int i=0; iSetBinContent(i+1, scale*sqrt(fOut[i][0]*fOut[i][0]+fOut[i][1]*fOut[i][1])); pwrFourier->SetBinError(i+1, 0.0); } @@ -322,28 +322,28 @@ TH1F* PFourier::GetPowerFourier(const double scale) * * \param scale */ -TH1F* PFourier::GetPhaseFourier(const double scale) +TH1F* PFourier::GetPhaseFourier(const Double_t scale) { // check if valid flag is set if (!fValid) return 0; // invoke phaseFourier - char name[256]; - char title[256]; + Char_t name[256]; + Char_t title[256]; snprintf(name, sizeof(name), "%s_Fourier_Phase", fData->GetName()); snprintf(title, sizeof(title), "%s_Fourier_Phase", fData->GetTitle()); - TH1F* phaseFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (double)fNoOfBins/2.0*fResolution+fResolution/2.0); + TH1F* phaseFourier = new TH1F(name, title, fNoOfBins/2, -fResolution/2.0, (Double_t)fNoOfBins/2.0*fResolution+fResolution/2.0); if (phaseFourier == 0) { fValid = false; - cout << endl << "**SEVERE ERROR** couldn't allocate memory for the phase part of the Fourier transform." << endl; + cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the phase part of the Fourier transform." << endl; return 0; } // fill phaseFourier vector - double value = 0.0; - for (unsigned int i=0; i= 0.0) @@ -374,12 +374,12 @@ TH1F* PFourier::GetPhaseFourier(const double scale) *

* */ -void PFourier::PrepareFFTwInputData(unsigned int apodizationTag) +void PFourier::PrepareFFTwInputData(UInt_t apodizationTag) { // 1st find t==0. fData start at times t<0!! - int t0bin = -1; + Int_t t0bin = -1; //cout << ">> PFourier::PrepareFFTwInputData: fData=" << fData << ", fData->GetNbinsX() = " << fData->GetNbinsX(); - for (int i=1; iGetNbinsX(); i++) { + for (Int_t i=1; iGetNbinsX(); i++) { //if (i<20) cout << endl << ">> PFourier::PrepareFFTwInputData: i=" << i << ", fData->GetBinCenter(i)=" << fData->GetBinCenter(i); if (fData->GetBinCenter(i) >= 0.0) { t0bin = i; @@ -389,13 +389,13 @@ void PFourier::PrepareFFTwInputData(unsigned int apodizationTag) //cout << endl << "t0bin = " << t0bin << endl; // 2nd fill fIn - unsigned int start = (unsigned int)(fStartTime/fTimeResolution) + t0bin; + UInt_t start = (UInt_t)(fStartTime/fTimeResolution) + t0bin; //cout << endl << "start = " << start << endl; - for (unsigned int i=0; iGetBinContent(i+start); fIn[i][1] = 0.0; } - for (unsigned int i=fNoOfData; i> PFourier::PrepareFFTwInputData: fNoOfData = " << fNoOfData << ", fNoOfBins = " << fNoOfBins << endl; -for (unsigned int i=0; i<10; i++) { +for (UInt_t i=0; i<10; i++) { cout << endl << ">> PFourier::PrepareFFTwInputData: " << i << ": fIn[i][0] = " << fIn[i][0]; } cout << endl; @@ -421,14 +421,14 @@ cout << endl; * * \param apodizationTag */ -void PFourier::ApodizeData(int apodizationTag) { +void PFourier::ApodizeData(Int_t apodizationTag) { - const double cweak[3] = { 0.384093, -0.087577, 0.703484 }; - const double cmedium[3] = { 0.152442, -0.136176, 0.983734 }; - const double cstrong[3] = { 0.045335, 0.554883, 0.399782 }; + const Double_t cweak[3] = { 0.384093, -0.087577, 0.703484 }; + const Double_t cmedium[3] = { 0.152442, -0.136176, 0.983734 }; + const Double_t cstrong[3] = { 0.045335, 0.554883, 0.399782 }; - double c[5]; - for (unsigned int i=0; i<5; i++) { + Double_t c[5]; + for (UInt_t i=0; i<5; i++) { c[i] = 0.0; } @@ -454,15 +454,15 @@ void PFourier::ApodizeData(int apodizationTag) { c[4] = cstrong[2]; break; default: - cout << endl << ">> **ERROR** User Apodization tag " << apodizationTag << " unknown, sorry ..." << endl; + cerr << endl << ">> **ERROR** User Apodization tag " << apodizationTag << " unknown, sorry ..." << endl; break; } - double q; - for (unsigned int i=0; i> realID: value = " << dvalue; @@ -216,7 +216,8 @@ void PFunction::FillFuncEvalTree(iter_t const& i, PFuncTreeNode &node) else if (!strcmp(str.c_str(), "EXP")) node.fFunctionTag = FUN_EXP; else { - cout << endl << "**PANIC ERROR**: function " << str << " doesn't exist, but you never should have reached this point!"; + cerr << endl << "**PANIC ERROR**: function " << str << " doesn't exist, but you never should have reached this point!"; + cerr << endl; assert(0); } // add node @@ -286,7 +287,7 @@ else * \param mapSize * \param paramSize */ -bool PFunction::CheckMapAndParamRange(unsigned int mapSize, unsigned int paramSize) +Bool_t PFunction::CheckMapAndParamRange(UInt_t mapSize, UInt_t paramSize) { return FindAndCheckMapAndParamRange(fFunc, mapSize, paramSize); } @@ -301,7 +302,7 @@ bool PFunction::CheckMapAndParamRange(unsigned int mapSize, unsigned int paramSi * \param mapSize * \param paramSize */ -bool PFunction::FindAndCheckMapAndParamRange(PFuncTreeNode &node, unsigned int mapSize, unsigned int paramSize) +Bool_t PFunction::FindAndCheckMapAndParamRange(PFuncTreeNode &node, UInt_t mapSize, UInt_t paramSize) { if (node.fID == PFunctionGrammar::realID) { return true; @@ -310,12 +311,12 @@ bool PFunction::FindAndCheckMapAndParamRange(PFuncTreeNode &node, unsigned int m } else if (node.fID == PFunctionGrammar::constGammaMuID) { return true; } else if (node.fID == PFunctionGrammar::parameterID) { - if (node.fIvalue <= (int) paramSize) + if (node.fIvalue <= (Int_t) paramSize) return true; else return false; } else if (node.fID == PFunctionGrammar::mapID) { - if (node.fIvalue <= (int) mapSize) + if (node.fIvalue <= (Int_t) mapSize) return true; else return false; @@ -334,7 +335,8 @@ bool PFunction::FindAndCheckMapAndParamRange(PFuncTreeNode &node, unsigned int m else return false; } else { - cout << endl << "**PANIC ERROR**: PFunction::FindAndCheckMapAndParamRange: you never should have reached this point!" << endl; + cerr << endl << "**PANIC ERROR**: PFunction::FindAndCheckMapAndParamRange: you never should have reached this point!"; + cerr << endl; assert(0); } return true; @@ -347,7 +349,7 @@ bool PFunction::FindAndCheckMapAndParamRange(PFuncTreeNode &node, unsigned int m *

* */ -double PFunction::Eval(vector param) +Double_t PFunction::Eval(vector param) { fParam = param; @@ -362,7 +364,7 @@ double PFunction::Eval(vector param) * * \param node */ -double PFunction::EvalNode(PFuncTreeNode &node) +Double_t PFunction::EvalNode(PFuncTreeNode &node) { if (node.fID == PFunctionGrammar::realID) { return node.fDvalue; @@ -409,7 +411,8 @@ double PFunction::EvalNode(PFuncTreeNode &node) } else if (node.fFunctionTag == FUN_EXP) { return exp(EvalNode(node.children[0])); } else { - cout << endl << "**PANIC ERROR**: PFunction::EvalNode: node.fID == PFunctionGrammar::functionID: you never should have reached this point!" << endl; + cerr << endl << "**PANIC ERROR**: PFunction::EvalNode: node.fID == PFunctionGrammar::functionID: you never should have reached this point!"; + cerr << endl; assert(0); } } else if (node.fID == PFunctionGrammar::factorID) { @@ -418,9 +421,10 @@ double PFunction::EvalNode(PFuncTreeNode &node) if (node.fOperatorTag == OP_MUL) { return EvalNode(node.children[0]) * EvalNode(node.children[1]); } else { - double denominator = EvalNode(node.children[1]); + Double_t denominator = EvalNode(node.children[1]); if (denominator == 0.0) { - cout << endl << "**PANIC ERROR**: PFunction::EvalNode: division by 0.0" << endl; + cerr << endl << "**PANIC ERROR**: PFunction::EvalNode: division by 0.0"; + cerr << endl; assert(0); } return EvalNode(node.children[0]) / denominator; @@ -432,7 +436,8 @@ double PFunction::EvalNode(PFuncTreeNode &node) return EvalNode(node.children[0]) - EvalNode(node.children[1]); } } else { - cout << endl << "**PANIC ERROR**: PFunction::EvalNode: you never should have reached this point!" << endl; + cerr << endl << "**PANIC ERROR**: PFunction::EvalNode: you never should have reached this point!"; + cerr << endl; assert(0); } return 0.0; @@ -462,7 +467,7 @@ void PFunction::CleanupFuncEvalTree() void PFunction::CleanupNode(PFuncTreeNode &node) { if (node.children.size() != 0) { - for (unsigned int i=0; i info) */ void PFunction::EvalTreeForStringExpression(iter_t const& i) { - static int termOp = 0; + static Int_t termOp = 0; if (i->value.id() == PFunctionGrammar::realID) { assert(i->children.size() == 0); diff --git a/src/classes/PFunctionHandler.cpp b/src/classes/PFunctionHandler.cpp index 7d511969..67892942 100644 --- a/src/classes/PFunctionHandler.cpp +++ b/src/classes/PFunctionHandler.cpp @@ -72,16 +72,16 @@ PFunctionHandler::~PFunctionHandler() *

* */ -bool PFunctionHandler::DoParse() +Bool_t PFunctionHandler::DoParse() { // cout << endl << "in PFunctionHandler::DoParse() ..."; - bool success = true; + Bool_t success = true; PFunctionGrammar function; TString line; // feed the function block into the parser. Start with i=1, since i=0 is FUNCTIONS - for (unsigned int i=1; i map, vector param) * * \param idx */ -int PFunctionHandler::GetFuncNo(unsigned int idx) +Int_t PFunctionHandler::GetFuncNo(UInt_t idx) { if (idx > fFuncs.size()) return -1; @@ -194,11 +196,11 @@ int PFunctionHandler::GetFuncNo(unsigned int idx) * * \param funcNo */ -int PFunctionHandler::GetFuncIndex(int funcNo) +Int_t PFunctionHandler::GetFuncIndex(Int_t funcNo) { - int index = -1; + Int_t index = -1; - for (unsigned int i=0; i fFuncs.size()) return 0; diff --git a/src/classes/PMsr2Data.cpp b/src/classes/PMsr2Data.cpp index 7372aa03..ba2982fa 100644 --- a/src/classes/PMsr2Data.cpp +++ b/src/classes/PMsr2Data.cpp @@ -184,8 +184,8 @@ int PMsr2Data::SetRunNumbers(const string &runListFile) ifstream in(runListFile.c_str()); if (!in) { - cout << endl; - cout << ">> msr2data: **ERROR** The runlist file " << runListFile << " cannot be opened! Please check!" << endl; + cerr << endl << ">> msr2data: **ERROR** The runlist file " << runListFile << " cannot be opened! Please check!"; + cerr << endl; return -1; } @@ -211,8 +211,8 @@ int PMsr2Data::SetRunNumbers(const string &runListFile) strLine.str(splitVec[0]); strLine >> indvar; // "RUN" if (indvar.compare("RUN")) { - cout << endl; - cout << ">> msr2data: **ERROR** The format of the runlist file " << runListFile << " is not correct! Please check!" << endl; + cerr << endl << ">> msr2data: **ERROR** The format of the runlist file " << runListFile << " is not correct! Please check!"; + cerr << endl; } while (strLine >> indvar) fIndVar.push_back(indvar); @@ -251,7 +251,7 @@ int PMsr2Data::ParseXmlStartupFile() status = fSaxParser->ParseFile(startup_path_name.c_str()); // check for parse errors if (status) { // error - cout << endl << ">> msr2data: **WARNING** reading/parsing musrfit_startup.xml." << endl; + cerr << endl << ">> msr2data: **WARNING** reading/parsing musrfit_startup.xml." << endl; // clean up if (fSaxParser) { delete fSaxParser; @@ -277,13 +277,13 @@ int PMsr2Data::ReadMsrFile(const string &infile) if (status != PMUSR_SUCCESS) { switch (status) { case PMUSR_MSR_FILE_NOT_FOUND: - cout << endl << ">> msr2data: **ERROR** Could not find " << infile << endl; + cerr << endl << ">> msr2data: **ERROR** Could not find " << infile << endl; break; case PMUSR_MSR_SYNTAX_ERROR: - cout << endl << ">> msr2data: **SYNTAX ERROR** in file " << infile << ", full stop here." << endl; + cerr << endl << ">> msr2data: **SYNTAX ERROR** in file " << infile << ", full stop here." << endl; break; default: - cout << endl << ">> msr2data: **UNKOWN ERROR** when trying to read the msr-file" << endl; + cerr << endl << ">> msr2data: **UNKOWN ERROR** when trying to read the msr-file" << endl; break; } } @@ -303,7 +303,7 @@ bool PMsr2Data::ReadRunDataFile() bool success = fDataHandler->IsAllDataAvailable(); if (!success) { - cout << endl << ">> msr2data: **WARNING** Could not read all data files, will continue without the data file information..." << endl; + cerr << endl << ">> msr2data: **WARNING** Could not read all data files, will continue without the data file information..." << endl; delete fDataHandler; fDataHandler = 0; } @@ -328,16 +328,16 @@ bool PMsr2Data::PrepareNewInputFile(unsigned int tempRun) const strInfile << tempRun << fFileExtension << ".msr"; ifstream in(strInfile.str().c_str()); if (!in) { - cout << endl; - cout << ">> msr2data: **ERROR** The template msr-file " << strInfile.str() << " cannot be opened! Please check!" << endl; + cerr << endl << ">> msr2data: **ERROR** The template msr-file " << strInfile.str() << " cannot be opened! Please check!"; + cerr << endl; return false; } ostringstream strOutfile; strOutfile << *fRunVectorIter << fFileExtension << ".msr"; ofstream out(strOutfile.str().c_str()); if (!out) { - cout << endl; - cout << ">> msr2data: **ERROR** The new msr file " << strOutfile.str() << " cannot be opened! Please check!" << endl; + cerr << endl << ">> msr2data: **ERROR** The new msr file " << strOutfile.str() << " cannot be opened! Please check!"; + cerr << endl; return false; } @@ -378,9 +378,9 @@ bool PMsr2Data::PrepareNewInputFile(unsigned int tempRun) const if ( loc != string::npos ) { line.replace(loc, N, newRunNumber.str()); } else { - cout << endl; - cout << ">> msr2data: **WARNING** The template run file number does not match the \"file index\"" << endl; - cout << ">> msr2data: **WARNING** Unexpected things will happen... (for sure)" << endl; + cerr << endl << ">> msr2data: **WARNING** The template run file number does not match the \"file index\""; + cerr << endl << ">> msr2data: **WARNING** Unexpected things will happen... (for sure)"; + cerr << endl; } } out << line << endl; @@ -494,9 +494,9 @@ void PMsr2Data::WriteOutput(const string &outfile, bool db, bool withHeader) con strLine.str(splitVec[0]); strLine >> runNo; if (runNo != *fRunVectorIter) { - cout << endl; - cout << ">> msr2data: **ERROR** The run number in the runlist file does not match the one which should be processed..." << endl; - cout << ">> msr2data: **ERROR** Something is very strange... Please report this bug!" << endl; + cerr << endl << ">> msr2data: **ERROR** The run number in the runlist file does not match the one which should be processed..."; + cerr << endl << ">> msr2data: **ERROR** Something is very strange... Please report this bug!"; + cerr << endl; fRunVectorIter = fRunVector.end(); return; } @@ -504,9 +504,9 @@ void PMsr2Data::WriteOutput(const string &outfile, bool db, bool withHeader) con indVarValues.push_back(val); } if (indVarValues.size() != fIndVar.size()) { - cout << endl; - cout << ">> msr2data: **ERROR** The number of data entries in the runlist file for the run number " << runNo << endl; - cout << ">> msr2data: **ERROR** does not match the number of labels given in the RUN-line! Please check the file!" << endl; + cerr << endl << ">> msr2data: **ERROR** The number of data entries in the runlist file for the run number " << runNo; + cerr << endl << ">> msr2data: **ERROR** does not match the number of labels given in the RUN-line! Please check the file!"; + cerr << endl; fRunVectorIter = fRunVector.end(); return; } @@ -518,9 +518,9 @@ void PMsr2Data::WriteOutput(const string &outfile, bool db, bool withHeader) con // The RUNLIST file stream and the run vector iterator might get out of synchronization, if the following check is placed before the above block... PMsrStatisticStructure *msrStatistic(fMsrHandler->GetMsrStatistic()); if (!msrStatistic->fValid) { - cout << endl; - cout << ">> msr2data: **WARNING** The fit of run " << *fRunVectorIter << " has not converged!" << endl; - cout << ">> msr2data: **WARNING** Its parameter data have not been appended to the output file " << outfile << endl; + cerr << endl << ">> msr2data: **WARNING** The fit of run " << *fRunVectorIter << " has not converged!"; + cerr << endl << ">> msr2data: **WARNING** Its parameter data have not been appended to the output file " << outfile; + cerr << endl; fRunVectorIter++; delete fMsrHandler; @@ -545,8 +545,8 @@ void PMsr2Data::WriteOutput(const string &outfile, bool db, bool withHeader) con ofstream outFile(outfile.c_str(), ios::app); if (!outFile) { - cout << endl; - cout << ">> msr2data: The output file " << outfile << " cannot be opened! Please check!" << endl; + cerr << endl << ">> msr2data: **ERROR** The output file " << outfile << " cannot be opened! Please check!"; + cerr << endl; fRunVectorIter = fRunVector.end(); return; } diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index de19c0bf..06d0273b 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -52,7 +52,7 @@ using namespace std; * * \param fileName */ -PMsrHandler::PMsrHandler(const char *fileName) : fFileName(fileName) +PMsrHandler::PMsrHandler(const Char_t *fileName) : fFileName(fileName) { // init variables fMsrBlockCounter = 0; @@ -90,7 +90,7 @@ PMsrHandler::~PMsrHandler() fParam.clear(); fTheory.clear(); fFunctions.clear(); - for (unsigned int i=0; i> PMsrHandler::ReadMsrFile: **SEVERE ERROR** parameter name " << fParam[parX].fName.Data() << " is identical for parameter no " << fParam[parX].fNo << " and " << fParam[parY].fNo << "!"; - cout << endl << "Needs to be fixed first!"; + cerr << endl << ">> PMsrHandler::ReadMsrFile: **SEVERE ERROR** parameter name " << fParam[parX].fName.Data() << " is identical for parameter no " << fParam[parX].fNo << " and " << fParam[parY].fNo << "!"; + cerr << endl << "Needs to be fixed first!"; + cerr << endl; result = PMUSR_MSR_SYNTAX_ERROR; } } @@ -317,20 +318,20 @@ cout << endl; /** *

*/ -int PMsrHandler::WriteMsrLogFile(const bool messages) +Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) { - const unsigned int prec = 6; // output precision for float/doubles + const UInt_t prec = 6; // output precision for float/doubles - int tag, lineNo = 0, number; - int runNo = -1, addRunNo = 0; - int plotNo = -1; + Int_t tag, lineNo = 0, number; + Int_t runNo = -1, addRunNo = 0; + Int_t plotNo = -1; string line; TString str, sstr; TObjArray *tokens = 0; TObjString *ostr = 0; - bool found = false; - bool statisticBlockFound = false; - bool partialStatisticBlockFound = true; + Bool_t found = false; + Bool_t statisticBlockFound = false; + Bool_t partialStatisticBlockFound = true; // construct log file name // first find the last '.' in the filename @@ -418,7 +419,7 @@ int PMsrHandler::WriteMsrLogFile(const bool messages) number = sstr.Atoi(); number--; // make sure number makes sense - assert ((number >= 0) && (number < (int)fParam.size())); + assert ((number >= 0) && (number < (Int_t)fParam.size())); // parameter no fout.width(9); fout << right << fParam[number].fNo; @@ -474,7 +475,7 @@ int PMsrHandler::WriteMsrLogFile(const bool messages) break; case MSR_TAG_THEORY: found = false; - for (unsigned int i=0; i fParam.size()) { - cout << endl << "PMsrHandler::SetMsrParamValue(): i = " << i << " is larger than the number of parameters " << fParam.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrParamValue(): **ERROR** i = " << i << " is larger than the number of parameters " << fParam.size(); + cerr << endl; return false; } @@ -997,11 +998,11 @@ bool PMsrHandler::SetMsrParamValue(unsigned int i, double value) * \param i * \param value */ -bool PMsrHandler::SetMsrParamStep(unsigned int i, double value) +Bool_t PMsrHandler::SetMsrParamStep(UInt_t i, Double_t value) { if (i > fParam.size()) { - cout << endl << "PMsrHandler::SetMsrParamValue(): i = " << i << " is larger than the number of parameters " << fParam.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrParamValue(): **ERROR** i = " << i << " is larger than the number of parameters " << fParam.size(); + cerr << endl; return false; } @@ -1019,11 +1020,11 @@ bool PMsrHandler::SetMsrParamStep(unsigned int i, double value) * \param i * \param value */ -bool PMsrHandler::SetMsrParamPosErrorPresent(unsigned int i, bool value) +Bool_t PMsrHandler::SetMsrParamPosErrorPresent(UInt_t i, Bool_t value) { if (i > fParam.size()) { - cout << endl << "PMsrHandler::SetMsrParamPosErrorPresent(): i = " << i << " is larger than the number of parameters " << fParam.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrParamPosErrorPresent(): **ERROR** i = " << i << " is larger than the number of parameters " << fParam.size(); + cerr << endl; return false; } @@ -1041,11 +1042,11 @@ bool PMsrHandler::SetMsrParamPosErrorPresent(unsigned int i, bool value) * \param i * \param value */ -bool PMsrHandler::SetMsrParamPosError(unsigned int i, double value) +Bool_t PMsrHandler::SetMsrParamPosError(UInt_t i, Double_t value) { if (i > fParam.size()) { - cout << endl << "PMsrHandler::SetMsrParamPosError(): i = " << i << " is larger than the number of parameters " << fParam.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrParamPosError(): **ERROR** i = " << i << " is larger than the number of parameters " << fParam.size(); + cerr << endl; return false; } @@ -1065,17 +1066,17 @@ bool PMsrHandler::SetMsrParamPosError(unsigned int i, double value) * \param idx * \param bin */ -void PMsrHandler::SetMsrT0Entry(unsigned int runNo, unsigned int idx, int bin) +void PMsrHandler::SetMsrT0Entry(UInt_t runNo, UInt_t idx, Int_t bin) { if ((runNo < 0) || (runNo > fRuns.size())) { // error - cout << endl << "**ERROR** in PMsrHandler::SetMsrT0Entry: runNo = " << runNo << ", is out of valid range 0.." << fRuns.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrT0Entry: **ERROR** runNo = " << runNo << ", is out of valid range 0.." << fRuns.size(); + cerr << endl; return; } if ((idx < 0) || (idx > fRuns[runNo].fT0.size())) { // error - cout << endl << "**ERROR** in PMsrHandler::SetMsrT0Entry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fT0.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrT0Entry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fT0.size(); + cerr << endl; return; } @@ -1092,17 +1093,17 @@ void PMsrHandler::SetMsrT0Entry(unsigned int runNo, unsigned int idx, int bin) * \param idx * \param bin */ -void PMsrHandler::SetMsrDataRangeEntry(unsigned int runNo, unsigned int idx, int bin) +void PMsrHandler::SetMsrDataRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) { if ((runNo < 0) || (runNo > fRuns.size())) { // error - cout << endl << "**ERROR** in PMsrHandler::SetMsrDataRangeEntry: runNo = " << runNo << ", is out of valid range 0.." << fRuns.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrDataRangeEntry: **ERROR** runNo = " << runNo << ", is out of valid range 0.." << fRuns.size(); + cerr << endl; return; } if ((idx < 0) || (idx > fRuns[runNo].fDataRange.size())) { // error - cout << endl << "**ERROR** in PMsrHandler::SetMsrDataRangeEntry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fDataRange.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrDataRangeEntry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fDataRange.size(); + cerr << endl; return; } @@ -1119,17 +1120,17 @@ void PMsrHandler::SetMsrDataRangeEntry(unsigned int runNo, unsigned int idx, int * \param idx * \param bin */ -void PMsrHandler::SetMsrBkgRangeEntry(unsigned int runNo, unsigned int idx, int bin) +void PMsrHandler::SetMsrBkgRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) { if ((runNo < 0) || (runNo > fRuns.size())) { // error - cout << endl << "**ERROR** in PMsrHandler::SetMsrBkgRangeEntry: runNo = " << runNo << ", is out of valid range 0.." << fRuns.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrBkgRangeEntry: **ERROR** runNo = " << runNo << ", is out of valid range 0.." << fRuns.size(); + cerr << endl; return; } if ((idx < 0) || (idx > fRuns[runNo].fBkgRange.size())) { // error - cout << endl << "**ERROR** in PMsrHandler::SetMsrBkgRangeEntry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fBkgRange.size(); - cout << endl; + cerr << endl << "PMsrHandler::SetMsrBkgRangeEntry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fBkgRange.size(); + cerr << endl; return; } @@ -1147,7 +1148,7 @@ void PMsrHandler::SetMsrBkgRangeEntry(unsigned int runNo, unsigned int idx, int * * \param paramNo */ -int PMsrHandler::ParameterInUse(unsigned int paramNo) +Int_t PMsrHandler::ParameterInUse(UInt_t paramNo) { // check that paramNo is within acceptable range if ((paramNo < 0) || (paramNo > fParam.size())) @@ -1176,10 +1177,10 @@ int PMsrHandler::ParameterInUse(unsigned int paramNo) * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) { PMsrParamStructure param; - bool error = false; + Bool_t error = false; PMsrLines::iterator iter; @@ -1206,8 +1207,8 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) tokens = iter->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandleFitParameterEntry: **SEVERE ERROR** Couldn't tokenize Parameters in line " << iter->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandleFitParameterEntry: **SEVERE ERROR** Couldn't tokenize Parameters in line " << iter->fLineNo; + cerr << endl << endl; return false; } @@ -1232,7 +1233,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(2)); str = ostr->GetString(); if (str.IsFloat()) - param.fValue = (double)str.Atof(); + param.fValue = (Double_t)str.Atof(); else error = true; @@ -1240,7 +1241,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(3)); str = ostr->GetString(); if (str.IsFloat()) - param.fStep = (double)str.Atof(); + param.fStep = (Double_t)str.Atof(); else error = true; @@ -1258,7 +1259,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) str = ostr->GetString(); if (str.IsFloat()) { param.fPosErrorPresent = true; - param.fPosError = (double)str.Atof(); + param.fPosError = (Double_t)str.Atof(); } else { str.ToLower(); if (!str.CompareTo("none", TString::kIgnoreCase)) @@ -1277,7 +1278,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) str = ostr->GetString(); if (str.IsFloat()) { param.fPosErrorPresent = true; - param.fPosError = (double)str.Atof(); + param.fPosError = (Double_t)str.Atof(); } else { str.ToLower(); if (!str.CompareTo("none", TString::kIgnoreCase)) @@ -1294,7 +1295,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) param.fLowerBoundaryPresent = false; } else { // assuming that the lower boundary is a number if (str.IsFloat()) { - param.fLowerBoundary = (double)str.Atof(); + param.fLowerBoundary = (Double_t)str.Atof(); param.fLowerBoundaryPresent = true; } else { error = true; @@ -1309,7 +1310,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) param.fUpperBoundaryPresent = false; } else { // assuming a number if (str.IsFloat()) { - param.fUpperBoundary = (double)str.Atof(); + param.fUpperBoundary = (Double_t)str.Atof(); param.fUpperBoundaryPresent = true; } else { error = true; @@ -1320,28 +1321,28 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) // check if enough elements found if (error) { - cout << endl; - cout << endl << ">> PMsrHandler::HandleFitParameterEntry: **ERROR** in line " << iter->fLineNo << ":"; - cout << endl << iter->fLine.Data(); - cout << endl << "A Fit Parameter line needs to have the following form: "; - cout << endl; - cout << endl << "No Name Value Step/Error [Lower_Boundary Upper_Boundary]"; - cout << endl; - cout << endl << "or"; - cout << endl; - cout << endl << "No Name Value Step/Neg_Error Pos_Error [Lower_Boundary Upper_Boundary]"; - cout << endl; - cout << endl << "No: the parameter number (an int)"; - cout << endl << "Name: the name of the parameter (less than 256 character)"; - cout << endl << "Value: the starting value of the parameter (a double)"; - cout << endl << "Step/Error,"; - cout << endl << "Step/Neg_Error: the starting step value in a fit (a double), or"; - cout << endl << " the symmetric error (MIGRAD, SIMPLEX), or"; - cout << endl << " the negative error (MINOS)"; - cout << endl << "Pos_Error: the positive error (MINOS), (a double or \"none\")"; - cout << endl << "Lower_Boundary: the lower boundary allowed for the fit parameter (a double or \"none\")"; - cout << endl << "Upper_Boundary: the upper boundary allowed for the fit parameter (a double or \"none\")"; - cout << endl; + cerr << endl; + cerr << endl << ">> PMsrHandler::HandleFitParameterEntry: **ERROR** in line " << iter->fLineNo << ":"; + cerr << endl << iter->fLine.Data(); + cerr << endl << "A Fit Parameter line needs to have the following form: "; + cerr << endl; + cerr << endl << "No Name Value Step/Error [Lower_Boundary Upper_Boundary]"; + cerr << endl; + cerr << endl << "or"; + cerr << endl; + cerr << endl << "No Name Value Step/Neg_Error Pos_Error [Lower_Boundary Upper_Boundary]"; + cerr << endl; + cerr << endl << "No: the parameter number (an Int_t)"; + cerr << endl << "Name: the name of the parameter (less than 256 character)"; + cerr << endl << "Value: the starting value of the parameter (a Double_t)"; + cerr << endl << "Step/Error,"; + cerr << endl << "Step/Neg_Error: the starting step value in a fit (a Double_t), or"; + cerr << endl << " the symmetric error (MIGRAD, SIMPLEX), or"; + cerr << endl << " the negative error (MINOS)"; + cerr << endl << "Pos_Error: the positive error (MINOS), (a Double_t or \"none\")"; + cerr << endl << "Lower_Boundary: the lower boundary allowed for the fit parameter (a Double_t or \"none\")"; + cerr << endl << "Upper_Boundary: the upper boundary allowed for the fit parameter (a Double_t or \"none\")"; + cerr << endl; } else { // everything is OK, therefore add the parameter to the parameter list fParam.push_back(param); } @@ -1366,7 +1367,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandleTheoryEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleTheoryEntry(PMsrLines &lines) { // store the theory lines fTheory = lines; @@ -1382,7 +1383,7 @@ bool PMsrHandler::HandleTheoryEntry(PMsrLines &lines) * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandleFunctionsEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleFunctionsEntry(PMsrLines &lines) { // store the functions lines fFunctions = lines; @@ -1390,7 +1391,7 @@ bool PMsrHandler::HandleFunctionsEntry(PMsrLines &lines) // create function handler fFuncHandler = new PFunctionHandler(fFunctions); if (fFuncHandler == 0) { - cout << endl << ">> PMsrHandler::HandleFunctionsEntry: **ERROR** Couldn't invoke PFunctionHandler." << endl; + cerr << endl << ">> PMsrHandler::HandleFunctionsEntry: **ERROR** Couldn't invoke PFunctionHandler." << endl; return false; } @@ -1401,9 +1402,9 @@ bool PMsrHandler::HandleFunctionsEntry(PMsrLines &lines) // check if an empty FUNCTIONS block is present if ((fFuncHandler->GetNoOfFuncs() == 0) && !lines.empty()) { - cout << endl << ">> PMsrHandler::HandleFunctionsEntry: **ERROR** empty FUNCTIONS block are not supported!"; - cout << endl << ">> If you want to keep it, just comment the whole block ;-)"; - cout << endl; + cerr << endl << ">> PMsrHandler::HandleFunctionsEntry: **ERROR** empty FUNCTIONS block are not supported!"; + cerr << endl << ">> If you want to keep it, just comment the whole block ;-)"; + cerr << endl; return false; } @@ -1418,12 +1419,12 @@ bool PMsrHandler::HandleFunctionsEntry(PMsrLines &lines) * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandleRunEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) { PMsrLines::iterator iter; PMsrRunStructure param; - bool first = true; // first run line tag - bool error = false; + Bool_t first = true; // first run line tag + Bool_t error = false; TString str; TObjArray *tokens = 0; @@ -1440,8 +1441,8 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) // tokenize line tokens = iter->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** Couldn't tokenize Parameters in line " << iter->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** Couldn't tokenize Parameters in line " << iter->fLineNo; + cerr << endl << endl; return false; } @@ -1504,7 +1505,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(1)); str = ostr->GetString(); if (str.IsDigit()) { - int fittype = str.Atoi(); + Int_t fittype = str.Atoi(); if ((fittype == MSR_FITTYPE_SINGLE_HISTO) || (fittype == MSR_FITTYPE_ASYM) || (fittype == MSR_FITTYPE_ASYM_RRF) || @@ -1557,7 +1558,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if (str.IsDigit()) { param.fNormParamNo = str.Atoi(); } else if (str.Contains("fun")) { - int no; + Int_t no; if (FilterNumber(str, "fun", MSR_PARAM_FUN_OFFSET, no)) param.fNormParamNo = no; else @@ -1617,7 +1618,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) // map ------------------------------------------------------ if (iter->fLine.BeginsWith("map", TString::kIgnoreCase)) { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) @@ -1626,9 +1627,9 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) error = true; } // check map entries, i.e. if the map values are within parameter bounds - for (unsigned int i=0; i (int) fParam.size())) { - cout << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** map value " << param.fMap[i] << " in line " << iter->fLineNo << " is out of range!"; + for (UInt_t i=0; i (Int_t) fParam.size())) { + cerr << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** map value " << param.fMap[i] << " in line " << iter->fLineNo << " is out of range!"; error = true; break; } @@ -1668,7 +1669,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if (tokens->GetEntries() < 2) { error = true; } else { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsFloat()) @@ -1684,7 +1685,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if ((tokens->GetEntries() < 3) || (tokens->GetEntries() % 2 != 1)) { // odd number (>=3) of entries needed error = true; } else { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) @@ -1700,7 +1701,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if ((tokens->GetEntries() < 3) || (tokens->GetEntries() % 2 != 1)) { // odd number (>=3) of entries needed error = true; } else { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) @@ -1716,7 +1717,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if (tokens->GetEntries() < 2) { error = true; } else { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) @@ -1732,7 +1733,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if (tokens->GetEntries() < 3) { error = true; } else { - for (int i=1; i<3; i++) { + for (Int_t i=1; i<3; i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsFloat()) @@ -1876,19 +1877,19 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) if (error) { --iter; - cout << endl << ">> PMsrHandler::HandleRunEntry: **ERROR** in line " << iter->fLineNo << ":"; - cout << endl << iter->fLine.Data(); - cout << endl << "RUN block syntax is too complex to print it here. Please check the manual."; + cerr << endl << ">> PMsrHandler::HandleRunEntry: **ERROR** in line " << iter->fLineNo << ":"; + cerr << endl << iter->fLine.Data(); + cerr << endl << "RUN block syntax is too complex to print it here. Please check the manual."; } else { // save last run found fRuns.push_back(param); } // check if for fittypes: single histo, asymmetry, RRF any background info is given - for (unsigned int i=0; i= 0) { // check if backgr.fit is given found = true; } else if (fRuns[i].fBkgFix.size() > 0) { // check if backgr.fix is given @@ -1899,11 +1900,11 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines) found = false; } if (!found) { - cout << endl << ">> PMsrHandler::HandleRunEntry: **ERROR** for run " << fRuns[i].fRunName[0].Data() << ", forward " << fRuns[i].fForwardHistoNo; - cout << endl << " no background information found!"; - cout << endl << " Either of the tags 'backgr.fit', 'backgr.fix', 'background'"; - cout << endl << " with data is needed."; - cout << endl; + cerr << endl << ">> PMsrHandler::HandleRunEntry: **ERROR** for run " << fRuns[i].fRunName[0].Data() << ", forward " << fRuns[i].fForwardHistoNo; + cerr << endl << " no background information found!"; + cerr << endl << " Either of the tags 'backgr.fit', 'backgr.fix', 'background'"; + cerr << endl << " with data is needed."; + cerr << endl; return false; } } @@ -1941,7 +1942,7 @@ void PMsrHandler::InitRunParameterStructure(PMsrRunStructure ¶m) param.fBkgRange.clear(); param.fDataRange.clear(); param.fT0.clear(); - for (int i=0; i<4; i++) + for (Int_t i=0; i<4; i++) param.fFitRange[i] = -1; param.fPacking = 1; param.fRRFFreq = -1.0; @@ -1950,9 +1951,9 @@ void PMsrHandler::InitRunParameterStructure(PMsrRunStructure ¶m) param.fBeta2ParamNo = -1; param.fRightHistoNo = -1; param.fLeftHistoNo = -1; - for (int i=0; i<2; i++) + for (Int_t i=0; i<2; i++) param.fXYDataIndex[i] = -1; - for (int i=0; i<2; i++) + for (Int_t i=0; i<2; i++) param.fXYDataLabel[i] = ""; } @@ -1970,13 +1971,13 @@ void PMsrHandler::InitRunParameterStructure(PMsrRunStructure ¶m) * \param offset it is used to offset to found number, e.g. strX -> no = X+offset * \param no filtered number */ -bool PMsrHandler::FilterNumber(TString str, const char *filter, int offset, int &no) +Bool_t PMsrHandler::FilterNumber(TString str, const Char_t *filter, Int_t offset, Int_t &no) { - int found, no_found=-1; + Int_t found, no_found=-1; // copy str to an ordinary c-like string - char *cstr, filterStr[32]; - cstr = new char[str.Sizeof()]; + Char_t *cstr, filterStr[32]; + cstr = new Char_t[str.Sizeof()]; strncpy(cstr, str.Data(), str.Sizeof()); sprintf(filterStr, "%s%%d", filter); @@ -2007,13 +2008,13 @@ bool PMsrHandler::FilterNumber(TString str, const char *filter, int offset, int * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandleCommandsEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleCommandsEntry(PMsrLines &lines) { PMsrLines::iterator iter; if (lines.empty()) { - cout << endl << "**WARNING**: There is no COMMANDS block! Do you really want this?"; - cout << endl; + cerr << endl << "**WARNING**: There is no COMMANDS block! Do you really want this?"; + cerr << endl; } for (iter = lines.begin(); iter != lines.end(); ++iter) { @@ -2041,7 +2042,7 @@ void PMsrHandler::InitFourierParameterStructure(PMsrFourierStructure &fourier) fourier.fPlotTag = FOURIER_PLOT_NOT_GIVEN; // initial plot tag, default: NOT GIVEN fourier.fPhaseParamNo = 0; // initial parameter no = 0 means not a parameter fourier.fPhase = -999.0; // fourier phase: -999 = NOT GIVEN - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { fourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN fourier.fPlotRange[i] = -1.0; // fourier plot range, default: {-1, -1} = NOT GIVEN } @@ -2055,11 +2056,11 @@ void PMsrHandler::InitFourierParameterStructure(PMsrFourierStructure &fourier) * * \param lines is a list of lines containing the fourier parameter block */ -bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleFourierEntry(PMsrLines &lines) { //cout << endl << ">> in PMsrHandler::HandleFourierEntry ..."; - bool error = false; + Bool_t error = false; if (lines.empty()) // no fourier block present return true; @@ -2078,15 +2079,15 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) TObjString *ostr = 0; TString str; - int ival; + Int_t ival; iter = lines.begin(); while ((iter != lines.end()) && !error) { // tokenize line tokens = iter->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** Couldn't tokenize Parameters in line " << iter->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** Couldn't tokenize Parameters in line " << iter->fLineNo; + cerr << endl << endl; return false; } @@ -2191,10 +2192,10 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(1)); str = ostr->GetString(); if (str.BeginsWith("par", TString::kIgnoreCase)) { // parameter value - int no = 0; + Int_t no = 0; if (FilterNumber(str, "par", 0, no)) { // check that the parameter is in range - if ((int)fParam.size() < no) { + if ((Int_t)fParam.size() < no) { error = true; continue; } @@ -2221,7 +2222,7 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) error = true; continue; } else { - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { ostr = dynamic_cast(tokens->At(i+1)); str = ostr->GetString(); if (str.IsFloat()) { @@ -2240,7 +2241,7 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) error = true; continue; } else { - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { ostr = dynamic_cast(tokens->At(i+1)); str = ostr->GetString(); if (str.IsFloat()) { @@ -2264,23 +2265,23 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) } if (error) { - cout << endl << ">> PMsrHandler::HandleFourierEntry: **ERROR** in line " << iter->fLineNo << ":"; - cout << endl; - cout << endl << iter->fLine.Data(); - cout << endl; - cout << endl << "FOURIER block syntax, parameters in [] are optinal:"; - cout << endl; - cout << endl << "FOURIER"; - cout << endl << "[units Gauss | MHz | Mc/s]"; - cout << endl << "[fourier_power n # n is a number such that zero padding up to 2^n will be used]"; - cout << endl << " n=0 means no zero padding"; - cout << endl << " 0 <= n <= 20 are allowed values"; - cout << endl << "[apodization none | weak | medium | strong]"; - cout << endl << "[plot real | imag | real_and_imag | power | phase]"; - cout << endl << "[phase value]"; - cout << endl << "[range_for_phase_correction min max]"; - cout << endl << "[range min max]"; - cout << endl; + cerr << endl << ">> PMsrHandler::HandleFourierEntry: **ERROR** in line " << iter->fLineNo << ":"; + cerr << endl; + cerr << endl << iter->fLine.Data(); + cerr << endl; + cerr << endl << "FOURIER block syntax, parameters in [] are optinal:"; + cerr << endl; + cerr << endl << "FOURIER"; + cerr << endl << "[units Gauss | MHz | Mc/s]"; + cerr << endl << "[fourier_power n # n is a number such that zero padding up to 2^n will be used]"; + cerr << endl << " n=0 means no zero padding"; + cerr << endl << " 0 <= n <= 20 are allowed values"; + cerr << endl << "[apodization none | weak | medium | strong]"; + cerr << endl << "[plot real | imag | real_and_imag | power | phase]"; + cerr << endl << "[phase value]"; + cerr << endl << "[range_for_phase_correction min max]"; + cerr << endl << "[range min max]"; + cerr << endl; } else { // save last run found fFourier = fourier; } @@ -2296,9 +2297,9 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines) { - bool error = false; + Bool_t error = false; PMsrPlotStructure param; @@ -2311,8 +2312,8 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) TString str2; if (lines.empty()) { - cout << endl << "**WARNING**: There is no PLOT block! Do you really want this?"; - cout << endl; + cerr << endl << "**WARNING**: There is no PLOT block! Do you really want this?"; + cerr << endl; } iter1 = lines.begin(); @@ -2339,8 +2340,8 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) if (iter1->fLine.Contains("PLOT")) { // handle plot header tokens = iter1->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << endl; return false; } if (tokens->GetEntries() < 2) { // plot type missing @@ -2369,14 +2370,14 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) case MSR_PLOT_NON_MUSR: tokens = iter1->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << endl; return false; } if (tokens->GetEntries() < 2) { // runs missing error = true; } else { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) { @@ -2396,14 +2397,14 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) case MSR_PLOT_ASYM_RRF: // like: runs 1,1 1,2 tokens = iter1->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << endl; return false; } if (tokens->GetEntries() < 2) { // runs missing error = true; } else { - for (int i=1; iGetEntries(); i++) { + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); // something like 1,2 str = ostr->GetString(); tokens2 = str.Tokenize(","); @@ -2446,8 +2447,8 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) tokens = iter1->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << endl; return false; } if ((tokens->GetEntries() != 3) && (tokens->GetEntries() != 5)) { @@ -2458,7 +2459,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(1)); str = ostr->GetString(); if (str.IsFloat()) - param.fTmin.push_back((double)str.Atof()); + param.fTmin.push_back((Double_t)str.Atof()); else error = true; @@ -2466,7 +2467,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(2)); str = ostr->GetString(); if (str.IsFloat()) - param.fTmax.push_back((double)str.Atof()); + param.fTmax.push_back((Double_t)str.Atof()); else error = true; @@ -2476,7 +2477,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(3)); str = ostr->GetString(); if (str.IsFloat()) - param.fYmin.push_back((double)str.Atof()); + param.fYmin.push_back((Double_t)str.Atof()); else error = true; @@ -2484,7 +2485,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(4)); str = ostr->GetString(); if (str.IsFloat()) - param.fYmax.push_back((double)str.Atof()); + param.fYmax.push_back((Double_t)str.Atof()); else error = true; } @@ -2503,21 +2504,21 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) tokens = iter1->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << endl; return false; } - if ((tokens->GetEntries() != (int)(2*param.fRuns.size() + 1)) && (tokens->GetEntries() != (int)(2*param.fRuns.size() + 3))) { + if ((tokens->GetEntries() != (Int_t)(2*param.fRuns.size() + 1)) && (tokens->GetEntries() != (Int_t)(2*param.fRuns.size() + 3))) { error = true; } else { // get all the times - for (unsigned int i=0; i(tokens->At(2*i+1)); str = ostr->GetString(); if (str.IsFloat()) - param.fTmin.push_back((double)str.Atof()); + param.fTmin.push_back((Double_t)str.Atof()); else error = true; @@ -2525,19 +2526,19 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(2*i+2)); str = ostr->GetString(); if (str.IsFloat()) - param.fTmax.push_back((double)str.Atof()); + param.fTmax.push_back((Double_t)str.Atof()); else error = true; } // get y-range if present - if (tokens->GetEntries() == (int)(2*param.fRuns.size() + 3)) { + if (tokens->GetEntries() == (Int_t)(2*param.fRuns.size() + 3)) { // handle y_min ostr = dynamic_cast(tokens->At(2*param.fRuns.size()+1)); str = ostr->GetString(); if (str.IsFloat()) - param.fYmin.push_back((double)str.Atof()); + param.fYmin.push_back((Double_t)str.Atof()); else error = true; @@ -2545,7 +2546,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(2*param.fRuns.size()+2)); str = ostr->GetString(); if (str.IsFloat()) - param.fYmax.push_back((double)str.Atof()); + param.fYmax.push_back((Double_t)str.Atof()); else error = true; } @@ -2565,8 +2566,8 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) } else if (iter1->fLine.Contains("view_packing", TString::kIgnoreCase)) { tokens = iter1->fLine.Tokenize(" \t"); if (!tokens) { - cout << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << endl; return false; } if (tokens->GetEntries() != 2) { @@ -2575,7 +2576,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(1)); str = ostr->GetString(); if (str.IsDigit()) { - int val = str.Atoi(); + Int_t val = str.Atoi(); if (val > 0) param.fViewPacking = val; else @@ -2599,13 +2600,13 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) } // analyze if the plot block is valid - double keep; + Double_t keep; if (!error) { if (param.fRuns.empty()) { // there was no run tag error = true; } else { // everything ok if ((param.fTmin.size() > 0) || (param.fTmax.size() > 0)) { // if range is given, check that it is ordered properly - for (unsigned int i=0; i param.fTmax[i]) { keep = param.fTmin[i]; param.fTmin[i] = param.fTmax[i]; @@ -2615,7 +2616,7 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) } if ((param.fYmin.size() > 0) || (param.fYmax.size() > 0)) { // if range is given, check that it is ordered properly - for (unsigned int i=0; i param.fYmax[i]) { keep = param.fYmin[i]; param.fYmin[i] = param.fYmax[i]; @@ -2629,33 +2630,33 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) if (error) { // print error message --iter1; - cout << endl << ">> PMsrHandler::HandlePlotEntry: **ERROR** in line " << iter1->fLineNo << ": " << iter1->fLine.Data(); - cout << endl << "A PLOT block needs to have the following structure:"; - cout << endl; - cout << endl << "PLOT "; - cout << endl << "runs "; - cout << endl << "[range tmin tmax [ymin ymax]]"; - cout << endl << "[sub_ranges tmin1 tmax1 tmin2 tmax2 ... tminN tmaxN [ymin ymax]"; - cout << endl << "[logx | logy]"; - cout << endl << "[use_fit_ranges]"; - cout << endl << "[view_packing n]"; - cout << endl; - cout << endl << "where is: 0=single histo asym,"; - cout << endl << " 2=forward-backward asym,"; - cout << endl << " 4=RRF asym (not implemented yet),"; - cout << endl << " 8=non muSR."; - cout << endl << " is the list of runs"; - cout << endl << " for 0,2,8 it is a list of run numbers, e.g. runs 1 3"; - cout << endl << " for 4 it is a list of 'complex' numbers, where"; - cout << endl << " the real part is the run number, and the"; - cout << endl << " imaginary one is 1=real part or 2=imag part, e.g."; - cout << endl << " runs 1,1 1,2"; - cout << endl << "range is optional"; - cout << endl << "sub_ranges (if present) will plot the N given runs each on its own sub-range"; - cout << endl << "logx, logy (if present) will present the x-, y-axis in log-scale"; - cout << endl << "use_fit_ranges (if present) will plot each run on its fit-range"; - cout << endl << "view_packing n (if present) will bin all data by n (> 0) rather than the binning of the fit"; - cout << endl; + cerr << endl << ">> PMsrHandler::HandlePlotEntry: **ERROR** in line " << iter1->fLineNo << ": " << iter1->fLine.Data(); + cerr << endl << "A PLOT block needs to have the following structure:"; + cerr << endl; + cerr << endl << "PLOT "; + cerr << endl << "runs "; + cerr << endl << "[range tmin tmax [ymin ymax]]"; + cerr << endl << "[sub_ranges tmin1 tmax1 tmin2 tmax2 ... tminN tmaxN [ymin ymax]"; + cerr << endl << "[logx | logy]"; + cerr << endl << "[use_fit_ranges]"; + cerr << endl << "[view_packing n]"; + cerr << endl; + cerr << endl << "where is: 0=single histo asym,"; + cerr << endl << " 2=forward-backward asym,"; + cerr << endl << " 4=RRF asym (not implemented yet),"; + cerr << endl << " 8=non muSR."; + cerr << endl << " is the list of runs"; + cerr << endl << " for 0,2,8 it is a list of run numbers, e.g. runs 1 3"; + cerr << endl << " for 4 it is a list of 'complex' numbers, where"; + cerr << endl << " the real part is the run number, and the"; + cerr << endl << " imaginary one is 1=real part or 2=imag part, e.g."; + cerr << endl << " runs 1,1 1,2"; + cerr << endl << "range is optional"; + cerr << endl << "sub_ranges (if present) will plot the N given runs each on its own sub-range"; + cerr << endl << "logx, logy (if present) will present the x-, y-axis in log-scale"; + cerr << endl << "use_fit_ranges (if present) will plot each run on its fit-range"; + cerr << endl << "view_packing n (if present) will bin all data by n (> 0) rather than the binning of the fit"; + cerr << endl; } param.fRuns.clear(); @@ -2673,41 +2674,41 @@ bool PMsrHandler::HandlePlotEntry(PMsrLines &lines) * * \param lines is a list of lines containing the fitparameter block */ -bool PMsrHandler::HandleStatisticEntry(PMsrLines &lines) +Bool_t PMsrHandler::HandleStatisticEntry(PMsrLines &lines) { if (lines.empty()) { - cout << endl << ">> PMsrHandler::HandleStatisticEntry: **WARNING** There is no STATISTIC block! Do you really want this?"; - cout << endl; + cerr << endl << ">> PMsrHandler::HandleStatisticEntry: **WARNING** There is no STATISTIC block! Do you really want this?"; + cerr << endl; fStatistic.fValid = false; return true; } // check if chisq or max.log likelihood fStatistic.fChisq = true; - for (unsigned int i=0; i 0) { if (!tstr.BeginsWith("#") && !tstr.BeginsWith("STATISTIC") && !tstr.BeginsWith("chisq") && !tstr.BeginsWith("maxLH") && !tstr.BeginsWith("*** FIT DID NOT CONVERGE ***")) { - cout << endl << ">> PMsrHandler::HandleStatisticEntry: **SYNTAX ERROR** in line " << lines[i].fLineNo; - cout << endl << ">> '" << lines[i].fLine.Data() << "'"; - cout << endl << ">> not a valid STATISTIC block line"; - cout << endl << ">> If you do not understand this, just remove the STATISTIC block, musrfit will recreate after fitting"; - cout << endl << endl; + cerr << endl << ">> PMsrHandler::HandleStatisticEntry: **SYNTAX ERROR** in line " << lines[i].fLineNo; + cerr << endl << ">> '" << lines[i].fLine.Data() << "'"; + cerr << endl << ">> not a valid STATISTIC block line"; + cerr << endl << ">> If you do not understand this, just remove the STATISTIC block, musrfit will recreate after fitting"; + cerr << endl << endl; return false; } } @@ -2789,10 +2790,10 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi TObjArray *tokens = 0; TObjString *ostr = 0; TString str; - int ival, funNo; + Int_t ival, funNo; // create and initialize fParamInUse vector - for (unsigned int i=0; iGetEntries(); i++) { + for (Int_t i=0; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) { // parameter number ival = str.Atoi(); - if ((ival > 0) && (ival < (int)fParam.size()+1)) { + if ((ival > 0) && (ival < (Int_t)fParam.size()+1)) { fParamInUse[ival-1]++; //cout << endl << ">>>> theo: param no : " << ival; } @@ -2866,17 +2867,17 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi // check if fun number is used, and if yes, filter parameter numbers and maps TString sstr; //cout << endl << ">> fun.size() = " << fun.size(); - for (unsigned int i=0; i> funNo: " << fun[i] << ", funNo: " << funNo; if (fun[i] == funNo) { // function number found // filter for parX sstr = iter->fLine; - char sval[128]; + Char_t sval[128]; while (sstr.Index("par") != -1) { memset(sval, 0, sizeof(sval)); sstr = &sstr[sstr.Index("par")+3]; // trunc sstr //cout << endl << ">> par:sstr: " << sstr.Data(); - for (int j=0; j> map:sstr: " << sstr.Data(); - for (int j=0; j>>> mapX from func 1st, X = " << ival; // check if map value already in map, otherwise add it if (ival > 0) { - unsigned int pos; + UInt_t pos; for (pos=0; pos> map.size() = " << map.size(); - for (unsigned int i=0; iGetEntries()) { @@ -3029,16 +3030,16 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi // check if fun number is used, and if yes, filter parameter numbers and maps TString sstr; - for (unsigned int i=0; i> funNo: " << fun[i] << ", funNo: " << funNo; if (fun[i] == funNo) { // function number found // filter for parX sstr = iter->fLine; - char sval[128]; + Char_t sval[128]; while (sstr.Index("par") != -1) { memset(sval, 0, sizeof(sval)); sstr = &sstr[sstr.Index("par")+3]; // trunc sstr - for (int j=0; j>>> mapX from func 2nd, X = " << ival; // check if map value already in map, otherwise add it if (ival > 0) { - unsigned int pos; + UInt_t pos; for (pos=0; pos> map.size() = " << map.size(); - for (unsigned int i=0; iGetEntries()) { @@ -3128,15 +3129,15 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi } // cout << endl << ">> fParamInUse: "; -// for (unsigned int i=0; iChecks if map entries found in the theory- or function-block are also * present in the run-block, if yes return true otherwise return false. */ -bool PMsrHandler::CheckMaps() +Bool_t PMsrHandler::CheckMaps() { - bool result = true; + Bool_t result = true; PIntVector mapVec; PIntVector mapBlock; @@ -3193,14 +3194,14 @@ bool PMsrHandler::CheckMaps() TObjString *ostr = 0; TString str; - int no; + Int_t no; // check if map is present in the theory-block - for (unsigned int i=0; iGetEntries(); j++) { + for (Int_t j=0; jGetEntries(); j++) { ostr = dynamic_cast(tokens->At(j)); str = ostr->GetString(); if (str.Contains("map", TString::kIgnoreCase)) { @@ -3220,11 +3221,11 @@ bool PMsrHandler::CheckMaps() } // check if map is present in the function-block - for (unsigned int i=0; iGetEntries(); j++) { + for (Int_t j=0; jGetEntries(); j++) { ostr = dynamic_cast(tokens->At(j)); str = ostr->GetString(); if (str.Contains("map", TString::kIgnoreCase)) { @@ -3244,11 +3245,11 @@ bool PMsrHandler::CheckMaps() } // check if present maps are found in the run-block - bool found; - for (unsigned int i=0; i= 0)) { // map value smaller than run-block map length if (fRuns[j].fMap[mapVec[i]-MSR_PARAM_MAP_OFFSET-1] != 0) { // map value in the run-block != 0 found = true; @@ -3258,14 +3259,16 @@ bool PMsrHandler::CheckMaps() } if (!found) { // map not found result = false; - cout << endl << ">> PMsrHandler::CheckMaps: **ERROR** map" << mapVec[i]-MSR_PARAM_MAP_OFFSET << " found in the "; + cerr << endl << ">> PMsrHandler::CheckMaps: **ERROR** map" << mapVec[i]-MSR_PARAM_MAP_OFFSET << " found in the "; if (mapBlock[i] == 0) - cout << "theory-block "; + cerr << "theory-block "; else - cout << "functions-block "; - cout << "in line " << mapLineNo[i] << " is not present in the run-block!"; + cerr << "functions-block "; + cerr << "in line " << mapLineNo[i] << " is not present in the run-block!"; + cerr << endl; if (mapVec[i]-MSR_PARAM_MAP_OFFSET == 0) { - cout << endl << ">> by the way: map must be > 0 ..."; + cerr << endl << ">> by the way: map must be > 0 ..."; + cerr << endl; } } } @@ -3285,9 +3288,9 @@ bool PMsrHandler::CheckMaps() *

Checks if fun entries found in the theory- and run-block are also * present in the functions-block, if yes return true otherwise return false. */ -bool PMsrHandler::CheckFuncs() +Bool_t PMsrHandler::CheckFuncs() { - bool result = true; + Bool_t result = true; PIntVector funVec; PIntVector funBlock; @@ -3297,14 +3300,14 @@ bool PMsrHandler::CheckFuncs() TObjString *ostr = 0; TString str; - int no; + Int_t no; // check if func is present in the theory-block - for (unsigned int i=0; iGetEntries(); j++) { + for (Int_t j=0; jGetEntries(); j++) { ostr = dynamic_cast(tokens->At(j)); str = ostr->GetString(); if (str.Contains("fun", TString::kIgnoreCase)) { @@ -3324,7 +3327,7 @@ bool PMsrHandler::CheckFuncs() } // check if func is present in the run-block - for (unsigned int i=0; i= MSR_PARAM_FUN_OFFSET) { // function found funVec.push_back(fRuns[i].fNormParamNo); funBlock.push_back(1); // 1 = run-block @@ -3333,11 +3336,11 @@ bool PMsrHandler::CheckFuncs() } // check if present funcs are found in the functions-block - bool found; - for (unsigned int i=0; i> PMsrHandler::CheckFuncs: **ERROR** fun" << funVec[i]-MSR_PARAM_FUN_OFFSET << " found in the "; + cerr << endl << ">> PMsrHandler::CheckFuncs: **ERROR** fun" << funVec[i]-MSR_PARAM_FUN_OFFSET << " found in the "; if (funBlock[i] == 0) - cout << "theory-block in line " << funLineBlockNo[i] << " is not present in the functions-block!"; + cerr << "theory-block in line " << funLineBlockNo[i] << " is not present in the functions-block!"; else - cout << "run-block No " << funLineBlockNo[i] << " (norm) is not present in the functions-block!"; + cerr << "run-block No " << funLineBlockNo[i] << " (norm) is not present in the functions-block!"; + cerr << endl; } } diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 6d1cc114..720821eb 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -89,7 +89,7 @@ PMusrCanvas::PMusrCanvas() /** * */ -PMusrCanvas::PMusrCanvas(const int number, const char* title, +PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch) : fBatchMode(batch), fPlotNumber(number) @@ -113,7 +113,7 @@ PMusrCanvas::PMusrCanvas(const int number, const char* title, /** * */ -PMusrCanvas::PMusrCanvas(const int number, const char* title, +PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, PMsrFourierStructure fourierDefault, const PIntVector markerList, const PIntVector colorList, @@ -154,12 +154,12 @@ PMusrCanvas::~PMusrCanvas() fTitlePad = 0; } if (fData.size() > 0) { - for (unsigned int i=0; i 0) { - for (unsigned int i=0; iGetMsrParamList(); // get maximal parameter name string length - for (unsigned int i=0; i maxLength) maxLength = param[i].fName.Length(); } @@ -280,7 +280,7 @@ void PMusrCanvas::UpdateParamTheoryPad() yoffset = 0.05; // add parameters to the pad - for (unsigned int i=0; iGetMsrFunctions(); - for (unsigned int i=1; iAddText(0.03, ypos, functions[i].fLine.Data()); } @@ -373,36 +373,36 @@ void PMusrCanvas::UpdateParamTheoryPad() void PMusrCanvas::UpdateDataTheoryPad() { // some checks first - unsigned int runNo; + UInt_t runNo; PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber); PMsrRunList runs = *fMsrHandler->GetMsrRunList(); fPlotType = plotInfo.fPlotType; - for (unsigned int i=0; i (int)runs.size()) { + if ((Int_t)plotInfo.fRuns[i].Re() > (Int_t)runs.size()) { fValid = false; - cout << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** run plot number " << (int)plotInfo.fRuns[i].Re() << " is larger than the number of runs " << runs.size(); - cout << endl; + cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** run plot number " << (Int_t)plotInfo.fRuns[i].Re() << " is larger than the number of runs " << runs.size(); + cerr << endl; return; } // check that the plottype and the fittype do correspond - runNo = (unsigned int)plotInfo.fRuns[i].Re()-1; + runNo = (UInt_t)plotInfo.fRuns[i].Re()-1; //cout << endl << ">> runNo = " << runNo; //cout << endl; if (fPlotType != runs[runNo].fFitType) { fValid = false; - cout << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** plottype = " << fPlotType << ", fittype = " << runs[runNo].fFitType << ", however they have to correspond!"; - cout << endl; + cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** plottype = " << fPlotType << ", fittype = " << runs[runNo].fFitType << ", however they have to correspond!"; + cerr << endl; return; } } PRunData *data; - for (unsigned int i=0; i > ddvec; - char sval[128]; - unsigned int runNo; + Char_t sval[128]; + UInt_t runNo; PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber); PMsrRunList runs = *fMsrHandler->GetMsrRunList(); - for (unsigned int i=0; i 1) tstr = "++" + runs[runNo].fRunName[0] + TString(","); // run_name else @@ -555,7 +555,7 @@ void PMusrCanvas::UpdateInfoPad() sprintf(sval, "%0.2lf", ddvec[0].first); tstr += TString(sval) + TString("K,"); } else { - for(unsigned int i(0); ifMainCanvas " << fMainCanvas << endl; // cout << ">selected " << selected << endl; // -//cout << "x : " << (char)x << endl; -//cout << "px: " << (char)fMainCanvas->GetEventX() << endl; +//cout << "x : " << (Char_t)x << endl; +//cout << "px: " << (Char_t)fMainCanvas->GetEventX() << endl; // handle keys and popup menu entries - bool relevantKey = false; + Bool_t relevantKey = false; if (x == 'q') { // quit Done(0); } else if (x == 'd') { // difference @@ -937,14 +937,14 @@ void PMusrCanvas::LastCanvasClosed() * * \param graphicsFormat One of the supported graphics formats. */ -void PMusrCanvas::SaveGraphicsAndQuit(char *fileName, char *graphicsFormat) +void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) { cout << endl << ">> SaveGraphicsAndQuit: will dump the canvas into a graphics output file (" << graphicsFormat << ") ..."<< endl; TString str(fileName); Int_t idx = -1; Int_t size = 0; - char ext[32]; + Char_t ext[32]; if (str.Contains(".msr")) { idx = str.Index(".msr"); @@ -956,7 +956,7 @@ void PMusrCanvas::SaveGraphicsAndQuit(char *fileName, char *graphicsFormat) } if (idx == -1) { - cout << endl << "PMusrCanvas::SaveGraphicsAndQuit **ERROR**: fileName (" << fileName << ") is invalid." << endl; + cerr << endl << "PMusrCanvas::SaveGraphicsAndQuit **ERROR**: fileName (" << fileName << ") is invalid." << endl; return; } @@ -971,7 +971,7 @@ void PMusrCanvas::SaveGraphicsAndQuit(char *fileName, char *graphicsFormat) fMainCanvas->SaveAs(str.Data()); - if (fPlotNumber == static_cast(fMsrHandler->GetMsrPlotList()->size()) - 1) + if (fPlotNumber == static_cast(fMsrHandler->GetMsrPlotList()->size()) - 1) Done(0); } @@ -1005,7 +1005,7 @@ void PMusrCanvas::InitFourier() fFourier.fApodization = FOURIER_APOD_NONE; // no apodization fFourier.fPlotTag = FOURIER_PLOT_REAL_AND_IMAG; // initial plot tag, plot real and imaginary part fFourier.fPhase = 0.0; // fourier phase 0° - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { fFourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN fFourier.fPlotRange[i] = -1.0; // fourier plot range, default: {-1, -1} = NOT GIVEN } @@ -1024,7 +1024,7 @@ void PMusrCanvas::InitFourier() * \param ww * \param wh */ -void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) +void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) { fValid = false; fDifferenceView = false; @@ -1050,8 +1050,8 @@ void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, In canvasName += fPlotNumber; fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh); if (fMainCanvas == 0) { - cout << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke " << canvasName.Data(); - cout << endl; + cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke " << canvasName.Data(); + cerr << endl; return; } @@ -1096,8 +1096,8 @@ void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, In // title pad fTitlePad = new TPaveText(0.0, YTITLE, 1.0, 1.0, "NDC"); if (fTitlePad == 0) { - cout << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTitlePad"; - cout << endl; + cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTitlePad"; + cerr << endl; return; } fTitlePad->SetFillColor(TColor::GetColor(255,255,255)); @@ -1108,8 +1108,8 @@ void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, In // data/theory pad fDataTheoryPad = new TPad("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE); if (fDataTheoryPad == 0) { - cout << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fDataTheoryPad"; - cout << endl; + cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fDataTheoryPad"; + cerr << endl; return; } fDataTheoryPad->SetFillColor(TColor::GetColor(255,255,255)); @@ -1118,8 +1118,8 @@ void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, In // parameter pad fParameterPad = new TPaveText(XTHEO, 0.5, 1.0, YTITLE, "NDC"); if (fParameterPad == 0) { - cout << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fParameterPad"; - cout << endl; + cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fParameterPad"; + cerr << endl; return; } fParameterPad->SetFillColor(TColor::GetColor(255,255,255)); @@ -1129,8 +1129,8 @@ void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, In // theory pad fTheoryPad = new TPaveText(XTHEO, 0.1, 1.0, 0.5, "NDC"); if (fTheoryPad == 0) { - cout << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTheoryPad"; - cout << endl; + cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTheoryPad"; + cerr << endl; return; } fTheoryPad->SetFillColor(TColor::GetColor(255,255,255)); @@ -1141,8 +1141,8 @@ void PMusrCanvas::InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, In // info pad fInfoPad = new TLegend(0.0, 0.0, 1.0, YINFO, "NDC"); if (fInfoPad == 0) { - cout << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fInfoPad"; - cout << endl; + cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fInfoPad"; + cerr << endl; return; } fInfoPad->SetFillColor(TColor::GetColor(255,255,255)); @@ -1373,7 +1373,7 @@ void PMusrCanvas::CleanupDataSet(PMusrCanvasNonMusrDataSet &dataSet) * \param runNo is the number of the run * \param data */ -void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunData *data) +void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) { //cout << endl << ">> PMusrCanvas::HandleDataSet(): start ...; plotNo = " << plotNo << ", fPlotNumber = " << fPlotNumber << ", runNo = " << runNo << endl; PMusrCanvasDataSet dataSet; @@ -1383,7 +1383,7 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat TString name; double start; double end; - int size; + Int_t size; InitDataSet(dataSet); //cout << endl << ">> PMusrCanvas::HandleDataSet(): after InitDataSet ..." << endl; @@ -1391,7 +1391,7 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat // dataHisto ------------------------------------------------------------- // create histo specific infos name = fMsrHandler->GetMsrRunList()->at(runNo).fRunName[0] + "_DataRunNo"; - name += (int)runNo; + name += (Int_t)runNo; name += "_"; name += fPlotNumber; start = data->GetDataTimeStart() - data->GetDataTimeStep()/2.0; @@ -1404,9 +1404,9 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { start = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0]; // needed to estimate size end = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[1]; // needed to estimate size - size = (int) ((end - start) / data->GetDataTimeStep()) + 1; + size = (Int_t) ((end - start) / data->GetDataTimeStep()) + 1; start = data->GetDataTimeStart() + - (int)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() - + (Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() - 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 } @@ -1415,9 +1415,9 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) { start = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo]; // needed to estimate size end = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo]; // needed to estimate size - size = (int) ((end - start) / data->GetDataTimeStep()) + 1; + size = (Int_t) ((end - start) / data->GetDataTimeStep()) + 1; start = data->GetDataTimeStart() + - (int)((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 end = start + size * data->GetDataTimeStep(); // closesd end value compatible with the user given } @@ -1473,7 +1473,7 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat // theoHisto ------------------------------------------------------------- // create histo specific infos name = fMsrHandler->GetMsrRunList()->at(runNo).fRunName[0] + "_TheoRunNo"; - name += (int)runNo; + name += (Int_t)runNo; name += "_"; name += fPlotNumber; start = data->GetTheoryTimeStart() - data->GetTheoryTimeStep()/2.0; @@ -1484,9 +1484,9 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { start = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0]; // needed to estimate size end = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[1]; // needed to estimate size - size = (int) ((end - start) / data->GetTheoryTimeStep()) + 1; + size = (Int_t) ((end - start) / data->GetTheoryTimeStep()) + 1; start = data->GetTheoryTimeStart() + - (int)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - + (Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - data->GetTheoryTimeStep()/2.0; // closesd start value compatible with the user given end = start + size * data->GetTheoryTimeStep(); // closesd end value compatible with the user given } @@ -1495,9 +1495,9 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) { start = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo]; // needed to estimate size end = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo]; // needed to estimate size - size = (int) ((end - start) / data->GetTheoryTimeStep()) + 1; + size = (Int_t) ((end - start) / data->GetTheoryTimeStep()) + 1; start = data->GetTheoryTimeStart() + - (int)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - + (Int_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - data->GetTheoryTimeStep()/2.0; // closesd start value compatible with the user given end = start + size * data->GetTheoryTimeStep(); // closesd end value compatible with the user given } @@ -1558,7 +1558,7 @@ void PMusrCanvas::HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunDat * \param runNo * \param data */ -void PMusrCanvas::HandleNonMusrDataSet(unsigned int plotNo, unsigned int runNo, PRunData *data) +void PMusrCanvas::HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) { PMusrCanvasNonMusrDataSet dataSet; TGraphErrors *dataHisto; @@ -1572,7 +1572,7 @@ void PMusrCanvas::HandleNonMusrDataSet(unsigned int plotNo, unsigned int runNo, dataHisto = new TGraphErrors(data->GetX()->size()); // fill graph - for (unsigned int i=0; iGetX()->size(); i++) { + for (UInt_t i=0; iGetX()->size(); i++) { dataHisto->SetPoint(i, data->GetX()->at(i), data->GetValue()->at(i)); dataHisto->SetPointError(i, 0.0, data->GetError()->at(i)); } @@ -1603,7 +1603,7 @@ void PMusrCanvas::HandleNonMusrDataSet(unsigned int plotNo, unsigned int runNo, theoHisto = new TGraphErrors(data->GetXTheory()->size()); // fill graph - for (unsigned int i=0; iGetXTheory()->size(); i++) { + for (UInt_t i=0; iGetXTheory()->size(); i++) { theoHisto->SetPoint(i, data->GetXTheory()->at(i), data->GetTheory()->at(i)); theoHisto->SetPointError(i, 0.0, 0.0); } @@ -1639,7 +1639,7 @@ void PMusrCanvas::HandleDifference() TH1F *diffHisto; TString name; // loop over all histos - for (unsigned int i=0; iGetTitle()) + "_diff"; //cout << endl << ">> diff-name = " << name.Data() << endl; @@ -1659,7 +1659,7 @@ void PMusrCanvas::HandleDifference() fData[i].diff = diffHisto; // calculate diff histo entry double value; - for (int j=1; jGetNbinsX()-1; j++) { + for (Int_t j=1; jGetNbinsX()-1; j++) { // set diff bin value value = CalculateDiff(fData[i].data->GetBinCenter(j), fData[i].data->GetBinContent(j), @@ -1674,7 +1674,7 @@ void PMusrCanvas::HandleDifference() TGraphErrors *diffHisto; TString name; // loop over all histos - for (unsigned int i=0; iGetN()); @@ -1696,7 +1696,7 @@ void PMusrCanvas::HandleDifference() // calculate diff histo entry double value; double x, y; - for (int j=0; jGetN(); j++) { + for (Int_t j=0; jGetN(); j++) { // set diff bin value fNonMusrData[i].data->GetPoint(j, x, y); value = CalculateDiff(x, y, fNonMusrData[i].theory); @@ -1746,7 +1746,7 @@ void PMusrCanvas::HandleFourier() if (fData[0].dataFourierRe == 0) { //cout << endl << ">> Recalculate Fourier ----------------------------------------"; //cout << endl << ">> fData[0].data = " << fData[0].data; - int bin; + Int_t bin; bin = fHistoFrame->GetXaxis()->GetFirst(); //cout << endl << ">> start bin = " << bin; double startTime = fHistoFrame->GetBinCenter(bin); @@ -1755,11 +1755,11 @@ void PMusrCanvas::HandleFourier() //cout << endl << ">> end bin = " << bin; double endTime = fHistoFrame->GetBinCenter(bin); //cout << endl << ">> Fourier: startTime = " << startTime << ", endTime = " << endTime; - for (unsigned int i=0; iSetMarkerStyle(fData[i].data->GetMarkerStyle()); // calculate fourier transform of the theory - int powerPad = (int)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3; + Int_t powerPad = (Int_t)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3; //cout << endl << ">> powerPad = " << powerPad; PFourier fourierTheory(fData[i].theory, fFourier.fUnits, startTime, endTime, powerPad); if (!fourierTheory.IsValid()) { - cout << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier theory ..." << endl; + cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier theory ..." << endl; return; } fourierTheory.Transform(fFourier.fApodization); @@ -1842,9 +1842,9 @@ cout << endl; fCurrentFourierPhase = fFourier.fPhase; - for (unsigned int i=0; iGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].dataFourierRe->GetBinContent(j) * cp + fData[i].dataFourierIm->GetBinContent(j) * sp; im = fData[i].dataFourierIm->GetBinContent(j) * cp - fData[i].dataFourierRe->GetBinContent(j) * sp; @@ -1854,7 +1854,7 @@ cout << endl; } } if ((fData[i].theoryFourierRe != 0) && (fData[i].theoryFourierIm != 0)) { - for (int j=0; jGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].theoryFourierRe->GetBinContent(j) * cp + fData[i].theoryFourierIm->GetBinContent(j) * sp; im = fData[i].theoryFourierIm->GetBinContent(j) * cp - fData[i].theoryFourierRe->GetBinContent(j) * sp; @@ -1876,9 +1876,9 @@ cout << endl; const double cp = TMath::Cos(fCurrentFourierPhase/180.0*TMath::Pi()); const double sp = TMath::Sin(fCurrentFourierPhase/180.0*TMath::Pi()); - for (unsigned int i=0; iGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].dataFourierRe->GetBinContent(j) * cp + fData[i].dataFourierIm->GetBinContent(j) * sp; im = fData[i].dataFourierIm->GetBinContent(j) * cp - fData[i].dataFourierRe->GetBinContent(j) * sp; @@ -1888,7 +1888,7 @@ cout << endl; } } if ((fData[i].theoryFourierRe != 0) && (fData[i].theoryFourierIm != 0)) { - for (int j=0; jGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].theoryFourierRe->GetBinContent(j) * cp + fData[i].theoryFourierIm->GetBinContent(j) * sp; im = fData[i].theoryFourierIm->GetBinContent(j) * cp - fData[i].theoryFourierRe->GetBinContent(j) * sp; @@ -1924,17 +1924,17 @@ void PMusrCanvas::HandleFourierDifference() // check if difference has been already calcualted, if not do it if (fData[0].diff == 0) HandleDifference(); - int bin; + Int_t bin; bin = fData[0].diff->GetXaxis()->GetFirst(); double startTime = fData[0].diff->GetBinCenter(bin); bin = fData[0].diff->GetXaxis()->GetLast(); double endTime = fData[0].diff->GetBinCenter(bin); //cout << endl << ">> startTime = " << startTime << ", endTime = " << endTime << endl; - for (unsigned int i=0; iGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].diffFourierRe->GetBinContent(j) * cp + fData[i].diffFourierIm->GetBinContent(j) * sp; im = fData[i].diffFourierIm->GetBinContent(j) * cp - fData[i].diffFourierRe->GetBinContent(j) * sp; @@ -2020,8 +2020,8 @@ double PMusrCanvas::FindOptimalFourierPhase() Double_t minIm = 0.0, maxIm = 0.0, asymmetry; // get min/max of the imaginary part for phase = 0.0 as a starting point minPhase = 0.0; - bool first = true; - for (int i=0; iGetNbinsX(); i++) { + Bool_t first = true; + for (Int_t i=0; iGetNbinsX(); i++) { x = fData[0].dataFourierIm->GetBinCenter(i); if ((x > fFourier.fRangeForPhaseCorrection[0]) && (x < fFourier.fRangeForPhaseCorrection[1])) { valIm = fData[0].dataFourierIm->GetBinContent(i); @@ -2047,7 +2047,7 @@ double PMusrCanvas::FindOptimalFourierPhase() cp = TMath::Cos(phase / 180.0 * TMath::Pi()); sp = TMath::Sin(phase / 180.0 * TMath::Pi()); first = true; - for (int i=0; iGetNbinsX(); i++) { + for (Int_t i=0; iGetNbinsX(); i++) { x = fData[0].dataFourierIm->GetBinCenter(i); if ((x > fFourier.fRangeForPhaseCorrection[0]) && (x < fFourier.fRangeForPhaseCorrection[1])) { valIm = -sp * fData[0].dataFourierRe->GetBinContent(i) + cp * fData[0].dataFourierIm->GetBinContent(i); @@ -2085,7 +2085,7 @@ cout << endl << ">> optimal phase = " << minPhase << endl; */ void PMusrCanvas::CleanupDifference() { - for (unsigned int i=0; iGetBinContent(1); double binContent; - for (int i=2; i < histo->GetNbinsX(); i++) { + for (Int_t i=2; i < histo->GetNbinsX(); i++) { binContent = histo->GetBinContent(i); if (max < binContent) max = binContent; @@ -2276,7 +2276,7 @@ double PMusrCanvas::GetGlobalMinimum(TH1F* histo) double min = histo->GetBinContent(1); double binContent; - for (int i=2; i < histo->GetNbinsX(); i++) { + for (Int_t i=2; i < histo->GetNbinsX(); i++) { binContent = histo->GetBinContent(i); if (min > binContent) min = binContent; @@ -2317,7 +2317,7 @@ void PMusrCanvas::PlotData() Double_t dataXmax = fData[0].data->GetXaxis()->GetXmax(); Double_t dataYmin = fData[0].data->GetMinimum(); Double_t dataYmax = fData[0].data->GetMaximum(); - for (unsigned int i=1; iGetXaxis()->GetXmin() < dataXmin) dataXmin = fData[i].data->GetXaxis()->GetXmin(); if (fData[i].data->GetXaxis()->GetXmax() > dataXmax) @@ -2338,7 +2338,7 @@ void PMusrCanvas::PlotData() fXmax = fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[0]; fYmin = fData[0].data->GetMinimum(); fYmax = fData[0].data->GetMaximum(); - for (unsigned int i=1; iGetMsrPlotList()->at(fPlotNumber).fTmin.size(); i++) { + for (UInt_t i=1; iGetMsrPlotList()->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) @@ -2394,11 +2394,11 @@ void PMusrCanvas::PlotData() } fHistoFrame->GetYaxis()->SetTitle(yAxisTitle.Data()); // plot all data - for (unsigned int i=0; iDraw("pesame"); } // plot all the theory - for (unsigned int i=0; iDraw("lsame"); } } @@ -2412,7 +2412,7 @@ void PMusrCanvas::PlotData() PMsrRunList runs = *fMsrHandler->GetMsrRunList(); PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber); - unsigned int runNo = (unsigned int)plotInfo.fRuns[0].Re()-1; + UInt_t runNo = (UInt_t)plotInfo.fRuns[0].Re()-1; TString xAxisTitle = fRunList->GetXAxisTitle(runs[runNo].fRunName[0], runNo); TString yAxisTitle = fRunList->GetYAxisTitle(runs[runNo].fRunName[0], runNo); @@ -2423,7 +2423,7 @@ void PMusrCanvas::PlotData() assert(fMultiGraphData != 0); // add all data to fMultiGraphData - for (unsigned int i=0; iAdd(ge, "p"); } // add all the theory to fMultiGraphData - for (unsigned int i=0; iGetXAxisTitle(runs[runNo].fRunName[0], runNo); yAxisTitle = fRunList->GetYAxisTitle(runs[runNo].fRunName[0], runNo); legendLabel.push_back(xAxisTitle + " vs. " + yAxisTitle); } - for (unsigned int i=0; iAddEntry(fNonMusrData[i].data, legendLabel[i].Data(), "p"); } legendLabel.clear(); @@ -2517,7 +2517,7 @@ void PMusrCanvas::PlotDifference() // set y-axis label hframe->GetYaxis()->SetTitle("data-theory"); // plot all remaining diff data - for (unsigned int i=0; iDraw("pesame"); } } else { // fPlotType == MSR_PLOT_NON_MUSR @@ -2530,7 +2530,7 @@ void PMusrCanvas::PlotDifference() PMsrRunList runs = *fMsrHandler->GetMsrRunList(); PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber); - unsigned int runNo = (unsigned int)plotInfo.fRuns[0].Re()-1; + UInt_t runNo = (UInt_t)plotInfo.fRuns[0].Re()-1; TString xAxisTitle = fRunList->GetXAxisTitle(runs[runNo].fRunName[0], runNo); // if fMultiGraphDiff is not present create it and add the diff data @@ -2539,7 +2539,7 @@ void PMusrCanvas::PlotDifference() assert(fMultiGraphDiff != 0); // add all diff data to fMultiGraphDiff - for (unsigned int i=0; i> y-range: min, max = " << min << ", " << max; - for (unsigned int i=1; iGetYaxis()->SetTitle("Real Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("psame"); } // plot theories - for (unsigned int i=0; iDraw("same"); } @@ -2668,7 +2668,7 @@ void PMusrCanvas::PlotFourier() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].dataFourierIm); max = GetGlobalMaximum(fData[0].dataFourierIm); - for (unsigned int i=1; iGetYaxis()->SetTitle("Imaginary Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("psame"); } // plot theories - for (unsigned int i=0; iDraw("same"); } @@ -2716,7 +2716,7 @@ void PMusrCanvas::PlotFourier() // real part first min = GetGlobalMinimum(fData[0].dataFourierRe); max = GetGlobalMaximum(fData[0].dataFourierRe); - for (unsigned int i=1; iDraw("psame"); - for (unsigned int i=1; iDraw("psame"); fData[i].dataFourierIm->Draw("psame"); } // plot theories - for (unsigned int i=0; iDraw("same"); fData[i].theoryFourierIm->Draw("same"); } @@ -2775,7 +2775,7 @@ void PMusrCanvas::PlotFourier() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].dataFourierPwr); max = GetGlobalMaximum(fData[0].dataFourierPwr); - for (unsigned int i=1; iGetYaxis()->SetTitle("Power Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("psame"); } // plot theories - for (unsigned int i=0; iDraw("same"); } @@ -2820,7 +2820,7 @@ void PMusrCanvas::PlotFourier() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].dataFourierPhase); max = GetGlobalMaximum(fData[0].dataFourierPhase); - for (unsigned int i=1; iGetYaxis()->SetTitle("Phase Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("psame"); } // plot theories - for (unsigned int i=0; iDraw("same"); } @@ -2913,7 +2913,7 @@ void PMusrCanvas::PlotFourierDifference() min = GetGlobalMinimum(fData[0].diffFourierRe); max = GetGlobalMaximum(fData[0].diffFourierRe); //cout << endl << ">> y-range: min, max = " << min << ", " << max; - for (unsigned int i=1; iGetYaxis()->SetTitle("Real Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("plsame"); } @@ -2956,7 +2956,7 @@ void PMusrCanvas::PlotFourierDifference() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].diffFourierIm); max = GetGlobalMaximum(fData[0].diffFourierIm); - for (unsigned int i=1; iGetYaxis()->SetTitle("Imaginary Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("plsame"); } @@ -2998,7 +2998,7 @@ void PMusrCanvas::PlotFourierDifference() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].diffFourierRe); max = GetGlobalMaximum(fData[0].diffFourierRe); - for (unsigned int i=1; i max) max = binContent; } - for (unsigned int i=0; iDraw("plsame"); - for (unsigned int i=1; iDraw("plsame"); fData[i].diffFourierIm->Draw("plsame"); } @@ -3050,7 +3050,7 @@ void PMusrCanvas::PlotFourierDifference() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].diffFourierPwr); max = GetGlobalMaximum(fData[0].diffFourierPwr); - for (unsigned int i=1; iGetYaxis()->SetTitle("Power Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("plsame"); } @@ -3092,7 +3092,7 @@ void PMusrCanvas::PlotFourierDifference() // first find minimum/maximum of all histos min = GetGlobalMinimum(fData[0].diffFourierPhase); max = GetGlobalMaximum(fData[0].diffFourierPhase); - for (unsigned int i=1; iGetYaxis()->SetTitle("Phase Fourier"); // plot all remaining data - for (unsigned int i=1; iDraw("plsame"); } @@ -3179,9 +3179,9 @@ void PMusrCanvas::IncrementFourierPhase() fCurrentFourierPhase += fFourier.fPhaseIncrement; PlotFourierPhaseValue(); - for (unsigned int i=0; iGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].dataFourierRe->GetBinContent(j) * cp + fData[i].dataFourierIm->GetBinContent(j) * sp; im = fData[i].dataFourierIm->GetBinContent(j) * cp - fData[i].dataFourierRe->GetBinContent(j) * sp; @@ -3191,7 +3191,7 @@ void PMusrCanvas::IncrementFourierPhase() } } if ((fData[i].theoryFourierRe != 0) && (fData[i].theoryFourierIm != 0)) { - for (int j=0; jGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].theoryFourierRe->GetBinContent(j) * cp + fData[i].theoryFourierIm->GetBinContent(j) * sp; im = fData[i].theoryFourierIm->GetBinContent(j) * cp - fData[i].theoryFourierRe->GetBinContent(j) * sp; @@ -3201,7 +3201,7 @@ void PMusrCanvas::IncrementFourierPhase() } } if ((fData[i].diffFourierRe != 0) && (fData[i].diffFourierIm != 0)) { - for (int j=0; jGetNbinsX(); j++) { // loop over a fourier diff data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier diff data set // calculate new fourier diff data set value re = fData[i].diffFourierRe->GetBinContent(j) * cp + fData[i].diffFourierIm->GetBinContent(j) * sp; im = fData[i].diffFourierIm->GetBinContent(j) * cp - fData[i].diffFourierRe->GetBinContent(j) * sp; @@ -3230,9 +3230,9 @@ void PMusrCanvas::DecrementFourierPhase() fCurrentFourierPhase -= fFourier.fPhaseIncrement; PlotFourierPhaseValue(); - for (unsigned int i=0; iGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].dataFourierRe->GetBinContent(j) * cp - fData[i].dataFourierIm->GetBinContent(j) * sp; im = fData[i].dataFourierIm->GetBinContent(j) * cp + fData[i].dataFourierRe->GetBinContent(j) * sp; @@ -3242,7 +3242,7 @@ void PMusrCanvas::DecrementFourierPhase() } } if ((fData[i].theoryFourierRe != 0) && (fData[i].theoryFourierIm != 0)) { - for (int j=0; jGetNbinsX(); j++) { // loop over a fourier data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value re = fData[i].theoryFourierRe->GetBinContent(j) * cp - fData[i].theoryFourierIm->GetBinContent(j) * sp; im = fData[i].theoryFourierIm->GetBinContent(j) * cp + fData[i].theoryFourierRe->GetBinContent(j) * sp; @@ -3252,7 +3252,7 @@ void PMusrCanvas::DecrementFourierPhase() } } if ((fData[i].diffFourierRe != 0) && (fData[i].diffFourierIm != 0)) { - for (int j=0; jGetNbinsX(); j++) { // loop over a fourier diff data set + for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier diff data set // calculate new fourier diff data set value re = fData[i].diffFourierRe->GetBinContent(j) * cp - fData[i].diffFourierIm->GetBinContent(j) * sp; im = fData[i].diffFourierIm->GetBinContent(j) * cp + fData[i].diffFourierRe->GetBinContent(j) * sp; @@ -3281,7 +3281,7 @@ void PMusrCanvas::SaveDataAscii() TString str; TString flnData = TString(""); TString flnTheo = TString(""); - for (int i=0; iGetEntries()-1; i++) { + for (Int_t i=0; iGetEntries()-1; i++) { ostr = dynamic_cast(tokens->At(i)); flnData += ostr->GetString() + TString("."); flnTheo += ostr->GetString() + TString("."); @@ -3305,7 +3305,7 @@ void PMusrCanvas::SaveDataAscii() // open output data-file foutData.open(flnData.Data(), iostream::out); if (!foutData.is_open()) { - cout << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << flnData.Data() << " for writing." << endl; + cerr << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << flnData.Data() << " for writing." << endl; return; } @@ -3313,7 +3313,7 @@ void PMusrCanvas::SaveDataAscii() // open output theory-file foutTheo.open(flnTheo.Data(), iostream::out); if (!foutTheo.is_open()) { - cout << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << flnTheo.Data() << " for writing." << endl; + cerr << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << flnTheo.Data() << " for writing." << endl; return; } } @@ -3333,7 +3333,7 @@ void PMusrCanvas::SaveDataAscii() case PV_DATA: // write header foutData << "% time (us)"; - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xminBin); xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); // get difference data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { time = fData[0].diff->GetBinCenter(i); // get time if ((time < xmin) || (time > xmax)) continue; foutData << time; - for (unsigned int j=0; jGetBinContent(i); foutData << ", " << fData[j].diff->GetBinError(i); } @@ -3373,13 +3373,13 @@ void PMusrCanvas::SaveDataAscii() case PV_DATA: // write header foutData << endl << "% timeData (us)"; - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xminBin); xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { time = fData[0].data->GetBinCenter(i); // get time if ((time < xmin) || (time > xmax)) continue; foutData << time << ", "; - for (unsigned int j=0; jGetBinContent(i) << ", "; foutData << fData[j].data->GetBinError(i) << ", "; } @@ -3406,12 +3406,12 @@ void PMusrCanvas::SaveDataAscii() } // write theory - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { time = fData[0].theory->GetBinCenter(i); // get time if ((time < xmin) || (time > xmax)) continue; foutTheo << time << ", "; - for (unsigned int j=0; jGetBinContent(i) << ", "; } // write last data set @@ -3437,13 +3437,13 @@ void PMusrCanvas::SaveDataAscii() break; } foutData << str.Data(); - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].dataFourierRe->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetBinContent(i); } foutData << endl; } // write theory - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].theoryFourierRe->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutTheo << xval; - for (unsigned int j=0; jGetBinContent(i); } foutTheo << endl; @@ -3496,13 +3496,13 @@ void PMusrCanvas::SaveDataAscii() break; } foutData << str.Data(); - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].dataFourierIm->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetBinContent(i); } foutData << endl; } // write theory - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].theoryFourierIm->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutTheo << xval; - for (unsigned int j=0; jGetBinContent(i); } foutTheo << endl; @@ -3555,13 +3555,13 @@ void PMusrCanvas::SaveDataAscii() break; } foutData << str.Data(); - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].dataFourierRe->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetBinContent(i); foutData << ", " << fData[j].dataFourierIm->GetBinContent(i); } @@ -3586,12 +3586,12 @@ void PMusrCanvas::SaveDataAscii() } // write theory - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].theoryFourierRe->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutTheo << xval; - for (unsigned int j=0; jGetBinContent(i); foutTheo << ", " << fData[j].theoryFourierIm->GetBinContent(i); } @@ -3616,13 +3616,13 @@ void PMusrCanvas::SaveDataAscii() break; } foutData << str.Data(); - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].dataFourierPwr->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetBinContent(i); } foutData << endl; } // write theory - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].theoryFourierPwr->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutTheo << xval; - for (unsigned int j=0; jGetBinContent(i); } foutTheo << endl; @@ -3675,13 +3675,13 @@ void PMusrCanvas::SaveDataAscii() break; } foutData << str.Data(); - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].dataFourierPhase->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetBinContent(i); } foutData << endl; } // write theory - for (int i=1; iGetNbinsX()-1; i++) { + for (Int_t i=1; iGetNbinsX()-1; i++) { xval = fData[0].theoryFourierPhase->GetBinCenter(i); // get x-unit if ((xval < xmin) || (xval > xmax)) continue; foutTheo << xval; - for (unsigned int j=0; jGetBinContent(i); } foutTheo << endl; @@ -3727,7 +3727,7 @@ void PMusrCanvas::SaveDataAscii() case PV_DATA: // write header foutData << "% " << fNonMusrData[0].diff->GetXaxis()->GetTitle() << ", "; - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=0; iGetN(); i++) { + for (Int_t i=0; iGetN(); i++) { fNonMusrData[0].diff->GetPoint(i,xval,yval); // get values if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetPoint(i,xval,yval); // get values foutData << ", " << yval; foutData << ", " << fNonMusrData[j].diff->GetErrorY(i); @@ -3771,13 +3771,13 @@ void PMusrCanvas::SaveDataAscii() case PV_DATA: // write header foutData << "% " << fNonMusrData[0].data->GetXaxis()->GetTitle() << ", "; - for (unsigned int j=0; jGetXaxis()->GetTitle() << ", "; - for (unsigned int j=0; jGetXaxis()->GetBinCenter(xmaxBin); // write data - for (int i=0; iGetN(); i++) { + for (Int_t i=0; iGetN(); i++) { fNonMusrData[0].data->GetPoint(i,xval,yval); // get values if ((xval < xmin) || (xval > xmax)) continue; foutData << xval; - for (unsigned int j=0; jGetPoint(i,xval,yval); // get values foutData << ", " << yval; foutData << ", " << fNonMusrData[j].data->GetErrorY(i); @@ -3803,12 +3803,12 @@ void PMusrCanvas::SaveDataAscii() } // write theory - for (int i=0; iGetN(); i++) { + for (Int_t i=0; iGetN(); i++) { fNonMusrData[0].theory->GetPoint(i,xval,yval); // get values if ((xval < xmin) || (xval > xmax)) continue; foutTheo << xval; - for (unsigned int j=0; jGetPoint(i,xval,yval); // get values foutTheo << ", " << yval; } diff --git a/src/classes/PMusrT0.cpp b/src/classes/PMusrT0.cpp index f698bd46..70a64d4f 100644 --- a/src/classes/PMusrT0.cpp +++ b/src/classes/PMusrT0.cpp @@ -84,7 +84,7 @@ PMusrT0::PMusrT0() * \param rawRunData * \param histoNo */ -PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTag, int addRunNo) : +PMusrT0::PMusrT0(PRawRunData *rawRunData, Int_t runNo, Int_t histoNo, Int_t detectorTag, Int_t addRunNo) : fRunNo(runNo), fDetectorTag(detectorTag), fAddRunNo(addRunNo) { cout << endl << "run Name = " << rawRunData->GetRunName()->Data() << ", runNo = " << fRunNo << ", histoNo = " << histoNo << endl; @@ -107,7 +107,7 @@ cout << endl << "run Name = " << rawRunData->GetRunName()->Data() << ", runNo = fHisto->SetMarkerSize(0.5); fHisto->SetMarkerColor(TColor::GetColor(0,0,0)); // black - for (unsigned int i=0; iGetDataBin(histoNo-1)->size(); i++) { + for (UInt_t i=0; iGetDataBin(histoNo-1)->size(); i++) { fHisto->SetBinContent(i+1, rawRunData->GetDataBin(histoNo-1)->at(i)); } @@ -243,7 +243,7 @@ void PMusrT0::SetMsrHandler(PMsrHandler *msrHandler) void PMusrT0::InitDataAndBkg() { // get addRun offset which depends on the fit type - int fitType = fMsrHandler->GetMsrRunList()->at(fRunNo).fFitType; + Int_t fitType = fMsrHandler->GetMsrRunList()->at(fRunNo).fFitType; if (fitType == MSR_FITTYPE_SINGLE_HISTO) { fAddRunOffset = 2; } else if (fitType == MSR_FITTYPE_ASYM) { @@ -281,7 +281,7 @@ void PMusrT0::InitDataAndBkg() fData->SetMarkerSize(0.5); fData->SetMarkerColor(TColor::GetColor(0,0,255)); // blue - for (int i=0; iSetBinContent(i+1, fHisto->GetBinContent(fDataRange[0]+i+1)); } fData->Draw("p0 9 hist same"); @@ -315,7 +315,7 @@ void PMusrT0::InitDataAndBkg() fBkg->SetMarkerSize(0.5); fBkg->SetMarkerColor(TColor::GetColor(255,0,0)); // red - for (int i=0; iSetBinContent(i+1, fHisto->GetBinContent(fBkgRange[0]+i+1)); } fBkg->Draw("p0 9 hist same"); @@ -341,33 +341,33 @@ void PMusrT0::InitDataAndBkg() break; } Double_t max = fHisto->GetMaximum(); - fT0Line = new TLine((double)t0Bin, 0.0, (double)t0Bin, max); + fT0Line = new TLine((Double_t)t0Bin, 0.0, (Double_t)t0Bin, max); fT0Line->SetLineStyle(1); // solid fT0Line->SetLineColor(TColor::GetColor(0,255,0)); // green fT0Line->SetLineWidth(2); fT0Line->Draw(); // data lines - fFirstDataLine = new TLine((double)fDataRange[0], 0.0, (double)fDataRange[0], max); + fFirstDataLine = new TLine((Double_t)fDataRange[0], 0.0, (Double_t)fDataRange[0], max); fFirstDataLine->SetLineStyle(3); // doted fFirstDataLine->SetLineColor(TColor::GetColor(0,0,255)); // blue fFirstDataLine->SetLineWidth(2); fFirstDataLine->Draw(); - fLastDataLine = new TLine((double)fDataRange[1], 0.0, (double)fDataRange[1], max); + fLastDataLine = new TLine((Double_t)fDataRange[1], 0.0, (Double_t)fDataRange[1], max); fLastDataLine->SetLineStyle(3); // doted fLastDataLine->SetLineColor(TColor::GetColor(0,0,255)); // blue fLastDataLine->SetLineWidth(2); fLastDataLine->Draw(); // bkg lines - fFirstBkgLine = new TLine((double)fBkgRange[0], 0.0, (double)fBkgRange[0], max); + fFirstBkgLine = new TLine((Double_t)fBkgRange[0], 0.0, (Double_t)fBkgRange[0], max); fFirstBkgLine->SetLineStyle(6); // _..._... fFirstBkgLine->SetLineColor(TColor::GetColor(255,0,0)); // red fFirstBkgLine->SetLineWidth(2); fFirstBkgLine->Draw(); - fLastBkgLine = new TLine((double)fBkgRange[1], 0.0, (double)fBkgRange[1], max); + fLastBkgLine = new TLine((Double_t)fBkgRange[1], 0.0, (Double_t)fBkgRange[1], max); fLastBkgLine->SetLineStyle(6); // _..._... fLastBkgLine->SetLineColor(TColor::GetColor(255,0,0)); // red fLastBkgLine->SetLineWidth(2); @@ -385,7 +385,7 @@ void PMusrT0::InitDataAndBkg() */ void PMusrT0::SetT0Channel() { - double x=0, y=0; + Double_t x=0, y=0; fMainCanvas->AbsPixeltoXY(fPx,fPy,x,y); // get binx to set t0 corresponding to fPx @@ -394,7 +394,7 @@ void PMusrT0::SetT0Channel() cout << endl << ">> PMusrT0::SetT0Channel(): binx = " << binx << endl; // set t0 bin in msr-Handler - unsigned int idx = 0; + UInt_t idx = 0; switch(fDetectorTag) { case DETECTOR_TAG_FORWARD: idx = fAddRunNo * fAddRunOffset / 2; @@ -430,7 +430,7 @@ cout << endl << ">> PMusrT0::SetT0Channel(): binx = " << binx << endl; */ void PMusrT0::SetDataFirstChannel() { - double x=0, y=0; + Double_t x=0, y=0; fMainCanvas->AbsPixeltoXY(fPx,fPy,x,y); // get binx to set the data first channel corresponding to fPx @@ -439,7 +439,7 @@ void PMusrT0::SetDataFirstChannel() cout << endl << ">> PMusrT0::SetDataFirstChannel(): fDataRange[0] = " << fDataRange[0] << endl; // set the data first bin in msr-Handler - unsigned int idx = 0; + UInt_t idx = 0; switch(fDetectorTag) { case DETECTOR_TAG_FORWARD: idx = fAddRunNo * fAddRunOffset; @@ -474,7 +474,7 @@ cout << endl << ">> PMusrT0::SetDataFirstChannel(): fDataRange[0] = " << fDataRa fData->SetMarkerStyle(21); fData->SetMarkerSize(0.5); fData->SetMarkerColor(TColor::GetColor(0,0,255)); // blue - for (int i=0; iSetBinContent(i+1, fHisto->GetBinContent(fDataRange[0]+i+1)); } fData->Draw("p0 9 hist same"); @@ -492,7 +492,7 @@ cout << endl << ">> PMusrT0::SetDataFirstChannel(): fDataRange[0] = " << fDataRa */ void PMusrT0::SetDataLastChannel() { - double x=0, y=0; + Double_t x=0, y=0; fMainCanvas->AbsPixeltoXY(fPx,fPy,x,y); // get binx to set the data last channel corresponding to fPx @@ -501,7 +501,7 @@ void PMusrT0::SetDataLastChannel() cout << endl << ">> PMusrT0::SetDataLastChannel(): fDataRange[1] = " << fDataRange[1] << endl; // set the data first bin in msr-Handler - unsigned int idx = 0; + UInt_t idx = 0; switch(fDetectorTag) { case DETECTOR_TAG_FORWARD: idx = 1 + fAddRunNo * fAddRunOffset; @@ -536,7 +536,7 @@ cout << endl << ">> PMusrT0::SetDataLastChannel(): fDataRange[1] = " << fDataRan fData->SetMarkerStyle(21); fData->SetMarkerSize(0.5); fData->SetMarkerColor(TColor::GetColor(0,0,255)); // blue - for (int i=0; iSetBinContent(i+1, fHisto->GetBinContent(fDataRange[0]+i+1)); } fData->Draw("p0 9 hist same"); @@ -554,7 +554,7 @@ cout << endl << ">> PMusrT0::SetDataLastChannel(): fDataRange[1] = " << fDataRan */ void PMusrT0::SetBkgFirstChannel() { - double x=0, y=0; + Double_t x=0, y=0; fMainCanvas->AbsPixeltoXY(fPx,fPy,x,y); // get binx to set the background first channel corresponding to fPx @@ -563,7 +563,7 @@ void PMusrT0::SetBkgFirstChannel() cout << endl << ">> PMusrT0::SetBkgFirstChannel(): fBkgRange[0] = " << fBkgRange[0] << endl; // set the background first bin in msr-Handler - unsigned int idx = 0; + UInt_t idx = 0; switch(fDetectorTag) { case DETECTOR_TAG_FORWARD: idx = fAddRunNo * fAddRunOffset; @@ -598,7 +598,7 @@ cout << endl << ">> PMusrT0::SetBkgFirstChannel(): fBkgRange[0] = " << fBkgRange fBkg->SetMarkerStyle(21); fBkg->SetMarkerSize(0.5); fBkg->SetMarkerColor(TColor::GetColor(255,0,0)); // red - for (int i=0; iSetBinContent(i+1, fHisto->GetBinContent(fBkgRange[0]+i+1)); } fBkg->Draw("p0 9 hist same"); @@ -616,7 +616,7 @@ cout << endl << ">> PMusrT0::SetBkgFirstChannel(): fBkgRange[0] = " << fBkgRange */ void PMusrT0::SetBkgLastChannel() { - double x=0, y=0; + Double_t x=0, y=0; fMainCanvas->AbsPixeltoXY(fPx,fPy,x,y); // get binx to set the background last channel corresponding to fPx @@ -625,7 +625,7 @@ void PMusrT0::SetBkgLastChannel() cout << endl << ">> PMusrT0::SetBkgLastChannel(): fBkgRange[1] = " << fBkgRange[1] << endl; // set the background first bin in msr-Handler - unsigned int idx = 0; + UInt_t idx = 0; switch(fDetectorTag) { case DETECTOR_TAG_FORWARD: idx = 1 + fAddRunNo * fAddRunOffset; @@ -660,7 +660,7 @@ cout << endl << ">> PMusrT0::SetBkgLastChannel(): fBkgRange[1] = " << fBkgRange[ fBkg->SetMarkerStyle(21); fBkg->SetMarkerSize(0.5); fBkg->SetMarkerColor(TColor::GetColor(255,0,0)); // red - for (int i=0; iSetBinContent(i+1, fHisto->GetBinContent(fBkgRange[0]+i+1)); } fBkg->Draw("p0 9 hist same"); diff --git a/src/classes/PRunAsymmetry.cpp b/src/classes/PRunAsymmetry.cpp index ade82862..a844aff0 100644 --- a/src/classes/PRunAsymmetry.cpp +++ b/src/classes/PRunAsymmetry.cpp @@ -59,7 +59,7 @@ PRunAsymmetry::PRunAsymmetry() : PRunBase() * \param msrInfo pointer to the msr info structure * \param runNo number of the run of the msr-file */ -PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) +PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) { // check if alpha and/or beta is fixed -------------------- @@ -67,31 +67,34 @@ PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, uns // check if alpha is given if (fRunInfo->fAlphaParamNo == -1) { // no alpha given - cout << endl << "PRunAsymmetry::PRunAsymmetry(): no alpha parameter given! This is needed for an asymmetry fit!"; + cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!"; + cerr << endl; fValid = false; return; } // check if alpha parameter is within proper bounds - if ((fRunInfo->fAlphaParamNo < 0) || (fRunInfo->fAlphaParamNo > (int)param->size())) { - cout << endl << "PRunAsymmetry::PRunAsymmetry(): alpha parameter no = " << fRunInfo->fAlphaParamNo; - cout << endl << " This is out of bound, since there are only " << param->size() << " parameters."; + if ((fRunInfo->fAlphaParamNo < 0) || (fRunInfo->fAlphaParamNo > (Int_t)param->size())) { + cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** alpha parameter no = " << fRunInfo->fAlphaParamNo; + cerr << endl << " This is out of bound, since there are only " << param->size() << " parameters."; + cerr << endl; fValid = false; return; } // check if alpha is fixed - bool alphaFixedToOne = false; + Bool_t alphaFixedToOne = false; //cout << endl << ">> alpha = " << (*param)[fRunInfo->fAlphaParamNo-1].fValue << ", " << (*param)[fRunInfo->fAlphaParamNo-1].fStep; if (((*param)[fRunInfo->fAlphaParamNo-1].fStep == 0.0) && ((*param)[fRunInfo->fAlphaParamNo-1].fValue == 1.0)) alphaFixedToOne = true; // check if beta is given - bool betaFixedToOne = false; + Bool_t betaFixedToOne = false; if (fRunInfo->fBetaParamNo == -1) { // no beta given hence assuming beta == 1 betaFixedToOne = true; - } else if ((fRunInfo->fBetaParamNo < 0) || (fRunInfo->fBetaParamNo > (int)param->size())) { // check if beta parameter is within proper bounds - cout << endl << "PRunAsymmetry::PRunAsymmetry(): beta parameter no = " << fRunInfo->fBetaParamNo; - cout << endl << " This is out of bound, since there are only " << param->size() << " parameters."; + } else if ((fRunInfo->fBetaParamNo < 0) || (fRunInfo->fBetaParamNo > (Int_t)param->size())) { // check if beta parameter is within proper bounds + cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** beta parameter no = " << fRunInfo->fBetaParamNo; + cerr << endl << " This is out of bound, since there are only " << param->size() << " parameters."; + cerr << endl; fValid = false; return; } else { // check if beta is fixed @@ -140,22 +143,22 @@ PRunAsymmetry::~PRunAsymmetry() * * \param par parameter vector iterated by minuit */ -double PRunAsymmetry::CalcChiSquare(const std::vector& par) +Double_t PRunAsymmetry::CalcChiSquare(const std::vector& par) { - double chisq = 0.0; - double diff = 0.0; - double asymFcnValue = 0.0; - double a, b, f; + Double_t chisq = 0.0; + Double_t diff = 0.0; + Double_t asymFcnValue = 0.0; + Double_t a, b, f; // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate chisq - double time; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + Double_t time; + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); if ((time>=fFitStartTime) && (time<=fFitStopTime)) { switch (fAlphaBetaTag) { case 1: // alpha == 1, beta == 1 @@ -199,7 +202,7 @@ double PRunAsymmetry::CalcChiSquare(const std::vector& par) * * \param par parameter vector iterated by minuit */ -double PRunAsymmetry::CalcMaxLikelihood(const std::vector& par) +Double_t PRunAsymmetry::CalcMaxLikelihood(const std::vector& par) { cout << endl << "PRunSingleHisto::CalcMaxLikelihood(): not implemented yet ..." << endl; @@ -216,22 +219,22 @@ double PRunAsymmetry::CalcMaxLikelihood(const std::vector& par) void PRunAsymmetry::CalcTheory() { // feed the parameter vector - std::vector par; + std::vector par; PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); - for (unsigned int i=0; isize(); i++) + for (UInt_t i=0; isize(); i++) par.push_back((*paramList)[i].fValue); // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate asymmetry - double asymFcnValue = 0.0; - double a, b, f; - double time; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + Double_t asymFcnValue = 0.0; + Double_t a, b, f; + Double_t time; + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); switch (fAlphaBetaTag) { case 1: // alpha == 1, beta == 1 asymFcnValue = fTheory->Func(time, par, fFuncValues); @@ -274,7 +277,7 @@ void PRunAsymmetry::CalcTheory() * (b_i^{\rm c})^2 (\Delta f_i^{\rm c})^2 + * (\Delta b_i^{\rm c})^2 (f_i^{\rm c})^2\right]^{1/2}\f] */ -bool PRunAsymmetry::PrepareData() +Bool_t PRunAsymmetry::PrepareData() { //cout << endl << "in PRunAsymmetry::PrepareData(): will feed fData" << endl; @@ -282,7 +285,8 @@ bool PRunAsymmetry::PrepareData() // get the correct run PRawRunData *runData = fRawData->GetRunData(fRunInfo->fRunName[0]); if (!runData) { // run not found - cout << endl << "PRunAsymmetry::PrepareData(): Couldn't get run " << fRunInfo->fRunName[0].Data() << "!"; + cerr << endl << "PRunAsymmetry::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->fRunName[0].Data() << "!"; + cerr << endl; return false; } @@ -304,7 +308,8 @@ bool PRunAsymmetry::PrepareData() fT0s.push_back(runData->GetT0(fRunInfo->fForwardHistoNo-1)); // forward t0 fT0s.push_back(runData->GetT0(fRunInfo->fBackwardHistoNo-1)); // backward t0 } else { // t0's are neither in the run data nor in the msr-file -> not acceptable! - cout << endl << "PRunAsymmetry::PrepareData(): NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << "PRunAsymmetry::PrepareData(): **ERROR** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl; return false; } } else { // t0's in the msr-file @@ -312,18 +317,18 @@ bool PRunAsymmetry::PrepareData() if (runData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file if (fabs(fRunInfo->fT0[0]-runData->GetT0(fRunInfo->fForwardHistoNo-1))>5.0) { // given in bins!! - cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo"; - cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[0]; - cout << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->fForwardHistoNo-1); - cout << endl << " This is quite a deviation! Is this done intentionally??"; - cout << endl; + cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo"; + cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[0]; + cerr << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->fForwardHistoNo-1); + cerr << endl << " This is quite a deviation! Is this done intentionally??"; + cerr << endl; } if (fabs(fRunInfo->fT0[1]-runData->GetT0(fRunInfo->fBackwardHistoNo-1))>5.0) { // given in bins!! - cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo"; - cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[1]; - cout << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->fBackwardHistoNo-1); - cout << endl << " This is quite a deviation! Is this done intentionally??"; - cout << endl; + cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo"; + cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[1]; + cerr << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->fBackwardHistoNo-1); + cerr << endl << " This is quite a deviation! Is this done intentionally??"; + cerr << endl; } } fT0s.push_back(fRunInfo->fT0[0]); // forward t0 @@ -331,17 +336,17 @@ bool PRunAsymmetry::PrepareData() } // check if post pile up data shall be used - unsigned int histoNo[2]; // forward/backward + UInt_t histoNo[2]; // forward/backward histoNo[0] = fRunInfo->fForwardHistoNo-1; histoNo[1] = fRunInfo->fBackwardHistoNo-1; // first check if forward/backward given in the msr-file are valid if ((runData->GetNoOfHistos() < histoNo[0]+1) || (histoNo[0] < 0) || (runData->GetNoOfHistos() < histoNo[1]+1) || (histoNo[1] < 0)) { - cout << endl << "PRunAsymmetry::PrepareData(): **PANIC ERROR**:"; - cout << endl << " forward/backward histo no found = " << histoNo[0]+1; - cout << ", " << histoNo[1]+1 << ", but there are only " << runData->GetNoOfHistos() << " histo sets!?!?"; - cout << endl << " Will quit :-("; - cout << endl; + cerr << endl << "PRunAsymmetry::PrepareData(): **PANIC ERROR**:"; + cerr << endl << " forward/backward histo no found = " << histoNo[0]+1; + cerr << ", " << histoNo[1]+1 << ", but there are only " << runData->GetNoOfHistos() << " histo sets!?!?"; + cerr << endl << " Will quit :-("; + cerr << endl; return false; } @@ -355,16 +360,17 @@ bool PRunAsymmetry::PrepareData() // check if there are runs to be added to the current one if (fRunInfo->fRunName.size() > 1) { // runs to be added present PRawRunData *addRunData; - for (unsigned int i=1; ifRunName.size(); i++) { + for (UInt_t i=1; ifRunName.size(); i++) { // get run to be added to the main one addRunData = fRawData->GetRunData(fRunInfo->fRunName[i]); if (addRunData == 0) { // couldn't get run - cout << endl << "PRunAsymmetry::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->fRunName[i].Data() << "!"; + cerr << endl << "PRunAsymmetry::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->fRunName[i].Data() << "!"; + cerr << endl; return false; } // get T0's of the to be added run - int t0Add[2] = {0, 0}; + Int_t t0Add[2] = {0, 0}; // check if the t0's are given in the msr-file if (2*i+1 >= fRunInfo->fT0.size()) { // t0's are NOT in the msr-file // check if the t0's are in the data file @@ -374,7 +380,8 @@ bool PRunAsymmetry::PrepareData() t0Add[0] = addRunData->GetT0(fRunInfo->fForwardHistoNo-1); // forward t0 t0Add[1] = addRunData->GetT0(fRunInfo->fBackwardHistoNo-1); // backward t0 } else { // t0's are neither in the run data nor in the msr-file -> not acceptable! - cout << endl << "PRunAsymmetry::PrepareData(): NO t0's found, neither in the addrun (" << fRunInfo->fRunName[i].Data() << ") data nor in the msr-file!"; + cerr << endl << "PRunAsymmetry::PrepareData(): **ERROR** NO t0's found, neither in the addrun (" << fRunInfo->fRunName[i].Data() << ") data nor in the msr-file!"; + cerr << endl; return false; } } else { // t0's in the msr-file @@ -383,38 +390,38 @@ bool PRunAsymmetry::PrepareData() t0Add[0] = fRunInfo->fT0[2*i]; t0Add[1] = fRunInfo->fT0[2*i+1]; } else { - cout << endl << "PRunAsymmetry::PrepareData(): **WARNING** NO t0's found, neither in the addrun data ("; - cout << fRunInfo->fRunName[i].Data(); - cout << "), nor in the msr-file! Will try to use the T0 of the run data ("; - cout << fRunInfo->fRunName[i].Data(); - cout << ") without any warranty!"; + cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING** NO t0's found, neither in the addrun data ("; + cerr << fRunInfo->fRunName[i].Data(); + cerr << "), nor in the msr-file! Will try to use the T0 of the run data ("; + cerr << fRunInfo->fRunName[i].Data(); + cerr << ") without any warranty!"; t0Add[0] = fRunInfo->fT0[0]; t0Add[1] = fRunInfo->fT0[1]; } if (addRunData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file if (fabs(t0Add[0]-addRunData->GetT0(fRunInfo->fForwardHistoNo-1))>5.0) { // given in bins!! - cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo"; - cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i]; - cout << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->fForwardHistoNo-1); - cout << endl << " This is quite a deviation! Is this done intentionally??"; - cout << endl << " addrun: " << fRunInfo->fRunName[i].Data(); - cout << endl; + cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo"; + cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i]; + cerr << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->fForwardHistoNo-1); + cerr << endl << " This is quite a deviation! Is this done intentionally??"; + cerr << endl << " addrun: " << fRunInfo->fRunName[i].Data(); + cerr << endl; } if (fabs(t0Add[1]-addRunData->GetT0(fRunInfo->fBackwardHistoNo-1))>5.0) { // given in bins!! - cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo"; - cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i+1]; - cout << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->fBackwardHistoNo-1); - cout << endl << " This is quite a deviation! Is this done intentionally??"; - cout << endl << " addrun: " << fRunInfo->fRunName[i].Data(); - cout << endl; + cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo"; + cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i+1]; + cerr << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->fBackwardHistoNo-1); + cerr << endl << " This is quite a deviation! Is this done intentionally??"; + cerr << endl << " addrun: " << fRunInfo->fRunName[i].Data(); + cerr << endl; } } } // add forward run UInt_t addRunSize = addRunData->GetDataBin(histoNo[0])->size(); - for (unsigned int j=0; jGetDataBin(histoNo[0])->size(); j++) { + for (UInt_t j=0; jGetDataBin(histoNo[0])->size(); j++) { // make sure that the index stays in the proper range if ((j-t0Add[0]+fT0s[0] >= 0) && (j-t0Add[0]+fT0s[0] < addRunSize)) { fForward[j] += addRunData->GetDataBin(histoNo[0])->at(j-t0Add[0]+fT0s[0]); @@ -423,7 +430,7 @@ bool PRunAsymmetry::PrepareData() // add backward run addRunSize = addRunData->GetDataBin(histoNo[1])->size(); - for (unsigned int j=0; jGetDataBin(histoNo[1])->size(); j++) { + for (UInt_t j=0; jGetDataBin(histoNo[1])->size(); j++) { // make sure that the index stays in the proper range if ((j-t0Add[1]+fT0s[1] >= 0) && (j-t0Add[1]+fT0s[1] < addRunSize)) { fBackward[j] += addRunData->GetDataBin(histoNo[1])->at(j-t0Add[1]+fT0s[1]); @@ -438,8 +445,8 @@ bool PRunAsymmetry::PrepareData() if (!SubtractEstimatedBkg()) return false; } else { // no background given to do the job - cout << endl << "PRunAsymmetry::PrepareData(): Neither fix background nor background bins are given!"; - cout << endl << "One of the two is needed! Will quit ..."; + cerr << endl << "PRunAsymmetry::PrepareData(): **ERROR** Neither fix background nor background bins are given!"; + cerr << endl << "One of the two is needed! Will quit ..."; return false; } } else { // fixed background given @@ -448,7 +455,7 @@ bool PRunAsymmetry::PrepareData() } // everything looks fine, hence fill data set - bool status; + Bool_t status; switch(fHandleTag) { case kFit: status = PrepareFitData(runData, histoNo); @@ -479,9 +486,9 @@ bool PRunAsymmetry::PrepareData() * where \f$ f_i^{\rm c} \f$ is the background corrected histogram, \f$ f_i \f$ the raw histogram * and \f$ \mathrm{bkg} \f$ the fix given background. */ -bool PRunAsymmetry::SubtractFixBkg() +Bool_t PRunAsymmetry::SubtractFixBkg() { - for (unsigned int i=0; ifBkgFix[0] * fTimeResolution * 1.0e3)); fForward[i] -= fRunInfo->fBkgFix[0] * fTimeResolution * 1.0e3; // bkg per ns -> bkg per bin; 1.0e3: us -> ns fBackwardErr.push_back(TMath::Sqrt(fBackward[i]+fRunInfo->fBkgFix[1] * fTimeResolution * 1.0e3)); @@ -508,9 +515,9 @@ bool PRunAsymmetry::SubtractFixBkg() * \pm\frac{1}{N}\left[\sum_{i=0}^N f_i \right]^{1/2},\f] * where \f$N\f$ is the number of bins over which the background is formed. */ -bool PRunAsymmetry::SubtractEstimatedBkg() +Bool_t PRunAsymmetry::SubtractEstimatedBkg() { - double beamPeriod = 0.0; + Double_t beamPeriod = 0.0; // check if data are from PSI, RAL, or TRIUMF if (fRunInfo->fInstitute[0].Contains("psi")) @@ -523,23 +530,23 @@ bool PRunAsymmetry::SubtractEstimatedBkg() beamPeriod = 0.0; // check if start and end are in proper order - unsigned int start[2] = {fRunInfo->fBkgRange[0], fRunInfo->fBkgRange[2]}; - unsigned int end[2] = {fRunInfo->fBkgRange[1], fRunInfo->fBkgRange[3]}; - for (unsigned int i=0; i<2; i++) { + UInt_t start[2] = {fRunInfo->fBkgRange[0], fRunInfo->fBkgRange[2]}; + UInt_t end[2] = {fRunInfo->fBkgRange[1], fRunInfo->fBkgRange[3]}; + for (UInt_t i=0; i<2; i++) { if (end[i] < start[i]) { cout << endl << "PRunAsymmetry::SubtractEstimatedBkg(): end = " << end[i] << " > start = " << start[i] << "! Will swap them!"; - unsigned int keep = end[i]; + UInt_t keep = end[i]; end[i] = start[i]; start[i] = keep; } } // calculate proper background range - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { if (beamPeriod != 0.0) { - double beamPeriodBins = beamPeriod/fRunInfo->fPacking; - unsigned int periods = (unsigned int)((double)(end[i] - start[i] + 1) / beamPeriodBins); - end[i] = start[i] + (unsigned int)round((double)periods*beamPeriodBins); + Double_t beamPeriodBins = beamPeriod/fRunInfo->fPacking; + UInt_t periods = (UInt_t)((Double_t)(end[i] - start[i] + 1) / beamPeriodBins); + end[i] = start[i] + (UInt_t)round((Double_t)periods*beamPeriodBins); cout << "PRunAsymmetry::SubtractEstimatedBkg(): Background " << start[i] << ", " << end[i] << endl; if (end[i] == start[i]) end[i] = fRunInfo->fBkgRange[2*i+1]; @@ -549,47 +556,47 @@ bool PRunAsymmetry::SubtractEstimatedBkg() // check if start is within histogram bounds if ((start[0] < 0) || (start[0] >= fForward.size()) || (start[1] < 0) || (start[1] >= fBackward.size())) { - cout << endl << "PRunAsymmetry::SubtractEstimatedBkg(): background bin values out of bound!"; - cout << endl << " histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ")."; - cout << endl << " background start (f/b) = (" << start[0] << "/" << start[1] << ")."; + cerr << endl << "PRunAsymmetry::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << " histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ")."; + cerr << endl << " background start (f/b) = (" << start[0] << "/" << start[1] << ")."; return false; } // check if end is within histogram bounds if ((end[0] < 0) || (end[0] >= fForward.size()) || (end[1] < 0) || (end[1] >= fBackward.size())) { - cout << endl << "PRunAsymmetry::SubtractEstimatedBkg(): background bin values out of bound!"; - cout << endl << " histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ")."; - cout << endl << " background end (f/b) = (" << end[0] << "/" << end[1] << ")."; + cerr << endl << "PRunAsymmetry::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << " histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ")."; + cerr << endl << " background end (f/b) = (" << end[0] << "/" << end[1] << ")."; return false; } // calculate background - double bkg[2] = {0.0, 0.0}; - double errBkg[2] = {0.0, 0.0}; + Double_t bkg[2] = {0.0, 0.0}; + Double_t errBkg[2] = {0.0, 0.0}; // forward - for (unsigned int i=start[0]; i(end[0] - start[0] + 1); + bkg[0] /= static_cast(end[0] - start[0] + 1); //cout << endl << ">> bkg[0] = " << bkg[0]; // backward - for (unsigned int i=start[1]; i(end[1] - start[1] + 1); + bkg[1] /= static_cast(end[1] - start[1] + 1); //cout << endl << ">> bkg[1] = " << bkg[1] << endl; // correct error for forward, backward - for (unsigned int i=0; i * */ -bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2]) +Bool_t PRunAsymmetry::PrepareFitData(PRawRunData* runData, UInt_t histoNo[2]) { // transform raw histo data. This is done the following way (for details see the manual): // first rebin the data, than calculate the asymmetry // first get start data, end data, and t0 - int start[2] = {fRunInfo->fDataRange[0], fRunInfo->fDataRange[2]}; - int end[2] = {fRunInfo->fDataRange[1], fRunInfo->fDataRange[3]}; - double t0[2] = {fT0s[0], fT0s[1]}; + Int_t start[2] = {fRunInfo->fDataRange[0], fRunInfo->fDataRange[2]}; + Int_t end[2] = {fRunInfo->fDataRange[1], fRunInfo->fDataRange[3]}; + Double_t t0[2] = {fT0s[0], fT0s[1]}; // check if start, end, and t0 make any sense // 1st check if start and end are in proper order - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { if (end[i] < start[i]) { // need to swap them - int keep = end[i]; + Int_t keep = end[i]; end[i] = start[i]; start[i] = keep; } // 2nd check if start is within proper bounds - if ((start[i] < 0) || (start[i] > (int)runData->GetDataBin(histoNo[i])->size())) { - cout << endl << "PRunAsymmetry::PrepareFitData(): **ERROR** start data bin doesn't make any sense!"; + if ((start[i] < 0) || (start[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << "PRunAsymmetry::PrepareFitData(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; return false; } // 3rd check if end is within proper bounds - if ((end[i] < 0) || (end[i] > (int)runData->GetDataBin(histoNo[i])->size())) { - cout << endl << "PRunAsymmetry::PrepareFitData(): **ERROR** end data bin doesn't make any sense!"; + if ((end[i] < 0) || (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << "PRunAsymmetry::PrepareFitData(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; return false; } // 4th check if t0 is within proper bounds - if ((t0[i] < 0) || (t0[i] > (int)runData->GetDataBin(histoNo[i])->size())) { - cout << endl << "PRunAsymmetry::PrepareFitData(): **ERROR** t0 data bin doesn't make any sense!"; + if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << "PRunAsymmetry::PrepareFitData(): **ERROR** t0 data bin doesn't make any sense!"; + cerr << endl; return false; } } @@ -640,10 +650,10 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2] // everything looks fine, hence fill packed forward and backward histo PRunData forwardPacked; PRunData backwardPacked; - double value = 0.0; - double error = 0.0; + Double_t value = 0.0; + Double_t error = 0.0; // forward - for (int i=start[0]; ifPacking == 1) { forwardPacked.AppendValue(fForward[i]); forwardPacked.AppendErrorValue(fForwardErr[i]); @@ -665,7 +675,7 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2] } } // backward - for (int i=start[1]; ifPacking == 1) { backwardPacked.AppendValue(fBackward[i]); backwardPacked.AppendErrorValue(fBackwardErr[i]); @@ -688,20 +698,20 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2] } // check if packed forward and backward hist have the same size, otherwise take the minimum size - unsigned int noOfBins = forwardPacked.GetValue()->size(); + UInt_t noOfBins = forwardPacked.GetValue()->size(); if (forwardPacked.GetValue()->size() != backwardPacked.GetValue()->size()) { if (forwardPacked.GetValue()->size() > backwardPacked.GetValue()->size()) noOfBins = backwardPacked.GetValue()->size(); } // form asymmetry including error propagation - double asym; - double f, b, ef, eb; + Double_t asym; + Double_t f, b, ef, eb; // fill data time start, and step // data start at data_start-t0 shifted by (pack-1)/2 - fData.SetDataTimeStart(fTimeResolution*((double)start[0]-t0[0]+(double)(fRunInfo->fPacking-1)/2.0)); - fData.SetDataTimeStep(fTimeResolution*(double)fRunInfo->fPacking); - for (unsigned int i=0; ifPacking-1)/2.0)); + fData.SetDataTimeStep(fTimeResolution*(Double_t)fRunInfo->fPacking); + for (UInt_t i=0; iat(i); b = backwardPacked.GetValue()->at(i); @@ -722,10 +732,10 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2] } // count the number of bins to be fitted - double time; + Double_t time; fNoOfFitBins=0; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i * fData.GetDataTimeStep(); + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i * fData.GetDataTimeStep(); if ((time >= fFitStartTime) && (time <= fFitStopTime)) fNoOfFitBins++; } @@ -746,32 +756,32 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2] *

* */ -bool PRunAsymmetry::PrepareViewData(PRawRunData* runData, unsigned int histoNo[2]) +Bool_t PRunAsymmetry::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]) { // check if view_packing is wished - int packing = fRunInfo->fPacking; + Int_t packing = fRunInfo->fPacking; if (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0) { packing = fMsrInfo->GetMsrPlotList()->at(0).fViewPacking; } // feed the parameter vector - std::vector par; + std::vector par; PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); - for (unsigned int i=0; isize(); i++) + for (UInt_t i=0; isize(); i++) par.push_back((*paramList)[i].fValue); // transform raw histo data. This is done the following way (for details see the manual): // first rebin the data, than calculate the asymmetry // first get start data, end data, and t0 - int val = fRunInfo->fDataRange[0]-packing*(fRunInfo->fDataRange[0]/packing); + Int_t val = fRunInfo->fDataRange[0]-packing*(fRunInfo->fDataRange[0]/packing); do { if (fRunInfo->fDataRange[2] - fRunInfo->fDataRange[0] < 0) val += packing; } while (val + fRunInfo->fDataRange[2] - fRunInfo->fDataRange[0] < 0); - int start[2] = {val, val + fRunInfo->fDataRange[2] - fRunInfo->fDataRange[0]}; - int end[2]; - double t0[2] = {fT0s[0], fT0s[1]}; + Int_t start[2] = {val, val + fRunInfo->fDataRange[2] - fRunInfo->fDataRange[0]}; + Int_t end[2]; + Double_t t0[2] = {fT0s[0], fT0s[1]}; /* cout << endl << ">> start[0]=" << start[0] << ", end[0]=" << end[0]; @@ -780,8 +790,8 @@ cout << endl; */ // make sure that there are equal number of rebinned bins in forward and backward - unsigned int noOfBins0 = (runData->GetDataBin(histoNo[0])->size()-start[0])/packing; - unsigned int noOfBins1 = (runData->GetDataBin(histoNo[1])->size()-start[1])/packing; + UInt_t noOfBins0 = (runData->GetDataBin(histoNo[0])->size()-start[0])/packing; + UInt_t noOfBins1 = (runData->GetDataBin(histoNo[1])->size()-start[1])/packing; if (noOfBins0 > noOfBins1) noOfBins0 = noOfBins1; end[0] = start[0] + noOfBins0 * packing; @@ -789,25 +799,28 @@ cout << endl; // check if start, end, and t0 make any sense // 1st check if start and end are in proper order - for (unsigned int i=0; i<2; i++) { + for (UInt_t i=0; i<2; i++) { if (end[i] < start[i]) { // need to swap them - int keep = end[i]; + Int_t keep = end[i]; end[i] = start[i]; start[i] = keep; } // 2nd check if start is within proper bounds - if ((start[i] < 0) || (start[i] > (int)runData->GetDataBin(histoNo[i])->size())) { - cout << endl << "PRunAsymmetry::PrepareViewData(): **ERROR** start data bin doesn't make any sense!"; + if ((start[i] < 0) || (start[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << "PRunAsymmetry::PrepareViewData(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; return false; } // 3rd check if end is within proper bounds - if ((end[i] < 0) || (end[i] > (int)runData->GetDataBin(histoNo[i])->size())) { - cout << endl << "PRunAsymmetry::PrepareViewData(): **ERROR** end data bin doesn't make any sense!"; + if ((end[i] < 0) || (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << "PRunAsymmetry::PrepareViewData(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; return false; } // 4th check if t0 is within proper bounds - if ((t0[i] < 0) || (t0[i] > (int)runData->GetDataBin(histoNo[i])->size())) { - cout << endl << "PRunAsymmetry::PrepareViewData(): **ERROR** t0 data bin doesn't make any sense!"; + if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << "PRunAsymmetry::PrepareViewData(): **ERROR** t0 data bin doesn't make any sense!"; + cerr << endl; return false; } } @@ -815,10 +828,10 @@ cout << endl; // everything looks fine, hence fill packed forward and backward histo PRunData forwardPacked; PRunData backwardPacked; - double value = 0.0; - double error = 0.0; + Double_t value = 0.0; + Double_t error = 0.0; // forward - for (int i=start[0]; isize(); + UInt_t noOfBins = forwardPacked.GetValue()->size(); if (forwardPacked.GetValue()->size() != backwardPacked.GetValue()->size()) { if (forwardPacked.GetValue()->size() > backwardPacked.GetValue()->size()) noOfBins = backwardPacked.GetValue()->size(); } // form asymmetry including error propagation - double asym; - double f, b, ef, eb, alpha = 1.0, beta = 1.0; + Double_t asym; + Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0; // fill data time start, and step // data start at data_start-t0 - fData.SetDataTimeStart(fTimeResolution*((double)start[0]-t0[0]+(double)(packing-1)/2.0)); - fData.SetDataTimeStep(fTimeResolution*(double)packing); + fData.SetDataTimeStart(fTimeResolution*((Double_t)start[0]-t0[0]+(Double_t)(packing-1)/2.0)); + fData.SetDataTimeStep(fTimeResolution*(Double_t)packing); /* cout << endl << ">> start time = " << fData.GetDataTimeStart() << ", step = " << fData.GetDataTimeStep(); @@ -905,7 +918,7 @@ cout << endl << "--------------------------------" << endl; } //cout << endl << ">> alpha = " << alpha << ", beta = " << beta; - for (unsigned int i=0; isize(); i++) { + for (UInt_t i=0; isize(); i++) { // to make the formulae more readable f = forwardPacked.GetValue()->at(i); b = backwardPacked.GetValue()->at(i); @@ -926,10 +939,10 @@ cout << endl << "--------------------------------" << endl; } // count the number of bins to be fitted - double time; + Double_t time; fNoOfFitBins=0; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i * fData.GetDataTimeStep(); + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i * fData.GetDataTimeStep(); if ((time >= fFitStartTime) && (time <= fFitStopTime)) fNoOfFitBins++; } @@ -942,22 +955,22 @@ cout << endl << "--------------------------------" << endl; // fill theory vector for kView // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate theory - unsigned int size = runData->GetDataBin(histoNo[0])->size(); - double factor = 1.0; + UInt_t size = runData->GetDataBin(histoNo[0])->size(); + Double_t factor = 1.0; if (fData.GetValue()->size() * 10 > runData->GetDataBin(histoNo[0])->size()) { size = fData.GetValue()->size() * 10; - factor = (double)runData->GetDataBin(histoNo[0])->size() / (double)size; + factor = (Double_t)runData->GetDataBin(histoNo[0])->size() / (Double_t)size; } //cout << endl << ">> runData->fDataBin[histoNo[0]].size() = " << runData->fDataBin[histoNo[0]].size() << ", fData.GetValue()->size() * 10 = " << fData.GetValue()->size() * 10 << ", size = " << size << ", factor = " << factor << endl; fData.SetTheoryTimeStart(fData.GetDataTimeStart()); fData.SetTheoryTimeStep(fTimeResolution*factor); - for (unsigned int i=0; iFunc(time, par, fFuncValues); if (fabs(value) > 10.0) { // dirty hack needs to be fixed!! value = 0.0; diff --git a/src/classes/PRunBase.cpp b/src/classes/PRunBase.cpp index 0fd9a3e3..67b5f2b1 100644 --- a/src/classes/PRunBase.cpp +++ b/src/classes/PRunBase.cpp @@ -72,12 +72,12 @@ PRunBase::PRunBase() * \param runNo * \param tag */ -PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag) +PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) { fValid = true; fHandleTag = tag; - fRunNo = static_cast(runNo); + fRunNo = static_cast(runNo); if ((runNo < 0) || (runNo > msrInfo->GetMsrRunList()->size())) { fRunInfo = 0; return; @@ -91,7 +91,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int // check the parameter and map range of the functions if (!fMsrInfo->CheckMapAndParamRange(fRunInfo->fMap.size(), fMsrInfo->GetNoOfParams())) { - cout << endl << "**SEVERE ERROR** PRunBase::PRunBase: map and/or parameter out of range in FUNCTIONS." << endl; + cerr << endl << "**SEVERE ERROR** PRunBase::PRunBase: map and/or parameter out of range in FUNCTIONS." << endl; exit(0); } @@ -100,17 +100,17 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int // init private variables fTimeResolution = -1.0; - for (int i=0; iGetNoOfFuncs(); i++) + for (Int_t i=0; iGetNoOfFuncs(); i++) fFuncValues.push_back(0.0); // generate theory fTheory = new PTheory(msrInfo, runNo); if (fTheory == 0) { - cout << endl << "**SEVERE ERROR** PRunBase::PRunBase: Couldn't create an instance of PTheory :-(, will quit" << endl; + cerr << endl << "**SEVERE ERROR** PRunBase::PRunBase: Couldn't create an instance of PTheory :-(, will quit" << endl; exit(0); } if (!fTheory->IsValid()) { - cout << endl << "**SEVERE ERROR** PRunBase::PRunBase: Theory is not valid :-(, will quit" << endl; + cerr << endl << "**SEVERE ERROR** PRunBase::PRunBase: Theory is not valid :-(, will quit" << endl; exit(0); } } diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index 814ecc94..ef1ee153 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -138,7 +138,8 @@ Bool_t PRunDataHandler::ReadFile() PMsrRunList *runList = 0; runList = fMsrInfo->GetMsrRunList(); if (runList == 0) { - cout << endl << "PRunDataHandler::ReadFile(): Couldn't obtain run list from PMsrHandler: something VERY fishy"; + cerr << endl << "PRunDataHandler::ReadFile(): **ERROR** Couldn't obtain run list from PMsrHandler: something VERY fishy"; + cerr << endl; return false; } @@ -253,18 +254,18 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunStructure &runInfo, const UInt_t if (!success) { str = runInfo.fFileFormat[idx]; str.ToUpper(); - cout << endl << "File Format '" << str.Data() << "' unsupported."; - cout << endl << " support file formats are:"; - cout << endl << " ROOT-NPP -> root not post pileup corrected for lem"; - cout << endl << " ROOT-PPC -> root post pileup corrected for lem"; - cout << endl << " NEXUS -> nexus file format"; - cout << endl << " PSI-BIN -> psi bin file format"; - cout << endl << " MUD -> triumf mud file format"; - cout << endl << " WKM -> wkm ascii file format"; - cout << endl << " MDU-ASCII -> psi mdu ascii file format"; - cout << endl << " ASCII -> column like file format"; - cout << endl << " DB -> triumf db file \"format\""; - cout << endl; + cerr << endl << "**ERROR** File Format '" << str.Data() << "' unsupported."; + cerr << endl << " support file formats are:"; + cerr << endl << " ROOT-NPP -> root not post pileup corrected for lem"; + cerr << endl << " ROOT-PPC -> root post pileup corrected for lem"; + cerr << endl << " NEXUS -> nexus file format"; + cerr << endl << " PSI-BIN -> psi bin file format"; + cerr << endl << " MUD -> triumf mud file format"; + cerr << endl << " WKM -> wkm ascii file format"; + cerr << endl << " MDU-ASCII -> psi mdu ascii file format"; + cerr << endl << " ASCII -> column like file format"; + cerr << endl << " DB -> triumf db file \"format\""; + cerr << endl; return success; } @@ -376,7 +377,7 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) TFolder *folder; f.GetObject("RunInfo", folder); if (!folder) { - cout << endl << "Couldn't obtain RunInfo from " << fRunPathName.Data() << endl; + cerr << endl << "PRunDataHandler::ReadRootFile: **ERROR** Couldn't obtain RunInfo from " << fRunPathName.Data() << endl; f.Close(); return false; } @@ -386,7 +387,7 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) // check if run header is valid if (!runHeader) { - cout << endl << "Couldn't obtain run header info from ROOT file " << fRunPathName.Data() << endl; + cerr << endl << "PRunDataHandler::ReadRootFile: **ERROR** Couldn't obtain run header info from ROOT file " << fRunPathName.Data() << endl; f.Close(); return false; } @@ -520,7 +521,7 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) // check if histos folder is found f.GetObject("histos", folder); if (!folder) { - cout << endl << "Couldn't obtain histos from " << fRunPathName.Data() << endl; + cerr << endl << "PRunDataHandler::ReadRootFile: **ERROR** Couldn't obtain histos from " << fRunPathName.Data() << endl; f.Close(); return false; } @@ -531,7 +532,8 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) sprintf(histoName, "hDecay%02d", i); TH1F *histo = dynamic_cast(folder->FindObjectAny(histoName)); if (!histo) { - cout << endl << "PRunDataHandler::ReadRootFile: Couldn't get histo " << histoName; + cerr << endl << "PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName; + cerr << endl; return false; } // fill data @@ -547,7 +549,8 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) sprintf(histoName, "hDecay%02d", i+POST_PILEUP_HISTO_OFFSET); TH1F *histo = dynamic_cast(folder->FindObjectAny(histoName)); if (!histo) { - cout << endl << "PRunDataHandler::ReadRootFile: Couldn't get histo " << histoName; + cerr << endl << "PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName; + cerr << endl; return false; } // fill data @@ -606,8 +609,8 @@ Bool_t PRunDataHandler::ReadWkmFile() // open wkm-file f.open(fRunPathName.Data(), ifstream::in); if (!f.is_open()) { - cout << endl << "Couldn't open run data (" << fRunPathName.Data() << ") file for reading, sorry ..."; - cout << endl; + cerr << endl << "PRunDataHandler::ReadWkmFile: **ERROR** Couldn't open run data (" << fRunPathName.Data() << ") file for reading, sorry ..."; + cerr << endl; return false; } diff --git a/src/classes/PRunListCollection.cpp b/src/classes/PRunListCollection.cpp index 5c084a37..fef7745d 100644 --- a/src/classes/PRunListCollection.cpp +++ b/src/classes/PRunListCollection.cpp @@ -58,28 +58,28 @@ PRunListCollection::~PRunListCollection() { //cout << endl << "in ~PRunListCollection() ..." << endl; //cout << endl << ">> fRunSingleHistoList.size() = " << fRunSingleHistoList.size(); - for (unsigned int i=0; iCleanUp(); fRunSingleHistoList[i]->~PRunSingleHisto(); } fRunSingleHistoList.clear(); //cout << endl << ">> fRunAsymmetryList.size() = " << fRunAsymmetryList.size(); - for (unsigned int i=0; iCleanUp(); fRunAsymmetryList[i]->~PRunAsymmetry(); } fRunAsymmetryList.clear(); //cout << endl << ">> fRunRRFList.size() = " << fRunRRFList.size(); - for (unsigned int i=0; iCleanUp(); fRunRRFList[i]->~PRunRRF(); } fRunRRFList.clear(); //cout << endl << ">> fRunNonMusrList.size() = " << fRunNonMusrList.size(); - for (unsigned int i=0; iCleanUp(); fRunNonMusrList[i]->~PRunNonMusr(); } @@ -95,9 +95,9 @@ PRunListCollection::~PRunListCollection() * \param runNo * \param tag */ -bool PRunListCollection::Add(int runNo, EPMusrHandleTag tag) +Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag) { - bool success = true; + Bool_t success = true; // PMsrRunStructure *runList = &(*fMsrInfo->GetMsrRunList())[runNo]; @@ -105,7 +105,7 @@ bool PRunListCollection::Add(int runNo, EPMusrHandleTag tag) // cout << ", name = " << runList->fRunName.Data(); // cout << ", type = " << runList->fFitType; - int fitType = (*fMsrInfo->GetMsrRunList())[runNo].fFitType; + Int_t fitType = (*fMsrInfo->GetMsrRunList())[runNo].fFitType; switch (fitType) { case PRUN_SINGLE_HISTO: @@ -142,11 +142,11 @@ bool PRunListCollection::Add(int runNo, EPMusrHandleTag tag) /** *

*/ -double PRunListCollection::GetSingleHistoChisq(const std::vector& par) const +Double_t PRunListCollection::GetSingleHistoChisq(const std::vector& par) const { - double chisq = 0.0; + Double_t chisq = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return chisq; @@ -158,11 +158,11 @@ double PRunListCollection::GetSingleHistoChisq(const std::vector& par) c /** *

*/ -double PRunListCollection::GetAsymmetryChisq(const std::vector& par) const +Double_t PRunListCollection::GetAsymmetryChisq(const std::vector& par) const { - double chisq = 0.0; + Double_t chisq = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return chisq; @@ -174,11 +174,11 @@ double PRunListCollection::GetAsymmetryChisq(const std::vector& par) con /** *

*/ -double PRunListCollection::GetRRFChisq(const std::vector& par) const +Double_t PRunListCollection::GetRRFChisq(const std::vector& par) const { - double chisq = 0.0; + Double_t chisq = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return chisq; @@ -190,11 +190,11 @@ double PRunListCollection::GetRRFChisq(const std::vector& par) const /** *

*/ -double PRunListCollection::GetNonMusrChisq(const std::vector& par) const +Double_t PRunListCollection::GetNonMusrChisq(const std::vector& par) const { - double chisq = 0.0; + Double_t chisq = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return chisq; @@ -206,11 +206,11 @@ double PRunListCollection::GetNonMusrChisq(const std::vector& par) const /** *

*/ -double PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector& par) const +Double_t PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector& par) const { - double mlh = 0.0; + Double_t mlh = 0.0; - for (unsigned int i=0; iCalcMaxLikelihood(par); return mlh; @@ -223,11 +223,11 @@ double PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector Since it is not clear yet how to handle asymmetry fits with max likelihood * the chi square will be used! */ -double PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector& par) const +Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector& par) const { - double mlh = 0.0; + Double_t mlh = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return mlh; @@ -240,11 +240,11 @@ double PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector Since it is not clear yet how to handle RRF fits with max likelihood * the chi square will be used! */ -double PRunListCollection::GetRRFMaximumLikelihood(const std::vector& par) const +Double_t PRunListCollection::GetRRFMaximumLikelihood(const std::vector& par) const { - double mlh = 0.0; + Double_t mlh = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return mlh; @@ -257,11 +257,11 @@ double PRunListCollection::GetRRFMaximumLikelihood(const std::vector& pa *

Since it is not clear yet how to handle non musr fits with max likelihood * the chi square will be used! */ -double PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector& par) const +Double_t PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector& par) const { - double mlh = 0.0; + Double_t mlh = 0.0; - for (unsigned int i=0; iCalcChiSquare(par); return mlh; @@ -273,20 +273,20 @@ double PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector /** *

*/ -unsigned int PRunListCollection::GetTotalNoOfBinsFitted() const +UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const { - unsigned int counts = 0; + UInt_t counts = 0; - for (unsigned int i=0; iGetNoOfFitBins(); - for (unsigned int i=0; iGetNoOfFitBins(); - for (unsigned int i=0; iGetNoOfFitBins(); - for (unsigned int i=0; iGetNoOfFitBins(); // cout << endl << "Total No of Bins Fitted = " << counts; @@ -302,14 +302,15 @@ unsigned int PRunListCollection::GetTotalNoOfBinsFitted() const * \param index * \param tag kIndex -> data at index, kRunNo -> data of given run no */ -PRunData* PRunListCollection::GetSingleHisto(unsigned int index, EDataSwitch tag) +PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag) { PRunData *data = 0; switch (tag) { case kIndex: if ((index < 0) || (index > fRunSingleHistoList.size())) { - cout << endl << "PRunListCollection::GetSingleHisto: index = " << index << " out of bounds"; + cerr << endl << "PRunListCollection::GetSingleHisto: **ERROR** index = " << index << " out of bounds"; + cerr << endl; return 0; } @@ -317,7 +318,7 @@ PRunData* PRunListCollection::GetSingleHisto(unsigned int index, EDataSwitch tag data = fRunSingleHistoList[index]->GetData(); break; case kRunNo: - for (unsigned int i=0; iGetRunNo() == index) { data = fRunSingleHistoList[i]->GetData(); break; @@ -340,14 +341,15 @@ PRunData* PRunListCollection::GetSingleHisto(unsigned int index, EDataSwitch tag * \param index * \param tag kIndex -> data at index, kRunNo -> data of given run no */ -PRunData* PRunListCollection::GetAsymmetry(unsigned int index, EDataSwitch tag) +PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag) { PRunData *data = 0; switch (tag) { case kIndex: // called from musrfit when dumping the data if ((index < 0) || (index > fRunAsymmetryList.size())) { - cout << endl << "PRunListCollection::GetAsymmetry: index = " << index << " out of bounds"; + cerr << endl << "PRunListCollection::GetAsymmetry: **ERROR** index = " << index << " out of bounds"; + cerr << endl; return 0; } @@ -355,7 +357,7 @@ PRunData* PRunListCollection::GetAsymmetry(unsigned int index, EDataSwitch tag) data = fRunAsymmetryList[index]->GetData(); break; case kRunNo: // called from PMusrCanvas - for (unsigned int i=0; iGetRunNo() == index) { data = fRunAsymmetryList[i]->GetData(); break; @@ -378,14 +380,15 @@ PRunData* PRunListCollection::GetAsymmetry(unsigned int index, EDataSwitch tag) * \param index * \param tag kIndex -> data at index, kRunNo -> data of given run no */ -PRunData* PRunListCollection::GetRRF(unsigned int index, EDataSwitch tag) +PRunData* PRunListCollection::GetRRF(UInt_t index, EDataSwitch tag) { PRunData *data = 0; switch (tag) { case kIndex: if ((index < 0) || (index > fRunRRFList.size())) { - cout << endl << "PRunListCollection::GetRRF: index = " << index << " out of bounds"; + cerr << endl << "PRunListCollection::GetRRF: **ERROR** index = " << index << " out of bounds"; + cerr << endl; return 0; } break; @@ -407,19 +410,20 @@ PRunData* PRunListCollection::GetRRF(unsigned int index, EDataSwitch tag) * \param index * \param tag kIndex -> data at index, kRunNo -> data of given run no */ -PRunData* PRunListCollection::GetNonMusr(unsigned int index, EDataSwitch tag) +PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag) { PRunData *data = 0; switch (tag) { case kIndex: if ((index < 0) || (index > fRunNonMusrList.size())) { - cout << endl << "PRunListCollection::GetNonMusr: index = " << index << " out of bounds"; + cerr << endl << "PRunListCollection::GetNonMusr: **ERROR** index = " << index << " out of bounds"; + cerr << endl; return 0; } break; case kRunNo: - for (unsigned int i=0; iGetRunNo() == index) { data = fRunNonMusrList[i]->GetData(); break; @@ -454,7 +458,7 @@ PDoublePairVector PRunListCollection::GetTemp(const TString &runName) const * * \param runName */ -double PRunListCollection::GetField(const TString &runName) const +Double_t PRunListCollection::GetField(const TString &runName) const { return fData->GetRunData(runName)->GetField(); } @@ -467,7 +471,7 @@ double PRunListCollection::GetField(const TString &runName) const * * \param runName */ -double PRunListCollection::GetEnergy(const TString &runName) const +Double_t PRunListCollection::GetEnergy(const TString &runName) const { return fData->GetRunData(runName)->GetEnergy(); } @@ -480,7 +484,7 @@ double PRunListCollection::GetEnergy(const TString &runName) const * * \param runName */ -const char* PRunListCollection::GetSetup(const TString &runName) const +const Char_t* PRunListCollection::GetSetup(const TString &runName) const { return fData->GetRunData(runName)->GetSetup()->Data(); } @@ -494,7 +498,7 @@ const char* PRunListCollection::GetSetup(const TString &runName) const * \param runName name of the run file * \param idx msr-file run index */ -const char* PRunListCollection::GetXAxisTitle(const TString &runName, const unsigned int idx) const +const Char_t* PRunListCollection::GetXAxisTitle(const TString &runName, const UInt_t idx) const { //cout << endl << ">> PRunListCollection::GetXAxisTitle: runName = " << runName.Data() << ", idx = " << idx; //cout << endl << ">> PRunListCollection::GetXAxisTitle: fRunNonMusrList.size() = " << fRunNonMusrList.size(); @@ -502,14 +506,14 @@ const char* PRunListCollection::GetXAxisTitle(const TString &runName, const unsi PRawRunData *runData = fData->GetRunData(runName); - const char *result = 0; + const Char_t *result = 0; if (runData->fDataNonMusr.FromAscii()) { result = runData->fDataNonMusr.GetLabels()->at(0).Data(); } else { - for (unsigned int i=0; iGetRunNo() == idx) { - int index = fRunNonMusrList[i]->GetXIndex(); + Int_t index = fRunNonMusrList[i]->GetXIndex(); result = runData->fDataNonMusr.GetLabels()->at(index).Data(); break; } @@ -528,21 +532,21 @@ const char* PRunListCollection::GetXAxisTitle(const TString &runName, const unsi * \param runName name of the run file * \param idx msr-file run index */ -const char* PRunListCollection::GetYAxisTitle(const TString &runName, const unsigned int idx) const +const Char_t* PRunListCollection::GetYAxisTitle(const TString &runName, const UInt_t idx) const { //cout << endl << ">> PRunListCollection::GetYAxisTitle: runName = " << runName.Data() << ", idx = " << idx; //cout << endl; PRawRunData *runData = fData->GetRunData(runName); - const char *result = 0; + const Char_t *result = 0; if (runData->fDataNonMusr.FromAscii()) { result = runData->fDataNonMusr.GetLabels()->at(1).Data(); } else { - for (unsigned int i=0; iGetRunNo() == idx) { - int index = fRunNonMusrList[i]->GetYIndex(); + Int_t index = fRunNonMusrList[i]->GetYIndex(); result = runData->fDataNonMusr.GetLabels()->at(index).Data(); break; } diff --git a/src/classes/PRunNonMusr.cpp b/src/classes/PRunNonMusr.cpp index 8ace6646..1c31f3e3 100644 --- a/src/classes/PRunNonMusr.cpp +++ b/src/classes/PRunNonMusr.cpp @@ -60,12 +60,13 @@ PRunNonMusr::PRunNonMusr() : PRunBase() * \param msrInfo pointer to the msr info structure * \param runNo number of the run of the msr-file */ -PRunNonMusr::PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) +PRunNonMusr::PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) { // get the proper run fRawRunData = fRawData->GetRunData(fRunInfo->fRunName[0]); if (!fRawRunData) { // couldn't get run - cout << endl << "PRunNonMusr::PRunNonMusr(): **ERROR** Couldn't get raw run data!"; + cerr << endl << "PRunNonMusr::PRunNonMusr(): **ERROR** Couldn't get raw run data!"; + cerr << endl; fValid = false; } @@ -93,19 +94,19 @@ PRunNonMusr::~PRunNonMusr() * * \param par parameter vector iterated by minuit */ -double PRunNonMusr::CalcChiSquare(const std::vector& par) +Double_t PRunNonMusr::CalcChiSquare(const std::vector& par) { - double chisq = 0.0; - double diff = 0.0; + Double_t chisq = 0.0; + Double_t diff = 0.0; // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate chi square - double x; - for (unsigned int i=0; isize(); i++) { + Double_t x; + for (UInt_t i=0; isize(); i++) { x = fData.GetX()->at(i); if ((x>=fFitStartTime) && (x<=fFitStopTime)) { diff = fData.GetValue()->at(i) - fTheory->Func(x, par, fFuncValues); @@ -126,7 +127,7 @@ double PRunNonMusr::CalcChiSquare(const std::vector& par) * * \param par parameter vector iterated by minuit */ -double PRunNonMusr::CalcMaxLikelihood(const std::vector& par) +Double_t PRunNonMusr::CalcMaxLikelihood(const std::vector& par) { cout << endl << "PRunSingleHisto::CalcMaxLikelihood(): not implemented yet ..." << endl; @@ -151,14 +152,14 @@ void PRunNonMusr::CalcTheory() *

* */ -bool PRunNonMusr::PrepareData() +Bool_t PRunNonMusr::PrepareData() { - bool success = true; + Bool_t success = true; //cout << endl << "in PRunNonMusr::PrepareData(): will feed fFitData"; if (fRunInfo->fRunName.size() > 1) { // ADDRUN present which is not supported for NonMusr - cout << endl << ">> PRunNonMusr::PrepareData(): **WARNING** ADDRUN NOT SUPPORTED FOR THIS FIT TYPE, WILL IGNORE IT." << endl; + cerr << endl << ">> PRunNonMusr::PrepareData(): **WARNING** ADDRUN NOT SUPPORTED FOR THIS FIT TYPE, WILL IGNORE IT." << endl; } if (fHandleTag == kFit) @@ -178,24 +179,24 @@ bool PRunNonMusr::PrepareData() *

* */ -bool PRunNonMusr::PrepareFitData() +Bool_t PRunNonMusr::PrepareFitData() { - bool success = true; + Bool_t success = true; // keep start/stop time for fit: here the meaning is of course start x, stop x fFitStartTime = fRunInfo->fFitRange[0]; fFitStopTime = fRunInfo->fFitRange[1]; // get x-, y-index - unsigned int xIndex = GetXIndex(); - unsigned int yIndex = GetYIndex(); + UInt_t xIndex = GetXIndex(); + UInt_t yIndex = GetYIndex(); // cout << endl << ">> xIndex=" << xIndex << ", yIndex=" << yIndex; // pack the raw data - double value = 0.0; - double err = 0.0; + Double_t value = 0.0; + Double_t err = 0.0; // cout << endl << ">> fRawRunData->fDataNonMusr.fData[" << xIndex << "].size()=" << fRawRunData->fDataNonMusr.fData[xIndex].size(); - for (unsigned int i=0; ifDataNonMusr.GetData()->at(xIndex).size(); i++) { + for (UInt_t i=0; ifDataNonMusr.GetData()->at(xIndex).size(); i++) { // cout << endl << ">> i=" << i << ", packing=" << fRunInfo->fPacking; if (fRunInfo->fPacking == 1) { fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)); @@ -219,8 +220,8 @@ bool PRunNonMusr::PrepareFitData() // count the number of bins to be fitted fNoOfFitBins=0; - double x; - for (unsigned int i=0; isize(); i++) { + Double_t x; + for (UInt_t i=0; isize(); i++) { x = fData.GetX()->at(i); if ((x >= fFitStartTime) && (x <= fFitStopTime)) fNoOfFitBins++; @@ -237,23 +238,23 @@ bool PRunNonMusr::PrepareFitData() *

* */ -bool PRunNonMusr::PrepareViewData() +Bool_t PRunNonMusr::PrepareViewData() { - bool success = true; + Bool_t success = true; // cout << endl << ">> fRunInfo->fRunName = " << fRunInfo->fRunName[0].Data(); // get x-, y-index - unsigned int xIndex = GetXIndex(); - unsigned int yIndex = GetYIndex(); + UInt_t xIndex = GetXIndex(); + UInt_t yIndex = GetYIndex(); // cout << endl << "PRunNonMusr::PrepareViewData: xIndex=" << xIndex << ", yIndex=" << yIndex << endl; // fill data histo // pack the raw data - double value = 0.0; - double err = 0.0; + Double_t value = 0.0; + Double_t err = 0.0; // cout << endl << ">> fRawRunData->fDataNonMusr.fData[" << xIndex << "].size()=" << fRawRunData->fDataNonMusr.fData[xIndex].size(); - for (unsigned int i=0; ifDataNonMusr.GetData()->at(xIndex).size(); i++) { + for (UInt_t i=0; ifDataNonMusr.GetData()->at(xIndex).size(); i++) { // cout << endl << ">> i=" << i << ", packing=" << fRunInfo->fPacking; if (fRunInfo->fPacking == 1) { fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)); @@ -281,12 +282,12 @@ bool PRunNonMusr::PrepareViewData() // fill theory histo // feed the parameter vector - std::vector par; + std::vector par; PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); - for (unsigned int i=0; isize(); i++) + for (UInt_t i=0; isize(); i++) par.push_back((*paramList)[i].fValue); // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } @@ -304,12 +305,12 @@ bool PRunNonMusr::PrepareViewData() // xmin found up to the largest xmax found. Double_t xMin = 0.0, xMax = 0.0; Double_t xAbsMin = 0.0, xAbsMax = 0.0; - bool first = true; + Bool_t first = true; // cout << endl << ">> plotList->size()=" << plotList->size(); - for (unsigned int i=0; isize(); i++) { + for (UInt_t i=0; isize(); i++) { plotBlock = plotList->at(i); // cout << endl << ">> plotBlock.fRuns.size()=" << plotBlock.fRuns.size() << endl; - for (unsigned int j=0; j> j=" << j; // cout << endl << ">> fRunNo=" << fRunNo; // cout << endl << ">> plotBlock.fRuns[j].Re()=" << plotBlock.fRuns[j].Re(); @@ -340,13 +341,13 @@ bool PRunNonMusr::PrepareViewData() // cout << endl << ">> after the xmin/xmax loop." << endl; // typically take 1000 points to calculate the theory, except if there are more data points, than take that number - double xStep; + Double_t xStep; if (fData.GetX()->size() > 1000.0) xStep = (xMax-xMin)/fData.GetX()->size(); else xStep = (xMax-xMin)/1000.0; - double xx = xAbsMin; + Double_t xx = xAbsMin; do { // fill x-vector fData.AppendXTheoryValue(xx); @@ -369,10 +370,10 @@ bool PRunNonMusr::PrepareViewData() *

* */ -unsigned int PRunNonMusr::GetXIndex() +UInt_t PRunNonMusr::GetXIndex() { - unsigned int index = 0; - bool found = false; + UInt_t index = 0; + Bool_t found = false; //cout << endl << ">> PRunNonMusr::GetXIndex: fRawRunData->fDataNonMusr.fFromAscii = " << fRawRunData->fDataNonMusr.fFromAscii; if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format @@ -387,7 +388,7 @@ unsigned int PRunNonMusr::GetXIndex() found = true; } else { // xy-data data tags which needs to be converted to an index //cout << endl << ">> fDataTags.size()=" << fRawRunData->fDataNonMusr.fDataTags.size(); - for (unsigned int i=0; ifDataNonMusr.GetDataTags()->size(); i++) { + for (UInt_t i=0; ifDataNonMusr.GetDataTags()->size(); i++) { if (fRawRunData->fDataNonMusr.GetDataTags()->at(i).CompareTo(fRunInfo->fXYDataLabel[0]) == 0) { //cout << endl << ">> i=" << i << ", fRawRunData->fDataNonMusr.fDataTags[i]=" << fRawRunData->fDataNonMusr.fDataTags[i].Data(); //cout << endl << ">> fRunInfo->fXYDataLabel[0]=" << fRunInfo->fXYDataLabel[0].Data(); @@ -400,8 +401,8 @@ unsigned int PRunNonMusr::GetXIndex() } if (!found) { - cout << endl << "PRunNonMusr::GetXIndex(): **ERROR** Couldn't obtain x-data index!"; - cout << endl; + cerr << endl << "PRunNonMusr::GetXIndex(): **ERROR** Couldn't obtain x-data index!"; + cerr << endl; assert(0); } @@ -415,10 +416,10 @@ unsigned int PRunNonMusr::GetXIndex() *

* */ -unsigned int PRunNonMusr::GetYIndex() +UInt_t PRunNonMusr::GetYIndex() { - unsigned int index = 0; - bool found = false; + UInt_t index = 0; + Bool_t found = false; // cout << endl << ">> PRunNonMusr::GetYIndex:"; if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format @@ -429,7 +430,7 @@ unsigned int PRunNonMusr::GetYIndex() index = fRunInfo->fXYDataIndex[1]-1; // since xy-data start with 1 ... found = true; } else { // xy-data data tags which needs to be converted to an index - for (unsigned int i=0; ifDataNonMusr.GetDataTags()->size(); i++) { + for (UInt_t i=0; ifDataNonMusr.GetDataTags()->size(); i++) { if (fRawRunData->fDataNonMusr.GetDataTags()->at(i).CompareTo(fRunInfo->fXYDataLabel[1]) == 0) { // cout << endl << ">> i=" << i << ", fRawRunData->fDataNonMusr.fDataTags[i]=" << fRawRunData->fDataNonMusr.fDataTags[i].Data(); // cout << endl << ">> fRunInfo->fXYDataLabel[1]=" << fRunInfo->fXYDataLabel[1].Data(); @@ -442,8 +443,8 @@ unsigned int PRunNonMusr::GetYIndex() } if (!found) { - cout << endl << "PRunNonMusr::GetYIndex(): **ERROR** Couldn't obtain y-data index!"; - cout << endl; + cerr << endl << "PRunNonMusr::GetYIndex(): **ERROR** Couldn't obtain y-data index!"; + cerr << endl; assert(0); } diff --git a/src/classes/PRunRRF.cpp b/src/classes/PRunRRF.cpp index ef2fa9be..bd16deee 100644 --- a/src/classes/PRunRRF.cpp +++ b/src/classes/PRunRRF.cpp @@ -58,9 +58,9 @@ PRunRRF::PRunRRF() : PRunBase() * \param msrInfo pointer to the msr info structure * \param runNo number of the run of the msr-file */ -PRunRRF::PRunRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) +PRunRRF::PRunRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) { - bool success; + Bool_t success; // calculate fFitData if (success) { @@ -87,10 +87,10 @@ PRunRRF::~PRunRRF() * * \param par parameter vector iterated by minuit */ -double PRunRRF::CalcChiSquare(const std::vector& par) +Double_t PRunRRF::CalcChiSquare(const std::vector& par) { - double chisq = 0.0; - double diff = 0.0; + Double_t chisq = 0.0; + Double_t diff = 0.0; return chisq; } @@ -103,7 +103,7 @@ double PRunRRF::CalcChiSquare(const std::vector& par) * * \param par parameter vector iterated by minuit */ -double PRunRRF::CalcMaxLikelihood(const std::vector& par) +Double_t PRunRRF::CalcMaxLikelihood(const std::vector& par) { cout << endl << "PRunSingleHisto::CalcMaxLikelihood(): not implemented yet ..." << endl; @@ -128,9 +128,9 @@ void PRunRRF::CalcTheory() *

* */ -bool PRunRRF::PrepareData() +Bool_t PRunRRF::PrepareData() { - bool success = true; + Bool_t success = true; cout << endl << "in PRunRRF::PrepareData(): will feed fData"; diff --git a/src/classes/PRunSingleHisto.cpp b/src/classes/PRunSingleHisto.cpp index b0cabed7..68e4a242 100644 --- a/src/classes/PRunSingleHisto.cpp +++ b/src/classes/PRunSingleHisto.cpp @@ -58,11 +58,12 @@ PRunSingleHisto::PRunSingleHisto() : PRunBase() * \param msrInfo pointer to the msr info structure * \param runNo number of the run of the msr-file */ -PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) +PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) { if (!PrepareData()) { - cout << endl << "**SEVERE ERROR**: PRunSingleHisto::PRunSingleHisto: Couldn't prepare data for fitting!"; - cout << endl << " This is very bad :-(, will quit ..."; + cerr << endl << "**SEVERE ERROR**: PRunSingleHisto::PRunSingleHisto: Couldn't prepare data for fitting!"; + cerr << endl << " This is very bad :-(, will quit ..."; + cerr << endl; fValid = false; } } @@ -92,32 +93,32 @@ PRunSingleHisto::~PRunSingleHisto() * * \param par parameter vector iterated by minuit */ -double PRunSingleHisto::CalcChiSquare(const std::vector& par) +Double_t PRunSingleHisto::CalcChiSquare(const std::vector& par) { - double chisq = 0.0; - double diff = 0.0; + Double_t chisq = 0.0; + Double_t diff = 0.0; - double N0; + Double_t N0; // check if norm is a parameter or a function if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter N0 = par[fRunInfo->fNormParamNo-1]; } else { // norm is a function // get function number - unsigned int funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; + UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; // evaluate function N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par); } // get tau - double tau; + Double_t tau; if (fRunInfo->fLifetimeParamNo != -1) tau = par[fRunInfo->fLifetimeParamNo-1]; else tau = PMUON_LIFETIME; // get background - double bkg; + Double_t bkg; if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval) bkg = fBackground; @@ -129,16 +130,16 @@ double PRunSingleHisto::CalcChiSquare(const std::vector& par) } // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { - int funcNo = fMsrInfo->GetFuncNo(i); + for (Int_t i=0; iGetNoOfFuncs(); i++) { + Int_t funcNo = fMsrInfo->GetFuncNo(i); //cout << ">> i = " << i << ", funcNo = " << funcNo << endl; fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, fRunInfo->fMap, par); } // calculate chi square - double time; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + Double_t time; + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); if ((time>=fFitStartTime) && (time<=fFitStopTime)) { diff = fData.GetValue()->at(i) - (N0*TMath::Exp(-time/tau)*(1.0+fTheory->Func(time, par, fFuncValues))+bkg); @@ -147,7 +148,7 @@ double PRunSingleHisto::CalcChiSquare(const std::vector& par) } /* -static int firstTime = 0; +static Int_t firstTime = 0; if (firstTime < 4) { firstTime++; cout << endl << "size=" << fData.GetValue()->size() << ", fDataTimeStart=" << fData.GetDataTimeStart() << ", fDataTimeStep=" << fData.GetDataTimeStep() << ", fFitStartTime=" << fFitStartTime << ", fFitStopTime=" << fFitStopTime; @@ -167,31 +168,31 @@ cout << endl << "----"; * * \param par parameter vector iterated by minuit */ -double PRunSingleHisto::CalcMaxLikelihood(const std::vector& par) +Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector& par) { - double mllh = 0.0; // maximum log likelihood assuming poisson distribution for the single bin + Double_t mllh = 0.0; // maximum log likelihood assuming poisson distribution for the single bin - double N0; + Double_t N0; // check if norm is a parameter or a function if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter N0 = par[fRunInfo->fNormParamNo-1]; } else { // norm is a function // get function number - unsigned int funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; + UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; // evaluate function N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par); } // get tau - double tau; + Double_t tau; if (fRunInfo->fLifetimeParamNo != -1) tau = par[fRunInfo->fLifetimeParamNo-1]; else tau = PMUON_LIFETIME; // get background - double bkg; + Double_t bkg; if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval) bkg = fBackground; @@ -203,17 +204,17 @@ double PRunSingleHisto::CalcMaxLikelihood(const std::vector& par) } // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { - int funcNo = fMsrInfo->GetFuncNo(i); + for (Int_t i=0; iGetNoOfFuncs(); i++) { + Int_t funcNo = fMsrInfo->GetFuncNo(i); fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, fRunInfo->fMap, par); } // calculate maximum log likelihood - double theo; - double data; - double time; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + Double_t theo; + Double_t data; + Double_t time; + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); if ((time>=fFitStartTime) && (time<=fFitStopTime)) { // calculate theory for the given parameter set theo = N0*TMath::Exp(-time/tau)*(1+fTheory->Func(time, par, fFuncValues))+bkg; @@ -240,32 +241,32 @@ double PRunSingleHisto::CalcMaxLikelihood(const std::vector& par) void PRunSingleHisto::CalcTheory() { // feed the parameter vector - std::vector par; + std::vector par; PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); - for (unsigned int i=0; isize(); i++) + for (UInt_t i=0; isize(); i++) par.push_back((*paramList)[i].fValue); // calculate asymmetry - double N0; + Double_t N0; // check if norm is a parameter or a function if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter N0 = par[fRunInfo->fNormParamNo-1]; } else { // norm is a function // get function number - unsigned int funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; + UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; // evaluate function N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par); } // get tau - double tau; + Double_t tau; if (fRunInfo->fLifetimeParamNo != -1) tau = par[fRunInfo->fLifetimeParamNo-1]; else tau = PMUON_LIFETIME; // get background - double bkg; + Double_t bkg; if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval) bkg = fBackground; @@ -277,17 +278,17 @@ void PRunSingleHisto::CalcTheory() } // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate theory - unsigned int size = fData.GetValue()->size(); - double start = fData.GetDataTimeStart(); - double resolution = fData.GetDataTimeStep(); - double time; - for (unsigned int i=0; isize(); + Double_t start = fData.GetDataTimeStart(); + Double_t resolution = fData.GetDataTimeStep(); + Double_t time; + for (UInt_t i=0; iFunc(time, par, fFuncValues))+bkg); } @@ -302,27 +303,28 @@ void PRunSingleHisto::CalcTheory() *

* */ -bool PRunSingleHisto::PrepareData() +Bool_t PRunSingleHisto::PrepareData() { // cout << endl << "in PRunSingleHisto::PrepareData(): will feed fData"; - bool success = true; + Bool_t success = true; // get the proper run PRawRunData* runData = fRawData->GetRunData(fRunInfo->fRunName[0]); if (!runData) { // couldn't get run - cout << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->fRunName[0].Data() << "!"; + cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->fRunName[0].Data() << "!"; + cerr << endl; return false; } // check if post pile up data shall be used - unsigned int histoNo; + UInt_t histoNo; histoNo = fRunInfo->fForwardHistoNo-1; if ((runData->GetNoOfHistos() < histoNo) || (histoNo < 0)) { - cout << endl << "PRunSingleHisto::PrepareData(): **PANIC ERROR**:"; - cout << endl << " histoNo found = " << histoNo << ", but there are only " << runData->GetNoOfHistos() << " runs!?!?"; - cout << endl << " Will quite :-("; - cout << endl; + cerr << endl << "PRunSingleHisto::PrepareData(): **PANIC ERROR**:"; + cerr << endl << " histoNo found = " << histoNo << ", but there are only " << runData->GetNoOfHistos() << " runs!?!?"; + cerr << endl << " Will quite :-("; + cerr << endl; return false; } @@ -334,8 +336,9 @@ bool PRunSingleHisto::PrepareData() // fForwardHistoNo starts with 1 not with 0 ;-) fT0s.push_back(runData->GetT0(fRunInfo->fForwardHistoNo-1)); } else { // t0's are neither in the run data nor in the msr-file -> not acceptable! - cout << endl << "PRunSingleHisto::PrepareData(): **ERROR** NO t0's found, neither in the run data nor in the msr-file!"; - cout << endl << " run: " << fRunInfo->fRunName[0].Data(); + cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << " run: " << fRunInfo->fRunName[0].Data(); + cerr << endl; return false; } } else { // t0's in the msr-file @@ -343,37 +346,39 @@ bool PRunSingleHisto::PrepareData() if (runData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file if (fabs(fRunInfo->fT0[0]-runData->GetT0(fRunInfo->fForwardHistoNo-1))>5.0) { // given in bins!! - cout << endl << "PRunSingleHisto::PrepareData(): **WARNING**:"; - cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[0]; - cout << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->fForwardHistoNo-1); - cout << endl << " This is quite a deviation! Is this done intentionally??"; - cout << endl; + cerr << endl << "PRunSingleHisto::PrepareData(): **WARNING**:"; + cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[0]; + cerr << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->fForwardHistoNo-1); + cerr << endl << " This is quite a deviation! Is this done intentionally??"; + cerr << endl; } } fT0s.push_back(fRunInfo->fT0[0]); } // check if t0 is within proper bounds - int t0 = fT0s[0]; - if ((t0 < 0) || (t0 > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareData(): **ERROR** t0 data bin doesn't make any sense!"; + Int_t t0 = fT0s[0]; + if ((t0 < 0) || (t0 > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** t0 data bin doesn't make any sense!"; + cerr << endl; return false; } // check if there are runs to be added to the current one if (fRunInfo->fRunName.size() > 1) { // runs to be added present PRawRunData *addRunData; - for (unsigned int i=1; ifRunName.size(); i++) { + for (UInt_t i=1; ifRunName.size(); i++) { // get run to be added to the main one addRunData = fRawData->GetRunData(fRunInfo->fRunName[i]); if (addRunData == 0) { // couldn't get run - cout << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->fRunName[i].Data() << "!"; + cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->fRunName[i].Data() << "!"; + cerr << endl; return false; } // get T0's of the to be added run - int t0Add; + Int_t t0Add; // check if the t0's are given in the msr-file if (i >= fRunInfo->fT0.size()) { // t0's are NOT in the msr-file // check if the t0's are in the data file @@ -382,8 +387,9 @@ bool PRunSingleHisto::PrepareData() // fForwardHistoNo starts with 1 not with 0 ;-) t0Add = addRunData->GetT0(fRunInfo->fForwardHistoNo-1); } else { // t0's are neither in the run data nor in the msr-file -> not acceptable! - cout << endl << "PRunSingleHisto::PrepareData(): **ERROR** NO t0's found, neither in the addrun data nor in the msr-file!"; - cout << endl << " addrun: " << fRunInfo->fRunName[i].Data(); + cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** NO t0's found, neither in the addrun data nor in the msr-file!"; + cerr << endl << " addrun: " << fRunInfo->fRunName[i].Data(); + cerr << endl; return false; } } else { // t0's in the msr-file @@ -391,28 +397,29 @@ bool PRunSingleHisto::PrepareData() if (addRunData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file if (fabs(fRunInfo->fT0[i]-addRunData->GetT0(fRunInfo->fForwardHistoNo-1))>5.0) { // given in bins!! - cout << endl << "PRunSingleHisto::PrepareData(): **WARNING**:"; - cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[i]; - cout << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->fForwardHistoNo-1); - cout << endl << " This is quite a deviation! Is this done intentionally??"; - cout << endl << " addrun: " << fRunInfo->fRunName[i].Data(); - cout << endl; + cerr << endl << "PRunSingleHisto::PrepareData(): **WARNING**:"; + cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[i]; + cerr << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->fForwardHistoNo-1); + cerr << endl << " This is quite a deviation! Is this done intentionally??"; + cerr << endl << " addrun: " << fRunInfo->fRunName[i].Data(); + cerr << endl; } } if (i < fRunInfo->fT0.size()) { t0Add = fRunInfo->fT0[i]; } else { - cout << endl << "PRunSingleHisto::PrepareData(): **WARNING** NO t0's found, neither in the addrun data ("; - cout << fRunInfo->fRunName[i].Data(); - cout << "), nor in the msr-file! Will try to use the T0 of the run data ("; - cout << fRunInfo->fRunName[i].Data(); - cout << ") without any warranty!"; + cerr << endl << "PRunSingleHisto::PrepareData(): **WARNING** NO t0's found, neither in the addrun data ("; + cerr << fRunInfo->fRunName[i].Data(); + cerr << "), nor in the msr-file! Will try to use the T0 of the run data ("; + cerr << fRunInfo->fRunName[i].Data(); + cerr << ") without any warranty!"; + cerr << endl; t0Add = fRunInfo->fT0[0]; } } // add run - for (unsigned int j=0; jGetDataBin(histoNo)->size(); j++) { + for (UInt_t j=0; jGetDataBin(histoNo)->size(); j++) { // make sure that the index stays in the proper range if ((j-t0Add+t0 >= 0) && (j-t0Add+t0 < addRunData->GetDataBin(histoNo)->size())) { runData->AddDataBin(histoNo, j, addRunData->GetDataBin(histoNo)->at(j-t0Add+t0)); @@ -443,7 +450,7 @@ bool PRunSingleHisto::PrepareData() *

* */ -bool PRunSingleHisto::PrepareFitData(PRawRunData* runData, const unsigned int histoNo) +Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoNo) { // keep start/stop time for fit fFitStartTime = fRunInfo->fFitRange[0]; @@ -454,25 +461,27 @@ bool PRunSingleHisto::PrepareFitData(PRawRunData* runData, const unsigned int hi // for the single histo fit, just the rebinned raw data are copied // first get start data, end data, and t0 - int start; - int end; + Int_t start; + Int_t end; start = fRunInfo->fDataRange[0]; end = fRunInfo->fDataRange[1]; // check if start, end, and t0 make any sense // 1st check if start and end are in proper order if (end < start) { // need to swap them - int keep = end; + Int_t keep = end; end = start; start = keep; } // 2nd check if start is within proper bounds - if ((start < 0) || (start > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareFitData(): **ERROR** start data bin doesn't make any sense!"; + if ((start < 0) || (start > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareFitData(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; return false; } // 3rd check if end is within proper bounds - if ((end < 0) || (end > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareFitData(): **ERROR** end data bin doesn't make any sense!"; + if ((end < 0) || (end > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareFitData(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; return false; } @@ -484,22 +493,23 @@ bool PRunSingleHisto::PrepareFitData(PRawRunData* runData, const unsigned int hi if (!EstimateBkg(histoNo)) return false; } else { // no background given to do the job - cout << endl << "PRunSingleHisto::PrepareData(): Neither fix background nor background bins are given!"; - cout << endl << "One of the two is needed! Will quit ..."; + cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Neither fix background nor background bins are given!"; + cerr << endl << "One of the two is needed! Will quit ..."; + cerr << endl; return false; } } } // everything looks fine, hence fill data set - int t0 = fT0s[0]; - double value = 0.0; - double normalizer = 1.0; + Int_t t0 = fT0s[0]; + Double_t value = 0.0; + Double_t normalizer = 1.0; // data start at data_start-t0 // time shifted so that packing is included correctly, i.e. t0 == t0 after packing - fData.SetDataTimeStart(fTimeResolution*((double)start-(double)t0+(double)(fRunInfo->fPacking-1)/2.0)); + fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(fRunInfo->fPacking-1)/2.0)); fData.SetDataTimeStep(fTimeResolution*fRunInfo->fPacking); - for (int i=start; ifPacking == 1) { value = runData->GetDataBin(histoNo)->at(i); normalizer = fRunInfo->fPacking * (fTimeResolution * 1e3); // fTimeResolution us->ns @@ -529,10 +539,10 @@ bool PRunSingleHisto::PrepareFitData(PRawRunData* runData, const unsigned int hi // count the number of bins to be fitted fNoOfFitBins=0; - double time; + Double_t time; //cout << endl << ">> size=" << fData.GetValue()->size() << ", fDataTimeStart=" << fData.GetDataTimeStart() << ", fDataTimeStep=" << fData.GetDataTimeStep() << ", fFitStartTime=" << fFitStartTime << ", fFitStopTime=" << fFitStopTime; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); if ((time >= fFitStartTime) && (time <= fFitStopTime)) fNoOfFitBins++; } @@ -547,43 +557,45 @@ bool PRunSingleHisto::PrepareFitData(PRawRunData* runData, const unsigned int hi *

Muon raw data * */ -bool PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const unsigned int histoNo) +Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo) { // check if view_packing is wished - int packing = fRunInfo->fPacking; + Int_t packing = fRunInfo->fPacking; if (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0) { packing = fMsrInfo->GetMsrPlotList()->at(0).fViewPacking; } // raw data, since PMusrCanvas is doing ranging etc. // start = the first bin which is a multiple of packing backward from first good data bin - int start = fRunInfo->fDataRange[0] - (fRunInfo->fDataRange[0]/packing)*packing; + Int_t start = fRunInfo->fDataRange[0] - (fRunInfo->fDataRange[0]/packing)*packing; // end = last bin starting from start which is a multipl of packing and still within the data - int end = start + ((runData->GetDataBin(histoNo)->size()-start)/packing)*packing; + Int_t end = start + ((runData->GetDataBin(histoNo)->size()-start)/packing)*packing; // check if start, end, and t0 make any sense // 1st check if start and end are in proper order if (end < start) { // need to swap them - int keep = end; + Int_t keep = end; end = start; start = keep; } // 2nd check if start is within proper bounds - if ((start < 0) || (start > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareRawViewData(): **ERROR** start data bin doesn't make any sense!"; + if ((start < 0) || (start > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareRawViewData(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; return false; } // 3rd check if end is within proper bounds - if ((end < 0) || (end > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareRawViewData(): **ERROR** end data bin doesn't make any sense!"; + if ((end < 0) || (end > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareRawViewData(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; return false; } // everything looks fine, hence fill data set - int t0 = fT0s[0]; - double value = 0.0; + Int_t t0 = fT0s[0]; + Double_t value = 0.0; // data start at data_start-t0 // time shifted so that packing is included correctly, i.e. t0 == t0 after packing - fData.SetDataTimeStart(fTimeResolution*((double)start-(double)t0+(double)(packing-1)/2.0)); + fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0)); fData.SetDataTimeStep(fTimeResolution*packing); /* @@ -592,8 +604,8 @@ cout << endl << ">> start = " << start << ", t0 = " << t0 << ", packing = " << p cout << endl << ">> data start time = " << fData.GetDataTimeStart(); */ - double normalizer = 1.0; - for (int i=start; i> data start time = " << fData.GetDataTimeStart(); // count the number of bins fNoOfFitBins=0; - double time; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + Double_t time; + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); if ((time >= fFitStartTime) && (time <= fFitStopTime)) fNoOfFitBins++; } // fill theory vector for kView // feed the parameter vector - std::vector par; + std::vector par; PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); - for (unsigned int i=0; isize(); i++) + for (UInt_t i=0; isize(); i++) par.push_back((*paramList)[i].fValue); // calculate asymmetry - double N0; + Double_t N0; // check if norm is a parameter or a function if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter N0 = par[fRunInfo->fNormParamNo-1]; } else { // norm is a function // get function number - unsigned int funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; + UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; // evaluate function N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par); } // get tau - double tau; + Double_t tau; if (fRunInfo->fLifetimeParamNo != -1) tau = par[fRunInfo->fLifetimeParamNo-1]; else tau = PMUON_LIFETIME; // get background - double bkg; + Double_t bkg; if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval) if (!EstimateBkg(histoNo)) @@ -661,22 +673,22 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart(); } // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate theory - unsigned int size = runData->GetDataBin(histoNo)->size(); - double factor = 1.0; + UInt_t size = runData->GetDataBin(histoNo)->size(); + Double_t factor = 1.0; if (fData.GetValue()->size() * 10 > runData->GetDataBin(histoNo)->size()) { size = fData.GetValue()->size() * 10; - factor = (double)runData->GetDataBin(histoNo)->size() / (double)size; + factor = (Double_t)runData->GetDataBin(histoNo)->size() / (Double_t)size; } //cout << endl << ">> runData->GetDataBin(histoNo).size() = " << runData->GetDataBin(histoNo)->size() << ", fData.GetValue()->size() * 10 = " << fData.GetValue()->size() * 10 << ", size = " << size << ", factor = " << factor << endl; - double theoryValue; + Double_t theoryValue; fData.SetTheoryTimeStart(fData.GetDataTimeStart()); fData.SetTheoryTimeStep(fTimeResolution*factor); - for (unsigned int i=0; iFunc(time, par, fFuncValues); if (fabs(theoryValue) > 10.0) { // dirty hack needs to be fixed!! @@ -705,10 +717,10 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart(); * \f[ N(t_i) = \frac{1}{p}\, \sum_{j=i}^{i+p} n_j \f] * with \f$ n_j \f$ the raw histogram data bins. */ -bool PRunSingleHisto::PrepareViewData(PRawRunData* runData, const unsigned int histoNo) +Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histoNo) { // check if view_packing is wished - int packing = fRunInfo->fPacking; + Int_t packing = fRunInfo->fPacking; if (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0) { packing = fMsrInfo->GetMsrPlotList()->at(0).fViewPacking; } @@ -716,53 +728,55 @@ bool PRunSingleHisto::PrepareViewData(PRawRunData* runData, const unsigned int h // transform raw histo data. This is done the following way (for details see the manual): // for the single histo fit, just the rebinned raw data are copied // first get start data, end data, and t0 - int t0 = fT0s[0]; + Int_t t0 = fT0s[0]; // start = the first bin which is a multiple of packing backward from first good data bin - int start = fRunInfo->fDataRange[0] - (fRunInfo->fDataRange[0]/packing)*packing; + Int_t start = fRunInfo->fDataRange[0] - (fRunInfo->fDataRange[0]/packing)*packing; // end = last bin starting from start which is a multiple of packing and still within the data - int end = start + ((runData->GetDataBin(histoNo)->size()-start)/packing)*packing; + Int_t end = start + ((runData->GetDataBin(histoNo)->size()-start)/packing)*packing; // check if start, end, and t0 make any sense // 1st check if start and end are in proper order if (end < start) { // need to swap them - int keep = end; + Int_t keep = end; end = start; start = keep; } // 2nd check if start is within proper bounds - if ((start < 0) || (start > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareViewData(): **ERROR** start data bin doesn't make any sense!"; + if ((start < 0) || (start > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareViewData(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; return false; } // 3rd check if end is within proper bounds - if ((end < 0) || (end > (int)runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::PrepareViewData(): **ERROR** end data bin doesn't make any sense!"; + if ((end < 0) || (end > (Int_t)runData->GetDataBin(histoNo)->size())) { + cerr << endl << "PRunSingleHisto::PrepareViewData(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; return false; } // everything looks fine, hence fill data set // feed the parameter vector - std::vector par; + std::vector par; PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); - for (unsigned int i=0; isize(); i++) + for (UInt_t i=0; isize(); i++) par.push_back((*paramList)[i].fValue); // calculate asymmetry - double N0; + Double_t N0; // check if norm is a parameter or a function if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter N0 = par[fRunInfo->fNormParamNo-1]; } else { // norm is a function // get function number - unsigned int funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; + UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET; // evaluate function N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par); } // get tau - double tau; + Double_t tau; if (fRunInfo->fLifetimeParamNo != -1) tau = par[fRunInfo->fLifetimeParamNo-1]; else @@ -770,7 +784,7 @@ bool PRunSingleHisto::PrepareViewData(PRawRunData* runData, const unsigned int h //cout << endl << ">> tau = " << tau; // get background - double bkg; + Double_t bkg; if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval) if (!EstimateBkg(histoNo)) @@ -783,12 +797,12 @@ bool PRunSingleHisto::PrepareViewData(PRawRunData* runData, const unsigned int h bkg = par[fRunInfo->fBkgFitParamNo-1]; } - double value = 0.0; - double expval; - double time; + Double_t value = 0.0; + Double_t expval; + Double_t time; // data start at data_start-t0 shifted by (pack-1)/2 - fData.SetDataTimeStart(fTimeResolution*((double)start-(double)t0+(double)(packing-1)/2.0)); + fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0)); fData.SetDataTimeStep(fTimeResolution*packing); /* @@ -797,14 +811,14 @@ cout << endl << ">> start = " << start << ", end = " << end; cout << endl << "--------------------------------" << endl; */ - double normalizer = 1.0; - for (int i=start; ins value /= normalizer; - time = (((double)i-(double)(packing-1)/2.0)-t0)*fTimeResolution; + time = (((Double_t)i-(Double_t)(packing-1)/2.0)-t0)*fTimeResolution; expval = TMath::Exp(+time/tau)/N0; fData.AppendValue(-1.0+expval*(value-bkg)); //cout << endl << ">> i=" << i << ",t0=" << t0 << ",time=" << time << ",expval=" << expval << ",value=" << value << ",bkg=" << bkg << ",expval*(value-bkg)-1=" << expval*(value-bkg)-1.0; @@ -817,31 +831,31 @@ cout << endl << "--------------------------------" << endl; // count the number of bins to be fitted fNoOfFitBins=0; - for (unsigned int i=0; isize(); i++) { - time = fData.GetDataTimeStart() + (double)i*fData.GetDataTimeStep(); + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); if ((time >= fFitStartTime) && (time <= fFitStopTime)) fNoOfFitBins++; } // calculate functions - for (int i=0; iGetNoOfFuncs(); i++) { + for (Int_t i=0; iGetNoOfFuncs(); i++) { fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par); } // calculate theory - double theoryValue; - unsigned int size = runData->GetDataBin(histoNo)->size(); - double factor = 1.0; + Double_t theoryValue; + UInt_t size = runData->GetDataBin(histoNo)->size(); + Double_t factor = 1.0; if (fData.GetValue()->size() * 10 > runData->GetDataBin(histoNo)->size()) { size = fData.GetValue()->size() * 10; - factor = (double)runData->GetDataBin(histoNo)->size() / (double)size; + factor = (Double_t)runData->GetDataBin(histoNo)->size() / (Double_t)size; } //cout << endl << ">> runData->GetDataBin(histoNo).size() = " << runData->GetDataBin(histoNo).size() << ", fData.GetValue()->size() * 10 = " << fData.GetValue()->size() * 10 << ", size = " << size << ", factor = " << factor << endl; fData.SetTheoryTimeStart(fData.GetDataTimeStart()); fData.SetTheoryTimeStep(fTimeResolution*factor); //cout << endl << ">> size=" << size << ", startTime=" << startTime << ", fTimeResolution=" << fTimeResolution; - for (unsigned int i=0; iFunc(time, par, fFuncValues); if (fabs(theoryValue) > 10.0) { // dirty hack needs to be fixed!! theoryValue = 0.0; @@ -861,9 +875,9 @@ cout << endl << "--------------------------------" << endl; /** *

*/ -bool PRunSingleHisto::EstimateBkg(unsigned int histoNo) +Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo) { - double beamPeriod = 0.0; + Double_t beamPeriod = 0.0; // check if data are from PSI, RAL, or TRIUMF if (fRunInfo->fInstitute[0].Contains("psi")) @@ -876,20 +890,20 @@ bool PRunSingleHisto::EstimateBkg(unsigned int histoNo) beamPeriod = 0.0; // check if start and end are in proper order - unsigned int start = fRunInfo->fBkgRange[0]; - unsigned int end = fRunInfo->fBkgRange[1]; + UInt_t start = fRunInfo->fBkgRange[0]; + UInt_t end = fRunInfo->fBkgRange[1]; if (end < start) { cout << endl << "PRunSingleHisto::EstimatBkg(): end = " << end << " > start = " << start << "! Will swap them!"; - unsigned int keep = end; + UInt_t keep = end; end = start; start = keep; } // calculate proper background range if (beamPeriod != 0.0) { - double beamPeriodBins = beamPeriod/fRunInfo->fPacking; - unsigned int periods = (unsigned int)((double)(end - start + 1) / beamPeriodBins); - end = start + (unsigned int)round((double)periods*beamPeriodBins); + Double_t beamPeriodBins = beamPeriod/fRunInfo->fPacking; + UInt_t periods = (UInt_t)((Double_t)(end - start + 1) / beamPeriodBins); + end = start + (UInt_t)round((Double_t)periods*beamPeriodBins); cout << endl << "PRunSingleHisto::EstimatBkg(): Background " << start << ", " << end; if (end == start) end = fRunInfo->fBkgRange[1]; @@ -900,28 +914,30 @@ bool PRunSingleHisto::EstimateBkg(unsigned int histoNo) // check if start is within histogram bounds if ((start < 0) || (start >= runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::EstimatBkg(): background bin values out of bound!"; - cout << endl << " histo lengths = " << runData->GetDataBin(histoNo)->size(); - cout << endl << " background start = " << start; + cerr << endl << "PRunSingleHisto::EstimatBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << " histo lengths = " << runData->GetDataBin(histoNo)->size(); + cerr << endl << " background start = " << start; + cerr << endl; return false; } // check if end is within histogram bounds if ((end < 0) || (end >= runData->GetDataBin(histoNo)->size())) { - cout << endl << "PRunSingleHisto::EstimatBkg(): background bin values out of bound!"; - cout << endl << " histo lengths = " << runData->GetDataBin(histoNo)->size(); - cout << endl << " background end = " << end; + cerr << endl << "PRunSingleHisto::EstimatBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << " histo lengths = " << runData->GetDataBin(histoNo)->size(); + cerr << endl << " background end = " << end; + cerr << endl; return false; } // calculate background - double bkg = 0.0; + Double_t bkg = 0.0; // forward //cout << endl << ">> bkg start=" << start << ", end=" << end; - for (unsigned int i=start; iGetDataBin(histoNo)->at(i); - bkg /= static_cast(end - start + 1); + bkg /= static_cast(end - start + 1); fBackground = bkg / (fTimeResolution * 1e3); // keep background (per 1 nsec) for chisq, max.log.likelihood, fTimeResolution us->ns diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index 812e98da..c0f0b06b 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -53,10 +53,10 @@ PStartupHandler::PStartupHandler() fStartupFilePath = ""; // get default path (for the moment only linux like) - char *pmusrpath; - char *home; - char musrpath[128]; - char startup_path_name[128]; + Char_t *pmusrpath; + Char_t *home; + Char_t musrpath[128]; + Char_t startup_path_name[128]; // check if the startup file is found in the current directory strcpy(startup_path_name, "./musrfit_startup.xml"); @@ -69,7 +69,7 @@ PStartupHandler::PStartupHandler() if (pmusrpath == 0) { // not set, will try default one home = getenv("ROOTSYS"); sprintf(musrpath, "%s/bin", home); - cout << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl; + cerr << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl; } else { strncpy(musrpath, pmusrpath, sizeof(musrpath)); } @@ -140,7 +140,7 @@ void PStartupHandler::OnEndDocument() * \param str * \param attributes */ -void PStartupHandler::OnStartElement(const char *str, const TList *attributes) +void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes) { if (!strcmp(str, "data_path")) { fKey = eDataPath; @@ -171,7 +171,7 @@ void PStartupHandler::OnStartElement(const char *str, const TList *attributes) * * \param str */ -void PStartupHandler::OnEndElement(const char *str) +void PStartupHandler::OnEndElement(const Char_t *str) { fKey = eEmpty; } @@ -184,7 +184,7 @@ void PStartupHandler::OnEndElement(const char *str) * * \param str */ -void PStartupHandler::OnCharacters(const char *str) +void PStartupHandler::OnCharacters(const Char_t *str) { TObjArray *tokens; TObjString *ostr; @@ -204,8 +204,8 @@ void PStartupHandler::OnCharacters(const char *str) // add converted str to the marker list fMarkerList.push_back(tstr.Atoi()); } else { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a number, will ignore it"; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a number, will ignore it"; + cerr << endl; } break; case eColor: @@ -214,14 +214,14 @@ void PStartupHandler::OnCharacters(const char *str) tokens = tstr.Tokenize(","); // check that there any tokens if (!tokens) { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; + cerr << endl; return; } // check there is the right number of tokens if (tokens->GetEntries() != 3) { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a rbg code, will ignore it"; + cerr << endl; return; } // get r @@ -230,8 +230,8 @@ void PStartupHandler::OnCharacters(const char *str) if (tstr.IsDigit()) { r = tstr.Atoi(); } else { - cout << endl << "PStartupHandler **WARNING** r within the rgb code is not a number, will ignore it"; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** r within the rgb code is not a number, will ignore it"; + cerr << endl; return; } // get g @@ -240,8 +240,8 @@ void PStartupHandler::OnCharacters(const char *str) if (tstr.IsDigit()) { g = tstr.Atoi(); } else { - cout << endl << "PStartupHandler **WARNING** g within the rgb code is not a number, will ignore it"; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** g within the rgb code is not a number, will ignore it"; + cerr << endl; return; } // get b @@ -250,8 +250,8 @@ void PStartupHandler::OnCharacters(const char *str) if (tstr.IsDigit()) { b = tstr.Atoi(); } else { - cout << endl << "PStartupHandler **WARNING** b within the rgb code is not a number, will ignore it"; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** b within the rgb code is not a number, will ignore it"; + cerr << endl; return; } // clean up tokens @@ -273,8 +273,8 @@ void PStartupHandler::OnCharacters(const char *str) } else if (!tstr.CompareTo("mc/s", TString::kIgnoreCase)) { fFourierDefaults.fUnits = FOURIER_UNIT_CYCLES; } else { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid unit, will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid unit, will ignore it."; + cerr << endl; } break; case eFourierPower: @@ -284,12 +284,12 @@ void PStartupHandler::OnCharacters(const char *str) if ((ival >= 0) && (ival <= 20)) { fFourierDefaults.fFourierPower = ival; } else { - cout << endl << "PStartupHandler **WARNING** fourier power '" << str << "' is not a valid number (0..20), will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** fourier power '" << str << "' is not a valid number (0..20), will ignore it."; + cerr << endl; } } else { - cout << endl << "PStartupHandler **WARNING** fourier power '" << str << "' is not a valid number (0..20), will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** fourier power '" << str << "' is not a valid number (0..20), will ignore it."; + cerr << endl; } break; case eApodization: @@ -303,8 +303,8 @@ void PStartupHandler::OnCharacters(const char *str) } else if (!tstr.CompareTo("strong", TString::kIgnoreCase)) { fFourierDefaults.fApodization = FOURIER_APOD_STRONG; } else { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid apodization, will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid apodization, will ignore it."; + cerr << endl; } break; case ePlot: @@ -320,8 +320,8 @@ void PStartupHandler::OnCharacters(const char *str) } else if (!tstr.CompareTo("phase", TString::kIgnoreCase)) { fFourierDefaults.fPlotTag = FOURIER_PLOT_PHASE; } else { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid plot option, will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid plot option, will ignore it."; + cerr << endl; } break; case ePhase: @@ -329,8 +329,8 @@ void PStartupHandler::OnCharacters(const char *str) if (tstr.IsFloat()) { fFourierDefaults.fPhase = tstr.Atof(); } else { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase, will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase, will ignore it."; + cerr << endl; } break; case ePhaseIncrement: @@ -338,8 +338,8 @@ void PStartupHandler::OnCharacters(const char *str) if (tstr.IsFloat()) { fFourierDefaults.fPhaseIncrement = tstr.Atof(); } else { - cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase increment, will ignore it."; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase increment, will ignore it."; + cerr << endl; } break; default: @@ -355,7 +355,7 @@ void PStartupHandler::OnCharacters(const char *str) * * \param str */ -void PStartupHandler::OnComment(const char *str) +void PStartupHandler::OnComment(const Char_t *str) { // nothing to be done for now } @@ -368,10 +368,10 @@ void PStartupHandler::OnComment(const char *str) * * \param str */ -void PStartupHandler::OnWarning(const char *str) +void PStartupHandler::OnWarning(const Char_t *str) { - cout << endl << "PStartupHandler **WARNING** " << str; - cout << endl; + cerr << endl << "PStartupHandler **WARNING** " << str; + cerr << endl; } //-------------------------------------------------------------------------- @@ -382,10 +382,10 @@ void PStartupHandler::OnWarning(const char *str) * * \param str */ -void PStartupHandler::OnError(const char *str) +void PStartupHandler::OnError(const Char_t *str) { - cout << endl << "PStartupHandler **ERROR** " << str; - cout << endl; + cerr << endl << "PStartupHandler **ERROR** " << str; + cerr << endl; } //-------------------------------------------------------------------------- @@ -396,10 +396,10 @@ void PStartupHandler::OnError(const char *str) * * \param str */ -void PStartupHandler::OnFatalError(const char *str) +void PStartupHandler::OnFatalError(const Char_t *str) { - cout << endl << "PStartupHandler **FATAL ERROR** " << str; - cout << endl; + cerr << endl << "PStartupHandler **FATAL ERROR** " << str; + cerr << endl; } //-------------------------------------------------------------------------- @@ -410,7 +410,7 @@ void PStartupHandler::OnFatalError(const char *str) * * \param str */ -void PStartupHandler::OnCdataBlock(const char *str, Int_t len) +void PStartupHandler::OnCdataBlock(const Char_t *str, Int_t len) { // nothing to be done for now } @@ -427,7 +427,7 @@ void PStartupHandler::CheckLists() // check if anything was set, and if not set some default stuff // check if any data path is given -//cout << endl << ">> check data path list ..."; +//cout << endl << ">> check data path list ..."; if (fDataPathList.size() == 0) { //cout << endl << ">> data path list empty, will set default ones"; fDataPathList.push_back(TString("/mnt/data/nemu/his")); @@ -478,9 +478,9 @@ void PStartupHandler::CheckLists() *

* */ -bool PStartupHandler::StartupFileExists(char *fln) +Bool_t PStartupHandler::StartupFileExists(Char_t *fln) { - bool result = false; + Bool_t result = false; ifstream ifile(fln); diff --git a/src/classes/PTheory.cpp b/src/classes/PTheory.cpp index 9a179356..7715eeb5 100644 --- a/src/classes/PTheory.cpp +++ b/src/classes/PTheory.cpp @@ -85,7 +85,7 @@ using namespace std; * false (default) -> this is the root object * true -> this is part of an already existing object tree */ -PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) +PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent) { // init stuff fValid = true; @@ -95,15 +95,15 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) fUserFcn = 0; fDynLFdt = 0.0; - static unsigned int lineNo = 1; // lineNo - static unsigned int depth = 0; // needed to handle '+' properly + static UInt_t lineNo = 1; // lineNo + static UInt_t depth = 0; // needed to handle '+' properly if (hasParent == false) { // reset static counters if root object lineNo = 1; // the lineNo counter and the depth counter need to be depth = 0; // reset for every root object (new run). } - for (unsigned int i=0; ifLine.Copy(); // remove theory line comment if present, i.e. something starting with '(' - int index = str.Index("("); + Int_t index = str.Index("("); if (index > 0) // theory line comment present str.Resize(index); @@ -133,40 +133,42 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) tokens = str.Tokenize(" \t"); if (!tokens) { - cout << endl << "**SEVERE ERROR**: PTheory(): Couldn't tokenize theory block line " << line->fLineNo << "."; - cout << endl << " line content: " << line->fLine.Data(); - cout << endl; + cerr << endl << "**SEVERE ERROR**: PTheory(): Couldn't tokenize theory block line " << line->fLineNo << "."; + cerr << endl << " line content: " << line->fLine.Data(); + cerr << endl; exit(0); } ostr = dynamic_cast(tokens->At(0)); str = ostr->GetString(); // search the theory function - unsigned int idx = SearchDataBase(str); + UInt_t idx = SearchDataBase(str); // function found is not defined - if (idx == (unsigned int) THEORY_UNDEFINED) { - cout << endl << "**ERROR**: PTheory(): Theory line '" << line->fLine.Data() << "'"; - cout << endl << " in line no " << line->fLineNo << " is undefined!"; + if (idx == (UInt_t) THEORY_UNDEFINED) { + cerr << endl << "**ERROR**: PTheory(): Theory line '" << line->fLine.Data() << "'"; + cerr << endl << " in line no " << line->fLineNo << " is undefined!"; + cerr << endl; fValid = false; return; } // line is a valid function, hence analyze parameters - if (((unsigned int)(tokens->GetEntries()-1) < fNoOfParam) && + if (((UInt_t)(tokens->GetEntries()-1) < fNoOfParam) && ((idx != THEORY_USER_FCN) && (idx != THEORY_POLYNOM))) { - cout << endl << "**ERROR**: PTheory(): Theory line '" << line->fLine.Data() << "'"; - cout << endl << " in line no " << line->fLineNo; - cout << endl << " expecting " << fgTheoDataBase[idx].fNoOfParam << ", but found " << tokens->GetEntries()-1; + cerr << endl << "**ERROR**: PTheory(): Theory line '" << line->fLine.Data() << "'"; + cerr << endl << " in line no " << line->fLineNo; + cerr << endl << " expecting " << fgTheoDataBase[idx].fNoOfParam << ", but found " << tokens->GetEntries()-1; + cerr << endl; fValid = false; } // keep function index fType = idx; // filter out the parameters - int status; - unsigned int value; - bool ok = false; - for (int i=1; iGetEntries(); i++) { + Int_t status; + UInt_t value; + Bool_t ok = false; + for (Int_t i=1; iGetEntries(); i++) { ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); @@ -192,11 +194,13 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) if ((value <= maps.size()) && (value > 0)) { // everything fine fParamNo.push_back(maps[value-1]-1); } else { // map index out of range - cout << endl << "**ERROR**: PTheory: map index " << value << " out of range! See line no " << line->fLineNo; + cerr << endl << "**ERROR**: PTheory: map index " << value << " out of range! See line no " << line->fLineNo; + cerr << endl; fValid = false; } } else { // something wrong - cout << endl << "**ERROR**: PTheory: map '" << str.Data() << "' not allowed. See line no " << line->fLineNo; + cerr << endl << "**ERROR**: PTheory: map '" << str.Data() << "' not allowed. See line no " << line->fLineNo; + cerr << endl; fValid = false; } } else if (str.Contains("fun")) { // check if str is fun @@ -217,7 +221,8 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) } // check if one of the valid entries was found if (!ok) { - cout << endl << "**ERROR**: PTheory: '" << str.Data() << "' not allowed. See line no " << line->fLineNo; + cerr << endl << "**ERROR**: PTheory: '" << str.Data() << "' not allowed. See line no " << line->fLineNo; + cerr << endl; fValid = false; } } @@ -254,9 +259,10 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) cout << endl << ">> user function class name: " << fUserFcnClassName.Data() << endl; if (!TClass::GetDict(fUserFcnClassName.Data())) { if (gSystem->Load(fUserFcnSharedLibName.Data()) < 0) { - cout << endl << "**ERROR**: PTheory: user function class '" << fUserFcnClassName.Data() << "' not found."; - cout << endl << " Tried to load " << fUserFcnSharedLibName.Data() << " but failed."; - cout << endl << " See line no " << line->fLineNo; + cerr << endl << "**ERROR**: PTheory: user function class '" << fUserFcnClassName.Data() << "' not found."; + cerr << endl << " Tried to load " << fUserFcnSharedLibName.Data() << " but failed."; + cerr << endl << " See line no " << line->fLineNo; + cerr << endl; fValid = false; // clean up if (tokens) { @@ -271,7 +277,8 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent) fUserFcn = (PUserFcnBase*)TClass::GetClass(fUserFcnClassName.Data())->New(); //cout << endl << ">> fUserFcn = " << fUserFcn << endl; if (fUserFcn == 0) { - cout << endl << "**ERROR**: PTheory: user function object could not be invoked. See line no " << line->fLineNo; + cerr << endl << "**ERROR**: PTheory: user function object could not be invoked. See line no " << line->fLineNo; + cerr << endl; fValid = false; } else { // user function valid, hence expand the fUserParam vector to the proper size fUserParam.resize(fParamNo.size()); @@ -317,7 +324,7 @@ PTheory::~PTheory() *

Checks if the theory tree is valid. Needs to be implemented!! * */ -bool PTheory::IsValid() +Bool_t PTheory::IsValid() { if (fMul) { @@ -344,7 +351,7 @@ bool PTheory::IsValid() * \param t * \param paramValues */ -double PTheory::Func(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const +Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const { if (fMul) { @@ -435,8 +442,8 @@ double PTheory::Func(register double t, const PDoubleVector& paramValues, const fAdd->Func(t, paramValues, funcValues); break; default: - cout << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; - cout << endl; + cerr << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; + cerr << endl; exit(0); } } else { // fMul !=0 && fAdd == 0 @@ -505,8 +512,8 @@ double PTheory::Func(register double t, const PDoubleVector& paramValues, const return UserFcn(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues); break; default: - cout << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; - cout << endl; + cerr << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; + cerr << endl; exit(0); } } @@ -577,8 +584,8 @@ double PTheory::Func(register double t, const PDoubleVector& paramValues, const return UserFcn(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues); break; default: - cout << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; - cout << endl; + cerr << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; + cerr << endl; exit(0); } } else { // fMul == 0 && fAdd == 0 @@ -647,8 +654,8 @@ double PTheory::Func(register double t, const PDoubleVector& paramValues, const return UserFcn(t, paramValues, funcValues); break; default: - cout << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; - cout << endl; + cerr << endl << "**PANIC ERROR**: PTheory::Func: You never should have reached this line?!?! (" << fType << ")"; + cerr << endl; exit(0); } } @@ -695,11 +702,11 @@ void PTheory::CleanUp(PTheory *theo) * * \param name */ -int PTheory::SearchDataBase(TString name) +Int_t PTheory::SearchDataBase(TString name) { - int idx = THEORY_UNDEFINED; + Int_t idx = THEORY_UNDEFINED; - for (unsigned int i=0; isize(); i++) { + for (UInt_t i=1; isize(); i++) { // get the line to be prettyfied line = &(*fullTheoryBlock)[i]; // copy line content to str in order to remove comments str = line->fLine.Copy(); // remove theory line comment if present, i.e. something starting with '(' - int index = str.Index("("); + Int_t index = str.Index("("); if (index > 0) // theory line comment present str.Resize(index); // tokenize line @@ -756,7 +763,7 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock) continue; } // search the theory function - for (unsigned int j=0; jGetEntries() < fgTheoDataBase[idx].fNoOfParam + 1) + if ((UInt_t)tokens->GetEntries() < fgTheoDataBase[idx].fNoOfParam + 1) return; // make tidy string sprintf(substr, "%-10s", fgTheoDataBase[idx].fName.Data()); tidy = TString(substr); - for (unsigned int j=1; j<(unsigned int)tokens->GetEntries(); j++) { + for (UInt_t j=1; j<(UInt_t)tokens->GetEntries(); j++) { ostr = dynamic_cast(tokens->At(j)); str = ostr->GetString(); sprintf(substr, "%6s", str.Data()); @@ -779,12 +786,12 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock) } if (fgTheoDataBase[idx].fComment.Length() != 0) { if (tidy.Length() < 35) { - for (unsigned int k=0; k<35-(unsigned int)tidy.Length(); k++) + for (UInt_t k=0; k<35-(UInt_t)tidy.Length(); k++) tidy += TString(" "); } else { tidy += TString(" "); } - if ((unsigned int)tokens->GetEntries() == fgTheoDataBase[idx].fNoOfParam + 1) // no tshift + if ((UInt_t)tokens->GetEntries() == fgTheoDataBase[idx].fNoOfParam + 1) // no tshift tidy += fgTheoDataBase[idx].fComment; else tidy += fgTheoDataBase[idx].fCommentTimeShift; @@ -809,13 +816,13 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock) * * \param fullTheoryBlock */ -void PTheory::MakeCleanAndTidyPolynom(unsigned int i, PMsrLines *fullTheoryBlock) +void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock) { PMsrLineStructure *line; TString str, tidy; TObjArray *tokens = 0; TObjString *ostr; - char substr[256]; + Char_t substr[256]; //cout << endl << ">> MakeCleanAndTidyPolynom: " << (*fullTheoryBlock)[i].fLine.Data(); @@ -829,8 +836,8 @@ void PTheory::MakeCleanAndTidyPolynom(unsigned int i, PMsrLines *fullTheoryBlock tokens = str.Tokenize(" \t"); // check if comment is already present, and if yes ignore it by setting max correctly - unsigned int max = (unsigned int)tokens->GetEntries(); - for (unsigned int j=1; jGetEntries(); + for (UInt_t j=1; j(tokens->At(j)); str = ostr->GetString(); if (str.Contains("(")) { // comment present @@ -839,7 +846,7 @@ void PTheory::MakeCleanAndTidyPolynom(unsigned int i, PMsrLines *fullTheoryBlock } } - for (unsigned int j=1; j(tokens->At(j)); str = ostr->GetString(); sprintf(substr, "%6s", str.Data()); @@ -867,7 +874,7 @@ void PTheory::MakeCleanAndTidyPolynom(unsigned int i, PMsrLines *fullTheoryBlock * * \param fullTheoryBlock */ -void PTheory::MakeCleanAndTidyUserFcn(unsigned int i, PMsrLines *fullTheoryBlock) +void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock) { PMsrLineStructure *line; TString str, tidy; @@ -885,7 +892,7 @@ void PTheory::MakeCleanAndTidyUserFcn(unsigned int i, PMsrLines *fullTheoryBlock // tokenize line tokens = str.Tokenize(" \t"); - for (unsigned int j=1; j<(unsigned int)tokens->GetEntries(); j++) { + for (UInt_t j=1; j<(UInt_t)tokens->GetEntries(); j++) { ostr = dynamic_cast(tokens->At(j)); str = ostr->GetString(); tidy += TString(" ") + str; @@ -908,11 +915,11 @@ void PTheory::MakeCleanAndTidyUserFcn(unsigned int i, PMsrLines *fullTheoryBlock * * \param paramValues */ -double PTheory::Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const +Double_t PTheory::Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const { // expected parameters: asym - double asym; + Double_t asym; // check if FUNCTIONS are used if (fParamNo[0] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map @@ -937,16 +944,16 @@ double PTheory::Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& * \param paramValues parameter values: depolarization rate \f$\lambda\f$ * in \f$(1/\mu\mathrm{s})\f$, optionally \f$t_{\rm shift}\f$ */ -double PTheory::SimpleExp(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const +Double_t PTheory::SimpleExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const { // expected parameters: lambda [tshift] - double val[2]; + Double_t val[2]; assert(fParamNo.size() <= 2); // check if FUNCTIONS are used - for (unsigned int i=0; i= 25.0) || (zm >= 25.0)) // needed to prevent crash of 1F1 skg = 2.0e300; @@ -1773,17 +1780,17 @@ double PTheory::SkewedGauss(register double t, const PDoubleVector& paramValues, * \param t time in \f$(\mu\mathrm{s})\f$ * \param paramValues tshift, p0, p1, ..., pn */ -double PTheory::Polynom(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const +Double_t PTheory::Polynom(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const { // expected parameters: tshift p0 p1 p2 ... - double result = 0.0; - double tshift = 0.0; - double val; - double expo = 0.0; + Double_t result = 0.0; + Double_t tshift = 0.0; + Double_t val; + Double_t expo = 0.0; // check if FUNCTIONS are used - for (unsigned int i=0; i> UserFcn: fParamNo.size()=" << fParamNo.size() << ", fUserParam.size()=" << fUserParam.size(); - for (unsigned int i=0; i> " << i << ": " << fParamNo[i]+1; } cout << endl; @@ -1821,7 +1828,7 @@ if (first) { */ // check if FUNCTIONS are used - for (unsigned int i=0; i " << i << ": " << fUserParam[i]; } cout << endl; @@ -1849,18 +1856,18 @@ if (first) { * * \param val parameters needed to calculate the non-analytic integral of the static Gauss LF function. */ -void PTheory::CalculateGaussLFIntegral(const double *val) const +void PTheory::CalculateGaussLFIntegral(const Double_t *val) const { // val[0] = nu (field), val[1] = Delta if (val[0] == 0.0) // field == 0.0, hence nothing to be done return; - const double dt=0.001; // all times in usec - double t, ft; - double w0 = TMath::TwoPi()*val[0]; - double Delta = val[1]; - double preFactor = 2.0*TMath::Power(Delta, 4.0) / TMath::Power(w0, 3.0); + const Double_t dt=0.001; // all times in usec + Double_t t, ft; + Double_t w0 = TMath::TwoPi()*val[0]; + Double_t Delta = val[1]; + Double_t preFactor = 2.0*TMath::Power(Delta, 4.0) / TMath::Power(w0, 3.0); // clear previously allocated vector fLFIntegral.clear(); @@ -1870,7 +1877,7 @@ void PTheory::CalculateGaussLFIntegral(const double *val) const fLFIntegral.push_back(0.0); // start value of the integral ft = 0.0; - for (unsigned int i=1; i<2e4; i++) { + for (UInt_t i=1; i<2e4; i++) { t += dt; ft += 0.5*dt*preFactor*(TMath::Exp(-0.5*TMath::Power(Delta * (t-dt), 2.0))*TMath::Sin(w0*(t-dt))+ TMath::Exp(-0.5*TMath::Power(Delta * t, 2.0))*TMath::Sin(w0*t)); @@ -1884,18 +1891,18 @@ void PTheory::CalculateGaussLFIntegral(const double *val) const * * \param val parameters needed to calculate the non-analytic integral of the static Lorentz LF function. */ -void PTheory::CalculateLorentzLFIntegral(const double *val) const +void PTheory::CalculateLorentzLFIntegral(const Double_t *val) const { // val[0] = nu, val[1] = a if (val[0] == 0.0) // field == 0.0, hence nothing to be done return; - const double dt=0.001; // all times in usec - double t, ft; - double w0 = TMath::TwoPi()*val[0]; - double a = val[1]; - double preFactor = a*(1+pow(a/w0,2.0)); + const Double_t dt=0.001; // all times in usec + Double_t t, ft; + Double_t w0 = TMath::TwoPi()*val[0]; + Double_t a = val[1]; + Double_t preFactor = a*(1+pow(a/w0,2.0)); // clear previously allocated vector fLFIntegral.clear(); @@ -1910,7 +1917,7 @@ void PTheory::CalculateLorentzLFIntegral(const double *val) const ft += 0.5*dt*preFactor*(1.0+sin(w0*t)/(w0*t)*exp(-a*t)); fLFIntegral.push_back(ft); // calculate all the other integral bin values - for (unsigned int i=2; i<2e4; i++) { + for (UInt_t i=2; i<2e4; i++) { t += dt; ft += 0.5*dt*preFactor*(sin(w0*(t-dt))/(w0*(t-dt))*exp(-a*(t-dt))+sin(w0*t)/(w0*t)*exp(-a*t)); fLFIntegral.push_back(ft); @@ -1923,9 +1930,9 @@ void PTheory::CalculateLorentzLFIntegral(const double *val) const * * \param t time in (usec) */ -double PTheory::GetLFIntegralValue(const double t) const +Double_t PTheory::GetLFIntegralValue(const Double_t t) const { - unsigned int idx = static_cast(t/0.001); // since LF-integral is calculated in nsec + UInt_t idx = static_cast(t/0.001); // since LF-integral is calculated in nsec if (idx < 0) return 0.0; @@ -1934,7 +1941,7 @@ double PTheory::GetLFIntegralValue(const double t) const return fLFIntegral[fLFIntegral.size()-1]; // liniarly interpolate between the two relvant function bins - double df = (fLFIntegral[idx+1]-fLFIntegral[idx])/0.001*(t-idx*0.001); + Double_t df = (fLFIntegral[idx+1]-fLFIntegral[idx])/0.001*(t-idx*0.001); return fLFIntegral[idx]+df; } @@ -1948,15 +1955,15 @@ double PTheory::GetLFIntegralValue(const double t) const * \param val parameters needed to solve the voltera integral equation * \param tag 0=Gauss, 1=Lorentz */ -void PTheory::CalculateDynKTLF(const double *val, int tag) const +void PTheory::CalculateDynKTLF(const Double_t *val, Int_t tag) const { // val: 0=nu0, 1=Delta (Gauss) / a (Lorentz), 2=nu - const double Tmax = 20.0; // 20 usec - unsigned int N = static_cast(16.0*Tmax*val[0]); + const Double_t Tmax = 20.0; // 20 usec + UInt_t N = static_cast(16.0*Tmax*val[0]); // check if rate (Delta or a) is very high if (fabs(val[1]) > 0.1) { - double tmin = 20.0; + Double_t tmin = 20.0; switch (tag) { case 0: // Gauss tmin = sqrt(3.0)/val[1]; @@ -1967,7 +1974,7 @@ void PTheory::CalculateDynKTLF(const double *val, int tag) const default: break; } - unsigned int Nrate = static_cast(25.0 * Tmax / tmin); + UInt_t Nrate = static_cast(25.0 * Tmax / tmin); if (Nrate > N) { N = Nrate; } @@ -1989,25 +1996,25 @@ void PTheory::CalculateDynKTLF(const double *val, int tag) const CalculateLorentzLFIntegral(val); break; default: - cout << endl << "**FATAL ERROR** in PTheory::CalculateDynKTLF: You should never have reached this point." << endl; + cerr << endl << "**FATAL ERROR** in PTheory::CalculateDynKTLF: You should never have reached this point." << endl; assert(false); break; } // calculate the P^(0)(t) exp(-nu t) vector PDoubleVector p0exp(N); - double t = 0.0; - double dt = Tmax/N; + Double_t t = 0.0; + Double_t dt = Tmax/N; fDynLFdt = dt; // keep it since it is needed in GetDynKTLFValue() - for (unsigned int i=0; i(t/fDynLFdt); + Int_t idx = static_cast(t/fDynLFdt); if (idx < 0) return 0.0; - if (idx > static_cast(fDynLFFuncValue.size())-1) + if (idx > static_cast(fDynLFFuncValue.size())-1) return fDynLFFuncValue[fDynLFFuncValue.size()-1]; // liniarly interpolate between the two relvant function bins - double df = (fDynLFFuncValue[idx+1]-fDynLFFuncValue[idx])*(t-idx*fDynLFdt)/fDynLFdt; + Double_t df = (fDynLFFuncValue[idx+1]-fDynLFFuncValue[idx])*(t-idx*fDynLFdt)/fDynLFdt; return fDynLFFuncValue[idx]+df; } diff --git a/src/include/PFitter.h b/src/include/PFitter.h index e32ffced..3dd10c18 100644 --- a/src/include/PFitter.h +++ b/src/include/PFitter.h @@ -63,20 +63,20 @@ Will handle all the possible minuit commands and actually do things ... class PFitter { public: - PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, bool chisq_only = false); + PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only = false); virtual ~PFitter(); - bool IsValid() { return fIsValid; } - bool HasConverged() { return fConverged; } - bool DoFit(); + Bool_t IsValid() { return fIsValid; } + Bool_t HasConverged() { return fConverged; } + Bool_t DoFit(); private: - bool fIsValid; - bool fConverged; - bool fChisqOnly; - bool fUseChi2; + Bool_t fIsValid; + Bool_t fConverged; + Bool_t fChisqOnly; + Bool_t fUseChi2; - unsigned int fStrategy; + UInt_t fStrategy; PMsrHandler *fRunInfo; @@ -90,15 +90,15 @@ class PFitter ROOT::Minuit2::FunctionMinimum *fFcnMin; ///< function minimum object ROOT::Minuit2::MnUserParameterState *fMnUserParamState; ///< keeps the current user parameter state - bool CheckCommands(); - bool SetParameters(); + Bool_t CheckCommands(); + Bool_t SetParameters(); - bool ExecuteHesse(); - bool ExecuteMigrad(); - bool ExecuteMinimize(); - bool ExecuteMinos(); - bool ExecuteSave(); - bool ExecuteSimplex(); + Bool_t ExecuteHesse(); + Bool_t ExecuteMigrad(); + Bool_t ExecuteMinimize(); + Bool_t ExecuteMinos(); + Bool_t ExecuteSave(); + Bool_t ExecuteSimplex(); }; #endif // _PFITTER_H_ diff --git a/src/include/PFitterFcn.h b/src/include/PFitterFcn.h index 306a1fac..ebcb8057 100644 --- a/src/include/PFitterFcn.h +++ b/src/include/PFitterFcn.h @@ -41,17 +41,17 @@ class PFitterFcn : public ROOT::Minuit2::FCNBase { public: - PFitterFcn(PRunListCollection *runList, bool useChi2); + PFitterFcn(PRunListCollection *runList, Bool_t useChi2); ~PFitterFcn(); - double Up() const { return fUp; } - double operator()(const std::vector&) const; + Double_t Up() const { return fUp; } + Double_t operator()(const std::vector&) const; - unsigned int GetTotalNoOfFittedBins() { return fRunListCollection->GetTotalNoOfBinsFitted(); } + UInt_t GetTotalNoOfFittedBins() { return fRunListCollection->GetTotalNoOfBinsFitted(); } private: - double fUp; - bool fUseChi2; + Double_t fUp; + Bool_t fUseChi2; PRunListCollection *fRunListCollection; }; diff --git a/src/include/PFourier.h b/src/include/PFourier.h index 05098ecf..2ba55306 100644 --- a/src/include/PFourier.h +++ b/src/include/PFourier.h @@ -45,43 +45,43 @@ class PFourier { public: - PFourier(TH1F *data, int unitTag, - double startTime = 0.0, double endTime = 0.0, - unsigned int zeroPaddingPower = 0); + PFourier(TH1F *data, Int_t unitTag, + Double_t startTime = 0.0, Double_t endTime = 0.0, + UInt_t zeroPaddingPower = 0); virtual ~PFourier(); - virtual void Transform(unsigned int apodizationTag = 0); + virtual void Transform(UInt_t apodizationTag = 0); - virtual double GetResolution() { return fResolution; } - virtual TH1F* GetRealFourier(const double scale = 1.0); - virtual TH1F* GetImaginaryFourier(const double scale = 1.0); - virtual TH1F* GetPowerFourier(const double scale = 1.0); - virtual TH1F* GetPhaseFourier(const double scale = 1.0); + virtual Double_t GetResolution() { return fResolution; } + virtual TH1F* GetRealFourier(const Double_t scale = 1.0); + virtual TH1F* GetImaginaryFourier(const Double_t scale = 1.0); + virtual TH1F* GetPowerFourier(const Double_t scale = 1.0); + virtual TH1F* GetPhaseFourier(const Double_t scale = 1.0); - virtual bool IsValid() { return fValid; } + virtual Bool_t IsValid() { return fValid; } private: TH1F *fData; - bool fValid; - int fUnitTag; ///< 1=Field Units (G), 2=Frequency Units (MHz), 3=Angular Frequency Units (Mc/s) + Bool_t fValid; + Int_t fUnitTag; ///< 1=Field Units (G), 2=Frequency Units (MHz), 3=Angular Frequency Units (Mc/s) - int fApodization; ///< 0=none, 1=weak, 2=medium, 3=strong + Int_t fApodization; ///< 0=none, 1=weak, 2=medium, 3=strong - double fTimeResolution; - double fStartTime; - double fEndTime; - unsigned int fZeroPaddingPower; - double fResolution; + Double_t fTimeResolution; + Double_t fStartTime; + Double_t fEndTime; + UInt_t fZeroPaddingPower; + Double_t fResolution; - unsigned int fNoOfData; - unsigned int fNoOfBins; + UInt_t fNoOfData; + UInt_t fNoOfBins; fftw_plan fFFTwPlan; fftw_complex *fIn; fftw_complex *fOut; - virtual void PrepareFFTwInputData(unsigned int apodizationTag); - virtual void ApodizeData(int apodizationTag); + virtual void PrepareFFTwInputData(UInt_t apodizationTag); + virtual void ApodizeData(Int_t apodizationTag); }; #endif // _PFOURIER_H_ diff --git a/src/include/PFunction.h b/src/include/PFunction.h index b8ab4422..799f814f 100644 --- a/src/include/PFunction.h +++ b/src/include/PFunction.h @@ -65,11 +65,11 @@ using namespace boost::spirit; //---------------------------------------------------------------------------- typedef struct func_tree_node { - int fID; ///< tag showing what tree element this is - int fOperatorTag; ///< tag for '+', '-', '*', '/' - int fFunctionTag; ///< tag got "cos", "sin", ... - int fIvalue; ///< for parameter numbers and maps - double fDvalue; ///< for numbers + Int_t fID; ///< tag showing what tree element this is + Int_t fOperatorTag; ///< tag for '+', '-', '*', '/' + Int_t fFunctionTag; ///< tag got "cos", "sin", ... + Int_t fIvalue; ///< for parameter numbers and maps + Double_t fDvalue; ///< for numbers vector children; ///< holding sub-tree } PFuncTreeNode; @@ -79,32 +79,32 @@ class PFunction { PFunction(tree_parse_info<> info); virtual ~PFunction(); - virtual bool IsValid() { return fValid; } - virtual int GetFuncNo() { return fFuncNo; } - virtual bool CheckMapAndParamRange(unsigned int mapSize, unsigned int paramSize); - virtual double Eval(vector param); - virtual void SetMap(vector map) { fMap = map; } + virtual Bool_t IsValid() { return fValid; } + virtual Int_t GetFuncNo() { return fFuncNo; } + virtual Bool_t CheckMapAndParamRange(UInt_t mapSize, UInt_t paramSize); + virtual Double_t Eval(vector param); + virtual void SetMap(vector map) { fMap = map; } virtual TString* GetFuncString() { return &fFuncString; } protected: - virtual bool SetFuncNo(); + virtual Bool_t SetFuncNo(); - virtual bool FindAndCheckMapAndParamRange(PFuncTreeNode &node, unsigned int mapSize, unsigned int paramSize); - virtual bool GenerateFuncEvalTree(); + virtual Bool_t FindAndCheckMapAndParamRange(PFuncTreeNode &node, UInt_t mapSize, UInt_t paramSize); + virtual Bool_t GenerateFuncEvalTree(); virtual void FillFuncEvalTree(iter_t const& i, PFuncTreeNode &node); - virtual double EvalNode(PFuncTreeNode &node); + virtual Double_t EvalNode(PFuncTreeNode &node); virtual void CleanupFuncEvalTree(); virtual void CleanupNode(PFuncTreeNode &node); private: tree_parse_info<> fInfo; - vector fParam; - vector fMap; + vector fParam; + vector fMap; PFuncTreeNode fFunc; - bool fValid; ///< flag showing if the function is valid - int fFuncNo; ///< function number, i.e. FUNx with x the function number + Bool_t fValid; ///< flag showing if the function is valid + Int_t fFuncNo; ///< function number, i.e. FUNx with x the function number virtual void EvalTreeForString(tree_parse_info<> info); virtual void EvalTreeForStringExpression(iter_t const& i); diff --git a/src/include/PFunctionHandler.h b/src/include/PFunctionHandler.h index 74eaacac..ee74cd6b 100644 --- a/src/include/PFunctionHandler.h +++ b/src/include/PFunctionHandler.h @@ -48,17 +48,17 @@ class PFunctionHandler PFunctionHandler(PMsrLines lines); virtual ~PFunctionHandler(); - virtual bool IsValid() { return fValid; } - virtual bool DoParse(); - virtual bool CheckMapAndParamRange(unsigned int mapSize, unsigned int paramSize); - virtual double Eval(int funNo, vector map, vector param); - virtual int GetFuncNo(unsigned int idx); - virtual int GetFuncIndex(int funcNo); - virtual unsigned int GetNoOfFuncs() { return fFuncs.size(); } - virtual TString* GetFuncString(unsigned int idx); + virtual Bool_t IsValid() { return fValid; } + virtual Bool_t DoParse(); + virtual Bool_t CheckMapAndParamRange(UInt_t mapSize, UInt_t paramSize); + virtual double Eval(Int_t funNo, vector map, vector param); + virtual Int_t GetFuncNo(UInt_t idx); + virtual Int_t GetFuncIndex(Int_t funcNo); + virtual UInt_t GetNoOfFuncs() { return fFuncs.size(); } + virtual TString* GetFuncString(UInt_t idx); private: - bool fValid; + Bool_t fValid; PMsrLines fLines; vector fFuncs; diff --git a/src/include/PMsrHandler.h b/src/include/PMsrHandler.h index 76285123..c03d94c0 100644 --- a/src/include/PMsrHandler.h +++ b/src/include/PMsrHandler.h @@ -47,11 +47,11 @@ class PMsrHandler { public: - PMsrHandler(const char *fileName); + PMsrHandler(const Char_t *fileName); virtual ~PMsrHandler(); - virtual int ReadMsrFile(); - virtual int WriteMsrLogFile(const bool messages = true); + virtual Int_t ReadMsrFile(); + virtual Int_t WriteMsrLogFile(const Bool_t messages = true); virtual TString* GetMsrTitle() { return &fTitle; } virtual PMsrParamList* GetMsrParamList() { return &fParam; } @@ -65,37 +65,37 @@ class PMsrHandler virtual TString* GetMsrFileDirectoryPath() { return &fMsrFileDirectoryPath; } - virtual unsigned int GetNoOfParams() { return fParam.size(); } + virtual UInt_t GetNoOfParams() { return fParam.size(); } virtual const TString& GetFileName() const { return fFileName; } virtual void SetMsrTitle(const TString &title) { fTitle = title; } - virtual bool SetMsrParamValue(unsigned int i, double value); - virtual bool SetMsrParamStep(unsigned int i, double value); - virtual bool SetMsrParamPosErrorPresent(unsigned int i, bool value); - virtual bool SetMsrParamPosError(unsigned int i, double value); + virtual Bool_t SetMsrParamValue(UInt_t i, Double_t value); + virtual Bool_t SetMsrParamStep(UInt_t i, Double_t value); + virtual Bool_t SetMsrParamPosErrorPresent(UInt_t i, Bool_t value); + virtual Bool_t SetMsrParamPosError(UInt_t i, Double_t value); - virtual void SetMsrT0Entry(unsigned int runNo, unsigned int idx, int bin); - virtual void SetMsrDataRangeEntry(unsigned int runNo, unsigned int idx, int bin); - virtual void SetMsrBkgRangeEntry(unsigned int runNo, unsigned int idx, int bin); + virtual void SetMsrT0Entry(UInt_t runNo, UInt_t idx, Int_t bin); + virtual void SetMsrDataRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin); + virtual void SetMsrBkgRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin); virtual void CopyMsrStatisticBlock() { fCopyStatisticsBlock = true; } - virtual void SetMsrStatisticConverged(bool converged) { fStatistic.fValid = converged; } - virtual void SetMsrStatisticMin(double min) { fStatistic.fMin = min; } - virtual void SetMsrStatisticNdf(unsigned int ndf) { fStatistic.fNdf = ndf; } + virtual void SetMsrStatisticConverged(Bool_t converged) { fStatistic.fValid = converged; } + virtual void SetMsrStatisticMin(Double_t min) { fStatistic.fMin = min; } + virtual void SetMsrStatisticNdf(UInt_t ndf) { fStatistic.fNdf = ndf; } - virtual int GetNoOfFuncs() { return fFuncHandler->GetNoOfFuncs(); } - virtual unsigned int GetFuncNo(int idx) { return fFuncHandler->GetFuncNo(idx); } - virtual unsigned int GetFuncIndex(int funNo) { return fFuncHandler->GetFuncIndex(funNo); } - virtual bool CheckMapAndParamRange(unsigned int mapSize, unsigned int paramSize) + virtual Int_t GetNoOfFuncs() { return fFuncHandler->GetNoOfFuncs(); } + virtual UInt_t GetFuncNo(Int_t idx) { return fFuncHandler->GetFuncNo(idx); } + virtual UInt_t GetFuncIndex(Int_t funNo) { return fFuncHandler->GetFuncIndex(funNo); } + virtual Bool_t CheckMapAndParamRange(UInt_t mapSize, UInt_t paramSize) { return fFuncHandler->CheckMapAndParamRange(mapSize, paramSize); } - virtual double EvalFunc(unsigned int i, vector map, vector param) + virtual Double_t EvalFunc(UInt_t i, vector map, vector param) { return fFuncHandler->Eval(i,map,param); } - virtual int ParameterInUse(unsigned int paramNo); - virtual bool CheckUniquenessOfParamNames(unsigned int &parX, unsigned int &parY); - virtual bool CheckMaps(); - virtual bool CheckFuncs(); + virtual Int_t ParameterInUse(UInt_t paramNo); + virtual Bool_t CheckUniquenessOfParamNames(UInt_t &parX, UInt_t &parY); + virtual Bool_t CheckMaps(); + virtual Bool_t CheckFuncs(); private: TString fFileName; ///< file name of the msr-file @@ -110,29 +110,29 @@ class PMsrHandler PMsrPlotList fPlots; ///< holds a list of the plot input parameters PMsrStatisticStructure fStatistic; ///< holds the statistic info - int fMsrBlockCounter; ///< used to select the proper msr-block + Int_t fMsrBlockCounter; ///< used to select the proper msr-block PFunctionHandler *fFuncHandler; ///< needed to parse functions PIntVector fParamInUse; ///< array holding the information if a particular parameter is used at all, i.e. if the theory is using it (perhaps via maps or functions) - bool fCopyStatisticsBlock; ///< flag, if true: just copy to old statistics block (musrt0), otherwise write a new one (musrfit) + Bool_t fCopyStatisticsBlock; ///< flag, if true: just copy to old statistics block (musrt0), otherwise write a new one (musrfit) - virtual bool HandleFitParameterEntry(PMsrLines &line); - virtual bool HandleTheoryEntry(PMsrLines &line); - virtual bool HandleFunctionsEntry(PMsrLines &line); - virtual bool HandleRunEntry(PMsrLines &line); - virtual bool HandleCommandsEntry(PMsrLines &line); - virtual bool HandleFourierEntry(PMsrLines &line); - virtual bool HandlePlotEntry(PMsrLines &line); - virtual bool HandleStatisticEntry(PMsrLines &line); + virtual Bool_t HandleFitParameterEntry(PMsrLines &line); + virtual Bool_t HandleTheoryEntry(PMsrLines &line); + virtual Bool_t HandleFunctionsEntry(PMsrLines &line); + virtual Bool_t HandleRunEntry(PMsrLines &line); + virtual Bool_t HandleCommandsEntry(PMsrLines &line); + virtual Bool_t HandleFourierEntry(PMsrLines &line); + virtual Bool_t HandlePlotEntry(PMsrLines &line); + virtual Bool_t HandleStatisticEntry(PMsrLines &line); virtual void FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLines &run); virtual void InitRunParameterStructure(PMsrRunStructure ¶m); virtual void InitFourierParameterStructure(PMsrFourierStructure &fourier); - virtual bool FilterNumber(TString str, const char *filter, int offset, int &no); + virtual Bool_t FilterNumber(TString str, const Char_t *filter, Int_t offset, Int_t &no); }; #endif // _PMSRHANDLER_H_ diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h index 49652613..460d59ca 100644 --- a/src/include/PMusrCanvas.h +++ b/src/include/PMusrCanvas.h @@ -147,9 +147,9 @@ class PMusrCanvas : public TObject, public TQObject { public: PMusrCanvas(); - PMusrCanvas(const int number, const char* title, + PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch); - PMusrCanvas(const int number, const char* title, + PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, PMsrFourierStructure fourierDefault, const PIntVector markerList, const PIntVector colorList, const Bool_t batch); @@ -171,7 +171,7 @@ class PMusrCanvas : public TObject, public TQObject virtual void HandleMenuPopup(Int_t id); // SLOT virtual void LastCanvasClosed(); // SLOT - virtual void SaveGraphicsAndQuit(char *fileName, char *graphicsFormat); + virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat); private: Bool_t fBatchMode; /// musrview in ROOT batch mode @@ -222,27 +222,27 @@ class PMusrCanvas : public TObject, public TQObject virtual void CreateStyle(); virtual void InitFourier(); - virtual void InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh); + virtual void InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh); virtual void InitDataSet(PMusrCanvasDataSet &dataSet); virtual void InitDataSet(PMusrCanvasNonMusrDataSet &dataSet); virtual void CleanupDataSet(PMusrCanvasDataSet &dataSet); virtual void CleanupDataSet(PMusrCanvasNonMusrDataSet &dataSet); - virtual void HandleDataSet(unsigned int plotNo, unsigned int runNo, PRunData *data); - virtual void HandleNonMusrDataSet(unsigned int plotNo, unsigned int 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 HandleDifference(); virtual void HandleFourier(); virtual void HandleFourierDifference(); - virtual double FindOptimalFourierPhase(); + virtual Double_t FindOptimalFourierPhase(); virtual void CleanupDifference(); virtual void CleanupFourier(); virtual void CleanupFourierDifference(); - virtual double CalculateDiff(const double x, const double y, TH1F *theo); - virtual double CalculateDiff(const double x, const double y, TGraphErrors *theo); - virtual Int_t FindBin(const double x, TGraphErrors *graph); + virtual Double_t CalculateDiff(const Double_t x, const Double_t y, TH1F *theo); + virtual Double_t CalculateDiff(const Double_t x, const Double_t y, TGraphErrors *theo); + virtual Int_t FindBin(const Double_t x, TGraphErrors *graph); - virtual double GetGlobalMaximum(TH1F* histo); - virtual double GetGlobalMinimum(TH1F* histo); + virtual Double_t GetGlobalMaximum(TH1F* histo); + virtual Double_t GetGlobalMinimum(TH1F* histo); virtual void PlotData(); virtual void PlotDifference(); diff --git a/src/include/PMusrT0.h b/src/include/PMusrT0.h index ebef3bce..a2c10e8a 100644 --- a/src/include/PMusrT0.h +++ b/src/include/PMusrT0.h @@ -55,7 +55,7 @@ class PMusrT0 : public TObject, public TQObject { public: PMusrT0(); - PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTag, int addRunNo); + PMusrT0(PRawRunData *rawRunData, Int_t runNo, Int_t histoNo, Int_t detectorTag, Int_t addRunNo); virtual ~PMusrT0(); @@ -73,12 +73,12 @@ class PMusrT0 : public TObject, public TQObject PMsrHandler *fMsrHandler; #endif // __MAKECINT__ - int fStatus; + Int_t fStatus; - int fRunNo; - int fDetectorTag; - int fAddRunNo; - int fAddRunOffset; + Int_t fRunNo; + Int_t fDetectorTag; + Int_t fAddRunNo; + Int_t fAddRunOffset; // canvas related variables TCanvas *fMainCanvas; diff --git a/src/include/PRunAsymmetry.h b/src/include/PRunAsymmetry.h index 43df615b..19719fdf 100644 --- a/src/include/PRunAsymmetry.h +++ b/src/include/PRunAsymmetry.h @@ -38,34 +38,34 @@ class PRunAsymmetry : public PRunBase { public: PRunAsymmetry(); - PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag); + PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); virtual ~PRunAsymmetry(); - virtual double CalcChiSquare(const std::vector& par); - virtual double CalcMaxLikelihood(const std::vector& par); + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); virtual void CalcTheory(); - virtual unsigned int GetNoOfFitBins() { return fNoOfFitBins; } + virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } protected: - virtual bool PrepareData(); - virtual bool PrepareFitData(PRawRunData* runData, unsigned int histoNo[2]); - virtual bool PrepareViewData(PRawRunData* runData, unsigned int histoNo[2]); + virtual Bool_t PrepareData(); + virtual Bool_t PrepareFitData(PRawRunData* runData, UInt_t histoNo[2]); + virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]); private: - unsigned int fAlphaBetaTag; ///< 1-> alpha = beta = 1; 2-> alpha != 1, beta = 1; 3-> alpha = 1, beta != 1; 4-> alpha != 1, beta != 1 + UInt_t fAlphaBetaTag; ///< 1-> alpha = beta = 1; 2-> alpha != 1, beta = 1; 3-> alpha = 1, beta != 1; 4-> alpha != 1, beta != 1 - double fFitStartTime; - double fFitStopTime; - unsigned int fNoOfFitBins; + Double_t fFitStartTime; + Double_t fFitStopTime; + UInt_t fNoOfFitBins; PDoubleVector fForward; ///< forward histo data PDoubleVector fForwardErr; ///< forward histo errors PDoubleVector fBackward; ///< backward histo data PDoubleVector fBackwardErr; ///< backward histo errors - bool SubtractFixBkg(); - bool SubtractEstimatedBkg(); + Bool_t SubtractFixBkg(); + Bool_t SubtractEstimatedBkg(); }; #endif // _PRUNASYMMETRY_H_ diff --git a/src/include/PRunBase.h b/src/include/PRunBase.h index 12ed936f..15af45ee 100644 --- a/src/include/PRunBase.h +++ b/src/include/PRunBase.h @@ -44,42 +44,31 @@ using namespace std; //------------------------------------------------------------------------------------------ /** - * brauche ich eine base class um zwischen den verschiedenen run-modi unterscheiden zu können? - * Ich meine: - * - single histogram - * - asymmetry - * - RRF - * - non muSR - * - * --> JA - * - * PTheory and PFunctions werden direkt für jeden run generiert, da man dann maps und functions - * direkt für den spezifischen run umsetzen kann (da man eliminiert alle maps und functions). Dies - * garantiert effiziente theory-Aufrufe da diese in chisq/maxlikelyhood x-fach aufgerufen werden. + *

*/ class PRunBase { public: PRunBase(); - PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag); + PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); virtual ~PRunBase(); - virtual double CalcChiSquare(const vector& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! - virtual double CalcMaxLikelihood(const vector& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! + virtual Double_t CalcChiSquare(const vector& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! + virtual Double_t CalcMaxLikelihood(const vector& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! virtual void CalcTheory() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! - virtual unsigned int GetRunNo() { return fRunNo; } + virtual UInt_t GetRunNo() { return fRunNo; } virtual PRunData* GetData() { return &fData; } virtual void CleanUp(); - virtual bool IsValid() { return fValid; } + virtual Bool_t IsValid() { return fValid; } protected: - bool fValid; + Bool_t fValid; EPMusrHandleTag fHandleTag; ///< tag telling whether this is used for fit, view, ... - int fRunNo; ///< number of the run within the msr file + Int_t fRunNo; ///< number of the run within the msr file PMsrHandler *fMsrInfo; ///< msr-file handler PMsrRunStructure *fRunInfo; ///< run info used to filter out needed infos for the run PRunDataHandler *fRawData; ///< holds the raw run data @@ -87,10 +76,10 @@ class PRunBase PIntVector fParamNo; ///< vector of parameter numbers for the specifc run PRunData fData; ///< data to be fitted, viewed, i.e. binned data - double fTimeResolution; ///< time resolution in (us) + Double_t fTimeResolution; ///< time resolution in (us) PIntVector fT0s; ///< all t0's of a run! The derived classes will handle it - virtual bool PrepareData() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! + virtual Bool_t PrepareData() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! PDoubleVector fFuncValues; ///< is keeping the values of the functions from the FUNCTIONS block PTheory *fTheory; ///< theory needed to calculate chi-square diff --git a/src/include/PRunListCollection.h b/src/include/PRunListCollection.h index 6b2d65b8..c4032921 100644 --- a/src/include/PRunListCollection.h +++ b/src/include/PRunListCollection.h @@ -51,36 +51,36 @@ class PRunListCollection enum EDataSwitch { kIndex, kRunNo }; - virtual bool Add(int runNo, EPMusrHandleTag tag); + virtual Bool_t Add(Int_t runNo, EPMusrHandleTag tag); - virtual double GetSingleHistoChisq(const std::vector& par) const; - virtual double GetAsymmetryChisq(const std::vector& par) const; - virtual double GetRRFChisq(const std::vector& par) const; - virtual double GetNonMusrChisq(const std::vector& par) const; + virtual Double_t GetSingleHistoChisq(const std::vector& par) const; + virtual Double_t GetAsymmetryChisq(const std::vector& par) const; + virtual Double_t GetRRFChisq(const std::vector& par) const; + virtual Double_t GetNonMusrChisq(const std::vector& par) const; - virtual double GetSingleHistoMaximumLikelihood(const std::vector& par) const; - virtual double GetAsymmetryMaximumLikelihood(const std::vector& par) const; - virtual double GetRRFMaximumLikelihood(const std::vector& par) const; - virtual double GetNonMusrMaximumLikelihood(const std::vector& par) const; + virtual Double_t GetSingleHistoMaximumLikelihood(const std::vector& par) const; + virtual Double_t GetAsymmetryMaximumLikelihood(const std::vector& par) const; + virtual Double_t GetRRFMaximumLikelihood(const std::vector& par) const; + virtual Double_t GetNonMusrMaximumLikelihood(const std::vector& par) const; - virtual unsigned int GetTotalNoOfBinsFitted() const; + virtual UInt_t GetTotalNoOfBinsFitted() const; - virtual unsigned int GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); } - virtual unsigned int GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); } - virtual unsigned int GetNoOfRRF() const { return fRunRRFList.size(); } - virtual unsigned int GetNoOfNonMusr() const { return fRunNonMusrList.size(); } + virtual UInt_t GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); } + virtual UInt_t GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); } + virtual UInt_t GetNoOfRRF() const { return fRunRRFList.size(); } + virtual UInt_t GetNoOfNonMusr() const { return fRunNonMusrList.size(); } - virtual PRunData* GetSingleHisto(unsigned int index, EDataSwitch tag=kIndex); - virtual PRunData* GetAsymmetry(unsigned int index, EDataSwitch tag=kIndex); - virtual PRunData* GetRRF(unsigned int index, EDataSwitch tag=kIndex); - virtual PRunData* GetNonMusr(unsigned int index, EDataSwitch tag=kIndex); + virtual PRunData* GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex); + virtual PRunData* GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex); + virtual PRunData* GetRRF(UInt_t index, EDataSwitch tag=kIndex); + virtual PRunData* GetNonMusr(UInt_t index, EDataSwitch tag=kIndex); - virtual vector< pair > GetTemp(const TString &runName) const; - virtual double GetField(const TString &runName) const; - virtual double GetEnergy(const TString &runName) const; - virtual const char* GetSetup(const TString &runName) const; - virtual const char* GetXAxisTitle(const TString &runName, const unsigned int idx) const; - virtual const char* GetYAxisTitle(const TString &runName, const unsigned int idx) const; + virtual vector< pair > GetTemp(const TString &runName) const; + virtual Double_t GetField(const TString &runName) const; + virtual Double_t GetEnergy(const TString &runName) const; + virtual const Char_t* GetSetup(const TString &runName) const; + virtual const Char_t* GetXAxisTitle(const TString &runName, const UInt_t idx) const; + virtual const Char_t* GetYAxisTitle(const TString &runName, const UInt_t idx) const; private: PMsrHandler *fMsrInfo; ///< keeps all msr file info diff --git a/src/include/PRunNonMusr.h b/src/include/PRunNonMusr.h index 5f078a5a..35f5125b 100644 --- a/src/include/PRunNonMusr.h +++ b/src/include/PRunNonMusr.h @@ -39,29 +39,29 @@ class PRunNonMusr : public PRunBase { public: PRunNonMusr(); - PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag); + PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); virtual ~PRunNonMusr(); - virtual double CalcChiSquare(const std::vector& par); - virtual double CalcMaxLikelihood(const std::vector& par); + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); virtual void CalcTheory(); - virtual unsigned int GetNoOfFitBins() { return fNoOfFitBins; } + virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } - virtual unsigned int GetXIndex(); - virtual unsigned int GetYIndex(); + virtual UInt_t GetXIndex(); + virtual UInt_t GetYIndex(); protected: - virtual bool PrepareData(); - virtual bool PrepareFitData(); - virtual bool PrepareViewData(); + virtual Bool_t PrepareData(); + virtual Bool_t PrepareFitData(); + virtual Bool_t PrepareViewData(); private: PRawRunData *fRawRunData; - double fFitStartTime; - double fFitStopTime; - unsigned int fNoOfFitBins; + Double_t fFitStartTime; + Double_t fFitStopTime; + UInt_t fNoOfFitBins; }; #endif // _PRUNNONMUSR_H_ diff --git a/src/include/PRunRRF.h b/src/include/PRunRRF.h index 4f320c98..082bde4c 100644 --- a/src/include/PRunRRF.h +++ b/src/include/PRunRRF.h @@ -38,22 +38,22 @@ class PRunRRF : public PRunBase { public: PRunRRF(); - PRunRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag); + PRunRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); virtual ~PRunRRF(); - virtual double CalcChiSquare(const std::vector& par); - virtual double CalcMaxLikelihood(const std::vector& par); + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); virtual void CalcTheory(); - virtual unsigned int GetNoOfFitBins() { return fNoOfFitBins; } + virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } protected: - virtual bool PrepareData(); + virtual Bool_t PrepareData(); private: - double fFitStartTime; - double fFitStopTime; - unsigned int fNoOfFitBins; + Double_t fFitStartTime; + Double_t fFitStopTime; + UInt_t fNoOfFitBins; }; #endif // _PRUNRRF_H_ diff --git a/src/include/PRunSingleHisto.h b/src/include/PRunSingleHisto.h index bebe35d5..f73d65b8 100644 --- a/src/include/PRunSingleHisto.h +++ b/src/include/PRunSingleHisto.h @@ -38,28 +38,28 @@ class PRunSingleHisto : public PRunBase { public: PRunSingleHisto(); - PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, unsigned int runNo, EPMusrHandleTag tag); + PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); virtual ~PRunSingleHisto(); - virtual double CalcChiSquare(const std::vector& par); - virtual double CalcMaxLikelihood(const std::vector& par); + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); virtual void CalcTheory(); - virtual unsigned int GetNoOfFitBins() { return fNoOfFitBins; } + virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } protected: - virtual bool PrepareData(); - virtual bool PrepareFitData(PRawRunData* runData, const unsigned int histoNo); - virtual bool PrepareRawViewData(PRawRunData* runData, const unsigned int histoNo); - virtual bool PrepareViewData(PRawRunData* runData, const unsigned int histoNo); + virtual Bool_t PrepareData(); + virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo); + virtual Bool_t PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo); + virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo); private: - double fFitStartTime; - double fFitStopTime; - unsigned int fNoOfFitBins; - double fBackground; ///< needed if background range is given. In units per bin + Double_t fFitStartTime; + Double_t fFitStopTime; + UInt_t fNoOfFitBins; + Double_t fBackground; ///< needed if background range is given. In units per bin - bool EstimateBkg(unsigned int histoNo); + Bool_t EstimateBkg(UInt_t histoNo); }; #endif // _PRUNSINGLEHISTO_H_ diff --git a/src/include/PStartupHandler.h b/src/include/PStartupHandler.h index e8c9a1c4..438bb203 100644 --- a/src/include/PStartupHandler.h +++ b/src/include/PStartupHandler.h @@ -47,16 +47,16 @@ class PStartupHandler : public TObject, public TQObject virtual void OnStartDocument(); // SLOT virtual void OnEndDocument(); // SLOT - virtual void OnStartElement(const char*, const TList*); // SLOT - virtual void OnEndElement(const char*); // SLOT - virtual void OnCharacters(const char*); // SLOT - virtual void OnComment(const char*); // SLOT - virtual void OnWarning(const char*); // SLOT - virtual void OnError(const char*); // SLOT - virtual void OnFatalError(const char*); // SLOT - virtual void OnCdataBlock(const char*, Int_t); // SLOT + virtual void OnStartElement(const Char_t*, const TList*); // SLOT + virtual void OnEndElement(const Char_t*); // SLOT + virtual void OnCharacters(const Char_t*); // SLOT + virtual void OnComment(const Char_t*); // SLOT + virtual void OnWarning(const Char_t*); // SLOT + virtual void OnError(const Char_t*); // SLOT + virtual void OnFatalError(const Char_t*); // SLOT + virtual void OnCdataBlock(const Char_t*, Int_t); // SLOT - virtual bool StartupFileFound() { return fStartupFileFound; } + virtual Bool_t StartupFileFound() { return fStartupFileFound; } virtual TString GetStartupFilePath() { return fStartupFilePath; } virtual void CheckLists(); @@ -73,14 +73,14 @@ class PStartupHandler : public TObject, public TQObject eColorList, eColor}; EKeyWords fKey; - bool fStartupFileFound; + Bool_t fStartupFileFound; TString fStartupFilePath; PMsrFourierStructure fFourierDefaults; PStringVector fDataPathList; PIntVector fMarkerList; PIntVector fColorList; - bool StartupFileExists(char *fln); + Bool_t StartupFileExists(Char_t *fln); ClassDef(PStartupHandler, 1) }; diff --git a/src/include/PTheory.h b/src/include/PTheory.h index 7afc1893..802aac33 100644 --- a/src/include/PTheory.h +++ b/src/include/PTheory.h @@ -107,12 +107,12 @@ class PTheory; *

Structure holding the infos of a the available internally defined functions. */ typedef struct theo_data_base { - unsigned int fType; ///< function tag - unsigned int fNoOfParam; ///< number of parameters for this function - bool fTable; ///< table flag, indicating if the function is generate from a table - TString fName; ///< name of the function as written into the msr-file - TString fAbbrev; ///< abbreviation of the function name - TString fComment; ///< comment added in the msr-file theory block to help the used + UInt_t fType; ///< function tag + UInt_t fNoOfParam; ///< number of parameters for this function + Bool_t fTable; ///< table flag, indicating if the function is generate from a table + TString fName; ///< name of the function as written into the msr-file + TString fAbbrev; ///< abbreviation of the function name + TString fComment; ///< comment added in the msr-file theory block to help the used TString fCommentTimeShift; ///< comment added in the msr-file theory block if there is a time shift } PTheoDataBase; @@ -192,52 +192,52 @@ static PTheoDataBase fgTheoDataBase[THEORY_MAX] = { class PTheory { public: - PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent = false); + PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent = false); virtual ~PTheory(); - virtual bool IsValid(); - virtual double Func(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Bool_t IsValid(); + virtual Double_t Func(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; private: virtual void CleanUp(PTheory *theo); - virtual int SearchDataBase(TString name); + virtual Int_t SearchDataBase(TString name); virtual void MakeCleanAndTidyTheoryBlock(PMsrLines* fullTheoryBlock); - virtual void MakeCleanAndTidyPolynom(unsigned int i, PMsrLines* fullTheoryBlock); - virtual void MakeCleanAndTidyUserFcn(unsigned int i, PMsrLines* fullTheoryBlock); + virtual void MakeCleanAndTidyPolynom(UInt_t i, PMsrLines* fullTheoryBlock); + virtual void MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines* fullTheoryBlock); - virtual double Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double SimpleExp(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double GeneralExp(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double SimpleGauss(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double StaticGaussKT(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double StaticGaussKTLF(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double DynamicGaussKTLF(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double StaticLorentzKT(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double StaticLorentzKTLF(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double DynamicLorentzKTLF(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double CombiLGKT(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double SpinGlass(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double RandomAnisotropicHyperfine(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double Abragam(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double InternalField(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double TFCos(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double Bessel(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double InternalBessel(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double SkewedGauss(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double Polynom(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual double UserFcn(register double t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t SimpleExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t GeneralExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t SimpleGauss(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t StaticGaussKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t StaticGaussKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t DynamicGaussKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t StaticLorentzKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t StaticLorentzKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t DynamicLorentzKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t CombiLGKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t SpinGlass(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t RandomAnisotropicHyperfine(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t Abragam(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t InternalField(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t TFCos(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t Bessel(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t InternalBessel(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t SkewedGauss(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t Polynom(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; + virtual Double_t UserFcn(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const; - virtual void CalculateGaussLFIntegral(const double *val) const; - virtual void CalculateLorentzLFIntegral(const double *val) const; - virtual double GetLFIntegralValue(const double t) const; - virtual void CalculateDynKTLF(const double *val, int tag) const; - virtual double GetDynKTLFValue(const double t) const; + virtual void CalculateGaussLFIntegral(const Double_t *val) const; + virtual void CalculateLorentzLFIntegral(const Double_t *val) const; + virtual Double_t GetLFIntegralValue(const Double_t t) const; + virtual void CalculateDynKTLF(const Double_t *val, Int_t tag) const; + virtual Double_t GetDynKTLFValue(const Double_t t) const; // variables - bool fValid; - unsigned int fType; - vector fParamNo; ///< holds the parameter numbers for the theory (including maps and functions, see constructor desciption) - unsigned int fNoOfParam; + Bool_t fValid; + UInt_t fType; + vector fParamNo; ///< holds the parameter numbers for the theory (including maps and functions, see constructor desciption) + UInt_t fNoOfParam; PTheory *fAdd, *fMul; TString fUserFcnClassName; ///< name of the user function class for within root @@ -247,10 +247,10 @@ class PTheory PMsrHandler *fMsrInfo; - mutable double fPrevParam[THEORY_MAX_PARAM]; ///< needed for LF-stuff - mutable PDoubleVector fLFIntegral; ///< needed for LF-stuff. Keeps the non-analytic integral values - mutable double fDynLFdt; - mutable PDoubleVector fDynLFFuncValue; ///< needed for LF-stuff. Keeps the dynamic LF KT function values + mutable Double_t fPrevParam[THEORY_MAX_PARAM]; ///< needed for LF-stuff + mutable PDoubleVector fLFIntegral; ///< needed for LF-stuff. Keeps the non-analytic integral values + mutable Double_t fDynLFdt; + mutable PDoubleVector fDynLFFuncValue; ///< needed for LF-stuff. Keeps the dynamic LF KT function values }; #endif // _PTHEORY_H_