DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
ConditionsDataLoader.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
17 #include "DD4hep/detail/Handle.inl"
18 #include "DD4hep/Printout.h"
19 
20 using std::string;
21 using namespace dd4hep::cond;
22 
24 
27  : NamedObject(nam,"ConditionsDataLoader"), m_detector(description), m_mgr(mgr)
28 {
29  if ( m_mgr.isValid() ) return;
30  except("ConditionsDataLoader","+++ Cannot create loader without a valid conditions manager handle!");
31 }
32 
35 }
36 
38 dd4hep::Property& ConditionsDataLoader::operator[](const std::string& property_name) {
39  return properties().property(property_name);
40 }
41 
43 const dd4hep::Property& ConditionsDataLoader::operator[](const std::string& property_name) const {
44  return properties().property(property_name);
45 }
46 
48 void ConditionsDataLoader::addSource(const string& source, const IOV& iov) {
49  m_sources.emplace_back(source,iov);
50 }
51 
53 void ConditionsDataLoader::addSource(const string& source) {
54  m_sources.emplace_back(source,IOV(0,0));
55 }
56 
58 //Condition ConditionsDataLoader::queueUpdate(Entry* data) {
59 // return m_mgr->__queue_update(data);
60 //}
61 
64  m_mgr->pushUpdates();
65 }
dd4hep::cond::ConditionsDataLoader::pushUpdates
void pushUpdates()
Queue update to manager.
Definition: ConditionsDataLoader.cpp:63
dd4hep::Property
The property class to assign options to actions.
Definition: ComponentProperties.h:48
ConditionsDataLoader.h
dd4hep::cond::ConditionsDataLoader::m_sources
Sources m_sources
Property: input data source definitions.
Definition: ConditionsDataLoader.h:62
dd4hep::Handle::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:128
dd4hep::cond::ConditionsDataLoader::operator[]
Property & operator[](const std::string &property_name)
Access to properties.
Definition: ConditionsDataLoader.cpp:38
dd4hep::cond::ConditionsDataLoader::addSource
void addSource(const std::string &source)
Add data source definition to loader.
Definition: ConditionsDataLoader.cpp:53
dd4hep::cond::ConditionsDataLoader::ConditionsDataLoader
ConditionsDataLoader(Detector &description, ConditionsManager mgr, const std::string nam)
Default constructor.
Definition: ConditionsDataLoader.cpp:26
ConditionsManagerObject.h
dd4hep::cond
Namespace for implementation details of the AIDA detector description toolkit.
Definition: ConditionsCleanup.h:23
dd4hep::IOV
Class describing the interval of validty.
Definition: IOV.h:67
dd4hep::cond::ConditionsManager::pushUpdates
void pushUpdates() const
Push all pending updates to the conditions store.
Definition: ConditionsManager.cpp:259
dd4hep::cond::ConditionsDataLoader::m_mgr
ConditionsManager m_mgr
Reference to conditions manager used to queue update requests.
Definition: ConditionsDataLoader.h:60
dd4hep::PropertyManager::property
const Property & property(const std::string &name) const
Access property by name (CONST)
Definition: ComponentProperties.cpp:139
DD4HEP_INSTANTIATE_HANDLE_NAMED
DD4HEP_INSTANTIATE_HANDLE_NAMED(ConditionsDataLoader)
dd4hep::cond::ConditionsManager
Manager class for condition handles.
Definition: ConditionsManager.h:46
dd4hep::PropertyConfigurable::properties
virtual PropertyManager & properties() override
Access to the properties of the object.
Definition: ComponentProperties.h:269
dd4hep::cond::ConditionsDataLoader
Interface for a generic conditions loader.
Definition: ConditionsDataLoader.h:46
dd4hep::NamedObject
Implementation of a named object.
Definition: NamedObject.h:30
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
Printout.h
dd4hep::cond::ConditionsDataLoader::~ConditionsDataLoader
virtual ~ConditionsDataLoader()
Default destructor.
Definition: ConditionsDataLoader.cpp:34