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
ConditionsTest.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_CONDITIONSTEST_H
15 #define DDCOND_CONDITIONSTEST_H
16 
17 // Framework include files
18 #include "DD4hep/LCDD.h"
19 #include "DD4hep/Printout.h"
20 #include "DD4hep/Conditions.h"
22 
26 
28 namespace DD4hep {
29 
31  namespace Conditions {
32 
34  namespace Test {
35 
36  using Geometry::LCDD;
37  using Geometry::Position;
39 
40  struct TestEnv {
41  LCDD& lcdd;
43  ConditionsManager manager;
44  Handle<ConditionsDataLoader> loader;
45  const IOVType* epoch;
46  const IOVType* run;
47 
48  TestEnv(LCDD& _lcdd, const std::string& detector_name);
50  DetElement daughter(const std::string& sub_path) const;
51 
52  void add_xml_data_source(const std::string& file);
53  void dump_conditions_pools();
54  static void dump_detector_element(DetElement elt);
55  static void dump_conditions_tree(DetElement elt);
56  };
57 
58  template <typename T> void print_condition(Condition condition);
59  template <typename T> void print_bound_value(Condition condition, const char* norm=0);
60  template <typename T> void print_conditions(const RangeConditions& rc);
61  void check_discrete_condition(Condition c, const IOV& iov);
62 
63  template<typename T> const T& access_val(Condition c) {
64  if ( !c->is_bound() ) {
65  c.bind<T>();
66  }
67  return c.get<T>();
68  }
69  }
70  }
71 }
72 #endif // DDCOND_CONDITIONSTEST_H
const T & access_val(Condition c)
DetElement daughter(const std::string &sub_path) const
Find daughter element of the detector object.
TestEnv(LCDD &_lcdd, const std::string &detector_name)
void print_conditions(const RangeConditions &rc)
DD4hep::Geometry::DetElement DetElement
void print_condition(Condition condition)
void check_discrete_condition(Condition c, const IOV &iov)
ROOT::Math::XYZVector Position
Definition: Objects.h:75
static void dump_conditions_tree(DetElement elt)
Dump conditions tree of a detector element.
std::vector< Condition > RangeConditions
Definition: Conditions.h:359
static void dump_detector_element(DetElement elt)
Dump the conditions of one detectpr element.
void add_xml_data_source(const std::string &file, const std::string &iov)
void print_bound_value(Condition condition, const char *norm=0)
Handle< ConditionsDataLoader > loader