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
DetConditions.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
18 #include "DD4hep/DetConditions.h"
19 #include "DD4hep/Conditions.h"
20 #include "DD4hep/World.h"
21 #include "DD4hep/LCDD.h"
22 
23 using namespace std;
24 using namespace DD4hep::Conditions;
25 
27 bool DetConditions::hasConditions() const {
28  Object* o = access();
29  if ( o->conditions.isValid() && !o->conditions->keys.empty() )
30  return true;
31  return false;
32 }
33 
35 Container DetConditions::conditions() const {
36  Object* o = access();
37  if ( o->conditions.isValid() ) return o->conditions;
38  o->conditions.assign(new Container::Object(o),"conditions","");
39  return o->assign_conditions();
40 }
41 
43 Condition DetConditions::get(const std::string& key, const Condition::iov_type& iov) {
44  return conditions().get(key, iov);
45 }
46 
48 Condition DetConditions::get(Condition::key_type key, const Condition::iov_type& iov) {
49  return conditions().get(key, iov);
50 }
51 
53 Condition DetConditions::get(const std::string& key, const UserPool& pool) {
54  return conditions().get(key, pool);
55 }
56 
58 Condition DetConditions::get(Condition::key_type key, const UserPool& pool) {
59  return conditions().get(key, pool);
60 }
61 
Interface for conditions pool optimized to host conditions updates.
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:124
T & get()
Generic getter. Specify the exact type, not a polymorph type.
The data class behind a conditions container handle.
Main condition object handle.
Definition: Conditions.h:70
Container class for condition handles aggregated by a detector element.
Definition: Conditions.h:206
unsigned int key_type
Forward definition of the key type.
Definition: Conditions.h:75
const Keys & keys() const
Known keys of conditions in this container.
Definition: Conditions.cpp:180
Class describing the interval of validty.
Definition: IOV.h:59
ConditionsContainer assign_conditions()
void assign(Implementation *n, const std::string &nam, const std::string &title)
Assign a new named object. Note: object references must be managed by the user.
Definition: Handle.inl:27
ConditionsContainer conditions
The detector elements conditions access.
Data class with properties of a detector element.