cleaned up signed/unsigned int issues.
This commit is contained in:
parent
342da696db
commit
4a881fad56
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -574,7 +574,7 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(forwardHistoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(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; j<addRunData->GetDataBin(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]);
|
||||
}
|
||||
}
|
||||
|
@ -566,7 +566,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(forwardHistoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(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; j<addRunData->GetDataBin(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; i<forwardHistoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(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] << ").";
|
||||
|
@ -75,7 +75,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo,
|
||||
fValid = true;
|
||||
|
||||
fRunNo = static_cast<Int_t>(runNo);
|
||||
if ((runNo < 0) || (runNo > fMsrInfo->GetMsrRunList()->size())) {
|
||||
if (runNo > fMsrInfo->GetMsrRunList()->size()) {
|
||||
fRunInfo = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -520,7 +520,7 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(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; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(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]];
|
||||
}
|
||||
}
|
||||
|
@ -764,7 +764,7 @@ Bool_t PRunSingleHisto::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(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; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(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;
|
||||
|
@ -493,7 +493,7 @@ Bool_t PRunSingleHistoRRF::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(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; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(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;
|
||||
|
2
src/external/MagProximity/PMPRgeHandler.cpp
vendored
2
src/external/MagProximity/PMPRgeHandler.cpp
vendored
@ -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] +
|
||||
|
@ -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] +
|
||||
|
Loading…
x
Reference in New Issue
Block a user