File indexing completed on 2025-01-30 09:17:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef EXAMPLES_CONDITIONS_SRC_CONDITIONANYEXAMPLEOBJECTS_H
0014 #define EXAMPLES_CONDITIONS_SRC_CONDITIONANYEXAMPLEOBJECTS_H
0015
0016
0017 #include "ConditionExampleObjects.h"
0018
0019
0020 namespace dd4hep {
0021
0022
0023 namespace ConditionExamples {
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 class ConditionAnyUpdate1 : public ConditionUpdateCall, public OutputLevel {
0034 public:
0035
0036 ConditionAnyUpdate1(PrintLevel p) : OutputLevel(p) { }
0037
0038 virtual ~ConditionAnyUpdate1() = default;
0039
0040 virtual Condition operator()(const ConditionKey& key, ConditionUpdateContext& context) override final;
0041
0042 virtual void resolve(Condition condition, ConditionUpdateContext& context) override final;
0043 };
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 class ConditionAnyUpdate2 : public ConditionUpdateCall, public OutputLevel {
0054 public:
0055
0056 ConditionAnyUpdate2(PrintLevel p) : OutputLevel(p) { }
0057
0058 virtual ~ConditionAnyUpdate2() = default;
0059
0060 virtual Condition operator()(const ConditionKey& key, ConditionUpdateContext& context) override final;
0061
0062 virtual void resolve(Condition condition, ConditionUpdateContext& context) override final;
0063 };
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073 class ConditionAnyUpdate3 : public ConditionUpdateCall, public OutputLevel {
0074 public:
0075
0076 ConditionAnyUpdate3(PrintLevel p) : OutputLevel(p) { }
0077
0078 virtual ~ConditionAnyUpdate3() = default;
0079
0080 virtual Condition operator()(const ConditionKey& key, ConditionUpdateContext& context) override final;
0081
0082 virtual void resolve(Condition condition, ConditionUpdateContext& context) override final;
0083 };
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093 class ConditionAnyUpdate4 : public ConditionUpdateCall, public OutputLevel {
0094 public:
0095
0096 ConditionAnyUpdate4(PrintLevel p) : OutputLevel(p) { }
0097
0098 virtual ~ConditionAnyUpdate4() = default;
0099
0100 virtual Condition operator()(const ConditionKey& key, ConditionUpdateContext& context) override final;
0101 };
0102
0103
0104
0105
0106
0107
0108
0109 class ConditionsAnyKeys : public OutputLevel {
0110 public:
0111
0112 ConditionsContent& content;
0113
0114 ConditionsAnyKeys(ConditionsContent& c, PrintLevel p) : OutputLevel(p), content(c) {}
0115
0116 virtual int operator()(DetElement de, int level) const final;
0117 };
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127 class ConditionsAnyDependencyCreator : public OutputLevel {
0128 public:
0129
0130 ConditionsContent& content;
0131
0132 std::shared_ptr<ConditionUpdateCall> call1, call2, call3, call4;
0133
0134 bool persist_conditions;
0135
0136 int extended;
0137 public:
0138
0139 ConditionsAnyDependencyCreator(ConditionsContent& c, PrintLevel p, bool persist=false, int extended=0);
0140
0141 virtual ~ConditionsAnyDependencyCreator() = default;
0142
0143 virtual int operator()(DetElement de, int level) const final;
0144 };
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154 class ConditionsAnyCreator : public OutputLevel {
0155 public:
0156
0157 ConditionsSlice& slice;
0158
0159 ConditionsPool& pool;
0160 public:
0161
0162 ConditionsAnyCreator(ConditionsSlice& s, ConditionsPool& p, PrintLevel l=DEBUG)
0163 : OutputLevel(l), slice(s), pool(p) {}
0164
0165 virtual ~ConditionsAnyCreator() = default;
0166
0167 virtual int operator()(DetElement de, int level) const final;
0168 template<typename T>
0169 Condition make_condition(DetElement de,
0170 const std::string& name,
0171 const T& val) const;
0172 template<typename T, typename... Args>
0173 Condition make_condition_args(DetElement de,
0174 const std::string& name,
0175 Args... args) const;
0176 };
0177
0178
0179
0180
0181
0182
0183
0184 class ConditionsAnyDataAccess : public OutputLevel {
0185 public:
0186
0187 const IOV& iov;
0188
0189 ConditionsMap& map;
0190
0191 public:
0192
0193 ConditionsAnyDataAccess(const IOV& i, ConditionsMap& m, PrintLevel l=DEBUG)
0194 : OutputLevel(l), iov(i), map(m) {}
0195
0196 virtual ~ConditionsAnyDataAccess();
0197
0198 virtual int operator()(DetElement de, int level) const;
0199
0200 virtual int accessConditions(DetElement de,
0201 const std::vector<Condition>& conditions) const;
0202 };
0203 }
0204 }
0205 #endif