CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions
IdealObliquePrism Class Reference

#include <IdealObliquePrism.h>

Inheritance diagram for IdealObliquePrism:
CaloCellGeometry

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
- Public Types inherited from CaloCellGeometry
typedef float CCGFloat
 
typedef EZMgrFL< GlobalPointCornersMgr
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< CCGFloatParMgr
 
typedef EZArrayFL< CCGFloatParVec
 
typedef std::vector< ParVecParVecVec
 
typedef HepGeom::Point3D< CCGFloatPt3D
 
typedef std::vector< Pt3DPt3DVec
 
using RepCorners = std::array< RhoEtaPhi, k_cornerSize >
 
typedef HepGeom::Transform3D Tr3D
 

Public Member Functions

CCGFloat dEta () const
 
CCGFloat dPhi () const
 
CCGFloat dz () const
 
CCGFloat eta () const
 
 IdealObliquePrism ()
 
 IdealObliquePrism (const IdealObliquePrism &idop)
 
 IdealObliquePrism (const GlobalPoint &faceCenter, CornersMgr *mgr, const CCGFloat *parm)
 
IdealObliquePrismoperator= (const IdealObliquePrism &idop)
 
virtual void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
 
CCGFloat z () const
 
virtual ~IdealObliquePrism ()
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
float etaPos () const
 
float etaSpan () const
 
const GlobalPointgetBackPoint () const
 
CornersVec const & getCorners () const
 Returns the corner points of this cell's volume. More...
 
RepCorners const & getCornersREP () const
 
const GlobalPointgetPosition () const
 Returns the position of reference for this cell. More...
 
virtual void getTransform (Tr3D &tr, Pt3DVec *lptr) const
 --------— only needed by specific utility; overloaded when needed -— More...
 
bool inside (const GlobalPoint &point) const
 Returns true if the specified point is inside this cell. More...
 
const CCGFloatparam () const
 
float phiPos () const
 
float phiSpan () const
 
RhoEtaPhi const & repPos () const
 
float rhoPos () const
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static void localCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
 
- Static Public Member Functions inherited from CaloCellGeometry
static const CCGFloatcheckParmPtr (const std::vector< CCGFloat > &vd, ParVecVec &pvv)
 
static const CCGFloatgetParmPtr (const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Private Member Functions

virtual void initCorners (CornersVec &) override
 

Static Private Member Functions

static GlobalPoint etaPhiPerp (float eta, float phi, float perp)
 
static GlobalPoint etaPhiZ (float eta, float phi, float z)
 

Additional Inherited Members

- Static Public Attributes inherited from CaloCellGeometry
static constexpr unsigned int k_cornerSize = 8
 
static const CCGFloat k_ScaleFromDDDtoGeant
 
- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, CornersMgr *mgr, const CCGFloat *par)
 
 CaloCellGeometry (const CornersVec &cv, const CCGFloat *par)
 
 CaloCellGeometry (void)
 
void initSpan ()
 

Detailed Description

Oblique prism class used for HCAL (HB, HE, HO) volumes.

Required parameters for an ideal oblique prism:

Total: 6+1 parameters

Internally, the "point of reference" is the center (eta/phi) of the front face of the prism. Therefore, the only internally stored parameters are eta and phi widths, the axis tower thickness, and the parallel/perpendicular setting. The parallel/perpendicular setting is encoded in the sign of the thickness. (positive = parallel to z-axis, negative = perpendicular)

Author
J. Mans - Minnesota

Definition at line 28 of file IdealObliquePrism.h.

Member Typedef Documentation

Definition at line 32 of file IdealObliquePrism.h.

Definition at line 33 of file IdealObliquePrism.h.

Definition at line 34 of file IdealObliquePrism.h.

Constructor & Destructor Documentation

IdealObliquePrism::IdealObliquePrism ( )

Definition at line 8 of file IdealObliquePrism.cc.

8  :
10 {}
IdealObliquePrism::IdealObliquePrism ( const IdealObliquePrism idop)

Definition at line 12 of file IdealObliquePrism.cc.

13  : CaloCellGeometry( idop )
14 {
15  *this = idop ;
16 }
IdealObliquePrism::IdealObliquePrism ( const GlobalPoint faceCenter,
CornersMgr mgr,
const CCGFloat parm 
)

Definition at line 25 of file IdealObliquePrism.cc.

References CaloCellGeometry::initSpan().

28  : CaloCellGeometry ( faceCenter, mgr, parm )
29 {initSpan();}
IdealObliquePrism::~IdealObliquePrism ( )
virtual

Definition at line 31 of file IdealObliquePrism.cc.

32 {}

Member Function Documentation

CCGFloat IdealObliquePrism::dEta ( ) const

Definition at line 35 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by initCorners(), localCorners(), and operator<<().

36 {
37  return param()[0] ;
38 }
const CCGFloat * param() const
CCGFloat IdealObliquePrism::dPhi ( ) const

Definition at line 41 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by initCorners(), localCorners(), and operator<<().

42 {
43  return param()[1] ;
44 }
const CCGFloat * param() const
CCGFloat IdealObliquePrism::dz ( ) const

Definition at line 47 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by Electron.Electron::cutBasedId(), ntupleDataFormat.Track::dzPull(), initCorners(), localCorners(), and operator<<().

48 {
49  return param()[2] ;
50 }
const CCGFloat * param() const
CCGFloat IdealObliquePrism::eta ( void  ) const

Definition at line 53 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by Particle.Particle::__str__(), initCorners(), Jet.Jet::jetID(), localCorners(), and Jet.Jet::puJetId().

54 {
55  return param()[3] ;
56 }
const CCGFloat * param() const
GlobalPoint IdealObliquePrism::etaPhiPerp ( float  eta,
float  phi,
float  perp 
)
staticprivate

Definition at line 82 of file IdealObliquePrism.cc.

Referenced by initCorners(), and localCorners().

83 {
84  return GlobalPoint( perp*cosf(phi) ,
85  perp*sinf(phi) ,
86  perp*sinhf(eta) ) ;
87 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
T perp() const
Magnitude of transverse component.
GlobalPoint IdealObliquePrism::etaPhiZ ( float  eta,
float  phi,
float  z 
)
staticprivate

Definition at line 90 of file IdealObliquePrism.cc.

Referenced by initCorners(), and localCorners().

91 {
92  return GlobalPoint( z*cosf(phi)/sinhf(eta) ,
93  z*sinf(phi)/sinhf(eta) ,
94  z ) ;
95 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CCGFloat z() const
void IdealObliquePrism::initCorners ( CaloCellGeometry::CornersVec co)
overrideprivatevirtual

Implements CaloCellGeometry.

Definition at line 148 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), eta(), PV3DBase< T, PVType, FrameType >::eta(), etaPhiPerp(), etaPhiZ(), CaloCellGeometry::getPosition(), PV3DBase< T, PVType, FrameType >::mag(), mag(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), EZArrayFL< T >::uninitialized(), and PV3DBase< T, PVType, FrameType >::z().

149 {
150  if( co.uninitialized() )
151  {
152  CornersVec& corners ( co ) ;
153  if( dz()>0 )
154  {
155  /* In this case, the faces are parallel to the zaxis.
156  This implies that all corners will have the same
157  cylindrical radius.
158  */
159  const GlobalPoint p ( getPosition() ) ;
160  const CCGFloat r_near ( p.perp()/cos(dPhi()) ) ;
161  const CCGFloat r_far ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
162  const CCGFloat eta ( p.eta() ) ;
163  const CCGFloat phi ( p.phi() ) ;
164  corners[ 0 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_near ) ; // (+,+,near)
165  corners[ 1 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_near ) ; // (+,-,near)
166  corners[ 2 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_near ) ; // (-,-,near)
167  corners[ 3 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_near ) ; // (-,+,near)
168  corners[ 4 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_far ) ; // (+,+,far)
169  corners[ 5 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_far ) ; // (+,-,far)
170  corners[ 6 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_far ) ; // (-,-,far)
171  corners[ 7 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_far ) ; // (-,+,far)
172  }
173  else
174  {
175  /* In this case, the faces are perpendicular to the zaxis.
176  This implies that all corners will have the same
177  z-dimension.
178  */
179  const GlobalPoint p ( getPosition() ) ;
180  const CCGFloat z_near ( p.z() ) ;
181  const CCGFloat mag ( p.mag() ) ;
182  const CCGFloat z_far ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
183  const CCGFloat eta ( p.eta() ) ;
184  const CCGFloat phi ( p.phi() ) ;
185 
186  corners[ 0 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_near ) ; // (+,+,near)
187  corners[ 1 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_near ) ; // (+,-,near)
188  corners[ 2 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_near ) ; // (-,-,near)
189  corners[ 3 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_near ) ; // (-,+,near)
190  corners[ 4 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_far ) ; // (+,+,far)
191  corners[ 5 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_far ) ; // (+,-,far)
192  corners[ 6 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_far ) ; // (-,-,far)
193  corners[ 7 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_far ) ; // (-,+,far)
194 
195  }
196  }
197 }
EZArrayFL< GlobalPoint > CornersVec
static GlobalPoint etaPhiZ(float eta, float phi, float z)
CCGFloat dEta() const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
CCGFloat eta() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CaloCellGeometry::CCGFloat CCGFloat
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
CCGFloat dPhi() const
bool uninitialized() const
Definition: EZArrayFL.h:77
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
CCGFloat dz() const
void IdealObliquePrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 97 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), eta(), etaPhiPerp(), etaPhiZ(), mps_fire::i, PV3DBase< T, PVType, FrameType >::mag(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), x, y, and z().

Referenced by FWTGeoRecoGeometryESProducer::addCaloTowerGeometry(), FWTGeoRecoGeometryESProducer::addHcalCaloGeometryBarrel(), FWTGeoRecoGeometryESProducer::addHcalCaloGeometryEndcap(), FWTGeoRecoGeometryESProducer::addHcalCaloGeometryOuter(), CaloTowerGeometry::localCorners(), HcalGeometry::localCorners(), and vocalCorners().

100 {
101  assert( 8 == lc.size() ) ;
102  assert( 0 != pv ) ;
103 
104  const CCGFloat dEta ( pv[0] ) ;
105  const CCGFloat dPhi ( pv[1] ) ;
106  const CCGFloat dz ( pv[2] ) ;
107  const CCGFloat eta ( pv[3] ) ;
108  const CCGFloat z ( pv[4] ) ;
109 
110  std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;
111 
112  const GlobalPoint p ( etaPhiZ( eta, 0, z ) ) ;
113 
114  if( 0 < dz )
115  {
116  const CCGFloat r_near ( p.perp()/cos( dPhi ) ) ;
117  const CCGFloat r_far ( r_near*( ( p.mag() + 2*dz )/p.mag() ) ) ;
118  gc[ 0 ] = etaPhiPerp( eta + dEta , +dPhi , r_near ) ; // (+,+,near)
119  gc[ 1 ] = etaPhiPerp( eta + dEta , -dPhi , r_near ) ; // (+,-,near)
120  gc[ 2 ] = etaPhiPerp( eta - dEta , -dPhi , r_near ) ; // (-,-,near)
121  gc[ 3 ] = etaPhiPerp( eta - dEta , +dPhi , r_near ) ; // (-,+,near)
122  gc[ 4 ] = etaPhiPerp( eta + dEta , +dPhi , r_far ) ; // (+,+,far)
123  gc[ 5 ] = etaPhiPerp( eta + dEta , -dPhi , r_far ) ; // (+,-,far)
124  gc[ 6 ] = etaPhiPerp( eta - dEta , -dPhi , r_far ) ; // (-,-,far)
125  gc[ 7 ] = etaPhiPerp( eta - dEta , +dPhi , r_far ) ; // (-,+,far)
126  }
127  else
128  {
129  const CCGFloat z_near ( z ) ;
130  const CCGFloat z_far ( z*( 1 - 2*dz/p.mag() ) ) ;
131  gc[ 0 ] = etaPhiZ( eta + dEta , +dPhi , z_near ) ; // (+,+,near)
132  gc[ 1 ] = etaPhiZ( eta + dEta , -dPhi , z_near ) ; // (+,-,near)
133  gc[ 2 ] = etaPhiZ( eta - dEta , -dPhi , z_near ) ; // (-,-,near)
134  gc[ 3 ] = etaPhiZ( eta - dEta , +dPhi , z_near ) ; // (-,+,near)
135  gc[ 4 ] = etaPhiZ( eta + dEta , +dPhi , z_far ) ; // (+,+,far)
136  gc[ 5 ] = etaPhiZ( eta + dEta , -dPhi , z_far ) ; // (+,-,far)
137  gc[ 6 ] = etaPhiZ( eta - dEta , -dPhi , z_far ) ; // (-,-,far)
138  gc[ 7 ] = etaPhiZ( eta - dEta , +dPhi , z_far ) ; // (-,+,far)
139  }
140  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
141  {
142  lc[i] = Pt3D( gc[i].x(), gc[i].y(), gc[i].z() ) ;
143  }
144 
145  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
146 }
static GlobalPoint etaPhiZ(float eta, float phi, float z)
CCGFloat dEta() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CaloCellGeometry::Pt3D Pt3D
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
def pv(vc)
Definition: MetAnalyzer.py:6
CaloCellGeometry::CCGFloat CCGFloat
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
CCGFloat dPhi() const
CCGFloat z() const
CCGFloat dz() const
IdealObliquePrism & IdealObliquePrism::operator= ( const IdealObliquePrism idop)

Definition at line 19 of file IdealObliquePrism.cc.

20 {
21  if( &idop != this ) CaloCellGeometry::operator=( idop ) ;
22  return *this ;
23 }
void IdealObliquePrism::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
overridevirtual

Implements CaloCellGeometry.

Definition at line 65 of file IdealObliquePrism.cc.

References localCorners().

68 {
69  localCorners( vec, pv, ref ) ;
70 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
def pv(vc)
Definition: MetAnalyzer.py:6
CCGFloat IdealObliquePrism::z ( ) const

Definition at line 59 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by localCorners(), geometryXMLparser.Alignable::pos(), and ntupleDataFormat._HitObject::r3D().

60 {
61  return param()[4] ;
62 }
const CCGFloat * param() const