CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes
CaloCellGeometry Class Referenceabstract

#include <CaloCellGeometry.h>

Inheritance diagram for CaloCellGeometry:
GCC11_FINAL< T, TOPO > IdealCastorTrapezoid IdealObliquePrism IdealZDCTrapezoid IdealZPrism PreshowerStrip

Public Types

typedef float CCGFloat
 
typedef EZMgrFL< GlobalPointCornersMgr
 
enum  CornersSize { k_cornerSize = 8 }
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< CCGFloatParMgr
 
typedef EZArrayFL< CCGFloatParVec
 
typedef std::vector< ParVecParVecVec
 
typedef HepGeom::Point3D
< CCGFloat
Pt3D
 
typedef std::vector< Pt3DPt3DVec
 
typedef HepGeom::Transform3D Tr3D
 

Public Member Functions

bool emptyCorners () const
 
float etaPos () const
 
float etaSpan () const
 
virtual const CornersVecgetCorners () const =0
 Returns the corner points of this cell's volume. More...
 
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
 
virtual void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const =0
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static const CCGFloatcheckParmPtr (const std::vector< CCGFloat > &vd, ParVecVec &pvv)
 
static const CCGFloatgetParmPtr (const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Static Public Attributes

static const CCGFloat k_ScaleFromDDDtoGeant
 

Protected Member Functions

 CaloCellGeometry (CornersVec::const_reference gp, const CornersMgr *mgr, const CCGFloat *par)
 
 CaloCellGeometry (const CornersVec &cv, const CCGFloat *par)
 
 CaloCellGeometry (void)
 
void initSpan () const
 
CornersVecsetCorners () const
 

Private Attributes

CornersVec m_corners
 
float m_dEta
 
float m_dPhi
 
float m_eta
 
const CCGFloatm_parms
 
float m_phi
 
GlobalPoint m_refPoint
 

Detailed Description

Abstract base class for an individual cell's geometry.

The base class declares a pure virtual function and also writes a definition (body) to force conscious acceptance of default behaviour.

If a derived class doesn't choose to override a normal virtual, it just inherits the base version's behaviour by default. If you want to provide a default behaviour but not let derived classes just inherit it "silently" like this, you can make it pure virtual but still provide a default that the derived class author has to call deliberately if he wants it:

class B {
public:
virtual bool f() = 0;
};
bool B::f() {
return true; // this is a good default, but
} // shouldn't be used blindly
class D : public B {
public:
bool f() {
return B::f(); // if D wants the default
} // behaviour, it has to say so
};
Author
J. Mans, P. Meridiani

Definition at line 50 of file CaloCellGeometry.h.

Member Typedef Documentation

Definition at line 54 of file CaloCellGeometry.h.

Definition at line 60 of file CaloCellGeometry.h.

Definition at line 59 of file CaloCellGeometry.h.

Definition at line 64 of file CaloCellGeometry.h.

Definition at line 62 of file CaloCellGeometry.h.

typedef std::vector<ParVec> CaloCellGeometry::ParVecVec

Definition at line 63 of file CaloCellGeometry.h.

Definition at line 56 of file CaloCellGeometry.h.

typedef std::vector<Pt3D> CaloCellGeometry::Pt3DVec

Definition at line 57 of file CaloCellGeometry.h.

typedef HepGeom::Transform3D CaloCellGeometry::Tr3D

Definition at line 55 of file CaloCellGeometry.h.

Member Enumeration Documentation

Enumerator
k_cornerSize 

Definition at line 66 of file CaloCellGeometry.h.

Constructor & Destructor Documentation

CaloCellGeometry::~CaloCellGeometry ( )
virtual

Definition at line 26 of file CaloCellGeometry.cc.

27 {}
CaloCellGeometry::CaloCellGeometry ( CornersVec::const_reference  gp,
const CornersMgr mgr,
const CCGFloat par 
)
protected

Definition at line 31 of file CaloCellGeometry.cc.

33  :
34  m_refPoint ( gp ),
35  m_corners ( mgr ),
36  m_parms ( par ),
37  m_eta(gp.eta()), m_phi(gp.phi())
38 {}
const CCGFloat * m_parms
GlobalPoint m_refPoint
CaloCellGeometry::CaloCellGeometry ( const CornersVec cv,
const CCGFloat par 
)
protected

Definition at line 40 of file CaloCellGeometry.cc.

41  :
42  m_refPoint ( 0.25*( cv[0].x() + cv[1].x() + cv[2].x() + cv[3].x() ),
43  0.25*( cv[0].y() + cv[1].y() + cv[2].y() + cv[3].y() ),
44  0.25*( cv[0].z() + cv[1].z() + cv[2].z() + cv[3].z() ) ),
45  m_corners ( cv ),
46  m_parms ( par ),
48 {}
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const CCGFloat * m_parms
float float float z
GlobalPoint m_refPoint
dictionary cv
Definition: cuy.py:362
T eta() const
Definition: PV3DBase.h:76
Definition: DDAxes.h:10
CaloCellGeometry::CaloCellGeometry ( void  )
protected

Definition at line 19 of file CaloCellGeometry.cc.

19  :
20  m_refPoint ( 0., 0., 0. ),
21  m_corners ( ) ,
22  m_parms ( (CCGFloat*) 0 ), m_eta(0), m_phi(0)
23 {}
const CCGFloat * m_parms
CaloCellGeometry::CCGFloat CCGFloat
GlobalPoint m_refPoint

Member Function Documentation

const float * CaloCellGeometry::checkParmPtr ( const std::vector< CCGFloat > &  vd,
CaloCellGeometry::ParVecVec pvv 
)
static

Definition at line 131 of file CaloCellGeometry.cc.

References EZArrayFL< T >::begin(), cuy::ii, j, EZArrayFL< T >::size(), and findQualityFiles::v.

Referenced by getParmPtr().

134 {
135  const float* pP ( 0 ) ;
136 
137  for( unsigned int ii ( 0 ) ; ii != pvv.size() ; ++ii )
138  {
139  const ParVec& v ( pvv[ii] ) ;
140  assert( v.size() == vv.size() ) ;
141 
142  bool same ( true ) ;
143  for( unsigned int j ( 0 ) ; j != vv.size() ; ++j )
144  {
145  same = same && ( fabs( vv[j] - v[j] )<1.e-6 ) ;
146  if( !same ) break ;
147  }
148  if( same )
149  {
150  pP = &(*v.begin()) ;
151  break ;
152  }
153  }
154  return pP ;
155 }
EZArrayFL< CCGFloat > ParVec
int ii
Definition: cuy.py:588
int j
Definition: DBlmapReader.cc:9
bool CaloCellGeometry::emptyCorners ( ) const
inline

Definition at line 87 of file CaloCellGeometry.h.

References EZArrayFL< T >::empty(), and m_corners.

Referenced by operator<<().

87 { return m_corners.empty() ;}
bool empty() const
Definition: EZArrayFL.h:79
float CaloCellGeometry::etaPos ( ) const
inline

Definition at line 77 of file CaloCellGeometry.h.

References m_eta.

77 { return m_eta;}
float CaloCellGeometry::etaSpan ( ) const
inline

Definition at line 80 of file CaloCellGeometry.h.

References m_dEta.

Referenced by reco::makeSpecific().

80 { return m_dEta;}
const CaloCellGeometry::CornersVec & CaloCellGeometry::getCorners ( ) const
pure virtual
const float * CaloCellGeometry::getParmPtr ( const std::vector< CCGFloat > &  vd,
CaloCellGeometry::ParMgr mgr,
CaloCellGeometry::ParVecVec pvv 
)
static

Definition at line 158 of file CaloCellGeometry.cc.

References prof2calltree::back, checkParmPtr(), and i.

Referenced by HcalFlexiHardcodeGeometryLoader::fillHBHO(), HcalFlexiHardcodeGeometryLoader::fillHE(), HcalFlexiHardcodeGeometryLoader::fillHF(), CaloTowerHardcodeGeometryLoader::makeCell(), CastorHardcodeGeometryLoader::makeCell(), ZdcHardcodeGeometryLoader::makeCell(), HcalHardcodeGeometryLoader::makeCell(), HcalDDDGeometryLoader::makeCell(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), and CaloGeometryDBEP< T, U >::produceAligned().

162 {
163  const float* pP ( checkParmPtr( vv, pvv ) ) ;
164 
165  if( 0 == pP )
166  {
167  pvv.push_back( ParVec( mgr ) ) ;
168  ParVec& back ( pvv.back() ) ;
169  for( unsigned int i ( 0 ) ; i != vv.size() ; ++i )
170  {
171  back[i] = vv[i] ;
172  }
173  pP = &(*back.begin()) ;
174  }
175  return pP ;
176 }
int i
Definition: DBlmapReader.cc:9
EZArrayFL< CCGFloat > ParVec
static const CCGFloat * checkParmPtr(const std::vector< CCGFloat > &vd, ParVecVec &pvv)
const GlobalPoint& CaloCellGeometry::getPosition ( ) const
inline

Returns the position of reference for this cell.

Definition at line 76 of file CaloCellGeometry.h.

References m_refPoint.

Referenced by PreshowerHitMaker::addHit(), EcalTPGParamBuilder::analyze(), HcalRecHitsValidation::analyze(), CaloTowersCreationAlgo::assignHit(), EcalBoundaryInfoCalculator< EcalDetId >::boundaryRecHits(), CaloRecoTauAlgorithm::buildCaloTau(), CaloGeometryHelper::buildCrystalArray(), SuperClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_EnergyDepTopology(), compEcalEnergySum(), compHcalEnergySum(), CaloTowersCreationAlgo::convert(), EcalClusterToolsT< noZS >::covariances(), PFRecHitProducerECAL::createEcalRecHit(), PFHCALDualTimeRecHitProducer::createHcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), PFRecHitProducerHO::createHORecHit(), PFRecHitProducerPS::createRecHits(), DistanceToCell::DistanceToCell(), InvRingCalib::EERingDef(), CaloTowersCreationAlgo::emCrystalShwrPos(), GlobalHitsAnalyzer::fillECal(), GlobalHitsProdHist::fillECal(), GlobalHitsProducer::fillECal(), HCALRecHitAnalyzer::FillGeometry(), ECALRecHitAnalyzer::FillGeometry(), GlobalHitsAnalyzer::fillHCal(), GlobalHitsProdHist::fillHCal(), GlobalHitsProducer::fillHCal(), GlobalRecHitsAnalyzer::fillHCal(), GlobalRecHitsProducer::fillHCal(), EcalDeadCellBoundaryEnergyFilter::filter(), PFRecHitProducerECAL::findEcalRecHitGeometry(), PFRecHitProducerHO::findHORecHitGeometry(), EcalBoundaryInfoCalculator< EcalDetId >::gapRecHits(), TCTauAlgorithm::getCellMomentum(), HcalGeometry::getCells(), CaloSubdetectorGeometry::getCells(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), CaloGeometryHelper::getClosestCell(), HcalGeometry::getClosestCell(), CaloSubdetectorGeometry::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), IdealZDCTrapezoid::getCorners(), IdealZPrism::getCorners(), PreshowerStrip::getCorners(), IdealObliquePrism::getCorners(), IdealCastorTrapezoid::getCorners(), L2TauModularIsolationProducer::getECALHits(), L2TauIsolationProducer::getECALHits(), L2TauNarrowConeIsolationProducer::getECALHits(), EcalClusterToolsT< noZS >::getEnergyDepTopology(), EcalHitMaker::getHits(), ParticleTowerProducer::getNearestTower(), CaloGeometry::getPosition(), HCaloDetIdAssociator::getPosition(), CaloDetIdAssociator::getPosition(), HcalGeometry::getSummary(), CaloSubdetectorGeometry::getSummary(), getTransform(), CaloTowersCreationAlgo::hadSegmentShwrPos(), CaloTowersCreationAlgo::hadShwPosFromCells(), CalorimetryManager::HDShowerSimulation(), PhotonFixCMS::initialise(), CaloGeometryHelper::initialize(), EcalRingCalibrationTools::initializeFromGeometry(), EcalPreshowerGeometry::initializeParms(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), HybridClusterAlgo::makeClusters(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), operator<<(), HcalHitRelabeller::process(), EgammaHLTRechitInRegionsProducer::produce(), ParticleTowerProducer::produce(), JetCrystalsAssociator::produce(), CalorimetryManager::reconstructHCAL(), ParticleTowerProducer::resetTowers(), EcalRecHitWorkerRecover::run(), EcalGeomPhiSymHelper::setup(), CaloHitRespoNew::timeOfFlight(), EcalHitResponse::timeOfFlight(), and CaloHitResponse::timeOfFlight().

76 {return m_refPoint ; }
GlobalPoint m_refPoint
void CaloCellGeometry::getTransform ( Tr3D tr,
Pt3DVec lptr 
) const
virtual

--------— only needed by specific utility; overloaded when needed -—

Reimplemented in GCC11_FINAL< T, TOPO >.

Definition at line 82 of file CaloCellGeometry.cc.

References angle(), getCorners(), getPosition(), i, mag(), AlCaHLTBitMon_ParallelJobs::p, param(), csvLumiCalc::unit, vocalCorners(), x, PV3DBase< T, PVType, FrameType >::x(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by CaloSubdetectorGeometry::getSummary(), and HcalGeometry::getSummary().

83 {
85  const Pt3D gFront ( p.x(), p.y(), p.z() ) ;
86  const DPt3D dgFront ( p.x(), p.y(), p.z() ) ;
87 
88  Pt3D lFront ;
89  assert( 0 != param() ) ;
90  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
91  vocalCorners( lc, param(), lFront ) ;
92 
93  DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ;
94 
95  const Pt3D lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ;
96  const DPt3D dlBack ( lBack.x(), lBack.y(), lBack.z() ) ;
97 
98  const Pt3D dlOne ( lc[0].x(), lc[0].y(), lc[0].z() ) ;
99 
100  const CornersVec& cor ( getCorners() ) ;
101  DPt3DVec dkor ( 8, DPt3D(0,0,0) ) ;
102  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
103  {
104  dkor[i] = DPt3D ( cor[i].x(), cor[i].y(), cor[i].z() ) ;
105  }
106 
107  DPt3D dgBack ( 0.25*( dkor[4]+dkor[5]+dkor[6]+dkor[7] ) ) ;
108 
109  const DVec3D dgAxis ( (dgBack-dgFront).unit() ) ;
110 
111  dgBack = ( dgFront + (dlBack-dlFront).mag()*dgAxis ) ;
112  const DPt3D dgOneT ( dgFront + ( dlOne - dlFront ).mag()*( dkor[0] - dgFront ).unit() ) ;
113 
114  const double dlangle ( ( dlBack - dlFront).angle( dlOne - dlFront ) ) ;
115  const double dgangle ( ( dgBack - dgFront).angle( dgOneT- dgFront ) ) ;
116  const double ddangle ( dlangle - dgangle ) ;
117 
118  const DPlane3D dgPl ( dgFront, dgOneT, dgBack ) ;
119  const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ;
120 
121  const DPt3D dgOne ( dgFront + HepGeom::Rotate3D( -ddangle, dgFront, dp2 )*
122  DVec3D ( dgOneT - dgFront ) ) ;
123 
124  tr = Tr3D( dlFront , dlBack , dlOne ,
125  dgFront , dgBack , dgOne ) ;
126 
127  if( 0 != lptr ) (*lptr) = lc ;
128 }
EZArrayFL< GlobalPoint > CornersVec
int i
Definition: DBlmapReader.cc:9
HepGeom::Point3D< double > DPt3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
HepGeom::Transform3D Tr3D
float float float z
const CCGFloat * param() const
string unit
Definition: csvLumiCalc.py:46
HepGeom::Vector3D< double > DVec3D
virtual void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const =0
CaloCellGeometry::Pt3D Pt3D
HepGeom::Plane3D< double > DPlane3D
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
std::vector< DPt3D > DPt3DVec
Definition: DDAxes.h:10
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
void CaloCellGeometry::initSpan ( ) const
inlineprotected

Definition at line 121 of file CaloCellGeometry.h.

References funct::abs(), eta(), getCorners(), m_dEta, m_dPhi, and phi.

Referenced by IdealCastorTrapezoid::IdealCastorTrapezoid(), IdealObliquePrism::IdealObliquePrism(), IdealZDCTrapezoid::IdealZDCTrapezoid(), IdealZPrism::IdealZPrism(), and PreshowerStrip::PreshowerStrip().

121  {
122  m_dEta = std::abs(getCorners()[0].eta()-
123  getCorners()[2].eta());
124  m_dPhi = std::abs(getCorners()[0].phi() -
125  getCorners()[2].phi());
126  }
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.
Definition: DDAxes.h:10
bool CaloCellGeometry::inside ( const GlobalPoint point) const

Returns true if the specified point is inside this cell.

Definition at line 179 of file CaloCellGeometry.cc.

References getCorners(), i, AlCaHLTBitMon_ParallelJobs::p, funct::true, x, PV3DBase< T, PVType, FrameType >::x(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by MuonCaloDistanceProducer::fillDistanceMap(), CastorGeometry::getClosestCell(), CaloDetIdAssociator::insideElement(), and HCaloDetIdAssociator::insideElement().

180 {
181  bool ans ( false ) ;
182  const Pt3D p ( point.x(), point.y(), point.z() ) ;
183  const CornersVec& cog ( getCorners() ) ;
184  Pt3D co[8] ;
185  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
186  {
187  co[i] = Pt3D ( cog[i].x(), cog[i].y(), cog[i].z() ) ;
188  }
189 
190  const Plane3D AA ( co[0], co[1], co[2] ) ; // z<0
191  const Plane3D BB ( co[6], co[5], co[4] ) ; // z>0
192 
193  if( AA.distance(p)*BB.distance(p) >= 0 )
194  {
195  const Plane3D CC ( co[0], co[4], co[5] ) ; // x<0
196  const Plane3D DD ( co[2], co[6], co[7] ) ; // x>0
197  if( CC.distance(p)*DD.distance(p) >= 0 )
198  {
199  const Plane3D EE ( co[3], co[7], co[4] ) ; // y<0
200  const Plane3D FF ( co[1], co[5], co[6] ) ; // y>0
201  if( EE.distance(p)*FF.distance(p) >= 0 )
202  {
203  ans = true ;
204  }
205  }
206  }
207  return ans ;
208 }
EZArrayFL< GlobalPoint > CornersVec
int i
Definition: DBlmapReader.cc:9
T y() const
Definition: PV3DBase.h:63
float float float z
T z() const
Definition: PV3DBase.h:64
CaloCellGeometry::Pt3D Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: DDAxes.h:10
T x() const
Definition: PV3DBase.h:62
ROOT::Math::Plane3D Plane3D
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.
const CCGFloat* CaloCellGeometry::param ( ) const
inline
float CaloCellGeometry::phiPos ( ) const
inline

Definition at line 78 of file CaloCellGeometry.h.

References m_phi.

78 { return m_phi;}
float CaloCellGeometry::phiSpan ( ) const
inline

Definition at line 81 of file CaloCellGeometry.h.

References m_dPhi.

Referenced by reco::makeSpecific().

81 { return m_dPhi;}
CaloCellGeometry::CornersVec & CaloCellGeometry::setCorners ( ) const
protected
virtual void CaloCellGeometry::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
pure virtual

Member Data Documentation

const float CaloCellGeometry::k_ScaleFromDDDtoGeant
static
CornersVec CaloCellGeometry::m_corners
mutableprivate

Definition at line 130 of file CaloCellGeometry.h.

Referenced by emptyCorners(), getCorners(), and setCorners().

float CaloCellGeometry::m_dEta
mutableprivate

Definition at line 133 of file CaloCellGeometry.h.

Referenced by etaSpan(), and initSpan().

float CaloCellGeometry::m_dPhi
mutableprivate

Definition at line 134 of file CaloCellGeometry.h.

Referenced by initSpan(), and phiSpan().

float CaloCellGeometry::m_eta
private

Definition at line 132 of file CaloCellGeometry.h.

Referenced by etaPos().

const CCGFloat* CaloCellGeometry::m_parms
private

Definition at line 131 of file CaloCellGeometry.h.

Referenced by param().

float CaloCellGeometry::m_phi
private

Definition at line 132 of file CaloCellGeometry.h.

Referenced by phiPos().

GlobalPoint CaloCellGeometry::m_refPoint
private

Definition at line 129 of file CaloCellGeometry.h.

Referenced by getPosition().