Belle II Software development
IntraRunDependency.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#include <TObject.h>
11#include <TObjArray.h>
12
13
14namespace Belle2 {
19 class EventMetaData;
20
26 class IntraRunDependency: public TObject {
27 public:
28
34 explicit IntraRunDependency(TObject* object = 0, bool owner = true) {m_objects.SetOwner(owner); if (object) m_objects.Add(object);};
35
40 virtual ~IntraRunDependency() {};
41
47 TObject* getObject(const EventMetaData& event) const {return m_objects.At(getIndex(event));};
48
53 TObject* getAnyObject() const {return m_objects.At(0);};
54
59 bool isOwner() const {return m_objects.IsOwner();}
60
67 virtual const std::vector<unsigned int>& getBoundaries() const = 0;
68
69 protected:
70 TObjArray m_objects;
77 virtual int getIndex(const EventMetaData& event) const = 0;
78
80 };
82}
Store event, run, and experiment numbers.
Definition: EventMetaData.h:33
Base class for handling changing conditions during a run.
bool isOwner() const
Flag for ownership.
TObject * getAnyObject() const
Get any of the objects.
TObjArray m_objects
Array of intra-run dependent objects.
ClassDef(IntraRunDependency, 1)
base class for intra run dependent conditions.
virtual ~IntraRunDependency()
Destructor.
IntraRunDependency(TObject *object=0, bool owner=true)
Constructor for intra run depenent conditions.
virtual const std::vector< unsigned int > & getBoundaries() const =0
Get a vector with the intra-run boundaries.
TObject * getObject(const EventMetaData &event) const
Get the conditions object that is valid for the given event.
virtual int getIndex(const EventMetaData &event) const =0
Get the index of the object that is valid for the given event.
Abstract base class for different kinds of events.