CMS 3D CMS Logo

PreshowerStrip.cc
Go to the documentation of this file.
2 #include <iostream>
3 
8 
10 
12 
14 
16  if (&tr != this) {
17  CaloCellGeometry::operator=(tr);
18  }
19  return *this;
20 }
21 
23  if (corners.uninitialized()) {
24  const GlobalPoint& ctr(getPosition());
25  const CCGFloat x(ctr.x());
26  const CCGFloat y(ctr.y());
27  const CCGFloat z(ctr.z());
28 
29  const double st(sin(tilt()));
30  const double ct(cos(tilt()));
31 
32  for (unsigned int ix(0); ix != 2; ++ix) {
33  const double sx(0 == ix ? -1.0 : +1.0);
34  for (unsigned int iy(0); iy != 2; ++iy) {
35  const double sy(0 == iy ? -1.0 : +1.0);
36  for (unsigned int iz(0); iz != 2; ++iz) {
37  const double sz(0 == iz ? -1.0 : +1.0);
38  const unsigned int i(4 * iz + 2 * ix + (1 == ix ? 1 - iy : iy)); //keeps ordering same as before
39 
40  corners[i] =
41  GlobalPoint(dy() > dx() ? x + sx * dx() : x + sx * dx() * ct - sz * dz() * st,
42  dy() < dx() ? y + sy * dy() : y + sy * dy() * ct - sz * dz() * st,
43  dy() > dx() ? z + sz * dz() * ct + sy * dy() * st : z + sz * dz() * ct + sx * dx() * st);
44  }
45  }
46  }
47  }
48 }
49 
50 std::ostream& operator<<(std::ostream& s, const PreshowerStrip& cell) {
51  s << "Center: " << cell.getPosition() << std::endl;
52  if (cell.param() != nullptr) {
53  s << "dx = " << cell.dx() << ", dy = " << cell.dy() << ", dz = " << cell.dz() << std::endl;
54 
55  const CaloCellGeometry::CornersVec& corners(cell.getCorners());
56  for (unsigned int ci(0); ci != corners.size(); ci++) {
57  s << "Corner: " << corners[ci] << std::endl;
58  }
59  } else {
60  s << " with empty parameters." << std::endl;
61  }
62 
63  return s;
64 }
65 
67  assert(8 == lc.size());
68  assert(nullptr != pv);
69 
70  const CCGFloat dx(pv[0]);
71  const CCGFloat dy(pv[1]);
72  const CCGFloat dz(pv[2]);
73 
74  lc[0] = Pt3D(-dx, -dy, -dz);
75  lc[1] = Pt3D(-dx, dy, -dz);
76  lc[2] = Pt3D(dx, dy, -dz);
77  lc[3] = Pt3D(dx, -dy, -dz);
78  lc[4] = Pt3D(-dx, -dy, dz);
79  lc[5] = Pt3D(-dx, dy, dz);
80  lc[6] = Pt3D(dx, dy, dz);
81  lc[7] = Pt3D(dx, -dy, dz);
82 
83  ref = Pt3D(0, 0, 0);
84 }
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
PreshowerStrip::dz
CCGFloat dz() const
Definition: PreshowerStrip.h:42
DDAxes::y
PreshowerStrip::~PreshowerStrip
~PreshowerStrip() override
Definition: PreshowerStrip.cc:13
mps_fire.i
i
Definition: mps_fire.py:355
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
Tr3D
PreshowerStrip::Tr3D Tr3D
Definition: PreshowerStrip.cc:7
PreshowerStrip::dx
CCGFloat dx() const
Definition: PreshowerStrip.h:40
cms::cuda::assert
assert(be >=bs)
CaloCellGeometry::getCorners
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
Definition: CaloCellGeometry.h:73
DDAxes::x
EZArrayFL< GlobalPoint >
PreshowerStrip::Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: PreshowerStrip.h:26
PreshowerStrip::tilt
CCGFloat tilt() const
Definition: PreshowerStrip.h:43
PreshowerStrip::initCorners
void initCorners(CaloCellGeometry::CornersVec &) override
Definition: PreshowerStrip.cc:22
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PreshowerStrip::operator=
PreshowerStrip & operator=(const PreshowerStrip &tr)
Definition: PreshowerStrip.cc:15
CCGFloat
PreshowerStrip::CCGFloat CCGFloat
Definition: PreshowerStrip.cc:4
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PreshowerStrip::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: PreshowerStrip.h:25
PreshowerStrip::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: PreshowerStrip.h:23
Pt3DVec
PreshowerStrip::Pt3DVec Pt3DVec
Definition: PreshowerStrip.cc:6
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
operator<<
std::ostream & operator<<(std::ostream &s, const PreshowerStrip &cell)
Definition: PreshowerStrip.cc:50
DDAxes::z
PreshowerStrip::PreshowerStrip
PreshowerStrip()
Definition: PreshowerStrip.cc:9
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: CaloCellGeometry.h:80
PreshowerStrip.h
dqmiodatasetharvest.ctr
ctr
Definition: dqmiodatasetharvest.py:191
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
fftjetcommon_cfi.sy
sy
Definition: fftjetcommon_cfi.py:203
PreshowerStrip::dy
CCGFloat dy() const
Definition: PreshowerStrip.h:41
Pt3D
PreshowerStrip::Pt3D Pt3D
Definition: PreshowerStrip.cc:5
PreshowerStrip
A base class to handle the shape of preshower strips.
Definition: PreshowerStrip.h:21
PreshowerStrip::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: PreshowerStrip.cc:66
EZArrayFL::uninitialized
bool uninitialized() const
Definition: EZArrayFL.h:63
PreshowerStrip::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: PreshowerStrip.h:24
fftjetcommon_cfi.sx
sx
Definition: fftjetcommon_cfi.py:202