File indexing completed on 2025-01-30 09:17:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef EXAMPLES_CONDITIONS_SRC_CONDITIONSTEST_H
0014 #define EXAMPLES_CONDITIONS_SRC_CONDITIONSTEST_H
0015
0016
0017 #include "DD4hep/Detector.h"
0018 #include "DD4hep/Printout.h"
0019 #include "DD4hep/Conditions.h"
0020 #include "DD4hep/ConditionsMap.h"
0021 #include "DD4hep/DetFactoryHelper.h"
0022 #include "DD4hep/detail/ConditionsInterna.h"
0023 #include "DD4hep/ConditionsProcessor.h"
0024
0025 #include "DDCond/ConditionsIOVPool.h"
0026 #include "DDCond/ConditionsManager.h"
0027
0028
0029
0030 namespace dd4hep {
0031
0032
0033 namespace ConditionExamples {
0034
0035 using namespace cond;
0036
0037 struct TestEnv {
0038 Detector& description;
0039 DetElement detector;
0040 ConditionsManager manager;
0041 Handle<ConditionsDataLoader> loader;
0042 const IOVType* epoch;
0043 const IOVType* run;
0044
0045 TestEnv(Detector& _description, const std::string& detector_name);
0046
0047 DetElement daughter(const std::string& sub_path) const;
0048
0049 void add_xml_data_source(const std::string& file, const std::string& iov);
0050 static void dump_detector_element(DetElement elt, ConditionsMap& map);
0051 static void dump_conditions_tree(DetElement elt, ConditionsMap& map);
0052 };
0053
0054 template <typename T> void print_condition(Condition condition);
0055 template <typename T> void print_bound_value(Condition condition, const char* norm=0);
0056 template <typename T> void print_conditions(const RangeConditions& rc);
0057 void check_discrete_condition(Condition c, const IOV& iov);
0058
0059 template<typename T> const T& access_val(Condition c) {
0060 if ( !c->is_bound() ) {
0061 c.bind<T>();
0062 }
0063 return c.get<T>();
0064 }
0065 }
0066 }
0067 #endif