Skip to content

Commit d1f5a37

Browse files
committed
make megalinter happy
1 parent c59dc0f commit d1f5a37

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

Common/Tools/Multiplicity/multGlauberNBDFitter.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ multGlauberNBDFitter::multGlauberNBDFitter(const char* name, const char* title)
8181
// Named constructor
8282
fNpart = new double[fMaxNpNcPairs];
8383
fNcoll = new double[fMaxNpNcPairs];
84-
fContent = new long[fMaxNpNcPairs];
84+
fContent = new int64_t[fMaxNpNcPairs];
8585

8686
// NBD
8787
fNBD->SetNpx(45000);
@@ -180,7 +180,7 @@ double multGlauberNBDFitter::GlauberProbDistrib(const double* x, const double* p
180180
//______________________________________________________
181181
// Actually evaluate function
182182
int lStartBin = fhNanc->FindBin(0.0) + 1;
183-
for (long iNanc = lStartBin; iNanc < fhNanc->GetNbinsX() + 1; ++iNanc) {
183+
for (int64_t iNanc = lStartBin; iNanc < fhNanc->GetNbinsX() + 1; ++iNanc) {
184184
double lNancestors = fhNanc->GetBinCenter(iNanc);
185185
double lNancestorCount = fhNanc->GetBinContent(iNanc);
186186

@@ -209,7 +209,7 @@ double multGlauberNBDFitter::TrentoProbDistrib(const double* x, const double* pa
209209
double lProbability = 0.0;
210210
//______________________________________________________
211211
// Actually ealuate function
212-
for (long iNSrc = 1; iNSrc < fhNSources->GetNbinsX() + 1; ++iNSrc) {
212+
for (int64_t iNSrc = 1; iNSrc < fhNSources->GetNbinsX() + 1; ++iNSrc) {
213213
double lNsources = fhNSources->GetBinCenter(iNSrc);
214214
double lThisMu = lNsources * par[Index(FitPar::mu)];
215215
double lThisk = lNsources * par[Index(FitPar::k)];
@@ -294,7 +294,7 @@ void multGlauberNBDFitter::SetFitOptions(const TString& lOpt)
294294
}
295295

296296
//________________________________________________________________
297-
void multGlauberNBDFitter::SetFitNpx(const long lNpx)
297+
void multGlauberNBDFitter::SetFitNpx(const int64_t lNpx)
298298
{
299299
fFitNpx = lNpx;
300300
}
@@ -400,7 +400,7 @@ bool multGlauberNBDFitter::InitializeNpNc()
400400
if (fhNpNc->GetBinContent(fhNpNc->FindBin(xbin, ybin)) != 0) {
401401
fNpart[fNNpNcPairs] = xbin;
402402
fNcoll[fNNpNcPairs] = ybin;
403-
fContent[fNNpNcPairs] = static_cast<long>(fhNpNc->GetBinContent(fhNpNc->FindBin(xbin, ybin)));
403+
fContent[fNNpNcPairs] = static_cast<int64_t>(fhNpNc->GetBinContent(fhNpNc->FindBin(xbin, ybin)));
404404
fNNpNcPairs++;
405405
}
406406
}
@@ -431,12 +431,12 @@ double multGlauberNBDFitter::ContinuousNBD(const double n, const double mu, cons
431431
if (n + k > NumStabilityThreshold) {
432432
// log method for handling large numbers
433433
F = std::lgamma(n + k) - std::lgamma(n + 1.) - std::lgamma(k);
434-
f = n * std::log(mu / k) - (n + k) * std::log(1.0 + mu / k);
434+
f = n * std::log(mu / k) - (n + k) * std::log1p(mu / k);
435435
F = F + f;
436436
F = std::exp(F);
437437
} else {
438438
F = std::tgamma(n + k) / (std::tgamma(n + 1.) * std::tgamma(k));
439-
f = n * std::log(mu / k) - (n + k) * std::log(1.0 + mu / k);
439+
f = n * std::log(mu / k) - (n + k) * std::log1p(mu / k);
440440
f = std::exp(f);
441441
F *= f;
442442
}
@@ -529,7 +529,7 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
529529
}
530530
}
531531

532-
for (long lMultValue = 1; lMultValue < lHiRange; lMultValue++) {
532+
for (int64_t lMultValue = 1; lMultValue < lHiRange; lMultValue++) {
533533
double lNancestorCount = fContent[ibin];
534534
double lThisMu = lNancestors * fMu;
535535
double lThisk = lNancestors * fk;

Common/Tools/Multiplicity/multGlauberNBDFitter.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class multGlauberNBDFitter : public TNamed
122122

123123
void SetFitRange(const double lMin, const double lMax);
124124
void SetFitOptions(const TString& lOpt);
125-
void SetFitNpx(const long lNpx);
125+
void SetFitNpx(const int64_t lNpx);
126126

127127
// For ancestor mode 2
128128
double ContinuousNBD(const double n, const double mu, const double k);
@@ -158,9 +158,9 @@ class multGlauberNBDFitter : public TNamed
158158
// Buffer for (Npart, Ncoll) pairs in memory
159159
double* fNpart;
160160
double* fNcoll;
161-
long* fContent;
162-
long fNNpNcPairs; // number of pairs to use
163-
long fMaxNpNcPairs;
161+
int64_t* fContent;
162+
int64_t fNNpNcPairs; // number of pairs to use
163+
int64_t fMaxNpNcPairs;
164164

165165
// The actual output: mu, k, f, norm
166166
double fMu;
@@ -170,7 +170,7 @@ class multGlauberNBDFitter : public TNamed
170170
double fnorm;
171171

172172
TString fFitOptions;
173-
long fFitNpx;
173+
int64_t fFitNpx;
174174

175175
ClassDefOverride(multGlauberNBDFitter, 1);
176176
};

0 commit comments

Comments
 (0)