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();
55 m_axis ( ( bCtr - fCtr ).
unit() ) ,
56 m_corOne ( cor1.
x(), cor1.
y(), cor1.
z() ),
57 m_local (0., 0., 0.) {
62 std::cout <<
"FlatTrd: Local " << m_local <<
" Global " << glb <<
" eta "
64 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
71 m_corOne ( corn[0].
x(), corn[0].
y(), corn[0].
z() ),
72 m_local (0., 0., 0.) {
78 std::cout <<
"FlatTrd: Local " << m_local <<
" Global " << glb <<
" eta "
80 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
90 std::cout <<
"FlatTrd: Local " << m_local <<
" Global " << glb <<
" eta "
92 <<
m_tr.getTranslation() <<
" and rotation " <<
m_tr.getRotation();
128 std::vector<GlobalPoint>& co ) {
130 assert( 11 <= pv.size() ) ;
131 assert( 8 == co.size() ) ;
139 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i ) {
141 const Pt3D &
p ( ko[
i] ) ;
144 std::cout <<
"Corner[" << i <<
"] = " << co[
i] << std::endl;
153 assert( 8 == lc.size() ) ;
163 lc[0] =
Pt3D ( - h*ta1 - bl, - h , -dz );
164 lc[1] =
Pt3D ( + h*ta1 - tl, + h , -dz );
165 lc[2] =
Pt3D ( + h*ta1 + tl, + h , -dz );
166 lc[3] =
Pt3D ( - h*ta1 + bl, - h , -dz );
167 lc[4] =
Pt3D ( - h*ta1 - bl, - h , dz );
168 lc[5] =
Pt3D ( + h*ta1 - tl, + h , dz );
169 lc[6] =
Pt3D ( + h*ta1 + tl, + h , dz );
170 lc[7] =
Pt3D ( - h*ta1 + bl, - h , dz );
172 ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
174 std::cout <<
"Ref " << ref <<
" Local Corners " << lc[0] <<
"|" << lc[1]
175 <<
"|" << lc[2] <<
"|" << lc[3] <<
"|" << lc[4] <<
"|" << lc[5]
176 <<
"|" << lc[6] <<
"|" << lc[7] << std::endl;
182 const Pt3D gFront ( p.
x(), p.
y(), p.
z() ) ;
183 const DPt3D dgFront ( p.
x(), p.
y(), p.
z() ) ;
187 std::vector<Pt3D > lc( 8,
Pt3D(0,0,0) ) ;
192 Pt3D lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ;
194 const DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ;
195 const DPt3D dlBack ( lBack.x() , lBack.y() , lBack.z() ) ;
196 const DPt3D dlOne ( lc[0].
x() , lc[0].
y() , lc[0].
z() ) ;
202 const DPt3D dgBack ( dgFront + ( dlBack - dlFront ).
mag()*dgAxis ) ;
203 DPt3D dgOne ( dgFront + ( dlOne - dlFront ).
mag()*( dmOne - dgFront ).
unit() ) ;
205 const double dlangle ( ( dlBack - dlFront).
angle( dlOne - dlFront ) ) ;
206 const double dgangle ( ( dgBack - dgFront).
angle( dgOne - dgFront ) ) ;
207 const double dangle ( dlangle - dgangle ) ;
209 if( 1.
e-6 < fabs(dangle) ) {
210 const DPlane3D dgPl ( dgFront, dgOne, dgBack ) ;
211 const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ;
213 DPt3D dgOld ( dgOne ) ;
215 dgOne = ( dgFront + HepGeom::Rotate3D( -dangle, dgFront, dp2 )*
216 DVec3D( dgOld - dgFront ) ) ;
219 tr =
Tr3D( dlFront , dlBack , dlOne ,
220 dgFront , dgBack , dgOne ) ;
222 if( 0 != lptr ) (*lptr) = lc ;
233 for (
unsigned int i ( 0 ) ;
i != 8 ; ++
i ) {
234 const Pt3D corn ( tr*lc[
i] ) ;
235 corners[
i] =
GlobalPoint( corn.x(), corn.y(), corn.z() ) ;
249 GlobalPoint global(global_b.x(),global_b.y(),global_b.z());
258 <<
" phi " << cell.
phiPos() << std::endl;
261 for (
unsigned int i=0 ;
i != corners.size() ; ++
i ) {
262 s <<
"Corner: " << corners[
i] << std::endl;
const GlobalVector & axis() const
A base class to handle the particular shape of HGCal volumes.
FlatTrd & operator=(const FlatTrd &tr)
CaloCellGeometry::Pt3D Pt3D
HepGeom::Point3D< double > DPt3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Geom::Theta< T > theta() const
T x() const
Cartesian x coordinate.
const GlobalPoint backCtr(void) const
const CCGFloat * param() const
CaloCellGeometry::CCGFloat CCGFloat
Tan< T >::type tan(const T &t)
HepGeom::Vector3D< double > DVec3D
CaloCellGeometry::CCGFloat CCGFloat
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
virtual const GlobalPoint & getPosition() const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::Pt3D Pt3D
Vector3DBase unit() const
Pt3D getLocal(const GlobalPoint &global) const
GlobalVector makeAxis(void)
HepGeom::Plane3D< double > DPlane3D
virtual void initCorners(CornersVec &) override
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
CaloCellGeometry::Tr3D Tr3D
std::vector< std::vector< double > > tmp
bool uninitialized() const
CaloCellGeometry::Tr3D Tr3D
CCGFloat getThetaAxis() const
virtual float phiPos() const
virtual float etaPos() const
const CornersVec & getCorners() const
Returns the corner points of this cell's volume.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const
CCGFloat getPhiAxis() const
HepGeom::Vector3D< CCGFloat > FVec3D
ROOT::Math::Plane3D Plane3D
Global3DVector GlobalVector
T angle(T x1, T y1, T z1, T x2, T y2, T z2)