CMS 3D CMS Logo

IdealZDCTrapezoid.cc
Go to the documentation of this file.
2 #include <cmath>
3 
7 
9 
11 
13  if (&idzt != this)
14  CaloCellGeometry::operator=(idzt);
15  return *this;
16 }
17 
19  : CaloCellGeometry(faceCenter, mgr, parm) {
20  initSpan();
21 }
22 
24 
25 CCGFloat IdealZDCTrapezoid::an() const { return param()[0]; }
26 
27 CCGFloat IdealZDCTrapezoid::dx() const { return param()[1]; }
28 
29 CCGFloat IdealZDCTrapezoid::dy() const { return param()[2]; }
30 
31 CCGFloat IdealZDCTrapezoid::dz() const { return param()[3]; }
32 
33 CCGFloat IdealZDCTrapezoid::ta() const { return tan(an()); }
34 
35 CCGFloat IdealZDCTrapezoid::dt() const { return dy() * ta(); }
36 
37 void IdealZDCTrapezoid::vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const { localCorners(vec, pv, ref); }
38 
40  assert(8 == lc.size());
41  assert(nullptr != pv);
42 
43  const CCGFloat an(pv[0]);
44  const CCGFloat dx(pv[1]);
45  const CCGFloat dy(pv[2]);
46  const CCGFloat dz(pv[3]);
47  const CCGFloat ta(tan(an));
48  const CCGFloat dt(dy * ta);
49 
50  lc[0] = Pt3D(-dx, -dy, +dz + dt);
51  lc[1] = Pt3D(-dx, +dy, +dz - dt);
52  lc[2] = Pt3D(+dx, +dy, +dz - dt);
53  lc[3] = Pt3D(+dx, -dy, +dz + dt);
54  lc[4] = Pt3D(-dx, -dy, -dz + dt);
55  lc[5] = Pt3D(-dx, +dy, -dz - dt);
56  lc[6] = Pt3D(+dx, +dy, -dz - dt);
57  lc[7] = Pt3D(+dx, -dy, -dz + dt);
58 
59  ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
60 }
61 
63  if (corners.uninitialized()) {
64  const GlobalPoint& p(getPosition());
65  const CCGFloat zsign(0 < p.z() ? 1. : -1.);
66  const Pt3D gf(p.x(), p.y(), p.z());
67 
68  Pt3D lf;
69  Pt3DVec lc(8, Pt3D(0, 0, 0));
70  localCorners(lc, param(), lf);
71  const Pt3D lb(lf.x(), lf.y(), lf.z() - 2. * dz());
72  const Pt3D ls(lf.x() - dx(), lf.y(), lf.z());
73 
74  const Pt3D gb(gf.x(), gf.y(), gf.z() + 2. * zsign * dz());
75 
76  const Pt3D gs(gf.x() - zsign * dx(), gf.y(), gf.z());
77 
78  const HepGeom::Transform3D tr(lf, lb, ls, gf, gb, gs);
79 
80  for (unsigned int i(0); i != 8; ++i) {
81  const Pt3D gl(tr * lc[i]);
82  corners[i] = GlobalPoint(gl.x(), gl.y(), gl.z());
83  }
84  }
85 }
86 
87 std::ostream& operator<<(std::ostream& s, const IdealZDCTrapezoid& cell) {
88  s << "Center: " << cell.getPosition() << std::endl;
89  s << "TiltAngle = " << cell.an() * 180. / M_PI << " deg, dx = " << cell.dx() << ", dy = " << cell.dy()
90  << ", dz = " << cell.dz() << std::endl;
91  return s;
92 }
IdealZDCTrapezoid::IdealZDCTrapezoid
IdealZDCTrapezoid()
Definition: IdealZDCTrapezoid.cc:8
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
gf
double gf
Definition: hdecay.h:34
IdealZDCTrapezoid::dx
CCGFloat dx() const
Definition: IdealZDCTrapezoid.cc:27
mps_fire.i
i
Definition: mps_fire.py:428
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
cms::cuda::assert
assert(be >=bs)
IdealZDCTrapezoid.h
EZArrayFL< GlobalPoint >
gs
Definition: AbsArchive.cc:46
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: IdealZDCTrapezoid.cc:6
IdealZDCTrapezoid::initCorners
void initCorners(CaloCellGeometry::CornersVec &) override
Definition: IdealZDCTrapezoid.cc:62
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: IdealZDCTrapezoid.cc:4
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
CaloCellGeometry::initSpan
void initSpan()
Definition: CaloCellGeometry.h:120
IdealZDCTrapezoid::an
CCGFloat an() const
Definition: IdealZDCTrapezoid.cc:25
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: CaloCellGeometry.h:80
IdealZDCTrapezoid::dy
CCGFloat dy() const
Definition: IdealZDCTrapezoid.cc:29
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
IdealZDCTrapezoid::dz
CCGFloat dz() const
Definition: IdealZDCTrapezoid.cc:31
IdealZDCTrapezoid::operator=
IdealZDCTrapezoid & operator=(const IdealZDCTrapezoid &idzt)
Definition: IdealZDCTrapezoid.cc:12
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
IdealZDCTrapezoid::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZDCTrapezoid.cc:39
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
IdealZDCTrapezoid::dt
CCGFloat dt() const
Definition: IdealZDCTrapezoid.cc:35
IdealZDCTrapezoid::vocalCorners
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: IdealZDCTrapezoid.cc:37
EZMgrFL
Definition: EZMgrFL.h:8
IdealZDCTrapezoid::~IdealZDCTrapezoid
~IdealZDCTrapezoid() override
Definition: IdealZDCTrapezoid.cc:23
operator<<
std::ostream & operator<<(std::ostream &s, const IdealZDCTrapezoid &cell)
Definition: IdealZDCTrapezoid.cc:87
IdealZDCTrapezoid::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZDCTrapezoid.h:25
Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZDCTrapezoid.cc:5
EZArrayFL::uninitialized
bool uninitialized() const
Definition: EZArrayFL.h:63
IdealZDCTrapezoid::ta
CCGFloat ta() const
Definition: IdealZDCTrapezoid.cc:33
IdealZDCTrapezoid
Definition: IdealZDCTrapezoid.h:22