CMS 3D CMS Logo

DDShapes.h
Go to the documentation of this file.
1 #ifndef Detector_Description_DDCMS_DDShapes_h
2 #define Detector_Description_DDCMS_DDShapes_h
3 
5 
6 namespace cms {
7 
8  enum class DDSolidShape;
9 
10  namespace dd {
11 
13 
14  class DDBox {
15  public:
16  DDBox(const cms::DDFilteredView &fview);
17  DDBox(void) = delete;
18 
19  double halfX() const { return (dx_); }
20  double halfY() const { return (dy_); }
21  double halfZ() const { return (dz_); }
22 
23  const bool valid; // Tells if DDBox contains valid values
24 
25  private:
26  double dx_, dy_, dz_;
27  };
28 
29  // A tube section
30  class DDTubs {
31  public:
32  DDTubs(const cms::DDFilteredView &fview);
33  DDTubs(void) = delete;
34 
35  double zhalf(void) const { return (zHalf_); }
36  double rIn(void) const { return (rIn_); }
37  double rOut(void) const { return (rOut_); }
38  double startPhi(void) const { return (startPhi_); }
39  double deltaPhi(void) const { return (deltaPhi_); }
40 
41  const bool valid;
42 
43  private:
44  double zHalf_;
45  double rIn_;
46  double rOut_;
47  double startPhi_;
48  double deltaPhi_;
49  };
50 
51  // A cone section
52  class DDCons {
53  public:
54  DDCons(const cms::DDFilteredView &fview);
55  DDCons(void) = delete;
56 
57  double zhalf(void) const { return (dz_); }
58  double rInMinusZ(void) const { return (rmin1_); }
59  double rOutMinusZ(void) const { return (rmax1_); }
60  double rInPlusZ(void) const { return (rmin2_); }
61  double rOutPlusZ(void) const { return (rmax2_); }
62  double phiFrom(void) const { return (phi1_); }
63  double deltaPhi(void) const { return (phi2_); }
64 
65  const bool valid; // Tells if DDCons contains valid values
66 
67  private:
68  double dz_;
69  double rmin1_;
70  double rmax1_;
71  double rmin2_;
72  double rmax2_;
73  double phi1_;
74  double phi2_;
75  };
76 
77  // A simple trapezoid
78  class DDTrap {
79  public:
80  DDTrap(const cms::DDFilteredView &fview);
81  DDTrap(void) = delete;
82 
84  double halfZ(void) const { return (halfZ_); }
85 
87  double theta(void) const { return (theta_); }
88 
90  double phi(void) const { return (phi_); }
91 
93  double y1(void) const { return (y1_); }
94 
96  double x1(void) const { return (x1_); }
97 
99  double x2(void) const { return (x2_); }
100 
102  double y2(void) const { return (y2_); }
103 
105  double x3(void) const { return (x3_); }
106 
108  double x4(void) const { return (x4_); }
109 
111  double alpha1(void) const { return (alpha1_); }
112 
114  double alpha2(void) const { return (alpha2_); }
115 
116  const bool valid;
117 
118  private:
119  double halfZ_;
120  double theta_;
121  double phi_;
122  double x1_;
123  double x2_;
124  double y1_;
125  double y2_;
126  double x3_;
127  double x4_;
128  double alpha1_;
129  double alpha2_;
130  };
131 
132  // A pseudo-trapezoid, that is, a trapezoid with a cylinder.
133  // This shape is obsolete. This commented-out code can be removed after we are sure
134  // it won't be needed with DD4hep.
135  // The code does not work correctly.
136  /*
137  class DDPseudoTrap {
138  public:
139  DDPseudoTrap(const cms::DDFilteredView &fview);
140  DDPseudoTrap(void) = delete;
141 
143  double halfZ(void) const { return (dz_); }
144  //
146  double x1(void) const { return (minusX_); }
147 
149  double x2(void) const { return (plusX_); }
150 
152  double y1(void) const { return (minusY_); }
153 
155  double y2(void) const { return (plusY_); }
156 
158  double radius(void) const { return (rmax_); }
159 
161  bool atMinusZ(void) const { return (minusZSide_); }
162 
163  const bool valid; // Tells if shape contains valid values
164 
165  private:
166  double dz_;
167  double minusX_;
168  double plusX_;
169  double minusY_;
170  double plusY_;
171  double rmax_;
172  bool minusZSide_;
173  };
174  */
175 
177  class DDTruncTubs {
178  public:
179  DDTruncTubs(const cms::DDFilteredView &fview);
180  DDTruncTubs(void) = delete;
181 
183  double zHalf(void) const { return (zHalf_); }
184 
186  double rIn(void) const { return (rIn_); }
187 
189  double rOut(void) const { return (rOut_); }
190 
192  double startPhi(void) const { return (startPhi_); }
193 
195  double deltaPhi(void) const { return (deltaPhi_); }
196 
198  double cutAtStart(void) const { return (cutAtStart_); }
199 
201  double cutAtDelta(void) const { return (cutAtDelta_); }
202 
204  bool cutInside(void) const { return (cutInside_); }
205 
206  const bool valid;
207 
208  private:
209  double zHalf_;
210  double rIn_;
211  double rOut_;
212  double startPhi_;
213  double deltaPhi_;
214  double cutAtStart_;
215  double cutAtDelta_;
217  };
218  } // namespace dd
219 } // namespace cms
220 
221 #endif
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDShapes.h:93
double startPhi_
Definition: DDShapes.h:47
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
Definition: DDShapes.h:204
double phiFrom(void) const
Definition: DDShapes.h:62
double zHalf_
Definition: DDShapes.h:44
double alpha2_
Definition: DDShapes.h:129
double deltaPhi(void) const
angular span of the tube-section
Definition: DDShapes.h:195
DDSolidShape getCurrentShape(const cms::DDFilteredView &fview)
Definition: DDShapes.cc:19
double halfZ() const
Definition: DDShapes.h:21
double halfZ(void) const
half of the z-Axis
Definition: DDShapes.h:84
const bool valid
Definition: DDShapes.h:41
double zHalf(void) const
half of the z-Axis
Definition: DDShapes.h:183
const bool valid
Definition: DDShapes.h:116
double rIn_
Definition: DDShapes.h:45
double dx_
Definition: DDShapes.h:26
double rmin2_
Definition: DDShapes.h:71
double theta_
Definition: DDShapes.h:120
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDShapes.h:99
double rOutPlusZ(void) const
Definition: DDShapes.h:61
DDBox(void)=delete
double rIn(void) const
Definition: DDShapes.h:36
double zhalf(void) const
Definition: DDShapes.h:57
double rOut(void) const
outer radius
Definition: DDShapes.h:189
double rOut_
Definition: DDShapes.h:46
double startPhi(void) const
Definition: DDShapes.h:38
double dz_
Definition: DDShapes.h:68
double alpha1_
Definition: DDShapes.h:128
double startPhi(void) const
angular start of the tube-section
Definition: DDShapes.h:192
const bool valid
Definition: DDShapes.h:23
double deltaPhi(void) const
Definition: DDShapes.h:63
double phi1_
Definition: DDShapes.h:73
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDShapes.h:102
double rOutMinusZ(void) const
Definition: DDShapes.h:59
double halfX() const
Definition: DDShapes.h:19
double dy_
Definition: DDShapes.h:26
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDShapes.h:87
const bool valid
Definition: DDShapes.h:206
double dz_
Definition: DDShapes.h:26
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
Definition: DDShapes.h:111
double rmax1_
Definition: DDShapes.h:70
double rIn(void) const
inner radius
Definition: DDShapes.h:186
const bool valid
Definition: DDShapes.h:65
double rmax2_
Definition: DDShapes.h:72
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDShapes.h:105
double rmin1_
Definition: DDShapes.h:69
Namespace of DDCMS conversion namespace.
double halfZ_
Definition: DDShapes.h:119
double cutAtDelta(void) const
truncation at end of the tube-section
Definition: DDShapes.h:201
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
Definition: DDShapes.h:114
double rInPlusZ(void) const
Definition: DDShapes.h:60
double zhalf(void) const
Definition: DDShapes.h:35
A truncated tube section.
Definition: DDShapes.h:177
double rInMinusZ(void) const
Definition: DDShapes.h:58
DDSolidShape
Definition: DDSolidShapes.h:6
double rOut(void) const
Definition: DDShapes.h:37
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDShapes.h:96
double halfY() const
Definition: DDShapes.h:20
double cutAtStart(void) const
truncation at begin of the tube-section
Definition: DDShapes.h:198
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDShapes.h:90
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDShapes.h:108
double phi2_
Definition: DDShapes.h:74
double deltaPhi_
Definition: DDShapes.h:48
double deltaPhi(void) const
Definition: DDShapes.h:39
DDSolidShape
Definition: DDSolidShapes.h:62