 |
Belle II Software
release-05-02-19
|
7 #include <TCollection.h>
8 #include <framework/database/IntervalOfValidity.h>
9 #include <framework/logging/Logger.h>
10 #include <calibration/Utilities.h>
17 class RunRange :
public TNamed {
25 explicit RunRange(std::vector<Calibration::ExpRun> expRuns) : TNamed()
27 for (
auto expRun : expRuns) {
28 this->
add(expRun.first, expRun.second);
47 m_expRunSet.insert(other->m_expRunSet.begin(), other->m_expRunSet.end());
51 void add(
int exp,
int run)
75 Long64_t
Merge(TCollection* hlist)
77 B2DEBUG(100,
"Running Merge() on " << this->GetName());
82 while ((xh =
dynamic_cast<RunRange*
>(nxh()))) {
88 B2DEBUG(100,
"Merged " << nMerged <<
" objects");
95 if (granularity ==
"all" || granularity ==
"run") {
98 B2WARNING(
"Tried to set RunRange granularity to something other than 'run' or 'all' -> " << granularity);
A class that describes the interval of experiments/runs for which an object in the database is valid.
void setGranularity(std::string &granularity)
Set the m_granularity to an allowed value.
std::set< Calibration::ExpRun > m_expRunSet
The set of (exp,run) stored in object.
const std::set< Calibration::ExpRun > & getExpRunSet()
Get access to the stored set.
RunRange(std::vector< Calibration::ExpRun > expRuns)
Constructor from vector of ExpRun objects.
void add(int exp, int run)
Add an experiment and run number to the set.
IntervalOfValidity getIntervalOfValidity()
Make IntervalOfValidity from the set, spanning all runs. Works because sets are sorted by default.
void Reset()
Root-like Reset function for "template compatibility" with ROOT objects.
Abstract base class for different kinds of events.
virtual void merge(const RunRange *other)
Implementation of merging - other is added to the set (union)
Long64_t Merge(TCollection *hlist)
Allow merging using TFileMerger if saved directly to a file.
void SetDirectory(TDirectory *)
Root-like SetDirectory function for "template compatibility" with ROOT objects. Does nothing.
virtual void clear()
Implementation of clearing - resets stored run set.
std::string getGranularity() const
Gets the m_granularity.
virtual ~RunRange()
Destructor.
std::string m_granularity
granularity used by the collector storing the information.
bool operator<(const RunRange &other) const
Comparison operator so that we can use RunRange in a map as a key.
Mergeable object holding (unique) set of (exp,run) pairs.