diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 70106d68..a1b20238 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -2607,7 +2607,7 @@ void PMsrHandler::SetMsrBkgRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) Int_t PMsrHandler::ParameterInUse(UInt_t paramNo) { // check that paramNo is within acceptable range - if ((paramNo < 0) || (paramNo >= fParam.size())) + if (paramNo >= fParam.size()) return -1; return fParamInUse[paramNo]; @@ -6164,10 +6164,10 @@ UInt_t PMsrHandler::LastSignificant(Double_t dval, UInt_t precLimit) } // find last significant digit - for (UInt_t i=strlen(str)-1; i>=0; i--) { + for (Int_t i=strlen(str)-1; i>=0; i--) { if (str[i] != '0') { - if ((i-decimalPoint) < precLimit) - lastSignificant = i-decimalPoint; + if (((UInt_t)i-decimalPoint) < precLimit) + lastSignificant = (UInt_t)i-decimalPoint; else lastSignificant = precLimit; break; diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 74b93014..dfd35246 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -6456,10 +6456,10 @@ UInt_t PMusrCanvas::GetNeededAccuracy(PMsrParamStructure param) } // find last significant digit - for (UInt_t i=strlen(str)-1; i>=0; i--) { + for (Int_t i=strlen(str)-1; i>=0; i--) { if (str[i] != '0') { - if ((i-decimalPoint) < precLimit) - accuracy = i-decimalPoint; + if (((UInt_t)i-decimalPoint) < precLimit) + accuracy = (UInt_t)i-decimalPoint; else accuracy = precLimit; break; diff --git a/src/classes/PRunAsymmetry.cpp b/src/classes/PRunAsymmetry.cpp index 6d253a3d..bed87c8c 100644 --- a/src/classes/PRunAsymmetry.cpp +++ b/src/classes/PRunAsymmetry.cpp @@ -574,7 +574,7 @@ Bool_t PRunAsymmetry::PrepareData() addRunSize = addRunData->GetDataBin(forwardHistoNo[k])->size(); for (UInt_t j=0; jGetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) { forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]); } } @@ -585,7 +585,7 @@ Bool_t PRunAsymmetry::PrepareData() addRunSize = addRunData->GetDataBin(backwardHistoNo[k])->size(); for (UInt_t j=0; jGetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) { backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]); } } diff --git a/src/classes/PRunAsymmetryRRF.cpp b/src/classes/PRunAsymmetryRRF.cpp index 7dbc4d34..7da88be1 100644 --- a/src/classes/PRunAsymmetryRRF.cpp +++ b/src/classes/PRunAsymmetryRRF.cpp @@ -566,7 +566,7 @@ Bool_t PRunAsymmetryRRF::PrepareData() addRunSize = addRunData->GetDataBin(forwardHistoNo[k])->size(); for (UInt_t j=0; jGetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) { forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]); } } @@ -577,7 +577,7 @@ Bool_t PRunAsymmetryRRF::PrepareData() addRunSize = addRunData->GetDataBin(backwardHistoNo[k])->size(); for (UInt_t j=0; jGetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) { backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]); } } @@ -597,7 +597,7 @@ Bool_t PRunAsymmetryRRF::PrepareData() for (UInt_t i=1; iGetDataBin(forwardHistoNo[i])->size(); j++) { // loop over the bin indices // make sure that the index stays within proper range - if ((j+fT0s[2*i]-fT0s[0] >= 0) && (j+fT0s[2*i]-fT0s[0] < runData->GetDataBin(forwardHistoNo[i])->size())) { + if (((Int_t)j+fT0s[2*i]-fT0s[0] >= 0) && (j+fT0s[2*i]-fT0s[0] < runData->GetDataBin(forwardHistoNo[i])->size())) { fForward[j] += forward[i][j+(Int_t)fT0s[2*i]-(Int_t)fT0s[0]]; } } @@ -771,8 +771,7 @@ Bool_t PRunAsymmetryRRF::SubtractEstimatedBkg() } // check if start is within histogram bounds - if ((start[0] < 0) || (start[0] >= fForward.size()) || - (start[1] < 0) || (start[1] >= fBackward.size())) { + if ((start[0] >= fForward.size()) || (start[1] >= fBackward.size())) { cerr << endl << ">> PRunAsymmetryRRF::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] << ")."; @@ -780,8 +779,7 @@ Bool_t PRunAsymmetryRRF::SubtractEstimatedBkg() } // check if end is within histogram bounds - if ((end[0] < 0) || (end[0] >= fForward.size()) || - (end[1] < 0) || (end[1] >= fBackward.size())) { + if ((end[0] >= fForward.size()) || (end[1] >= fBackward.size())) { cerr << endl << ">> PRunAsymmetryRRF::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] << ")."; diff --git a/src/classes/PRunBase.cpp b/src/classes/PRunBase.cpp index 654ca198..2d2466c4 100644 --- a/src/classes/PRunBase.cpp +++ b/src/classes/PRunBase.cpp @@ -75,7 +75,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, fValid = true; fRunNo = static_cast(runNo); - if ((runNo < 0) || (runNo > fMsrInfo->GetMsrRunList()->size())) { + if (runNo > fMsrInfo->GetMsrRunList()->size()) { fRunInfo = 0; return; } diff --git a/src/classes/PRunListCollection.cpp b/src/classes/PRunListCollection.cpp index 3cc36d01..e11bb0c6 100644 --- a/src/classes/PRunListCollection.cpp +++ b/src/classes/PRunListCollection.cpp @@ -788,7 +788,7 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: - if ((index < 0) || (index >= fRunSingleHistoList.size())) { + if (index >= fRunSingleHistoList.size()) { cerr << endl << ">> PRunListCollection::GetSingleHisto(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; @@ -831,7 +831,7 @@ PRunData* PRunListCollection::GetSingleHistoRRF(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: - if ((index < 0) || (index >= fRunSingleHistoRRFList.size())) { + if (index >= fRunSingleHistoRRFList.size()) { cerr << endl << ">> PRunListCollection::GetSingleHistoRRF(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; @@ -874,7 +874,7 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: // called from musrfit when dumping the data - if ((index < 0) || (index > fRunAsymmetryList.size())) { + if (index > fRunAsymmetryList.size()) { cerr << endl << ">> PRunListCollection::GetAsymmetry(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; @@ -917,7 +917,7 @@ PRunData* PRunListCollection::GetAsymmetryRRF(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: // called from musrfit when dumping the data - if ((index < 0) || (index > fRunAsymmetryRRFList.size())) { + if (index > fRunAsymmetryRRFList.size()) { cerr << endl << ">> PRunListCollection::GetAsymmetryRRF(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; @@ -960,7 +960,7 @@ PRunData* PRunListCollection::GetMuMinus(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: - if ((index < 0) || (index > fRunMuMinusList.size())) { + if (index > fRunMuMinusList.size()) { cerr << endl << ">> PRunListCollection::GetMuMinus(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; @@ -1002,7 +1002,7 @@ PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: - if ((index < 0) || (index > fRunNonMusrList.size())) { + if (index > fRunNonMusrList.size()) { cerr << endl << ">> PRunListCollection::GetNonMusr(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; diff --git a/src/classes/PRunMuMinus.cpp b/src/classes/PRunMuMinus.cpp index 6ac952e3..2a1dcefa 100644 --- a/src/classes/PRunMuMinus.cpp +++ b/src/classes/PRunMuMinus.cpp @@ -520,7 +520,7 @@ Bool_t PRunMuMinus::PrepareData() addRunSize = addRunData->GetDataBin(histoNo[k])->size(); for (UInt_t j=0; jGetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]); } } @@ -538,7 +538,7 @@ Bool_t PRunMuMinus::PrepareData() for (UInt_t i=1; iGetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices // make sure that the index stays within proper range - if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { + if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]]; } } diff --git a/src/classes/PRunSingleHisto.cpp b/src/classes/PRunSingleHisto.cpp index e72edaab..a882c44b 100644 --- a/src/classes/PRunSingleHisto.cpp +++ b/src/classes/PRunSingleHisto.cpp @@ -764,7 +764,7 @@ Bool_t PRunSingleHisto::PrepareData() addRunSize = addRunData->GetDataBin(histoNo[k])->size(); for (UInt_t j=0; jGetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]); } } @@ -782,7 +782,7 @@ Bool_t PRunSingleHisto::PrepareData() for (UInt_t i=1; iGetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices // make sure that the index stays within proper range - if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { + if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]]; } } @@ -1766,7 +1766,7 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo) } // check if start is within histogram bounds - if ((start < 0) || (start >= fForward.size())) { + if (start >= fForward.size()) { cerr << endl << ">> PRunSingleHisto::EstimatBkg(): **ERROR** background bin values out of bound!"; cerr << endl << ">> histo lengths = " << fForward.size(); cerr << endl << ">> background start = " << start; @@ -1775,7 +1775,7 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo) } // check if end is within histogram bounds - if ((end < 0) || (end >= fForward.size())) { + if (end >= fForward.size()) { cerr << endl << ">> PRunSingleHisto::EstimatBkg(): **ERROR** background bin values out of bound!"; cerr << endl << ">> histo lengths = " << fForward.size(); cerr << endl << ">> background end = " << end; diff --git a/src/classes/PRunSingleHistoRRF.cpp b/src/classes/PRunSingleHistoRRF.cpp index aa1fb46f..62314a23 100644 --- a/src/classes/PRunSingleHistoRRF.cpp +++ b/src/classes/PRunSingleHistoRRF.cpp @@ -493,7 +493,7 @@ Bool_t PRunSingleHistoRRF::PrepareData() addRunSize = addRunData->GetDataBin(histoNo[k])->size(); for (UInt_t j=0; jGetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices // make sure that the index stays in the proper range - if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { + if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]); } } @@ -511,7 +511,7 @@ Bool_t PRunSingleHistoRRF::PrepareData() for (UInt_t i=1; iGetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices // make sure that the index stays within proper range - if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { + if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]]; } } @@ -1173,7 +1173,7 @@ Bool_t PRunSingleHistoRRF::EstimateBkg(UInt_t histoNo) } // check if start is within histogram bounds - if ((start < 0) || (start >= fForward.size())) { + if (start >= fForward.size()) { cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!"; cerr << endl << ">> histo lengths = " << fForward.size(); cerr << endl << ">> background start = " << start; @@ -1182,7 +1182,7 @@ Bool_t PRunSingleHistoRRF::EstimateBkg(UInt_t histoNo) } // check if end is within histogram bounds - if ((end < 0) || (end >= fForward.size())) { + if (end >= fForward.size()) { cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!"; cerr << endl << ">> histo lengths = " << fForward.size(); cerr << endl << ">> background end = " << end; diff --git a/src/external/MagProximity/PMPRgeHandler.cpp b/src/external/MagProximity/PMPRgeHandler.cpp index ee23cda9..760fac01 100644 --- a/src/external/MagProximity/PMPRgeHandler.cpp +++ b/src/external/MagProximity/PMPRgeHandler.cpp @@ -94,7 +94,7 @@ Double_t PMPRgeHandler::GetRgeValue(const Int_t index, const Double_t dist) UInt_t distIdx = (UInt_t)(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0])); - if ((distIdx >= fRgeDataList[index].stoppingDistance.size()) || (distIdx < 0)) { + if (distIdx >= fRgeDataList[index].stoppingDistance.size()) { rgeVal = 0.0; } else { rgeVal = fRgeDataList[index].stoppingAmplitude[distIdx] + diff --git a/src/external/libPhotoMeissner/classes/PStartupHandler_PM.cpp b/src/external/libPhotoMeissner/classes/PStartupHandler_PM.cpp index a0f4d491..b9f4780e 100644 --- a/src/external/libPhotoMeissner/classes/PStartupHandler_PM.cpp +++ b/src/external/libPhotoMeissner/classes/PStartupHandler_PM.cpp @@ -95,7 +95,7 @@ Double_t PRgeHandler_PM::GetRgeValue(const Int_t index, const Double_t dist) UInt_t distIdx = (UInt_t)(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0])); - if ((distIdx >= fRgeDataList[index].stoppingDistance.size()) || (distIdx < 0)) { + if (distIdx >= fRgeDataList[index].stoppingDistance.size()) { rgeVal = 0.0; } else { rgeVal = fRgeDataList[index].stoppingAmplitude[distIdx] +