Skip to content

Commit 4267b0f

Browse files
committed
fix for ML, part 4
1 parent 72a6a13 commit 4267b0f

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ void initializeFixedLengthBins(EnAsFunctionOf afo)
19781978
} // switch(afo)
19791979

19801980
// From this point onward, the code is the same for any afo variable:
1981-
unsigned long int lFixedLengthBinsExpected = 3; // In this array, I expect three entries: nBins, min, max
1981+
uint8_t lFixedLengthBinsExpected = 3; // In this array, I expect three entries: nBins, min, max + TBI 20260714 I use uint8_t as a type to silent MegaLinter
19821982
if (lFixedLengthBins.size() != lFixedLengthBinsExpected) {
19831983
LOGF(fatal, "in function \033[1;31m%s at line %d => The array cfFixedLength_bins must have have 3 entries: {nBins, min, max} \n \033[0m", __FUNCTION__, __LINE__);
19841984
}
@@ -2046,7 +2046,7 @@ void initializeVariableLengthBins(EnAsFunctionOf afo)
20462046
} // switch(afo)
20472047

20482048
// From this point onward, the code is the same for any afo variable:
2049-
unsigned long int lVariableLengthBinsMinExpected = 2; // In this array, I should have at least 2 entries, otherwise, it's pointless...
2049+
uint8_t lVariableLengthBinsMinExpected = 2; // In this array, I should have at least 2 entries, otherwise, it's pointless... + TBI 20260714 I use uint8_t as a type to silent MegaLinter
20502050
if (lVariableLengthBins.size() < lVariableLengthBinsMinExpected) {
20512051
LOGF(fatal, "in function \033[1;31m%s at line %d => The array cfVariableLength_bins must have at least 2 entries \n \033[0m", __FUNCTION__, __LINE__);
20522052
}
@@ -5902,7 +5902,7 @@ void bookQvectorHistograms()
59025902
qv.fqabVector[i][j].resize(qv.fNumberOfKineBins[j]); // yes, qv.fNumberOfKineBins[j] => for each qvectorkine I calculate and dynamically allocate only necessary bins
59035903
qv.fmab[i][j].resize(qv.fNumberOfKineBins[j]);
59045904
} else {
5905-
// calculus for this kine variable is not needed, I am ironing out this esDimension
5905+
// calculus for this kine variable is not needed, I am ironing out this dimension
59065906
qv.fqabVector[i][j].resize(0);
59075907
qv.fmab[i][j].resize(0);
59085908
}
@@ -14502,7 +14502,7 @@ void insanitizeDiffWeightsSparse(THnSparseF* const sparse)
1450214502
LOGF(fatal, "\033[1;31m%s at line %d : axis %d (Charge) of sparse %s has upper boundary %f, while upper cut on that variable is %f. This means that for some particles I won't be able to fetch weights from this sparse. \033[0m", __FUNCTION__, __LINE__, d, sparse->GetName(), sparse->GetAxis(d)->GetBinUpEdge(sparse->GetAxis(d)->GetNbins()), pc.fdParticleCuts[eCharge][eMax]);
1450314503
}
1450414504

14505-
} else if (!axisTitle.find("Centrality")) { // I have to use here find() instead, because title also contains centrality estimator name, e.g. "Centality (FT0C)"
14505+
} else if (!(axisTitle.starts_with("Centrality") || axisTitle.find("Centrality"))) { // I have to use here find() instead, because title also contains centrality estimator name, e.g. "Centality (FT0C)". I added starts_with() per MegaLinter suggestion
1450614506

1450714507
// check lower boundary:
1450814508
if ((ec.fdEventCuts[eCentrality][eMin] < sparse->GetAxis(d)->GetBinLowEdge(1)) && (std::abs(sparse->GetAxis(d)->GetBinLowEdge(1) - ec.fdEventCuts[eCentrality][eMin]) > tc.fFloatingPointPrecision)) {
@@ -16406,7 +16406,8 @@ void getParticleWeights()
1640616406
if (pw.fUseWeights[wPHI]) {
1640716407
TH1D* phiWeights = getHistogramWithWeights(pw.fFileWithWeights.Data(), tc.fRunNumber.Data(), "phi");
1640816408
if (!phiWeights) {
16409-
LOGF(fatal, "in function \033[1;31m%s at line %d, phiWeights is NULL. Check the external file %s with particle weights\033[0m", __FUNCTION__, __LINE__, pw.fFileWithWeights.Data()); // oll
16409+
LOGF(fatal, "in function \033[1;31m%s at line %d, phiWeights is NULL. Check the external file %s with particle weights\033[0m", __FUNCTION__, __LINE__, pw.fFileWithWeights.Data());
16410+
exit(__LINE__); // TBI 20260714 temporarily here to silent MegaLinter
1641016411
}
1641116412
setWeightsHist(phiWeights, wPHI);
1641216413
}
@@ -16451,7 +16452,8 @@ void getParticleWeights()
1645116452
// *) okay, this pt bin is within pt phase-space window, defined by pt cut:
1645216453
phiptWeights = getHistogramWithWeights(pw.fFileWithWeights.Data(), tc.fRunNumber.Data(), "phipt", b);
1645316454
if (!phiptWeights) {
16454-
LOGF(fatal, "\033[1;31m%s at line %d : phiptWeights is NULL. Check the external file %s with particle weights\033[0m", __FUNCTION__, __LINE__, pw.fFileWithWeights.Data()); // oll
16455+
LOGF(fatal, "\033[1;31m%s at line %d : phiptWeights is NULL. Check the external file %s with particle weights\033[0m", __FUNCTION__, __LINE__, pw.fFileWithWeights.Data());
16456+
exit(__LINE__); // TBI 20260714 temporarily here to silent MegaLinter
1645516457
}
1645616458

1645716459
// *) okay, just use this histogram with weights:
@@ -16663,7 +16665,8 @@ void getCentralityWeights()
1666316665
if (cw.fUseCentralityWeights) {
1666416666
TH1D* centralityWeights = getHistogramWithCentralityWeights(cw.fFileWithCentralityWeights.Data(), tc.fRunNumber.Data());
1666516667
if (!centralityWeights) {
16666-
LOGF(fatal, "in function \033[1;31m%s at line %d : centralityWeights is NULL. Check the external file %s with centrality weights\033[0m", __FUNCTION__, __LINE__, cw.fFileWithCentralityWeights.Data()); // oll
16668+
LOGF(fatal, "in function \033[1;31m%s at line %d : centralityWeights is NULL. Check the external file %s with centrality weights\033[0m", __FUNCTION__, __LINE__, cw.fFileWithCentralityWeights.Data());
16669+
exit(__LINE__); // TBI 20260714 temporarily here to silent MegaLinter
1666716670
}
1666816671
setCentralityWeightsHist(centralityWeights);
1666916672
}

0 commit comments

Comments
 (0)