Belle II Software  release-05-01-25
GlobalParam.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Tadeas Bilka *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/logging/Logger.h>
14 #include <framework/database/Database.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <mdst/dbobjects/BeamSpot.h>
17 
18 #include <map>
19 #include <memory>
20 #include <set>
21 #include <string>
22 #include <vector>
23 
24 namespace Belle2 {
29  namespace alignment {
30  class GlobalParamVector;
31  class GlobalDerivativesHierarchy;
32 
34  class EmptyGlobalParamSet : public TObject {
35  public:
36  // ------------- Interface to global Millepede calibration ----------------
38  static unsigned short getGlobalUniqueID() {return 0;}
40  double getGlobalParam(unsigned short, unsigned short) {return 0.;}
42  void setGlobalParam(double, unsigned short, unsigned short) {}
44  std::vector<std::pair<unsigned short, unsigned short>> listGlobalParams() {return {};}
45  // ------------------------------------------------------------------------
46  };
47 
48 
53  public:
55  virtual ~IGlobalParamInterface() {}
61  virtual void readFromResult(std::vector<std::tuple<unsigned short, unsigned short, unsigned short, double>>&,
62  GlobalParamVector&) {};
65  };
66 
69  public:
70 
71  };
72 
75  public:
77  enum E_VXDHierarchyType {
78  c_None = 0,
79  c_Flat = 1,
80  c_HalfShells = 2,
81  c_Full = 3
82  };
86  static bool s_enablePXD;
88  static bool s_enableSVD;
89 
91  virtual void setupAlignmentHierarchy(GlobalDerivativesHierarchy& hierarchy) override final;
92  };
93 
97  public:
101  virtual ~GlobalParamSetAccess() {}
103  virtual unsigned short getGlobalUniqueID() const = 0;
106  virtual double getGlobalParam(unsigned short, unsigned short) = 0;
108  virtual void setGlobalParam(double, unsigned short, unsigned short) = 0;
110  virtual std::vector<std::pair<unsigned short, unsigned short>> listGlobalParams() = 0;
111 
113  virtual void updateGlobalParam(double correction, unsigned short element, unsigned short param) {setGlobalParam(getGlobalParam(element, param) + correction, element, param);}
116  virtual TObject* getDBObj() = 0;
118  virtual std::string getDefaultName() const = 0;
121  virtual TObject* releaseObject() = 0;
124  virtual GlobalParamSetAccess* clone() = 0;
125 
127  virtual void loadFromDB(EventMetaData emd) = 0;
129  virtual void loadFromDBObjPtr() = 0;
130 
132  virtual void construct() = 0;
135  virtual bool isConstructed() const = 0;
136 
138  virtual bool hasBeenChangedInDB(bool resetChangedState = true) final {auto tmp = m_hasBeenChangedInDB; if (resetChangedState) m_hasBeenChangedInDB = false; return tmp;}
140  virtual void callbackDB() {m_hasBeenChangedInDB = true;}
141 
144  template<class DBObjType>
145  bool is() const {return DBObjType::getGlobalUniqueID() == getGlobalUniqueID();}
146 
149  bool empty()
150  {
151  // We consider this to be the definition of empty
152  if (is<EmptyGlobalParamSet>())
153  return true;
154  // This is by convention (also used in hierarchy)
155  if (getGlobalUniqueID() == 0)
156  return true;
157  // This actually constructs the object using Default constructor if not
158  // previously loaded from DB (or using construct)
159  // TODO this is still not fully impelemnted by DB objects
160  if (listGlobalParams().empty())
161  return true;
162  return false;
163  }
164 
168  operator bool()
169  {
170  return not empty() and isConstructed();
171  }
172 
173  protected:
175  bool m_hasBeenChangedInDB {false};
176  };
177 
186  template<class DBObjType>
187  class GlobalParamSet : public GlobalParamSetAccess {
188  public:
190  // explicit GlobalParamSet(bool autoConstruct = false) {
192  {
193  //TODO: re-enable
194  //DBObjPtr<DBObjType> dbObject;
195  //dbObject.addCallback(this, &GlobalParamSet<DBObjType>::callbackDB);
196  // if (autoConstruct)
197  // construct();
198  }
200  ~GlobalParamSet() {m_object.reset();}
201 
203  virtual unsigned short getGlobalUniqueID() const override final {return DBObjType::getGlobalUniqueID();}
206  virtual double getGlobalParam(unsigned short element, unsigned short param) override final {ensureConstructed(); return m_object->getGlobalParam(element, param);}
208  virtual void setGlobalParam(double value, unsigned short element, unsigned short param) override final {ensureConstructed(); m_object->setGlobalParam(value, element, param);}
210  virtual std::vector<std::pair<unsigned short, unsigned short>> listGlobalParams() override final {ensureConstructed(); return m_object->listGlobalParams();}
212  virtual std::string getDefaultName() const override final {return DataStore::objectName<DBObjType>("");}
213 
216  virtual TObject* getDBObj() override final
217  {
218  if (!m_object)
219  return nullptr;
220 
221  return m_object.get();
222  }
223 
226  {
228  // Make new unique ptr to a copy of the other internal object
229  if (other.m_object)
230  m_object.reset(new DBObjType(*(static_cast<DBObjType*>(other.m_object.get()))));
231  }
232 
234  GlobalParamSet<DBObjType>& operator=(const GlobalParamSet<DBObjType>& other)
235  {
236  // check for self-assignment
237  if (&other == this)
238  return *this;
239  m_hasBeenChangedInDB = other.m_hasBeenChangedInDB;
240  // Make new unique ptr to a copy of the other internal object
241  if (other.m_object)
242  m_object.reset(new DBObjType(*(static_cast<DBObjType*>(other.m_object.get()))));
243  return *this;
244  }
245 
248  virtual TObject* releaseObject() override final
249  {
250  //ensureConstructed();
251  return m_object.release();
252  }
253 
255  virtual GlobalParamSetAccess* clone() override final
256  {
257  return new GlobalParamSet<DBObjType>(*this);
258  }
259 
263  virtual void loadFromDBObjPtr() override final
264  {
265  DBObjPtr<DBObjType> dbObject;
266  if (dbObject) {
267  m_object.reset(new DBObjType(*dbObject));
268  hasBeenChangedInDB(); // will set m_hasBeenChangedInDB to false, ignore return value;
269  }
270  }
271 
274  virtual void loadFromDB(EventMetaData event) override final
275  {
276  auto info = Database::Instance().getData(event, getDefaultName());
277  DBObjType* ptr = dynamic_cast<DBObjType*>(info.first);
278  if (!ptr) {
279  B2ERROR("Could not fetch object " << getDefaultName() << " from DB.");
280  return;
281  }
282  // don't make a copy, you own the object.
283  m_object.reset(ptr);
284  hasBeenChangedInDB(); // will set m_hasBeenChangedInDB to false, ignore return value;
285  }
286 
288  virtual void construct() override final {m_object.reset(new DBObjType());}
291  virtual bool isConstructed() const override final {return !!m_object;}
292 
295  virtual void callbackDB() override final {GlobalParamSetAccess::callbackDB();}
296 
297 
298  private:
300  std::unique_ptr<DBObjType> m_object {};
302  void ensureConstructed() {if (!m_object) construct();}
303  };
304 
306  template <>
307  unsigned short GlobalParamSet<BeamSpot>::getGlobalUniqueID() const;
310  template <>
311  double GlobalParamSet<BeamSpot>::getGlobalParam(unsigned short element, unsigned short param);
313  template <>
314  void GlobalParamSet<BeamSpot>::setGlobalParam(double value, unsigned short element, unsigned short param);
316  template <>
317  std::vector<std::pair<unsigned short, unsigned short>> GlobalParamSet<BeamSpot>::listGlobalParams();
318 
319 
320 
321 
328  class GlobalParamVector {
329  public:
333 
337  explicit GlobalParamVector(const std::vector<std::string>& components = {});
338 
341 
343  void construct();
344 
347  {
348  // this += rhs
349  // TODO: needs full implementation of listing in DBObjects
350  for (auto uid_element_param : listGlobalParams()) {
351  double delta = rhs.getGlobalParam(std::get<0>(uid_element_param), std::get<1>(uid_element_param), std::get<2>(uid_element_param));
352  updateGlobalParam(delta, std::get<0>(uid_element_param), std::get<1>(uid_element_param), std::get<2>(uid_element_param));
353  }
354  return *this;
355  }
356 
358  void addSubDetectorInterface(std::shared_ptr<IGlobalParamInterface> interface = {})
359  {
360  if (interface) {
362  interface) == m_subDetectorInterfacesVector.end())
363  m_subDetectorInterfacesVector.push_back(interface);
364  }
365  }
366 
371  template <class DBObjType>
372  void addDBObj(std::shared_ptr<IGlobalParamInterface> interface = {})
373  {
374  if (m_components.empty()
375  or std::find(m_components.begin(), m_components.end(), DataStore::objectName<DBObjType>("")) != m_components.end()) {
376  m_vector.insert(std::make_pair(DBObjType::getGlobalUniqueID(),
378  ));
379  // NOTE: Components disabled this way also disable added interfaces (e.g. if geometry would be needed to load)
380  // NOTE: add generic interfaces only once by addSubDetectorInterface(...)
381  addSubDetectorInterface(interface);
382  }
383  }
384 
388  bool hasBeenChangedInDB(const std::set<unsigned short>& subset, bool resetChangedState = true)
389  {
390  bool changed = false;
391 
392  for (auto& uID_DBObj : m_vector) {
393  if (!subset.empty() and subset.find(uID_DBObj.first) != subset.end())
394  continue;
395  if (uID_DBObj.second->hasBeenChangedInDB(resetChangedState)) {
396  changed = true;
397  break;
398  }
399  }
400 
401  return changed;
402  }
404  bool hasBeenChangedInDB(const std::set<unsigned short>& subset = {}) {return hasBeenChangedInDB(subset, false);}
405 
411  void updateGlobalParam(double difference, unsigned short uniqueID, unsigned short element, unsigned short param);
412 
418  void setGlobalParam(double value, unsigned short uniqueID, unsigned short element, unsigned short param);
419 
424  double getGlobalParam(unsigned short uniqueID, unsigned short element, unsigned short param);
425 
427  std::vector<std::tuple<unsigned short, unsigned short, unsigned short>> listGlobalParams();
428 
434  std::vector<TObject*> releaseObjects(bool onlyConstructed = true);
435 
438  void loadFromDB();
440  void loadFromDB(const EventMetaData& event);
441 
443  void postReadFromResult(std::vector<std::tuple<unsigned short, unsigned short, unsigned short, double>>& result);
446 
449  template<class DBObjType>
450  DBObjType* getDBObj()
451  {
452  if (m_vector.find(DBObjType::getGlobalUniqueID()) == m_vector.end())
453  return nullptr;
454 
455  return static_cast<DBObjType*>(m_vector[DBObjType::getGlobalUniqueID()]->getDBObj());
456  }
457 
462  template<class DBObjType>
464  {
465  if (m_vector.find(DBObjType::getGlobalUniqueID()) == m_vector.end())
466  return c_emptyGlobalParamSet;
467 
468  return static_cast<GlobalParamSet<DBObjType>&>(*m_vector[DBObjType::getGlobalUniqueID()]);
469  }
470 
472  const std::map<unsigned short, std::unique_ptr<GlobalParamSetAccess>>& getGlobalParamSets() const
473  {
474  return m_vector;
475  }
476 
478  const std::vector<std::shared_ptr<IGlobalParamInterface>>& getSubDetectorInterfaces() const
479  {
481  }
482 
484  std::set<unsigned short> getComponentsIDs() const
485  {
486  std::set<unsigned short> result;
487  for (auto& id_obj : m_vector)
488  result.insert(id_obj.first);
489  return result;
490  }
491  private:
493  std::map<unsigned short, std::unique_ptr<GlobalParamSetAccess>> m_vector {};
495  std::vector<std::shared_ptr<IGlobalParamInterface>> m_subDetectorInterfacesVector {};
497  std::vector<std::string> m_components {};
499  std::set<unsigned short> m_componentsIDs {};
500  };
501  }
503 }
Belle2::alignment::GlobalParamSetAccess::callbackDB
virtual void callbackDB()
Function to call when object has been changed in DB since last loaded.
Definition: GlobalParam.h:148
Belle2::alignment::EmptyGlobalParamSet::listGlobalParams
std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams()
list stored global parameters - empty list, no parameters
Definition: GlobalParam.h:52
Belle2::alignment::GlobalParamSetAccess::loadFromDB
virtual void loadFromDB(EventMetaData emd)=0
Load the content (by copying obj retrieved from DB) for a given exp/run/event.
Belle2::alignment::VXDGlobalParamInterface
Very tentative interface for VXD.
Definition: GlobalParam.h:82
Belle2::alignment::IGlobalParamInterface::~IGlobalParamInterface
virtual ~IGlobalParamInterface()
Destructor.
Definition: GlobalParam.h:63
Belle2::alignment::GlobalParamVector::getGlobalParam
double getGlobalParam(unsigned short uniqueID, unsigned short element, unsigned short param)
Get parameter value.
Definition: GlobalParam.cc:106
Belle2::alignment::GlobalParamSet::setGlobalParam
virtual void setGlobalParam(double value, unsigned short element, unsigned short param) override final
Set global parameter of the DB object by its element and parameter number.
Definition: GlobalParam.h:216
Belle2::alignment::GlobalParamSet::getGlobalUniqueID
virtual unsigned short getGlobalUniqueID() const override final
The DB object unique id in global calibration.
Definition: GlobalParam.h:211
Belle2::Database::getData
std::pair< TObject *, IntervalOfValidity > getData(const EventMetaData &event, const std::string &name)
Request an object from the database.
Definition: Database.cc:84
Belle2::alignment::GlobalParamSetAccess::~GlobalParamSetAccess
virtual ~GlobalParamSetAccess()
Virtual destructor (base class, but with no members)
Definition: GlobalParam.h:109
Belle2::alignment::VXDGlobalParamInterface::s_hierarchyType
static E_VXDHierarchyType s_hierarchyType
What type of hierarchy to use for VXD?
Definition: GlobalParam.h:92
Belle2::alignment::EmptyGlobalParamSet::getGlobalParam
double getGlobalParam(unsigned short, unsigned short)
Get global parameter - return zero.
Definition: GlobalParam.h:48
Belle2::alignment::GlobalParamSetAccess::clone
virtual GlobalParamSetAccess * clone()=0
Clone the object, making a copy of the internal object - has to be implemented in derived template cl...
Belle2::alignment::GlobalParamSetAccess::construct
virtual void construct()=0
Construct the internal DBObject.
Belle2::alignment::GlobalParamVector::releaseObjects
std::vector< TObject * > releaseObjects(bool onlyConstructed=true)
Get the vector of raw pointers to DB objects Caller takes the ownership of the objects and has to del...
Definition: GlobalParam.cc:127
Belle2::alignment::GlobalParamVector::getGlobalParamSet
GlobalParamSetAccess & getGlobalParamSet()
Get reference to the underlying DB object container You should check the container.
Definition: GlobalParam.h:471
Belle2::alignment::GlobalParamSet::operator=
GlobalParamSet< DBObjType > & operator=(const GlobalParamSet< DBObjType > &other)
Assignment operator.
Definition: GlobalParam.h:242
Belle2::alignment::GlobalParamSetAccess::hasBeenChangedInDB
virtual bool hasBeenChangedInDB(bool resetChangedState=true) final
Has the object been updated in DB since GlobalParamSet<...> has been constructed? Since last call to ...
Definition: GlobalParam.h:146
Belle2::alignment::GlobalParamSet::getGlobalParam
virtual double getGlobalParam(unsigned short element, unsigned short param) override final
Get global parameter of the DB object by its element and parameter number Note this is not const,...
Definition: GlobalParam.h:214
Belle2::alignment::GlobalDerivativesHierarchy
Class for alignment/calibration parameter hierarchy & constraints.
Definition: Hierarchy.h:51
Belle2::alignment::EmptyGlobalParamSet::setGlobalParam
void setGlobalParam(double, unsigned short, unsigned short)
Set global parameter - do nothing.
Definition: GlobalParam.h:50
Belle2::alignment::GlobalParamVector::getDBObj
DBObjType * getDBObj()
Get the raw pointer toa stored object WARNING: Use with caution, returns nullptr if object not regist...
Definition: GlobalParam.h:458
Belle2::alignment::GlobalParamVector::m_componentsIDs
std::set< unsigned short > m_componentsIDs
Vector of UniqueIDs of DB objects to consider in the vector.
Definition: GlobalParam.h:507
Belle2::alignment::GlobalParamSet::loadFromDBObjPtr
virtual void loadFromDBObjPtr() override final
Load content of the object using DBObjPtr<DBObjType> which will try to load object valid for current ...
Definition: GlobalParam.h:271
Belle2::alignment::GlobalParamVector::m_components
std::vector< std::string > m_components
Vector of names of DB objects to consider in the vector - if not here and non-empy,...
Definition: GlobalParam.h:505
Belle2::alignment::GlobalParamSetAccess::is
bool is() const
Is this set of given type?
Definition: GlobalParam.h:153
Belle2::alignment::CDCGlobalParamInterface
CDC interface.
Definition: GlobalParam.h:76
Belle2::alignment::IGlobalParamInterface
Some tentative base class to allow to add functionality to the default behavior, like manipulate cons...
Definition: GlobalParam.h:60
Belle2::alignment::VXDGlobalParamInterface::setupAlignmentHierarchy
virtual void setupAlignmentHierarchy(GlobalDerivativesHierarchy &hierarchy) override final
Very tentaive function: not yet used.
Definition: GlobalParam.cc:176
Belle2::alignment::GlobalParamSetAccess::setGlobalParam
virtual void setGlobalParam(double, unsigned short, unsigned short)=0
implemtn: set a global param value by element and param number
Belle2::alignment::GlobalParamSetAccess::empty
bool empty()
Is this set empty or otherwise 'invalid' to identify null sets, end of hierarchy.
Definition: GlobalParam.h:157
Belle2::alignment::GlobalParamVector::construct
void construct()
Construct all DB objects using default constructors (should be filled with zeros)
Definition: GlobalParam.cc:157
Belle2::alignment::GlobalParamSetAccess::releaseObject
virtual TObject * releaseObject()=0
Release the object from internal unique_ptr to be managed elsewhere Useful to pass it to be stored in...
Belle2::alignment::GlobalParamVector::postReadFromResult
void postReadFromResult(std::vector< std::tuple< unsigned short, unsigned short, unsigned short, double >> &result)
Function calling interfaces to do post processing after reading millepede result into GlobalParamVect...
Definition: GlobalParam.cc:163
Belle2::alignment::IGlobalParamInterface::readFromResult
virtual void readFromResult(std::vector< std::tuple< unsigned short, unsigned short, unsigned short, double >> &, GlobalParamVector &)
Implement this to be called after Millepede finishes and all global parameters are filled in DB objec...
Definition: GlobalParam.h:69
Belle2::alignment::GlobalParamVector::operator+=
GlobalParamVector & operator+=(GlobalParamVector &rhs)
TODO: operator += to sum two global vectors.
Definition: GlobalParam.h:354
Belle2::alignment::GlobalParamSetAccess
Base accessor class to store different DBObjects e.g.
Definition: GlobalParam.h:104
Belle2::alignment::GlobalParamVector::updateGlobalParam
void updateGlobalParam(double difference, unsigned short uniqueID, unsigned short element, unsigned short param)
Add 'difference' to param value.
Definition: GlobalParam.cc:88
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::alignment::GlobalParamSetAccess::GlobalParamSetAccess
GlobalParamSetAccess()
Constructor.
Definition: GlobalParam.h:107
Belle2::alignment::GlobalParamSetAccess::getGlobalParam
virtual double getGlobalParam(unsigned short, unsigned short)=0
implement: get a global parameter value based on the element number in the DBObject and its parameter...
Belle2::alignment::GlobalParamSet::callbackDB
virtual void callbackDB() override final
Function to call when object has been changed in DB since last loaded TODO Hide and find the class wh...
Definition: GlobalParam.h:303
Belle2::alignment::GlobalParamSet
Template class for generic access to DB objects.
Definition: GlobalParam.h:195
Belle2::alignment::GlobalParamVector
The central user class to manipulate any global constant in any DB object Used to retrieve global par...
Definition: GlobalParam.h:336
Belle2::alignment::GlobalParamSetAccess::getGlobalUniqueID
virtual unsigned short getGlobalUniqueID() const =0
implement: Get the global unique id of DBObject
Belle2::alignment::GlobalParamSet::releaseObject
virtual TObject * releaseObject() override final
Release the DB object from the internal unique pointer to be managed elsewhere (e....
Definition: GlobalParam.h:256
Belle2::alignment::GlobalParamSet::construct
virtual void construct() override final
Construct the internal object using default constructor.
Definition: GlobalParam.h:296
Belle2::alignment::GlobalParamSetAccess::getDBObj
virtual TObject * getDBObj()=0
Get a raw pointer to the internal DB object (can be nullptr if not yet constructed) Use with caution ...
Belle2::alignment::GlobalParamSet::getDefaultName
virtual std::string getDefaultName() const override final
Get the DB object default name used by datastore.
Definition: GlobalParam.h:220
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::alignment::GlobalParamVector::getGlobalParamSets
const std::map< unsigned short, std::unique_ptr< GlobalParamSetAccess > > & getGlobalParamSets() const
Get map of all contained parameter sets, key = unique id of the set (DB object)
Definition: GlobalParam.h:480
Belle2::alignment::IGlobalParamInterface::setupAlignmentHierarchy
virtual void setupAlignmentHierarchy(GlobalDerivativesHierarchy &)
Super-tentavive: not yet used.
Definition: GlobalParam.h:72
Belle2::alignment::GlobalParamVector::hasBeenChangedInDB
bool hasBeenChangedInDB(const std::set< unsigned short > &subset, bool resetChangedState=true)
Has any DB object in vector changed from last call to this function.
Definition: GlobalParam.h:396
Belle2::alignment::GlobalParamSetAccess::isConstructed
virtual bool isConstructed() const =0
Has the internal DBObject been already constructed The object is constructed at latest on first acces...
Belle2::alignment::GlobalParamVector::listGlobalParams
std::vector< std::tuple< unsigned short, unsigned short, unsigned short > > listGlobalParams()
Create vector of all global parameters maintained by GlobalParamVector.
Definition: GlobalParam.cc:117
Belle2::alignment::GlobalParamVector::postHierarchyChanged
void postHierarchyChanged(GlobalDerivativesHierarchy &hierarchy)
Function calling interfaces to build alignment hierarchy after constants changed in DB.
Definition: GlobalParam.cc:150
Belle2::alignment::GlobalParamVector::getSubDetectorInterfaces
const std::vector< std::shared_ptr< IGlobalParamInterface > > & getSubDetectorInterfaces() const
Get the vector of added interfaces to subdetectors.
Definition: GlobalParam.h:486
Belle2::alignment::VXDGlobalParamInterface::s_enablePXD
static bool s_enablePXD
Enable PXD in hierarchy?
Definition: GlobalParam.h:94
Belle2::alignment::GlobalParamSetAccess::getDefaultName
virtual std::string getDefaultName() const =0
Get the default DBObject name used by datastore.
Belle2::alignment::GlobalParamVector::setGlobalParam
void setGlobalParam(double value, unsigned short uniqueID, unsigned short element, unsigned short param)
Set param value.
Definition: GlobalParam.cc:95
Belle2::alignment::GlobalParamSetAccess::updateGlobalParam
virtual void updateGlobalParam(double correction, unsigned short element, unsigned short param)
Sum value of global element param with a correction.
Definition: GlobalParam.h:121
Belle2::Database::Instance
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:54
Belle2::alignment::GlobalParamSet::ensureConstructed
void ensureConstructed()
Function to construct the object if not already done.
Definition: GlobalParam.h:310
Belle2::EventMetaData
Store event, run, and experiment numbers.
Definition: EventMetaData.h:43
Belle2::alignment::GlobalParamVector::loadFromDB
void loadFromDB()
Load content of all objects in vector with values valid at current EventMetaData Uses DBObjPtr<DBObjT...
Definition: GlobalParam.cc:138
Belle2::alignment::GlobalParamSet::~GlobalParamSet
~GlobalParamSet()
Destructor.
Definition: GlobalParam.h:208
Belle2::alignment::EmptyGlobalParamSet::getGlobalUniqueID
static unsigned short getGlobalUniqueID()
Get global unique id = 0 (empty/none)
Definition: GlobalParam.h:46
Belle2::alignment::GlobalParamVector::c_emptyGlobalParamSet
GlobalParamSet< EmptyGlobalParamSet > c_emptyGlobalParamSet
An empty set to which reference is returned if DB object not found Also used e.g.
Definition: GlobalParam.h:340
Belle2::alignment::GlobalParamSet::loadFromDB
virtual void loadFromDB(EventMetaData event) override final
Load content of the object valid at given event from DB Also resets if the object has been changed.
Definition: GlobalParam.h:282
Belle2::alignment::GlobalParamSetAccess::listGlobalParams
virtual std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams()=0
implement: generate list of all global parameters in the DBObject
Belle2::alignment::GlobalParamSet::listGlobalParams
virtual std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams() override final
List global parameters in this DB object.
Definition: GlobalParam.h:218
Belle2::alignment::VXDGlobalParamInterface::s_enableSVD
static bool s_enableSVD
Enable SVD in hierarchy?
Definition: GlobalParam.h:96
Belle2::alignment::GlobalParamVector::GlobalParamVector
GlobalParamVector(const std::vector< std::string > &components={})
Constructor.
Definition: GlobalParam.cc:86
Belle2::alignment::GlobalParamSet::getDBObj
virtual TObject * getDBObj() override final
Get the raw pointer to the stored object WARNING: Use with caution if you really need to access the i...
Definition: GlobalParam.h:224
Belle2::alignment::GlobalParamVector::getComponentsIDs
std::set< unsigned short > getComponentsIDs() const
Get set of unique ids of all db objects considered.
Definition: GlobalParam.h:492
Belle2::alignment::GlobalParamSet::clone
virtual GlobalParamSetAccess * clone() override final
Clone the object, making a copy of the internal object.
Definition: GlobalParam.h:263
Belle2::alignment::GlobalParamVector::~GlobalParamVector
~GlobalParamVector()
Destructor.
Definition: GlobalParam.h:348
Belle2::alignment::VXDGlobalParamInterface::E_VXDHierarchyType
E_VXDHierarchyType
Type of VXD hierarchy.
Definition: GlobalParam.h:85
Belle2::alignment::GlobalParamVector::addSubDetectorInterface
void addSubDetectorInterface(std::shared_ptr< IGlobalParamInterface > interface={})
Add a generic interface (cannot be disabled by 'components' in constructor)
Definition: GlobalParam.h:366
Belle2::alignment::GlobalParamVector::m_subDetectorInterfacesVector
std::vector< std::shared_ptr< IGlobalParamInterface > > m_subDetectorInterfacesVector
Vector of interfaces to run at specific points in the workflow.
Definition: GlobalParam.h:503
Belle2::alignment::GlobalParamSet::isConstructed
virtual bool isConstructed() const override final
Is the internal object already constructed? we construct the object on first access to the stored val...
Definition: GlobalParam.h:299
Belle2::alignment::GlobalParamVector::m_vector
std::map< unsigned short, std::unique_ptr< GlobalParamSetAccess > > m_vector
The vector (well, actually a map) of DB objects.
Definition: GlobalParam.h:501
Belle2::alignment::GlobalParamVector::addDBObj
void addDBObj(std::shared_ptr< IGlobalParamInterface > interface={})
Add a DB object to the vector, optionally with interface.
Definition: GlobalParam.h:380
Belle2::alignment::GlobalParamSet::m_object
std::unique_ptr< DBObjType > m_object
The internal DB object.
Definition: GlobalParam.h:308
Belle2::alignment::GlobalParamSetAccess::m_hasBeenChangedInDB
bool m_hasBeenChangedInDB
Flag for object changed in DB.
Definition: GlobalParam.h:183
Belle2::alignment::GlobalParamSet::GlobalParamSet
GlobalParamSet()
Constructor. Sets callback for DB object changes.
Definition: GlobalParam.h:199
Belle2::alignment::GlobalParamSetAccess::loadFromDBObjPtr
virtual void loadFromDBObjPtr()=0
Load using DBObjPtr<DBObjType> which uses current EventMetaData to load valid constants.