File indexing completed on 2025-01-18 09:14:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef DE_CTORS_DEFAULT
0016 #pragma error("This header should never be included directly. Inlcude Detector/DetectorElement.h instead!")
0017 #endif
0018
0019 #ifndef DETECTOR_DEIOV_H
0020 #define DETECTOR_DEIOV_H
0021
0022
0023 namespace gaudi {
0024
0025
0026 namespace detail {
0027
0028
0029 class DeIOVObject;
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 class DeIOVObject : public detail::ConditionObject {
0054 DE_CONDITIONS_TYPEDEFS;
0055 typedef DeStatic::Object static_t;
0056
0057 public:
0058
0059 DeIOVObject* fill_info(DetElement de, Catalog* cat);
0060
0061 public:
0062
0063 DE_CTORS_DEFAULT(DeIOVObject);
0064
0065
0066 virtual void initialize();
0067
0068 void fillCache(ConditionsMap& m);
0069
0070
0071 virtual void print(int indent, int flags) const;
0072
0073 void checkAlignment() const;
0074
0075 DeIOVObject* child(DetElement de) const;
0076
0077 public:
0078
0079 DeStatic de_static;
0080
0081 std::map<DetElement,DeIOVObject*> childCache;
0082
0083 DetElement detector;
0084
0085 Conditions conditions;
0086
0087 Alignment detectorAlignment;
0088
0089 VolumeAlignments volumeAlignments;
0090
0091
0092 TGeoHMatrix toLocalMatrix;
0093
0094 TGeoHMatrix deltaMatrix;
0095
0096 unsigned short de_flags = 0;
0097 unsigned short de_user = 0;
0098
0099 itemkey_type item_key = 0;
0100
0101 public:
0102
0103
0104 static itemkey_type key(const std::string& value)
0105 { return dd4hep::ConditionKey::itemCode(value); }
0106
0107 static itemkey_type key(const char* value)
0108 { return dd4hep::ConditionKey::itemCode(value); }
0109
0110
0111 bool hasCondition(itemkey_type key) const
0112 { return this->condition(key, false).isValid(); }
0113
0114 Condition condition(itemkey_type key) const;
0115
0116 Condition condition(itemkey_type key, bool throw_if) const;
0117
0118
0119 bool hasCondition(const std::string& nam) const
0120 { return this->condition(nam, false).isValid(); }
0121
0122 Condition condition(const std::string& name) const;
0123
0124 Condition condition(const std::string& name, bool throw_if) const;
0125
0126
0127 XYZPoint toLocal( const XYZPoint& global ) const
0128 { return XYZPoint(detectorAlignment.worldToLocal(XYZVector(global))); }
0129 XYZPoint toGlobal( const XYZPoint& local ) const
0130 { return XYZPoint(detectorAlignment.localToWorld(XYZVector(local))); }
0131 XYZVector toLocal( const XYZVector& globalDirection ) const
0132 { return detectorAlignment.worldToLocal(globalDirection); }
0133 XYZVector toGlobal( const XYZVector& localDirection ) const
0134 { return detectorAlignment.localToWorld(localDirection); }
0135
0136 const TGeoHMatrix& toGlobalMatrix() const {
0137 return detectorAlignment.worldTransformation();
0138 }
0139
0140 };
0141 }
0142
0143
0144
0145
0146
0147
0148
0149
0150 class DeIOVElement : public dd4hep::Handle<detail::DeIOVObject> {
0151 DE_CONDITIONS_TYPEDEFS;
0152
0153 typedef detail::DeStaticObject static_t;
0154 typedef detail::DeIOVObject iov_t;
0155
0156 public:
0157
0158 DE_CTORS_HANDLE(DeIOVElement,Base);
0159
0160 static_t& staticData() const { return access()->de_static; }
0161 };
0162 }
0163
0164 #endif