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
cms::dd::DDCons
Definition: DDShapes.h:52
cms::dd::DDCons::rInPlusZ
double rInPlusZ(void) const
Definition: DDShapes.h:60
cms::dd::DDTrap::valid
const bool valid
Definition: DDShapes.h:116
cms::dd::DDTubs::deltaPhi
double deltaPhi(void) const
Definition: DDShapes.h:39
cms::dd::DDTubs::startPhi
double startPhi(void) const
Definition: DDShapes.h:38
cms::dd::DDTubs::DDTubs
DDTubs(void)=delete
cms::dd::DDBox::halfY
double halfY() const
Definition: DDShapes.h:20
DDSolidShape
DDSolidShape
Definition: DDSolidShapes.h:6
cms::dd::DDTruncTubs::zHalf
double zHalf(void) const
half of the z-Axis
Definition: DDShapes.h:183
cms::dd::DDCons::rmin1_
double rmin1_
Definition: DDShapes.h:69
cms::dd::DDCons::dz_
double dz_
Definition: DDShapes.h:68
cms::dd::DDTruncTubs::valid
const bool valid
Definition: DDShapes.h:206
cms::dd::DDTrap
Definition: DDShapes.h:78
cms::dd::DDCons::valid
const bool valid
Definition: DDShapes.h:65
cms::dd::DDTrap::x1_
double x1_
Definition: DDShapes.h:122
cms::dd::DDTruncTubs::DDTruncTubs
DDTruncTubs(void)=delete
cms::dd::DDCons::rmin2_
double rmin2_
Definition: DDShapes.h:71
cms::dd::DDTubs::rIn
double rIn(void) const
Definition: DDShapes.h:36
cms::dd::DDTubs::rOut_
double rOut_
Definition: DDShapes.h:46
cms::dd::DDTrap::y2_
double y2_
Definition: DDShapes.h:125
cms::dd::DDTrap::x2_
double x2_
Definition: DDShapes.h:123
cms::dd::DDTruncTubs::deltaPhi_
double deltaPhi_
Definition: DDShapes.h:213
cms::dd::DDTubs
Definition: DDShapes.h:30
cms::DDFilteredView
Definition: DDFilteredView.h:65
cms::dd::DDTruncTubs::rIn_
double rIn_
Definition: DDShapes.h:210
cms::dd::DDTrap::alpha2_
double alpha2_
Definition: DDShapes.h:129
cms::dd::DDBox::halfZ
double halfZ() const
Definition: DDShapes.h:21
cms::dd::DDTruncTubs::rOut
double rOut(void) const
outer radius
Definition: DDShapes.h:189
cms::dd::DDCons::rmax1_
double rmax1_
Definition: DDShapes.h:70
cms::dd::DDCons::phiFrom
double phiFrom(void) const
Definition: DDShapes.h:62
cms::dd::DDTrap::alpha1_
double alpha1_
Definition: DDShapes.h:128
cms::dd::DDCons::rInMinusZ
double rInMinusZ(void) const
Definition: DDShapes.h:58
cms::dd::DDTrap::DDTrap
DDTrap(void)=delete
cms::dd::DDTubs::deltaPhi_
double deltaPhi_
Definition: DDShapes.h:48
cms::dd::DDCons::rOutPlusZ
double rOutPlusZ(void) const
Definition: DDShapes.h:61
cms::dd::DDTruncTubs::cutInside_
bool cutInside_
Definition: DDShapes.h:216
cms::dd::DDBox::halfX
double halfX() const
Definition: DDShapes.h:19
cms::dd::DDTubs::startPhi_
double startPhi_
Definition: DDShapes.h:47
cms::dd::DDCons::rmax2_
double rmax2_
Definition: DDShapes.h:72
DDFilteredView.h
cms::dd::DDCons::DDCons
DDCons(void)=delete
cms::dd::DDBox::dz_
double dz_
Definition: DDShapes.h:26
cms::dd::DDTrap::phi
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDShapes.h:90
createTree.dd
string dd
Definition: createTree.py:154
cms::dd::getCurrentShape
DDSolidShape getCurrentShape(const cms::DDFilteredView &fview)
Definition: DDShapes.cc:19
cms::DDSolidShape
DDSolidShape
Definition: DDSolidShapes.h:62
cms::dd::DDBox
Definition: DDShapes.h:14
cms::dd::DDTruncTubs::deltaPhi
double deltaPhi(void) const
angular span of the tube-section
Definition: DDShapes.h:195
cms::dd::DDTruncTubs::rOut_
double rOut_
Definition: DDShapes.h:211
cms::dd::DDCons::phi2_
double phi2_
Definition: DDShapes.h:74
cms::dd::DDCons::phi1_
double phi1_
Definition: DDShapes.h:73
cms::dd::DDTubs::valid
const bool valid
Definition: DDShapes.h:41
cms::dd::DDTrap::x1
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDShapes.h:96
cms::dd::DDTrap::x4
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDShapes.h:108
cms::dd::DDTruncTubs::cutAtStart
double cutAtStart(void) const
truncation at begin of the tube-section
Definition: DDShapes.h:198
cms::dd::DDTrap::halfZ
double halfZ(void) const
half of the z-Axis
Definition: DDShapes.h:84
cms::dd::DDTruncTubs::startPhi_
double startPhi_
Definition: DDShapes.h:212
cms::dd::DDTubs::zHalf_
double zHalf_
Definition: DDShapes.h:44
cms::dd::DDBox::dx_
double dx_
Definition: DDShapes.h:26
cms::dd::DDCons::rOutMinusZ
double rOutMinusZ(void) const
Definition: DDShapes.h:59
cms::dd::DDTruncTubs::cutAtDelta
double cutAtDelta(void) const
truncation at end of the tube-section
Definition: DDShapes.h:201
cms::dd::DDTruncTubs::zHalf_
double zHalf_
Definition: DDShapes.h:209
cms::dd::DDTrap::x2
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDShapes.h:99
cms::dd::DDTrap::x4_
double x4_
Definition: DDShapes.h:127
cms::dd::DDTrap::alpha1
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
cms::dd::DDTrap::y1_
double y1_
Definition: DDShapes.h:124
cms::dd::DDTrap::x3
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDShapes.h:105
cms::dd::DDTubs::rOut
double rOut(void) const
Definition: DDShapes.h:37
cms::dd::DDTrap::y1
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDShapes.h:93
cms::dd::DDTrap::x3_
double x3_
Definition: DDShapes.h:126
cms::dd::DDBox::DDBox
DDBox(void)=delete
cms::dd::DDBox::valid
const bool valid
Definition: DDShapes.h:23
cms::dd::DDTruncTubs::cutAtDelta_
double cutAtDelta_
Definition: DDShapes.h:215
cms::dd::DDTubs::zhalf
double zhalf(void) const
Definition: DDShapes.h:35
cms::dd::DDCons::zhalf
double zhalf(void) const
Definition: DDShapes.h:57
cms::dd::DDTrap::halfZ_
double halfZ_
Definition: DDShapes.h:119
cms::dd::DDTrap::y2
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDShapes.h:102
cms::dd::DDTrap::phi_
double phi_
Definition: DDShapes.h:121
cms::dd::DDBox::dy_
double dy_
Definition: DDShapes.h:26
cms::dd::DDTrap::alpha2
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
cms::dd::DDTubs::rIn_
double rIn_
Definition: DDShapes.h:45
cms::dd::DDCons::deltaPhi
double deltaPhi(void) const
Definition: DDShapes.h:63
cms::dd::DDTruncTubs::cutAtStart_
double cutAtStart_
Definition: DDShapes.h:214
cms::dd::DDTruncTubs::rIn
double rIn(void) const
inner radius
Definition: DDShapes.h:186
cms::dd::DDTruncTubs::startPhi
double startPhi(void) const
angular start of the tube-section
Definition: DDShapes.h:192
cms::dd::DDTrap::theta
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDShapes.h:87
cms::dd::DDTruncTubs
A truncated tube section.
Definition: DDShapes.h:177
cms::dd::DDTruncTubs::cutInside
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
Definition: DDShapes.h:204
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
cms::dd::DDTrap::theta_
double theta_
Definition: DDShapes.h:120