File indexing completed on 2025-01-18 09:14:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef DETECTOR_DEVP_H
0016 #define DETECTOR_DEVP_H 1
0017
0018
0019 #include "Detector/DeVPSensor.h"
0020 #include "Detector/DeVPGeneric.h"
0021
0022 #define DE_VP_TYPEDEFS(TYP) public: \
0023 DE_CONDITIONS_TYPEDEFS; \
0024 typedef std::vector<DeVPSensor##TYP> Sensors; \
0025 typedef std::vector<DeVPGeneric##TYP> Sides; \
0026 typedef std::vector<DeVPGeneric##TYP> ModuleSupports; \
0027 typedef std::vector<DeVPGeneric##TYP> Modules; \
0028 typedef std::vector<DeVPGeneric##TYP> Ladders
0029
0030
0031
0032 namespace gaudi {
0033
0034
0035 namespace detail {
0036
0037
0038
0039
0040
0041
0042
0043
0044 class DeVPStaticObject : public DeVPGenericStaticObject {
0045 DE_VP_TYPEDEFS(Static);
0046
0047 public:
0048 enum { classID = 8200 };
0049 Sides sides;
0050 ModuleSupports supports;
0051 Modules modules;
0052 Ladders ladders;
0053
0054 double sensitiveVolumeCut = 0e0;
0055 public:
0056
0057 DE_CTORS_DEFAULT(DeVPStaticObject);
0058
0059 virtual void initialize() override;
0060
0061 virtual void print(int indent, int flags) const override;
0062 };
0063 }
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 class DeVPStaticElement : public dd4hep::Handle<detail::DeVPStaticObject> {
0075 DE_VP_TYPEDEFS(Static);
0076 typedef Object static_t;
0077
0078 public:
0079
0080 DE_CTORS_HANDLE(DeVPStaticElement,Base);
0081
0082 size_t numberSensors() const { return ptr()->sensors.size(); }
0083
0084 const std::vector<DeVPSensorStatic>& sensors() const { return ptr()->sensors; }
0085 };
0086
0087
0088 typedef DetectorStaticElement<DeVPStaticElement> DeVPStatic;
0089
0090
0091 namespace detail {
0092
0093
0094
0095
0096
0097
0098
0099
0100 class DeVPObject : public DeVPGenericObject {
0101 DE_VP_TYPEDEFS();
0102 typedef DeVPStatic::Object static_t;
0103
0104 public:
0105 DeVPStatic vp_static;
0106 Sides sides;
0107 ModuleSupports supports;
0108 Modules modules;
0109 Ladders ladders;
0110
0111 public:
0112
0113 DE_CTORS_DEFAULT(DeVPObject);
0114
0115 virtual void initialize() override;
0116
0117 void print(int indent, int flags) const override;
0118 };
0119 }
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129 class DeVPElement : public dd4hep::Handle<detail::DeVPObject> {
0130 DE_VP_TYPEDEFS();
0131 typedef Object::static_t static_t;
0132 typedef Object iov_t;
0133
0134 public:
0135
0136 DE_CTORS_HANDLE(DeVPElement,Base);
0137
0138 static_t& staticData() const { return access()->vp_static; }
0139
0140 size_t numberSensors() const { return ptr()->sensors.size(); }
0141
0142 const std::vector<DeVPSensor>& sensors() const { return ptr()->sensors; }
0143 };
0144
0145
0146 typedef DetectorElement<DeVPElement> DeVP;
0147
0148 }
0149 #endif