Skip to content

Commit 6554b74

Browse files
Merge branch 'AliceO2Group:master' into master
2 parents 22c0bf9 + d9d115f commit 6554b74

File tree

139 files changed

+11352
-3093
lines changed

Some content is hidden

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

139 files changed

+11352
-3093
lines changed

.clang-tidy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ CheckOptions:
44
- { key: readability-identifier-naming.ClassMemberPrefix, value: m }
55
- { key: readability-identifier-naming.ConceptCase, value: CamelCase }
66
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
7-
- { key: readability-identifier-naming.ConstexprVariableIgnoredRegexp, value: "^k[A-Z][a-zA-Z0-9]*$" } # Allow "k" prefix.
87
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
98
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
10-
- { key: readability-identifier-naming.EnumConstantIgnoredRegexp, value: "^k?[A-Z][a-zA-Z0-9_]*$" } # Allow "k" prefix and underscores.
9+
- { key: readability-identifier-naming.EnumConstantIgnoredRegexp, value: "^k?[A-Z][a-zA-Z0-9_]*$" } # Allow "k" prefix and non-trailing underscores in PDG names.
1110
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
1211
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
1312
- { key: readability-identifier-naming.MacroDefinitionIgnoredRegexp, value: "^[A-Z][A-Z0-9_]*_$" } # Allow the trailing underscore in header guards.

.github/workflows/mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
# Upload MegaLinter artifacts
5151
- name: Archive production artifacts
52-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@v5
5353
if: success() || failure()
5454
with:
5555
name: MegaLinter reports

Common/Core/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ o2physics_add_library(AnalysisCore
1414
OrbitRange.cxx
1515
PID/ParamBase.cxx
1616
PID/PIDTOF.cxx
17+
PID/PIDTOFParamService.cxx
1718
CollisionAssociation.cxx
1819
TrackSelectionDefaults.cxx
1920
EventPlaneHelper.cxx
2021
TableHelper.cxx
2122
MetadataHelper.cxx
2223
CollisionTypeHelper.cxx
2324
FFitWeights.cxx
24-
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base)
25+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base O2::DataFormatsParamTOF)
2526

2627
o2physics_target_root_dictionary(AnalysisCore
2728
HEADERS TrackSelection.h
@@ -34,6 +35,7 @@ o2physics_target_root_dictionary(AnalysisCore
3435
PID/DetectorResponse.h
3536
PID/PIDTOF.h
3637
PID/TPCPIDResponse.h
38+
PID/PIDTOFParamService.h
3739
CollisionTypeHelper.h
3840
FFitWeights.h
3941
LINKDEF AnalysisCoreLinkDef.h)

Common/Core/MetadataHelper.cxx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <Framework/InitContext.h>
2222
#include <Framework/Logger.h>
2323

24+
#include <TSystem.h>
25+
2426
#include <array>
2527
#include <string>
2628

@@ -140,3 +142,31 @@ std::string MetadataHelper::makeMetadataLabel() const
140142
}
141143
return label;
142144
}
145+
146+
std::string MetadataHelper::getO2Version() const
147+
{
148+
if (!mIsInitialized) {
149+
LOG(warning) << "Metadata not initialized";
150+
return "undefined";
151+
}
152+
return get("O2Version");
153+
}
154+
155+
bool MetadataHelper::isCommitInSoftwareTag(const std::string& commitHash, const std::string& ccdbUrl) const
156+
{
157+
const std::string softwareTag = getO2Version();
158+
std::string command = "curl -i -L ";
159+
command += ccdbUrl;
160+
command += "O2Version/CommitHash/";
161+
command += commitHash;
162+
command += "/-1/";
163+
command += "O2Version=" + softwareTag;
164+
command += " 2>&1 | grep --text O2Version:";
165+
// LOG(info) << "Command to check if commit " << commitHash << " is in software tag " << softwareTag << ": " << command;
166+
TString res = gSystem->GetFromPipe(command.c_str());
167+
if (res.Contains(Form("O2Version: %s", softwareTag.c_str()))) {
168+
LOG(debug) << "Commit " << commitHash << " is contained in software tag " << softwareTag;
169+
return true;
170+
}
171+
return false;
172+
}

Common/Core/MetadataHelper.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,21 @@ struct MetadataHelper {
5151
/// @return true if the data has been initialized, false otherwise
5252
bool isInitialized() const;
5353

54+
/// @brief Function to get the O2 version from the metadata in the monalisa format
55+
/// @return the O2 version from the metadata
56+
std::string getO2Version() const;
57+
5458
/// @brief Function to get the metadata value for a given key
5559
/// @param key the key of the metadata
5660
/// @return the value of the metadata. Throws an exception if the key is not found
5761
std::string get(const std::string& key) const;
5862

63+
/// @brief Function to set a metadata key to a given value
64+
/// @param key the key of the metadata
65+
/// @param value the value to set
66+
/// Note: this function does not check if the key is valid
67+
void set(const std::string& key, const std::string& value) { mMetadata[key] = value; }
68+
5969
/// @brief Function to check if a key is defined in the metadata
6070
/// @param key the key to check
6171
/// @return true if the key is defined, false otherwise. Throws an exception if the key is not found
@@ -64,6 +74,11 @@ struct MetadataHelper {
6474
/// @brief Function to create a label with the metadata information, useful e.g. for histogram naming
6575
std::string makeMetadataLabel() const;
6676

77+
/// Function to check if a commit is included in the software tag
78+
/// @param commitHash the commit hash to check
79+
/// @return true if the commit is included in the software tag, false otherwise
80+
bool isCommitInSoftwareTag(const std::string& commitHash, const std::string& ccdbUrl = "http://ccdb-test.cern.ch:8080/") const;
81+
6782
private:
6883
std::map<std::string, std::string> mMetadata; /// < The metadata map
6984
bool mIsInitialized = false; /// < Flag to check if the metadata has been initialized

0 commit comments

Comments
 (0)