DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConditionsDataLoader.cpp
Go to the documentation of this file.
1 // $Id$
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 // Framework include files
16 #include "DD4hep/Handle.inl"
17 #include "DD4hep/Printout.h"
20 
21 using std::string;
22 using namespace DD4hep::Conditions;
23 
25 
28  : NamedObject(nam,"ConditionsDataLoader"), m_lcdd(lcdd), m_mgr(mgr) {
29  if ( m_mgr.isValid() ) return;
30  except("ConditionsDataLoader","+++ Cannot create loader without a valid conditions manager handle!");
31 }
32 
35 }
36 
38 void ConditionsDataLoader::addSource(const string& source, const IOV& iov) {
39  m_sources.push_back(make_pair(source,iov));
40 }
41 
44  return m_mgr->__queue_update(data);
45 }
46 
49  m_mgr->pushUpdates();
50 }
void addSource(const std::string &source, const iov_type &iov)
Add data source definition to loader.
ConditionsDataLoader(LCDD &lcdd, ConditionsManager mgr, const std::string nam)
Default constructor.
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:124
Main condition object handle.
Definition: Conditions.h:70
DD4HEP_INSTANTIATE_HANDLE_NAMED(ConditionsDataLoader)
int except(const std::string &src, const std::string &fmt,...)
Calls the display action with ERROR and throws an std::runtime_error exception.
Definition: Printout.cpp:217
The intermediate conditions data used to populate the DetElement conditions.
Implementation of a named object.
Definition: NamedObject.h:31
Class describing the interval of validty.
Definition: IOV.h:59
Manager class for condition handles.
ConditionsManager m_mgr
Reference to conditions manager used to queue update requests.
Interface for a generic conditions loader.
Condition queueUpdate(Entry *data)
Queue update to manager.
Sources m_sources
Property: input data source definitions.
virtual ~ConditionsDataLoader()
Default destructor.
void pushUpdates()
Push update to manager.