13 typedef HepGeom::Vector3D<CCGFloat>
FVec3D ;
14 typedef HepGeom::Plane3D<CCGFloat>
Plane3D ;
16 typedef HepGeom::Vector3D<double>
DVec3D ;
18 typedef HepGeom::Point3D<double>
DPt3D ;
23 m_corOne ( 0., 0., 0. ), m_local (0., 0., 0.),
24 m_global ( 0., 0., 0. ) {
32 CaloCellGeometry::operator=( tr ) ;
42 <<
" eta " <<
etaPos() <<
" phi " <<
phiPos() <<
" Translation " 43 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
61 std::cout <<
"FlatTrd: Local " << m_local <<
" Global " << glb <<
" eta " 63 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
77 std::cout <<
"FlatTrd: Local " << m_local <<
" Global " << glb <<
" eta " 79 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
89 std::cout <<
"FlatTrd: Local " << m_local <<
" Global " << glb <<
" eta " 91 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
100 std::cout <<
"FlatTrd::Local " << local.x() <<
":" << local.y() <<
":" 101 << local.z() <<
" Global " << glb.x() <<
":" << glb.y() <<
":" 102 << glb.z() <<
" TR " <<
m_tr.xx() <<
":" <<
m_tr.xy() <<
":" 103 <<
m_tr.xz() <<
":" <<
m_tr.yx() <<
":" <<
m_tr.yy() <<
":" 104 <<
m_tr.yz() <<
":" <<
m_tr.zx() <<
":" <<
m_tr.zy() <<
":" 105 <<
m_tr.zz() <<
":" <<
m_tr.dx() <<
":" <<
m_tr.dy() <<
":" 106 <<
m_tr.dz() << std::endl;
114 std::cout <<
"FlatTrd::Global " << global.
x() <<
":" << global.
y() <<
":" 115 << global.
z() <<
" Local " << local.x() <<
":" << local.y() <<
":" 116 << local.z() << std::endl;
141 std::vector<GlobalPoint>& co ) {
143 assert( 11 <= pv.size() ) ;
144 assert( 8 == co.size() ) ;
152 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i ) {
154 const Pt3D &
p ( ko[
i] ) ;
157 std::cout <<
"Corner[" << i <<
"] = " << co[
i] << std::endl;
165 assert(
nullptr != pv ) ;
166 assert( 8 == lc.size() ) ;
176 lc[0] =
Pt3D ( - h*ta1 - bl, - h , -dz );
177 lc[1] =
Pt3D ( + h*ta1 - tl, + h , -dz );
178 lc[2] =
Pt3D ( + h*ta1 + tl, + h , -dz );
179 lc[3] =
Pt3D ( - h*ta1 + bl, - h , -dz );
180 lc[4] =
Pt3D ( - h*ta1 - bl, - h , dz );
181 lc[5] =
Pt3D ( + h*ta1 - tl, + h , dz );
182 lc[6] =
Pt3D ( + h*ta1 + tl, + h , dz );
183 lc[7] =
Pt3D ( - h*ta1 + bl, - h , dz );
185 ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
187 std::cout <<
"Ref " << ref <<
" Local Corners " << lc[0] <<
"|" << lc[1]
188 <<
"|" << lc[2] <<
"|" << lc[3] <<
"|" << lc[4] <<
"|" << lc[5]
189 <<
"|" << lc[6] <<
"|" << lc[7] << std::endl;
195 const Pt3D gFront ( p.
x(), p.
y(), p.
z() ) ;
196 const DPt3D dgFront ( p.
x(), p.
y(), p.
z() ) ;
199 assert(
nullptr !=
param() ) ;
200 std::vector<Pt3D > lc( 8,
Pt3D(0,0,0) ) ;
205 Pt3D lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ;
207 const DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ;
208 const DPt3D dlBack ( lBack.x() , lBack.y() , lBack.z() ) ;
209 const DPt3D dlOne ( lc[0].
x() , lc[0].
y() , lc[0].
z() ) ;
215 const DPt3D dgBack ( dgFront + ( dlBack - dlFront ).
mag()*dgAxis ) ;
216 DPt3D dgOne ( dgFront + ( dlOne - dlFront ).
mag()*( dmOne - dgFront ).
unit() ) ;
218 const double dlangle ( ( dlBack - dlFront).
angle( dlOne - dlFront ) ) ;
219 const double dgangle ( ( dgBack - dgFront).
angle( dgOne - dgFront ) ) ;
220 const double dangle ( dlangle - dgangle ) ;
222 if( 1.
e-6 < fabs(dangle) ) {
223 const DPlane3D dgPl ( dgFront, dgOne, dgBack ) ;
224 const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ;
226 DPt3D dgOld ( dgOne ) ;
228 dgOne = ( dgFront + HepGeom::Rotate3D( -dangle, dgFront, dp2 )*
229 DVec3D( dgOld - dgFront ) ) ;
232 tr =
Tr3D( dlFront , dlBack , dlOne ,
233 dgFront , dgBack , dgOne ) ;
235 if(
nullptr != lptr ) (*lptr) = lc ;
246 for (
unsigned int i ( 0 ) ;
i != 8 ; ++
i ) {
247 const Pt3D corn ( tr*lc[
i] ) ;
248 corners[
i] =
GlobalPoint( corn.x(), corn.y(), corn.z() ) ;
262 GlobalPoint global(global_b.x(),global_b.y(),global_b.z());
271 <<
" phi " << cell.
phiPos() << std::endl;
274 for (
unsigned int i=0 ;
i != corners.size() ; ++
i ) {
275 s <<
"Corner: " << corners[
i] << std::endl;
const GlobalVector & axis() const
A base class to handle the particular shape of HGCal volumes.
HepGeom::Point3D< double > DPt3D
FlatTrd & operator=(const FlatTrd &tr)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
CaloCellGeometry::Pt3D Pt3D
HepGeom::Point3D< double > DPt3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
FlatTrd::CCGFloat CCGFloat
HepGeom::Plane3D< CCGFloat > Plane3D
Geom::Theta< T > theta() const
const CCGFloat * param() const
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
CaloCellGeometry::CCGFloat CCGFloat
HepGeom::Vector3D< CCGFloat > FVec3D
Tan< T >::type tan(const T &t)
GlobalPoint backCtr(void) const
HepGeom::Vector3D< double > DVec3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
HepGeom::Plane3D< double > DPlane3D
Vector3DBase unit() const
Pt3D getLocal(const GlobalPoint &global) const
GlobalVector makeAxis(void)
HepGeom::Plane3D< double > DPlane3D
void initCorners(CornersVec &) override
HepGeom::Point3D< CCGFloat > Pt3D
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
std::vector< std::vector< double > > tmp
bool uninitialized() const
CaloCellGeometry::Tr3D Tr3D
CCGFloat getThetaAxis() const
virtual float phiPos() const
std::ostream & operator<<(std::ostream &s, const FlatTrd &cell)
virtual float etaPos() const
CCGFloat getPhiAxis() const
HepGeom::Vector3D< CCGFloat > FVec3D
Global3DVector GlobalVector
T angle(T x1, T y1, T z1, T x2, T y2, T z2)