Skip to content
Snippets Groups Projects
Commit 713ccfbc authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Minor fixes to PodioDataSvc, made while debugging memory leak but unrelated

parent d697ca03
Branches
Tags
1 merge request!416Minor fixes to PodioDataSvc, made while debugging memory leak but unrelated
......@@ -10,6 +10,7 @@
#include "TTree.h"
/// Service initialization
StatusCode PodioDataSvc::initialize() {
// Nothing to do: just call base class initialisation
StatusCode status = DataSvc::initialize();
......@@ -39,12 +40,12 @@ StatusCode PodioDataSvc::initialize() {
}
return status;
}
/// Service reinitialization
StatusCode PodioDataSvc::reinitialize() {
// Do nothing for this service
return StatusCode::SUCCESS;
}
/// Service finalization
StatusCode PodioDataSvc::finalize() {
m_cnvSvc = nullptr; // release
DataSvc::finalize().ignore();
......@@ -91,16 +92,20 @@ void PodioDataSvc::setCollectionIDs(podio::CollectionIDTable* collectionIds) {
/// Standard Constructor
PodioDataSvc::PodioDataSvc(const std::string& name, ISvcLocator* svc)
: DataSvc(name, svc), m_collectionIDs(new podio::CollectionIDTable()) {
m_eventDataTree = new TTree("events", "Events tree");
}
/// Standard Destructor
PodioDataSvc::~PodioDataSvc() = default;
PodioDataSvc::~PodioDataSvc() {
delete m_collectionIDs;
}
StatusCode PodioDataSvc::readCollection(const std::string& collectionName, int collectionID) {
podio::CollectionBase* collection(nullptr);
m_provider.get(collectionID, collection);
if (collection->isSubsetCollection()) {
return StatusCode::SUCCESS;
}
auto* wrapper = new DataWrapper<podio::CollectionBase>;
const int id = m_collectionIDs->add(collectionName);
collection->setID(id);
......
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Whitney Armstrong
#ifndef JUGBASE_FCCDATASVC_H
#define JUGBASE_FCCDATASVC_H
#ifndef JUGBASE_EICDATASVC_H
#define JUGBASE_EICDATASVC_H
#include "JugBase/PodioDataSvc.h"
......@@ -15,4 +15,4 @@ public:
/// Standard Destructor
virtual ~EICDataSvc();
};
#endif // JUGBASE_FCCDATASVC_H
#endif // JUGBASE_EICDATASVC_H
......@@ -20,7 +20,7 @@ StatusCode PodioInput::initialize() {
return StatusCode::FAILURE;
}
// check whether we have the PodioEvtSvc active
// check whether we have the PodioDataSvc active
m_podioDataSvc = dynamic_cast<PodioDataSvc*>(evtSvc().get());
if (m_podioDataSvc == nullptr) {
return StatusCode::FAILURE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment