Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,9 @@ void AODProducerWorkflowDPL::init(InitContext& ic)
if (!fResFile) {
LOGF(fatal, "Could not open file %s", mResFile);
}
if (!fResFile->FindObjectAny("metaData")) {
if (fResFile->FindObjectAny("metaData")) {
LOGF(warning, "Metadata: target file %s already has metadata, preserving it", mResFile);
} else {
// populating metadata map
TString dataType = mUseMC ? "MC" : "RAW";
mMetaData.Add(new TObjString("DataType"), new TObjString(dataType));
Expand All @@ -1004,9 +1006,7 @@ void AODProducerWorkflowDPL::init(InitContext& ic)
mMetaData.Add(new TObjString("AnchorPassName"), new TObjString(mAnchorPass));
mMetaData.Add(new TObjString("LPMProductionTag"), new TObjString(mLPMProdTag));
LOGF(info, "Metadata: writing into %s", mResFile);
fResFile->WriteObject(&mMetaData, "metaData");
} else {
LOGF(fatal, "Metadata: target file %s already has metadata", mResFile);
fResFile->WriteObject(&mMetaData, "metaData", "Overwrite");
}
fResFile->Close();

Expand Down
4 changes: 2 additions & 2 deletions Framework/Core/include/Framework/TableTreeHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ class TableToTree
public:
TableToTree(std::shared_ptr<arrow::Table> const& table, TFile* file, const char* treename);

TTree* process();
std::shared_ptr<TTree> process();
void addBranch(std::shared_ptr<arrow::ChunkedArray> const& column, std::shared_ptr<arrow::Field> const& field);
void addAllBranches();

private:
arrow::Table* mTable;
int64_t mRows = 0;
TTree* mTree = nullptr;
std::shared_ptr<TTree> mTree;
std::vector<std::unique_ptr<ColumnToBranch>> mColumnReaders;
};

Expand Down
4 changes: 2 additions & 2 deletions Framework/Core/src/CommonDataProcessors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ DataProcessorSpec
return [](ProcessingContext&) mutable -> void {
static bool once = false;
if (!once) {
LOG(INFO) << "No AODs to be saved.";
LOG(info) << "No AODs to be saved.";
once = true;
}
};
Expand Down Expand Up @@ -354,7 +354,7 @@ DataProcessorSpec
auto s = pc.inputs().get<TableConsumer>(ref.spec->binding);
auto table = s->asArrowTable();
if (!table->Validate().ok()) {
LOGP(WARNING, "The table \"{}\" is not valid and will not be saved!", tableName);
LOGP(warning, "The table \"{}\" is not valid and will not be saved!", tableName);
continue;
}
if (table->schema()->fields().empty()) {
Expand Down
10 changes: 5 additions & 5 deletions Framework/Core/src/TableTreeHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ void ColumnToBranch::nextChunk()
TableToTree::TableToTree(std::shared_ptr<arrow::Table> const& table, TFile* file, const char* treename)
{
mTable = table.get();
mTree = static_cast<TTree*>(file->Get(treename));
if (mTree != nullptr) {
mTree.reset(static_cast<TTree*>(file->Get(treename)));
if (mTree) {
return;
}
std::string treeName(treename);
Expand All @@ -308,7 +308,7 @@ TableToTree::TableToTree(std::shared_ptr<arrow::Table> const& table, TFile* file
file->cd(treeName.substr(0, pos).c_str());
treeName = treeName.substr(pos + 1, std::string::npos);
}
mTree = new TTree(treeName.c_str(), treeName.c_str());
mTree = std::make_shared<TTree>(treeName.c_str(), treeName.c_str());
}

void TableToTree::addAllBranches()
Expand All @@ -329,10 +329,10 @@ void TableToTree::addBranch(std::shared_ptr<arrow::ChunkedArray> const& column,
} else if (mRows != column->length()) {
throw runtime_error_f("Adding incompatible column with size %d (num rows = %d)", column->length(), mRows);
}
mColumnReaders.emplace_back(new ColumnToBranch{mTree, column, field});
mColumnReaders.emplace_back(new ColumnToBranch{mTree.get(), column, field});
}

TTree* TableToTree::process()
std::shared_ptr<TTree> TableToTree::process()
{
int64_t row = 0;
if (mTree->GetNbranches() == 0 || mRows == 0) {
Expand Down