File indexing completed on 2025-01-30 09:16:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <DD4hep/detail/ConditionsInterna.h>
0018 #include <DDCond/ConditionsPool.h>
0019 #include <DDCond/ConditionsIOVPool.h>
0020 #include <DDCond/ConditionsOperators.h>
0021
0022
0023 #include <cstring>
0024
0025 using namespace dd4hep::cond;
0026
0027
0028 size_t Operators::collectAllConditions(Detector& description, RangeConditions& conditions) {
0029 ConditionsManager manager = ConditionsManager::from(description);
0030 return collectAllConditions(manager, conditions);
0031 }
0032
0033
0034 size_t Operators::collectAllConditions(ConditionsManager manager, RangeConditions& conditions) {
0035 const auto types = manager.iovTypesUsed();
0036 size_t num_conditions = 0;
0037 for( auto type : types ) {
0038 if ( type ) {
0039 ConditionsIOVPool* pool = manager.iovPool(*type);
0040 if ( pool ) {
0041 for( auto& cp : pool->elements ) {
0042 RangeConditions rc;
0043 cp.second->select_all(rc);
0044 for( auto c : rc )
0045 conditions.emplace_back(c);
0046 num_conditions += rc.size();
0047 }
0048 }
0049 }
0050 }
0051 return num_conditions;
0052 }
0053
0054
0055 size_t Operators::collectAllConditions(Detector& description, std::map<int,Condition>& conditions) {
0056 ConditionsManager manager = ConditionsManager::from(description);
0057 return collectAllConditions(manager, conditions);
0058 }
0059
0060
0061 size_t Operators::collectAllConditions(ConditionsManager manager, std::map<int,Condition>& conditions) {
0062 const auto types = manager.iovTypesUsed();
0063 size_t num_conditions = 0;
0064 for( auto type : types ) {
0065 if ( type ) {
0066 ConditionsIOVPool* pool = manager.iovPool(*type);
0067 if ( pool ) {
0068 for( auto& cp : pool->elements ) {
0069 RangeConditions rc;
0070 cp.second->select_all(rc);
0071 for( auto c : rc )
0072 conditions.emplace(c->hash,c);
0073 num_conditions += rc.size();
0074 }
0075 }
0076 }
0077 }
0078 return num_conditions;
0079 }
0080