14#include <TCollection.h>
15#include <framework/database/IntervalOfValidity.h>
16#include <framework/logging/Logger.h>
17#include <calibration/Utilities.h>
32 explicit RunRange(std::vector<Calibration::ExpRun> expRuns) : TNamed()
34 for (
auto expRun : expRuns) {
35 this->
add(expRun.first, expRun.second);
58 void add(
int exp,
int run)
82 Long64_t
Merge(TCollection* hlist)
84 B2DEBUG(100,
"Running Merge() on " << this->GetName());
89 while ((xh =
dynamic_cast<RunRange*
>(nxh()))) {
95 B2DEBUG(100,
"Merged " << nMerged <<
" objects");
102 if (granularity ==
"all" || granularity ==
"run") {
105 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.
Mergeable object holding (unique) set of (exp,run) pairs.
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 add(int exp, int run)
Add an experiment and run number to the set.
void Reset()
Root-like Reset function for "template compatibility" with ROOT objects.
virtual ~RunRange()
Destructor.
std::string m_granularity
granularity used by the collector storing the information.
void setGranularity(const std::string &granularity)
Set the m_granularity to an allowed value.
RunRange(std::vector< Calibration::ExpRun > expRuns)
Constructor from vector of ExpRun objects.
std::set< Calibration::ExpRun > m_expRunSet
The set of (exp,run) stored in object.
virtual void clear()
Implementation of clearing - resets stored run set.
bool operator<(const RunRange &other) const
Comparison operator so that we can use RunRange in a map as a key.
std::string getGranularity() const
Gets the m_granularity.
IntervalOfValidity getIntervalOfValidity()
Make IntervalOfValidity from the set, spanning all runs. Works because sets are sorted by default.
const std::set< Calibration::ExpRun > & getExpRunSet()
Get access to the stored set.
void SetDirectory(TDirectory *)
Root-like SetDirectory function for "template compatibility" with ROOT objects. Does nothing.
Abstract base class for different kinds of events.