Belle II Software  release-08-01-10
ECLDBTool.h
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 #pragma once
9 
10 // FRAMEWORK
11 #include <framework/database/IntervalOfValidity.h>
12 #include <framework/dataobjects/EventMetaData.h>
13 namespace Belle2 {
23  class ECLDBTool {
24  public:
33  ECLDBTool(bool isLocal,
34  const char* dbName,
35  const char* payloadName);
39  ~ECLDBTool();
43  void connect() const;
50  void write(TObject* const obj,
51  const IntervalOfValidity& iov) const;
59  void read(TObject** obj,
60  IntervalOfValidity** iov,
61  const EventMetaData& event) const;
67  void read(IntervalOfValidity** iov,
68  const EventMetaData& event) const;
76  void changeIoV(const EventMetaData& event,
77  const IntervalOfValidity& iov) const;
78  private:
85  bool m_isLocal;
90  std::string m_dbName;
94  std::string m_payloadName;
95  };
97 }
98 
The ECLDBTool class is designed to read / write object from / to database.
Definition: ECLDBTool.h:23
std::string m_dbName
Tag in the central database or path to a local database.
Definition: ECLDBTool.h:90
void changeIoV(const EventMetaData &event, const IntervalOfValidity &iov) const
Change interval of validity (Make a copy of the current payload with other validity interval).
Definition: ECLDBTool.cc:66
bool m_isLocal
If m_isLocal is true, local database is used.
Definition: ECLDBTool.h:85
ECLDBTool(bool isLocal, const char *dbName, const char *payloadName)
Constructor.
Definition: ECLDBTool.cc:15
std::string m_payloadName
Name of payload.
Definition: ECLDBTool.h:94
~ECLDBTool()
Destructor.
Definition: ECLDBTool.cc:24
void read(TObject **obj, IntervalOfValidity **iov, const EventMetaData &event) const
Read object and validity interval from a database.
Definition: ECLDBTool.cc:45
void write(TObject *const obj, const IntervalOfValidity &iov) const
Write object and validity interval to a database.
Definition: ECLDBTool.cc:38
void connect() const
Connect to a database.
Definition: ECLDBTool.cc:28
Store event, run, and experiment numbers.
Definition: EventMetaData.h:33
A class that describes the interval of experiments/runs for which an object in the database is valid.
Abstract base class for different kinds of events.