Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Common/Tools/TrackTuner.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

/// configuration source
enum configSource : int { InputString = 1,
Configurables };

Check failure on line 55 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
} // namespace track_tuner

DECLARE_SOA_TABLE(TrackTunerTable, "AOD", "TRACKTUNERTABLE", //!
Expand All @@ -62,7 +62,7 @@
struct TrackTuner : o2::framework::ConfigurableGroup {

std::string prefix = "trackTuner"; // JSON group name
o2::framework::Configurable<bool> cfgDebugInfo{"debugInfo", false, "Flag to switch on the debug printout"};

Check failure on line 65 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
o2::framework::Configurable<bool> cfgUpdateTrackDCAs{"updateTrackDCAs", false, "Flag to enable the DCA smearing"};
o2::framework::Configurable<bool> cfgUpdateTrackCovMat{"updateTrackCovMat", false, "Flag to enable the DCA covariance-matrix smearing"};
o2::framework::Configurable<bool> cfgUpdateCurvature{"updateCurvature", false, "Flag to enable the Q/Pt smearing after the propagation to the production point"};
Expand Down Expand Up @@ -157,7 +157,7 @@
LOG(fatal) << "[TrackTuner::getPathInputFileAutomaticFromCCDB] runNumber==" << runNumber << ", automatic detection of dca calibration file from CCDB not possible. Did you call the function TrackTuner::setrunNumber()?";
}
/// check than the number of phi bins for the track tuner calibrations is 24
if (nPhiBins != 24) {

Check failure on line 160 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOG(fatal) << "[TrackTuner::getPathInputFileAutomaticFromCCDB] nPhiBins==" << nPhiBins << ", but the automatic detection of dca calibration file from CCDB is supported only for nPhiBins==24. Either put nPhiBins=24, or disable the auto-detection (autoDetectDcaCalib=false)";
}

Expand Down Expand Up @@ -185,12 +185,16 @@
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ [CASE 3]: pp, 13.6 TeV 2024: CCDB path Users/m/mfaggin/test/inputsTrackTuner/pp2024/pass1_minBias/vsPhi +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ Run list: 549559 (LHC24ac) <= runNumber && runNumber <= 558807 (LHC24ao) +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ [CASE 4]: OO, 5.36 TeV 2025, period LHC25ae: CCDB path Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25ae +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ Run list: 564356 <= runNumber && runNumber <= 564445 +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ [CASE 5]: OO, 5.36 TeV 2025, period LHC25af: CCDB path Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25af +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++ Run list: 564468 <= runNumber && runNumber <= 564472 +++";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
LOG(info) << "";

LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: current run number = " << runNumber;

if ((520259 <= runNumber && runNumber <= 529691) || (534998 <= runNumber && runNumber <= 543113)) {

Check failure on line 197 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
///
/// [CASE 1]: pp, 13.6 TeV 2022, 2023: CCDB path Users/m/mfaggin/test/inputsTrackTuner/pp2023/pass4/vsPhi
/// Run list: (520259 (LHC22f) <= runNumber <= 529691 (LHC22t)) || (534998 (LHC23zc) <= runNumber <= 543113 (LHC23zw))
Expand All @@ -198,7 +202,7 @@
pathInputFile = "Users/m/mfaggin/test/inputsTrackTuner/pp2023/pass4/vsPhi";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: >>> pp, 13.6 TeV 2022, 2023: CCDB path " << pathInputFile;
LOG(info) << " >>> Run list: (520259 (LHC22f) <= runNumber <= 529691 (LHC22t)) || (534998 (LHC23zc) <= runNumber <= 543113 (LHC23zw))";
} else if ((529397 <= runNumber && runNumber <= 529418) || (543437 <= runNumber && runNumber <= 545367)) {

Check failure on line 205 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
///
/// [CASE 2]: Pb-Pb, 5.34 TeV 2022, 2023, 2024: CCDB path Users/m/mfaggin/test/inputsTrackTuner/PbPb2023/apass4/vsPhi
/// Run list: (529397 <= runNumber <= 529418 (LHC22o)) || (543437 (LHC23zx) <= runNumber <= 545367 (LHC23zzo))
Expand All @@ -206,7 +210,7 @@
pathInputFile = "Users/m/mfaggin/test/inputsTrackTuner/PbPb2023/apass4/vsPhi";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: >>> Pb-Pb, 5.34 TeV 2022, 2023, 2024: CCDB path " << pathInputFile;
LOG(info) << " >>> Run list: (529397 <= runNumber <= 529418 (LHC22o)) || (543437 (LHC23zx) <= runNumber <= 545367 (LHC23zzo))";
} else if (549559 <= runNumber && runNumber <= 558807) {

Check failure on line 213 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
///
/// [CASE 3]: pp, 13.6 TeV 2024: CCDB path Users/m/mfaggin/test/inputsTrackTuner/pp2024/pass1_minBias/vsPhi
/// Run list: 549559 (LHC24ac) <= runNumber && runNumber <= 558807 (LHC24ao)
Expand All @@ -214,6 +218,22 @@
pathInputFile = "Users/m/mfaggin/test/inputsTrackTuner/pp2024/pass1_minBias/vsPhi";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: >>> pp, 13.6 TeV 2024: CCDB path " << pathInputFile;
LOG(info) << " >>> Run list: 549559 (LHC24ac) <= runNumber && runNumber <= 558807 (LHC24ao)";
} else if (564356 <= runNumber && runNumber <= 564445) {

Check failure on line 221 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
///
/// [CASE 4]: OO, 5.36 TeV 2025, period LHC25ae: CCDB path Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25ae
/// Run list: 564356 <= runNumber && runNumber <= 564445
///
pathInputFile = "Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25ae";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: >>> OO, 5.36 TeV 2025, period LHC25ae: CCDB path " << pathInputFile;
LOG(info) << " >>> Run list: 564356 <= runNumber && runNumber <= 564445";
} else if (564468 <= runNumber && runNumber <= 564472) {

Check failure on line 229 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
///
/// [CASE 5]: OO, 5.36 TeV 2025, period LHC25af: CCDB path Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25af
/// Run list: 564468 <= runNumber && runNumber <= 564472
///
pathInputFile = "Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25af";
LOG(info) << "[TrackTuner::getPathInputFileAutomaticFromCCDB]: >>> OO, 5.36 TeV 2025, period LHC25af: CCDB path " << pathInputFile;
LOG(info) << " >>> Run list: 564468 <= runNumber && runNumber <= 564472";
} else {
LOG(fatal) << "runNumber " << runNumber << " not supported for the autodetection. Please switch to manual configuration of the TrackTuner object. Aborting...";
}
Expand Down Expand Up @@ -332,7 +352,7 @@

LOG(info) << "[TrackTuner]";
LOG(info) << "[TrackTuner] >>> String slices:";
for (const std::string& s : slices)

Check failure on line 355 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
LOG(info) << "[TrackTuner] " << s;

/// check if the number of input parameters is correct
Expand Down Expand Up @@ -706,7 +726,7 @@
// get phibin
double phiMC = mcparticle.phi();
if (phiMC < 0.)
phiMC += o2::constants::math::TwoPI; // 2 * std::numbers::pi;//

Check failure on line 729 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
int phiBin = phiMC / (o2::constants::math::TwoPI + 0.0000001) * nPhiBins; // 0.0000001 just a numerical protection

dcaXYResMC = evalGraph(ptMC, grDcaXYResVsPtPionMC[phiBin].get());
Expand Down
Loading