File indexing completed on 2024-04-06 12:05:23
0001 #ifndef DETECTOR_DESCRIPTION_CORE_DD_COMPACT_VIEW_H
0002 #define DETECTOR_DESCRIPTION_CORE_DD_COMPACT_VIEW_H
0003
0004 #include <cstddef>
0005 #include <memory>
0006 #include <string>
0007 #include <utility>
0008 #include <vector>
0009 #include <unordered_map>
0010
0011 #include "DetectorDescription/Core/interface/DDRotationMatrix.h"
0012 #include "DetectorDescription/Core/interface/DDTranslation.h"
0013 #include "DetectorDescription/Core/interface/Store.h"
0014 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
0015 #include "DetectorDescription/Core/interface/DDPosData.h"
0016 #include "DetectorDescription/Core/interface/DDTransform.h"
0017 #include "DataFormats/Math/interface/Graph.h"
0018 #include "DataFormats/Math/interface/GraphWalker.h"
0019
0020 class DDCompactViewImpl;
0021 class DDDivision;
0022 class DDName;
0023 struct DDPosData;
0024
0025 namespace DDI {
0026 class LogicalPart;
0027 class Material;
0028 class Solid;
0029 class Specific;
0030 }
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 class DDCompactView {
0082 public:
0083 using Graph = math::Graph<DDLogicalPart, DDPosData*>;
0084 using GraphWalker = math::GraphWalker<DDLogicalPart, DDPosData*>;
0085 using Vectors = std::unordered_map<std::string, std::vector<double>>;
0086
0087
0088 explicit DDCompactView();
0089
0090
0091 explicit DDCompactView(const DDName&);
0092
0093 ~DDCompactView();
0094
0095
0096
0097 explicit DDCompactView(const DDLogicalPart& rootnodedata);
0098
0099
0100 const Graph& graph() const;
0101 GraphWalker walker() const;
0102
0103
0104 const DDLogicalPart& root() const;
0105
0106
0107 const DDPosData* worldPosition() const;
0108
0109
0110 std::vector<double> const& vector(std::string_view iKey) const;
0111
0112 void position(const DDLogicalPart& self,
0113 const DDLogicalPart& parent,
0114 const std::string& copyno,
0115 const DDTranslation& trans,
0116 const DDRotation& rot,
0117 const DDDivision* div = nullptr);
0118
0119 void position(const DDLogicalPart& self,
0120 const DDLogicalPart& parent,
0121 int copyno,
0122 const DDTranslation& trans,
0123 const DDRotation& rot,
0124 const DDDivision* div = nullptr);
0125
0126 void setRoot(const DDLogicalPart& root);
0127
0128 void lockdown();
0129
0130 private:
0131 void swap(DDCompactView&);
0132
0133 std::unique_ptr<DDCompactViewImpl> rep_;
0134 std::unique_ptr<DDPosData> worldpos_;
0135
0136 DDI::Store<DDName, std::unique_ptr<DDI::Material>> matStore_;
0137 DDI::Store<DDName, std::unique_ptr<DDI::Solid>> solidStore_;
0138 DDI::Store<DDName, std::unique_ptr<DDI::LogicalPart>> lpStore_;
0139 DDI::Store<DDName, std::unique_ptr<DDI::Specific>> specStore_;
0140 DDI::Store<DDName, std::unique_ptr<DDRotationMatrix>> rotStore_;
0141
0142 Vectors vectors_;
0143 };
0144
0145 #endif