Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:37

0001 #ifndef ECALCOMMONDATA_ECALTRAPEZOIDPARAMETERS_H
0002 #define ECALCOMMONDATA_ECALTRAPEZOIDPARAMETERS_H
0003 // -*- C++ -*-
0004 //
0005 // Package:     EcalCommonData
0006 // Module:      EcalTrapezoidParameters
0007 //
0008 // Description: Dimensionally, all you need to know about a trapezoid
0009 //
0010 // Usage:
0011 //        This class exists because there are many lengths and
0012 //        angles of interest in a trapezoidal polyhedron,
0013 //        and it makes more sense to put them in one place.
0014 //
0015 //
0016 //        Our naming convention is as follows: lower case abcdh at +Z
0017 //                                             upper case ABCDH at -Z
0018 //                                             L = full length in Z
0019 //                                             a1, a4 = angles at vertices 1,4
0020 //                                             hXx = perp distance between X, x
0021 //                                             (x15,y15) = coord of v5 wrt v1
0022 //                                 B
0023 //    6____________________________________________________________________ 7
0024 //     \                   /\                                             /
0025 //      \                  |                                           /
0026 //       \                hBb      b                                  /
0027 //        \        2 _____\/__________________________ 3            /
0028 //         \         \              /\               /            /
0029 //          \         \             |              /            /
0030 //           \         \            |            /            /
0031 //            \         \           |          /            /
0032 //          D  \       d \          h        / c          /   C    Y
0033 //              \         \         |      /            /         ^
0034 //               \         \ a1     |    /            /           |
0035 //                \         \______\/__/            /             |
0036 //                 \       1/\     a   4          /               |
0037 //                  \       |                   /                 |_____ X
0038 //                   \      |                 /                   /
0039 //                    \  y15=hAa            /                   /
0040 //                     \    |      a4     /                   /
0041 //                      \__\/___________/                    Z (out of page)
0042 //                    5 |   |   A       8
0043 //                  --->|x15|<----
0044 //
0045 //
0046 //        Specifying the minimal parameters for a GEANT TRAP
0047 //        requires 9 numbers, *NOT* 11 as used in GEANT or DDD.
0048 //
0049 //        We choose the following 9:
0050 //                    L/2, a/2, b/2, h/2, a1, A/2, H/2, hAa, x15
0051 //        In GEANT these correspond to
0052 //                    dz,  bl2, tl2,  h2,  -, bl1,  h1,   -,   -
0053 //
0054 // Author:      Brian K. Heltsley
0055 // Created:     Wed Aug 12 09:25:08 EDT 1998
0056 
0057 #include <vector>
0058 #include <CLHEP/Geometry/Point3D.h>
0059 
0060 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0061 
0062 class EcalTrapezoidParameters {
0063 public:
0064   using VertexList = CaloCellGeometry::Pt3DVec;
0065   using TPFloat = CaloCellGeometry::CCGFloat;
0066 
0067   EcalTrapezoidParameters(TPFloat aHalfLengthXNegZLoY,  // bl1, A/2
0068                           TPFloat aHalfLengthXPosZLoY,  // bl2, a/2
0069                           TPFloat aHalfLengthXPosZHiY,  // tl2, b/2
0070                           TPFloat aHalfLengthYNegZ,     // h1,  H/2
0071                           TPFloat aHalfLengthYPosZ,     // h2,  h/2
0072                           TPFloat aHalfLengthZ,         // dz,  L/2
0073                           TPFloat aAngleAD,             // alfa1
0074                           TPFloat aCoord15X,            // x15
0075                           TPFloat aCoord15Y             // y15
0076   );
0077 
0078   // GEANT parameters, in order
0079   TPFloat dz() const;
0080   TPFloat theta() const;
0081   TPFloat phi() const;
0082   TPFloat h1() const;
0083   TPFloat bl1() const;
0084   TPFloat tl1() const;
0085   TPFloat alp1() const;
0086   TPFloat h2() const;
0087   TPFloat bl2() const;
0088   TPFloat tl2() const;
0089   TPFloat alp2() const;
0090 
0091   // everything else
0092   TPFloat x15() const;
0093   TPFloat y15() const;
0094   TPFloat hAa() const;
0095   TPFloat hBb() const;
0096   TPFloat hCc() const;
0097   TPFloat hDd() const;
0098   TPFloat a1() const;
0099   TPFloat a4() const;
0100 
0101   TPFloat L() const;
0102   TPFloat a() const;
0103   TPFloat b() const;
0104   TPFloat c() const;
0105   TPFloat d() const;
0106   TPFloat h() const;
0107   TPFloat A() const;
0108   TPFloat B() const;
0109   TPFloat C() const;
0110   TPFloat D() const;
0111   TPFloat H() const;
0112 
0113   VertexList vertexList() const;  // order is as in picture above: index=vtx-1
0114 
0115   EcalTrapezoidParameters() = delete;
0116   EcalTrapezoidParameters(const EcalTrapezoidParameters&) = delete;
0117   const EcalTrapezoidParameters& operator=(const EcalTrapezoidParameters&) = delete;
0118 
0119 private:
0120   TPFloat m_dz, m_th, m_ph, m_h1, m_bl1, m_tl1, m_alp1, m_h2, m_bl2, m_tl2, m_alp2;
0121   TPFloat m_a1, m_hAa, m_x15, m_y15;
0122   TPFloat m_a4, m_hBb, m_hCc, m_hDd;
0123   TPFloat m_L, m_a, m_b, m_c, m_d, m_h, m_A, m_B, m_C, m_D, m_H;
0124 };
0125 
0126 #endif /* ECALCOMMONDATA_ECALTRAPEZOIDPARAMETERS_H */