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.h
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 #ifndef DDCOND_CONDITIONSDATALOADER_H
15 #define DDCOND_CONDITIONSDATALOADER_H
16 
17 // Framework include files
18 #include "DD4hep/Conditions.h"
19 #include "DD4hep/NamedObject.h"
22 
23 // C/C++ include files
24 #include <list>
25 #include <set>
26 
28 namespace DD4hep {
29 
31  namespace Conditions {
32 
33  // Forward declarations
34  class Entry;
36  typedef std::list<Entry*> ConditionsStack;
37 
39 
46  public:
47  typedef std::pair<std::string, IOV> Source;
48  typedef std::vector<Source> Sources;
52 
53  protected:
55  LCDD& m_lcdd;
60 
61  protected:
65  void pushUpdates();
66 
67  public:
69  ConditionsDataLoader(LCDD& lcdd, ConditionsManager mgr, const std::string nam);
71  virtual ~ConditionsDataLoader();
73  void addSource(const std::string& source, const iov_type& iov);
75  virtual size_t load(key_type key,
76  const iov_type& req_validity,
77  RangeConditions& conditions) = 0;
79  virtual size_t load_range(key_type key,
80  const iov_type& req_validity,
81  RangeConditions& conditions) = 0;
82  virtual size_t update(const iov_type& req_validity,
83  RangeConditions& conditions,
84  iov_type& conditions_validity) = 0;
85  };
86 
87  } /* End namespace Conditions */
88 } /* End namespace DD4hep */
89 
90 #endif /* DDCOND_CONDITIONSDATALOADER_H */
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.
Property object as base class for all objects supporting properties.
std::list< Entry * > ConditionsStack
Main condition object handle.
Definition: Conditions.h:70
virtual size_t update(const iov_type &req_validity, RangeConditions &conditions, iov_type &conditions_validity)=0
unsigned int key_type
Forward definition of the key type.
Definition: Conditions.h:75
The intermediate conditions data used to populate the DetElement conditions.
LCDD & m_lcdd
Reference to main detector description object.
Implementation of a named object.
Definition: NamedObject.h:31
Class describing the interval of validty.
Definition: IOV.h:59
Manager class for condition handles.
virtual size_t load(key_type key, const iov_type &req_validity, RangeConditions &conditions)=0
Load a condition set given a Detector Element and the conditions name according to their validity...
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.
std::vector< Condition > RangeConditions
Definition: Conditions.h:359
Sources m_sources
Property: input data source definitions.
virtual size_t load_range(key_type key, const iov_type &req_validity, RangeConditions &conditions)=0
Load a condition set given a Detector Element and the conditions name according to their validity...
Stack entry definition.
virtual ~ConditionsDataLoader()
Default destructor.
void pushUpdates()
Push update to manager.