Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QC-1227] Get beam type from PDP parameter #2461

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions Framework/include/QualityControl/runnerUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ uint64_t getCurrentTimestamp();

void initInfologger(framework::InitContext& iCtx, core::LogDiscardParameters infologgerDiscardParameters, std::string facility, std::string detectorName = "");

std::string translateBeamType(const std::string& pdpBeamType);

} // namespace o2::quality_control::core

#endif // QUALITYCONTROL_RUNNERUTILS_H
17 changes: 16 additions & 1 deletion Framework/src/runnerUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ std::string computeStringActivityField(framework::ServiceRegistryRef services, c
return property;
}

std::string translateBeamType(const std::string& pdpBeamType)
{
// convert the beam type received from pdp into the format we use in flp/ecs
if (pdpBeamType == "pp") {
return "PROTON-PROTON";
} else if (pdpBeamType == "PbPb") {
return "Pb-Pb";
} else if (pdpBeamType == "pPb") {
return "Pb-PROTON";
} else {
return "";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some warning, that we met value that we did not expect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, I let you have a look

}
}

Activity computeActivity(framework::ServiceRegistryRef services, const Activity& fallbackActivity)
{
// for a complete list of the properties provided by ECS, see here: https://github.com/AliceO2Group/Control/blob/master/docs/handbook/configuration.md#variables-pushed-to-controlled-tasks
Expand All @@ -102,7 +116,8 @@ Activity computeActivity(framework::ServiceRegistryRef services, const Activity&
auto partitionName = computeStringActivityField(services, "environment_id", fallbackActivity.mPartitionName);
auto periodName = computeStringActivityField(services, "lhc_period", fallbackActivity.mPeriodName);
auto fillNumber = computeNumericalActivityField<int>(services, "fill_info_fill_number", fallbackActivity.mFillNumber);
auto beam_type = computeStringActivityField(services, "fill_info_beam_type", fallbackActivity.mBeamType);
auto beam_type = computeStringActivityField(services, "pdp_beam_type", fallbackActivity.mBeamType);
beam_type = translateBeamType(beam_type);

Activity activity(
runNumber,
Expand Down
Loading