Belle II Software development
PersistenceManagerFactory.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <memory>
10#include <framework/logging/Logger.h>
11#include <reconstruction/persistenceManager/PersistenceManagerFactory.h>
12#include <reconstruction/persistenceManager/ConcreteVariablesToNtuplePersistenceManager.h>
13#include <reconstruction/persistenceManager/ConcreteVariablesToHistogramPersistenceManager.h>
14
15namespace Belle2::VariablePersistenceManager {
16
17 std::unique_ptr<PersistenceManager> PersistenceManagerFactory::create(const std::string& storageType)
18 {
19 if ("ntuple" == storageType) {
20 return std::make_unique<ConcreteVariablesToNtuplePersistenceManager>();
21 } else if ("histogram" == storageType) {
22 return std::make_unique<ConcreteVariablesToHistogramPersistenceManager>();
23 } else {
24 B2ERROR("Incorrect storage type.");
25 return nullptr;
26 }
27 }
28}
static std::unique_ptr< PersistenceManager > create(const std::string &storageType)
Creates a PersistenceManager instance based on the specified storage type.