Skip to content
Snippets Groups Projects

Add "empty" conditions when they are missing from the database

Merged Roel Aaij requested to merge default_conditions into master
4 files
+ 50
31
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -29,6 +29,14 @@ namespace {
namespace LHCb::Detector {
// Tag structs to refer to the three indices of the
// ConditionsRepository::Locations multi-index container
struct by_location_hash {};
struct by_filename_hash {};
struct by_condition_key {};
/// Utility function to extract the combined location hash (filename
/// and condition name) from a ConditionIdentifier
dd4hep::Condition::key_type location_key( const ConditionIdentifier* entry );
struct RequestSelector;
@@ -42,13 +50,24 @@ namespace LHCb::Detector {
friend struct RequestSelector;
public:
// A multi-index container that allows (fast) lookup in three
// ways. the value is always the ConditionIdentifier.
using Locations = boost::multi_index_container<
ConditionIdentifier*,
bmi::indexed_by<
// Analogously to an `std::map` with key the combined hash
// of the filename and the condition name
bmi::ordered_unique<
bmi::tag<LHCb::Detector::by_location_hash>,
bmi::global_fun<const ConditionIdentifier*, dd4hep::Condition::key_type, &location_key>>,
bmi::hashed_non_unique<bmi::member<ConditionIdentifier, int, &ConditionIdentifier::sys_id_hash>>,
// Analogously to an `std::unordered_multimap` with key the hash of the filename
bmi::hashed_non_unique<bmi::tag<LHCb::Detector::by_filename_hash>,
bmi::member<ConditionIdentifier, int, &ConditionIdentifier::sys_id_hash>>,
// Analogously to an `std::unordered_map` with key the
// combined hash of the detector element and the condition
// name
bmi::hashed_unique<
bmi::tag<LHCb::Detector::by_condition_key>,
bmi::member<ConditionIdentifier, dd4hep::Condition::key_type, &ConditionIdentifier::hash>>>>;
Locations locations;
Loading