Skip to content

Commit 176986f

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 49c0780 + f8da77f commit 176986f

File tree

454 files changed

+45993
-23328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+45993
-23328
lines changed

.clang-tidy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
CheckOptions:
2-
- { key: CheckPathRegex, value: ".*/O2/.*" }
32
# Naming conventions
43
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
54
- { key: readability-identifier-naming.ClassMemberPrefix, value: m }
65
- { key: readability-identifier-naming.ConceptCase, value: CamelCase }
76
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
8-
- { key: readability-identifier-naming.ConstexprVariableIgnoredRegexp, value: "^k[A-Z].*$" } # Allow "k" prefix.
7+
- { key: readability-identifier-naming.ConstexprVariableIgnoredRegexp, value: "^k[A-Z][a-zA-Z0-9]*$" } # Allow "k" prefix.
98
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
109
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
11-
- { key: readability-identifier-naming.EnumConstantIgnoredRegexp, value: "^k[A-Z].*$" } # Allow "k" prefix.
10+
- { key: readability-identifier-naming.EnumConstantIgnoredRegexp, value: "^k?[A-Z][a-zA-Z0-9_]*$" } # Allow "k" prefix and underscores.
1211
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
1312
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
14-
- { key: readability-identifier-naming.MacroDefinitionIgnoredRegexp, value: "^[A-Z]+(_[A-Z]+)*_$" } # Allow the trailing underscore in header guards.
13+
- { key: readability-identifier-naming.MacroDefinitionIgnoredRegexp, value: "^[A-Z][A-Z0-9_]*_$" } # Allow the trailing underscore in header guards.
1514
- { key: readability-identifier-naming.MemberCase, value: camelBack }
1615
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
1716
- { key: readability-identifier-naming.ParameterCase, value: camelBack }

.mega-linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ PYTHON_PYRIGHT_CONFIG_FILE: pyproject.toml
3939
PYTHON_RUFF_CONFIG_FILE: pyproject.toml
4040
CPP_CPPLINT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
4141
CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
42+
CPP_CPPCHECK_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
4243
CPP_CPPCHECK_ARGUMENTS: --language=c++ --std=c++20 --check-level=exhaustive --suppressions-list=cppcheck_config
4344
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
153153

154154
/*****************************************************************/
155155

156-
lutEntry_t*
157-
TrackSmearer::getLUTEntry(int pdg, float nch, float radius, float eta, float pt, float& interpolatedEff)
156+
lutEntry_t* TrackSmearer::getLUTEntry(const int pdg, const float nch, const float radius, const float eta, const float pt, float& interpolatedEff)
158157
{
159-
auto ipdg = getIndexPDG(pdg);
160-
if (!mLUTHeader[ipdg])
158+
const int ipdg = getIndexPDG(pdg);
159+
if (!mLUTHeader[ipdg]) {
160+
LOG(error) << " --- getLUTEntry: LUT header not loaded for pdg=" << pdg << ". Returning nullptr.";
161161
return nullptr;
162+
}
162163
auto inch = mLUTHeader[ipdg]->nchmap.find(nch);
163164
auto irad = mLUTHeader[ipdg]->radmap.find(radius);
164165
auto ieta = mLUTHeader[ipdg]->etamap.find(eta);
@@ -290,56 +291,56 @@ bool TrackSmearer::smearTrack(O2Track& o2track, int pdg, float nch)
290291
}
291292
auto eta = o2track.getEta();
292293
float interpolatedEff = 0.0f;
293-
auto lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, interpolatedEff);
294+
lutEntry_t* lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, interpolatedEff);
294295
if (!lutEntry || !lutEntry->valid)
295296
return false;
296297
return smearTrack(o2track, lutEntry, interpolatedEff);
297298
}
298299

299300
/*****************************************************************/
300301
// relative uncertainty on pt
301-
double TrackSmearer::getPtRes(int pdg, float nch, float eta, float pt)
302+
double TrackSmearer::getPtRes(const int pdg, const float nch, const float eta, const float pt)
302303
{
303304
float dummy = 0.0f;
304-
auto lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
305+
lutEntry_t* lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
305306
auto val = std::sqrt(lutEntry->covm[14]) * lutEntry->pt;
306307
return val;
307308
}
308309

309310
/*****************************************************************/
310311
// relative uncertainty on eta
311-
double TrackSmearer::getEtaRes(int pdg, float nch, float eta, float pt)
312+
double TrackSmearer::getEtaRes(const int pdg, const float nch, const float eta, const float pt)
312313
{
313314
float dummy = 0.0f;
314-
auto lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
315+
lutEntry_t* lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
315316
auto sigmatgl = std::sqrt(lutEntry->covm[9]); // sigmatgl2
316317
auto etaRes = std::fabs(std::sin(2.0 * std::atan(std::exp(-eta)))) * sigmatgl; // propagate tgl to eta uncertainty
317318
etaRes /= lutEntry->eta; // relative uncertainty
318319
return etaRes;
319320
}
320321
/*****************************************************************/
321322
// absolute uncertainty on pt
322-
double TrackSmearer::getAbsPtRes(int pdg, float nch, float eta, float pt)
323+
double TrackSmearer::getAbsPtRes(const int pdg, const float nch, const float eta, const float pt)
323324
{
324325
float dummy = 0.0f;
325-
auto lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
326+
lutEntry_t* lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
326327
auto val = std::sqrt(lutEntry->covm[14]) * lutEntry->pt * lutEntry->pt;
327328
return val;
328329
}
329330

330331
/*****************************************************************/
331332
// absolute uncertainty on eta
332-
double TrackSmearer::getAbsEtaRes(int pdg, float nch, float eta, float pt)
333+
double TrackSmearer::getAbsEtaRes(const int pdg, const float nch, const float eta, const float pt)
333334
{
334335
float dummy = 0.0f;
335-
auto lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
336+
lutEntry_t* lutEntry = getLUTEntry(pdg, nch, 0., eta, pt, dummy);
336337
auto sigmatgl = std::sqrt(lutEntry->covm[9]); // sigmatgl2
337338
auto etaRes = std::fabs(std::sin(2.0 * std::atan(std::exp(-eta)))) * sigmatgl; // propagate tgl to eta uncertainty
338339
return etaRes;
339340
}
340341
/*****************************************************************/
341342
// efficiency
342-
double TrackSmearer::getEfficiency(int pdg, float nch, float eta, float pt)
343+
double TrackSmearer::getEfficiency(const int pdg, const float nch, const float eta, const float pt)
343344
{
344345
float efficiency = 0.0f;
345346
getLUTEntry(pdg, nch, 0., eta, pt, efficiency);
@@ -360,7 +361,7 @@ double TrackSmearer::getEfficiency(int pdg, float nch, float eta, float pt)
360361
// return true;
361362

362363
// #if 0
363-
// auto lutEntry = getLUTEntry(track.PID, 0., 0., track.Eta, track.PT);
364+
// lutEntry_t* lutEntry = getLUTEntry(track.PID, 0., 0., track.Eta, track.PT);
364365
// if (!lutEntry)
365366
// return;
366367

ALICE3/Core/DelphesO2TrackSmearer.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,23 +180,24 @@ class TrackSmearer
180180

181181
/** LUT methods **/
182182
bool loadTable(int pdg, const char* filename, bool forceReload = false);
183-
void useEfficiency(bool val) { mUseEfficiency = val; } //;
184-
void interpolateEfficiency(bool val) { mInterpolateEfficiency = val; } //;
185-
void skipUnreconstructed(bool val) { mSkipUnreconstructed = val; } //;
186-
void setWhatEfficiency(int val) { mWhatEfficiency = val; } //;
187-
lutHeader_t* getLUTHeader(int pdg) { return mLUTHeader[getIndexPDG(pdg)]; } //;
188-
lutEntry_t* getLUTEntry(int pdg, float nch, float radius, float eta, float pt, float& interpolatedEff);
183+
bool hasTable(int pdg) { return (mLUTHeader[getIndexPDG(pdg)] != nullptr); } //;
184+
void useEfficiency(bool val) { mUseEfficiency = val; } //;
185+
void interpolateEfficiency(bool val) { mInterpolateEfficiency = val; } //;
186+
void skipUnreconstructed(bool val) { mSkipUnreconstructed = val; } //;
187+
void setWhatEfficiency(int val) { mWhatEfficiency = val; } //;
188+
lutHeader_t* getLUTHeader(int pdg) { return mLUTHeader[getIndexPDG(pdg)]; } //;
189+
lutEntry_t* getLUTEntry(const int pdg, const float nch, const float radius, const float eta, const float pt, float& interpolatedEff);
189190

190191
bool smearTrack(O2Track& o2track, lutEntry_t* lutEntry, float interpolatedEff);
191192
bool smearTrack(O2Track& o2track, int pdg, float nch);
192193
// bool smearTrack(Track& track, bool atDCA = true); // Only in DelphesO2
193-
double getPtRes(int pdg, float nch, float eta, float pt);
194-
double getEtaRes(int pdg, float nch, float eta, float pt);
195-
double getAbsPtRes(int pdg, float nch, float eta, float pt);
196-
double getAbsEtaRes(int pdg, float nch, float eta, float pt);
197-
double getEfficiency(int pdg, float nch, float eta, float pt);
194+
double getPtRes(const int pdg, const float nch, const float eta, const float pt);
195+
double getEtaRes(const int pdg, const float nch, const float eta, const float pt);
196+
double getAbsPtRes(const int pdg, const float nch, const float eta, const float pt);
197+
double getAbsEtaRes(const int pdg, const float nch, const float eta, const float pt);
198+
double getEfficiency(const int pdg, const float nch, const float eta, const float pt);
198199

199-
int getIndexPDG(int pdg)
200+
int getIndexPDG(const int pdg)
200201
{
201202
switch (abs(pdg)) {
202203
case 11:

0 commit comments

Comments
 (0)