23#include <fmt/format.h>
63 .
name =
"analysis-run-summary",
65 return ServiceHandle{TypeIdHelpers::uniqueId<RunSummary>(),
nullptr, ServiceKind::Serial,
"analysis-run-summary"};
68 LOGP(info,
"## Analysis Run Summary ##");
70 for (
size_t mi = 0; mi < info.deviceMetricsInfos.size(); ++mi) {
72 for (
size_t li = 0; li <
metrics.metricLabels.size(); ++li) {
74 if (strcmp(
label.label,
"aod-file-read-info") != 0) {
80 LOGP(info,
"### Files read stats ###");
83 LOGP(info,
"{}", files[fi % files.size()].data);
86 for (
size_t li = 0; li <
metrics.metricLabels.size(); ++li) {
88 if (strcmp(
label.label,
"aod-file-open-info") != 0) {
94 LOGP(info,
"### Files opened stats ###");
96 std::string lastFileRead;
98 lastFileRead = files[fi % files.size()].data;
100 if (lastFileRead.empty() ==
false) {
101 LOGP(info,
"Last file opened: {}", lastFileRead);
105 .kind = ServiceKind::Serial};
111 std::vector<std::string>
r;
114 std::string
first =
"";
116 for (
auto&
key :
f.topLevelKeys()) {
117 if (!std::string_view(
key.name).starts_with(
"DF_") && !std::string_view(
key.name).starts_with(
"/DF_")) {
121 if (
key.className ==
"TDirectoryFile" ||
key.className ==
"TDirectory") {
122 r =
f.keysIn(
key.name);
126 if (
key.className ==
"ROOT::RNTuple" ||
key.className ==
"ROOT::Experimental::RNTuple") {
127 std::string
const&
s =
key.name;
128 size_t pos =
s.find(
'-');
131 if (
pos == std::string::npos) {
134 std::string
t =
s.substr(
pos + 1);
152 auto m = currentFile.metaData();
153 std::vector<ConfigParamSpec> results;
159 LOGP(info,
"Metadata for file \"{}\":", currentFile.name());
163 std::string
key =
"aod-metadata-" +
name;
164 char const* valueCopy = strdup(
value.c_str());
165 results.push_back(
ConfigParamSpec{
key, VariantType::String, valueCopy, {
"Metadata in AOD"}});
184 .discover = [](
ConfigParamRegistry& registry,
int argc,
char** argv) -> std::vector<ConfigParamSpec> {
185 auto filename = registry.
get<std::string>(
"aod-file");
193 if (!
file.is_open()) {
194 LOGP(fatal,
"Couldn't open file \"{}\"!",
filename);
199 if (
filename.rfind(
"alien://", 0) == 0 && !gGrid) {
200 TGrid::Connect(
"alien://");
202 LOGP(info,
"Loading metadata from file {} in PID {}",
filename, getpid());
204 if (currentFile.get() ==
nullptr) {
205 throw std::runtime_error(fmt::format(
"Couldn't open file \"{}\"!",
filename));
207 std::vector<ConfigParamSpec> results =
readMetadata(*currentFile);
208 const bool metaDataEmpty = results.empty();
210 if (tables.empty() ==
false) {
211 results.push_back(
ConfigParamSpec{
"aod-metadata-tables", VariantType::ArrayString, tables, {
"Tables in first AOD"}});
215 if (!metaDataEmpty) {
216 results.push_back(
ConfigParamSpec{
"aod-metadata-source", VariantType::String,
filename, {
"File from which the metadata was extracted."}});
220 if (!registry.
isSet(
"aod-parent-access-level") || registry.
get<
int>(
"aod-parent-access-level") == 0) {
221 LOGP(info,
"No metadata found in file \"{}\" and parent level 0 prevents further lookup.",
filename);
222 results.push_back(
ConfigParamSpec{
"aod-metadata-disable", VariantType::String,
"1", {
"Metadata not found in AOD"}});
227 auto childFile = currentFile;
229 auto parentFiles = childFile->parentFiles();
230 if (parentFiles.empty()) {
233 LOGP(info,
"No metadata found in file \"{}\", checking in its parents.", childFile->name());
234 std::string parentFilename = parentFiles.begin()->second;
237 if (registry.
isSet(
"aod-parent-base-path-replacement")) {
238 auto parentFileReplacement = registry.
get<std::string>(
"aod-parent-base-path-replacement");
239 auto pos = parentFileReplacement.find(
';');
240 if (
pos == std::string::npos) {
241 throw std::runtime_error(fmt::format(
"Invalid syntax in aod-parent-base-path-replacement: \"{}\"", parentFileReplacement.c_str()));
243 auto from = parentFileReplacement.substr(0,
pos);
244 auto to = parentFileReplacement.substr(
pos + 1);
245 pos = parentFilename.find(from);
246 if (
pos != std::string::npos) {
247 parentFilename.replace(
pos, from.length(), to);
251 if (parentFilename.starts_with(
"alien://") && !gGrid) {
252 TGrid::Connect(
"alien://");
256 if (parentFile.get() ==
nullptr) {
257 LOGP(fatal,
"Couldn't open derived file \"{}\"!", parentFilename);
261 if (!results.empty()) {
263 if (tables.empty() ==
false) {
264 results.push_back(
ConfigParamSpec{
"aod-metadata-tables", VariantType::ArrayString, tables, {
"Tables in first AOD"}});
266 results.push_back(
ConfigParamSpec{
"aod-metadata-source", VariantType::String,
filename, {
"File from which the metadata was extracted."}});
269 LOGP(info,
"No metadata found in parent file \"{}\" at level {}", parentFilename,
level);
270 childFile = parentFile;
272 LOGP(info,
"No metadata found in file \"{}\" nor in its parents",
filename);
273 results.push_back(
ConfigParamSpec{
"aod-metadata-disable", VariantType::String,
"1", {
"Metadata not found in AOD"}});
auto readMetadata(AODInputFile ¤tFile) -> std::vector< ConfigParamSpec >
std::shared_ptr< AODInputFile > openForDiscovery(std::string const &filename)
std::vector< std::string > getListOfTables(AODInputFile &f)
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
#define DEFINE_DPL_PLUGIN_INSTANCE(NAME, KIND)
#define DEFINE_DPL_PLUGINS_END
#define DEFINE_DPL_PLUGINS_BEGIN
#define O2_DECLARE_DYNAMIC_LOG(name)
bool isSet(const char *key) const
T get(const char *key) const
GLuint const GLchar * name
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
GLsizei const GLfloat * value
GLuint GLsizei const GLchar * label
Defining ITS Vertex explicitly as messageable.
o2::framework::AlgorithmSpec create(o2::framework::ConfigContext const &config) override
o2::framework::AlgorithmSpec create(o2::framework::ConfigContext const &config) override
o2::framework::AlgorithmSpec create(o2::framework::ConfigContext const &config) override
o2::framework::ServiceSpec * create() final
Helper class for an algorithm which is loaded as a plugin.
std::function< void()> init
Running state information of a given device.
std::string name
Name of the service.
static AlgorithmSpec rootFileReaderCallback(ConfigContext const &context)
static AlgorithmSpec getOutputObjHistWriter(ConfigContext const &context)
static AlgorithmSpec getOutputTTreeWriter(ConfigContext const &context)