#include <CaloCellGeometry.h>
Public Types | |
typedef float | CCGFloat |
typedef EZMgrFL< GlobalPoint > | CornersMgr |
enum | CornersSize { k_cornerSize = 8 } |
typedef EZArrayFL< GlobalPoint > | CornersVec |
typedef EZMgrFL< CCGFloat > | ParMgr |
typedef EZArrayFL< CCGFloat > | ParVec |
typedef std::vector< ParVec > | ParVecVec |
typedef HepGeom::Point3D < CCGFloat > | Pt3D |
typedef std::vector< Pt3D > | Pt3DVec |
typedef HepGeom::Transform3D | Tr3D |
Public Member Functions | |
bool | emptyCorners () const |
float | etaPos () const |
virtual const CornersVec & | getCorners () const =0 |
Returns the corner points of this cell's volume. | |
const GlobalPoint & | getPosition () const |
Returns the position of reference for this cell. | |
virtual void | getTransform (Tr3D &tr, Pt3DVec *lptr) const |
----------- only needed by specific utility; overloaded when needed ---- | |
bool | inside (const GlobalPoint &point) const |
Returns true if the specified point is inside this cell. | |
const CCGFloat * | param () const |
float | phiPos () const |
virtual void | vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const =0 |
virtual | ~CaloCellGeometry () |
Static Public Member Functions | |
static const CCGFloat * | checkParmPtr (const std::vector< CCGFloat > &vd, ParVecVec &pvv) |
static const CCGFloat * | getParmPtr (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 (void) | |
CaloCellGeometry (const CornersVec &cv, const CCGFloat *par) | |
CornersVec & | setCorners () const |
Private Attributes | |
CornersVec | m_corners |
float | m_eta |
const CCGFloat * | m_parms |
float | m_phi |
GlobalPoint | m_refPoint |
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 };
Definition at line 52 of file CaloCellGeometry.h.
typedef float CaloCellGeometry::CCGFloat |
Reimplemented in IdealObliquePrism, IdealZPrism, PreshowerStrip, GCC11_FINAL< T >, GCC11_FINAL< T >, GCC11_FINAL< T >, IdealCastorTrapezoid, and IdealZDCTrapezoid.
Definition at line 56 of file CaloCellGeometry.h.
typedef EZMgrFL< GlobalPoint > CaloCellGeometry::CornersMgr |
Definition at line 62 of file CaloCellGeometry.h.
typedef EZArrayFL< GlobalPoint > CaloCellGeometry::CornersVec |
Definition at line 61 of file CaloCellGeometry.h.
typedef EZMgrFL< CCGFloat > CaloCellGeometry::ParMgr |
Definition at line 66 of file CaloCellGeometry.h.
typedef EZArrayFL<CCGFloat> CaloCellGeometry::ParVec |
Definition at line 64 of file CaloCellGeometry.h.
typedef std::vector<ParVec> CaloCellGeometry::ParVecVec |
Definition at line 65 of file CaloCellGeometry.h.
Reimplemented in IdealObliquePrism, IdealZPrism, PreshowerStrip, GCC11_FINAL< T >, GCC11_FINAL< T >, GCC11_FINAL< T >, IdealCastorTrapezoid, and IdealZDCTrapezoid.
Definition at line 58 of file CaloCellGeometry.h.
typedef std::vector<Pt3D> CaloCellGeometry::Pt3DVec |
Reimplemented in IdealObliquePrism, IdealZPrism, PreshowerStrip, GCC11_FINAL< T >, GCC11_FINAL< T >, GCC11_FINAL< T >, IdealCastorTrapezoid, and IdealZDCTrapezoid.
Definition at line 59 of file CaloCellGeometry.h.
typedef HepGeom::Transform3D CaloCellGeometry::Tr3D |
Reimplemented in PreshowerStrip, GCC11_FINAL< T >, IdealCastorTrapezoid, and IdealZDCTrapezoid.
Definition at line 57 of file CaloCellGeometry.h.
CaloCellGeometry::~CaloCellGeometry | ( | ) | [virtual] |
Definition at line 26 of file CaloCellGeometry.cc.
{}
CaloCellGeometry::CaloCellGeometry | ( | CornersVec::const_reference | gp, |
const CornersMgr * | mgr, | ||
const CCGFloat * | par | ||
) | [protected] |
Definition at line 33 of file CaloCellGeometry.cc.
: m_refPoint ( gp ), m_corners ( mgr ), m_parms ( par ), m_eta(gp.eta()), m_phi(gp.phi()) {}
CaloCellGeometry::CaloCellGeometry | ( | const CornersVec & | cv, |
const CCGFloat * | par | ||
) | [protected] |
Definition at line 42 of file CaloCellGeometry.cc.
CaloCellGeometry::CaloCellGeometry | ( | void | ) | [protected] |
Definition at line 19 of file CaloCellGeometry.cc.
const float * CaloCellGeometry::checkParmPtr | ( | const std::vector< CCGFloat > & | vd, |
CaloCellGeometry::ParVecVec & | pvv | ||
) | [static] |
Definition at line 133 of file CaloCellGeometry.cc.
References EZArrayFL< T >::begin(), j, EZArrayFL< T >::size(), and v.
Referenced by getParmPtr().
{ const float* pP ( 0 ) ; for( unsigned int ii ( 0 ) ; ii != pvv.size() ; ++ii ) { const ParVec& v ( pvv[ii] ) ; assert( v.size() == vv.size() ) ; bool same ( true ) ; for( unsigned int j ( 0 ) ; j != vv.size() ; ++j ) { same = same && ( fabs( vv[j] - v[j] )<1.e-6 ) ; if( !same ) break ; } if( same ) { pP = &(*v.begin()) ; break ; } } return pP ; }
bool CaloCellGeometry::emptyCorners | ( | ) | const [inline] |
Definition at line 87 of file CaloCellGeometry.h.
References EZArrayFL< T >::empty(), and m_corners.
Referenced by operator<<().
float CaloCellGeometry::etaPos | ( | ) | const [inline] |
const CaloCellGeometry::CornersVec & CaloCellGeometry::getCorners | ( | ) | const [pure virtual] |
Returns the corner points of this cell's volume.
Implemented in IdealObliquePrism, IdealZPrism, PreshowerStrip, GCC11_FINAL< T >, IdealCastorTrapezoid, and IdealZDCTrapezoid.
Definition at line 59 of file CaloCellGeometry.cc.
References m_corners.
Referenced by CaloGeometryHelper::buildCrystalArray(), HFClusterAlgo::clusterize(), PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), PFRecHitProducerHO::createHORecHit(), CaloSubdetectorGeometry::deltaEta(), CaloSubdetectorGeometry::deltaPhi(), CaloTowersCreationAlgo::emCrystalShwrPos(), IdealCastorTrapezoid::getCorners(), IdealZDCTrapezoid::getCorners(), IdealZPrism::getCorners(), IdealObliquePrism::getCorners(), PreshowerStrip::getCorners(), HCaloDetIdAssociator::getDetIdPoints(), CaloDetIdAssociator::getDetIdPoints(), EcalShowerProperties::getDistance(), EcalShowerProperties::getSurface(), getTransform(), CaloTowersCreationAlgo::hadSegmentShwrPos(), CaloTowersCreationAlgo::hadShwPosFromCells(), inside(), JetMaker::makeSpecific(), operator<<(), PlotEcalRecHits::printEcalRecHit(), EcalGeomPhiSymHelper::setup(), and ValidateGeometry::validateCaloGeometry().
{ return m_corners ; }
const float * CaloCellGeometry::getParmPtr | ( | const std::vector< CCGFloat > & | vd, |
CaloCellGeometry::ParMgr * | mgr, | ||
CaloCellGeometry::ParVecVec & | pvv | ||
) | [static] |
Definition at line 160 of file CaloCellGeometry.cc.
References prof2calltree::back, checkParmPtr(), and i.
Referenced by HcalFlexiHardcodeGeometryLoader::fillHBHO(), HcalFlexiHardcodeGeometryLoader::fillHE(), PHcalValidInfoLayer::fillHF(), CaloTowerHardcodeGeometryLoader::makeCell(), HcalHardcodeGeometryLoader::makeCell(), CastorHardcodeGeometryLoader::makeCell(), HcalDDDGeometryLoader::makeCell(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), and CaloGeometryDBEP< T, U >::produceAligned().
const GlobalPoint& CaloCellGeometry::getPosition | ( | ) | const [inline] |
Returns the position of reference for this cell.
Definition at line 78 of file CaloCellGeometry.h.
References m_refPoint.
Referenced by 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(), EcalClusterTools::covariances(), PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), PFRecHitProducerHO::createHORecHit(), DistanceToCell::DistanceToCell(), InvRingCalib::EERingDef(), CaloTowersCreationAlgo::emCrystalShwrPos(), GlobalHitsProducer::fillECal(), GlobalHitsProdHist::fillECal(), GlobalHitsAnalyzer::fillECal(), ECALRecHitAnalyzer::FillGeometry(), HCALRecHitAnalyzer::FillGeometry(), GlobalRecHitsAnalyzer::fillHCal(), GlobalHitsAnalyzer::fillHCal(), GlobalHitsProducer::fillHCal(), GlobalHitsProdHist::fillHCal(), GlobalRecHitsProducer::fillHCal(), EcalDeadCellBoundaryEnergyFilter::filter(), PFRecHitProducerECAL::findEcalRecHitGeometry(), PFRecHitProducerHO::findHORecHitGeometry(), EcalBoundaryInfoCalculator< EcalDetId >::gapRecHits(), TCTauAlgorithm::getCellMomentum(), CaloSubdetectorGeometry::getCells(), HcalGeometry::getCells(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), HcalGeometry::getClosestCell(), CaloSubdetectorGeometry::getClosestCell(), CaloGeometryHelper::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), IdealCastorTrapezoid::getCorners(), IdealZDCTrapezoid::getCorners(), IdealZPrism::getCorners(), IdealObliquePrism::getCorners(), PreshowerStrip::getCorners(), L2TauModularIsolationProducer::getECALHits(), L2TauNarrowConeIsolationProducer::getECALHits(), L2TauIsolationProducer::getECALHits(), EcalClusterTools::getEnergyDepTopology(), ParticleTowerProducer::getNearestTower(), CaloGeometry::getPosition(), CaloDetIdAssociator::getPosition(), HCaloDetIdAssociator::getPosition(), CaloSubdetectorGeometry::getSummary(), getTransform(), CaloTowersCreationAlgo::hadSegmentShwrPos(), CaloTowersCreationAlgo::hadShwPosFromCells(), PhotonFixCMS::initialise(), CaloGeometryHelper::initialize(), EcalRingCalibrationTools::initializeFromGeometry(), EcalPreshowerGeometry::initializeParms(), CalorimetryManager::loadFromEcalBarrel(), CalorimetryManager::loadFromEcalEndcap(), CalorimetryManager::loadFromHcal(), CosmicClusterAlgo::makeClusters(), HybridClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), IslandClusterAlgo::makeClusters(), PreshowerClusterAlgo::makeOneCluster(), PreshowerPhiClusterAlgo::makeOneCluster(), EcalClusterTools::meanClusterPosition(), DistanceToCell::operator()(), operator<<(), PlotEcalRecHits::printEcalRecHit(), CastorEventDisplay::processEvent(), JetCrystalsAssociator::produce(), ParticleTowerProducer::produce(), ParticleTowerProducer::resetTowers(), EcalRecHitWorkerRecover::run(), EcalGeomPhiSymHelper::setup(), EcalHitResponse::timeOfFlight(), CaloHitResponse::timeOfFlight(), and CaloHitRespoNew::timeOfFlight().
{return m_refPoint ; }
----------- only needed by specific utility; overloaded when needed ----
Reimplemented in GCC11_FINAL< T >.
Definition at line 84 of file CaloCellGeometry.cc.
References angle(), getCorners(), getPosition(), i, mag(), AlCaHLTBitMon_ParallelJobs::p, param(), csvLumiCalc::unit, vocalCorners(), PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by CaloSubdetectorGeometry::getSummary().
{ const GlobalPoint& p ( CaloCellGeometry::getPosition() ) ; const Pt3D gFront ( p.x(), p.y(), p.z() ) ; const DPt3D dgFront ( p.x(), p.y(), p.z() ) ; Pt3D lFront ; assert( 0 != param() ) ; Pt3DVec lc ( 8, Pt3D(0,0,0) ) ; vocalCorners( lc, param(), lFront ) ; DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ; const Pt3D lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ; const DPt3D dlBack ( lBack.x(), lBack.y(), lBack.z() ) ; const Pt3D dlOne ( lc[0].x(), lc[0].y(), lc[0].z() ) ; const CornersVec& cor ( getCorners() ) ; DPt3DVec dkor ( 8, DPt3D(0,0,0) ) ; for( unsigned int i ( 0 ) ; i != 8 ; ++i ) { dkor[i] = DPt3D ( cor[i].x(), cor[i].y(), cor[i].z() ) ; } DPt3D dgBack ( 0.25*( dkor[4]+dkor[5]+dkor[6]+dkor[7] ) ) ; const DVec3D dgAxis ( (dgBack-dgFront).unit() ) ; dgBack = ( dgFront + (dlBack-dlFront).mag()*dgAxis ) ; const DPt3D dgOneT ( dgFront + ( dlOne - dlFront ).mag()*( dkor[0] - dgFront ).unit() ) ; const double dlangle ( ( dlBack - dlFront).angle( dlOne - dlFront ) ) ; const double dgangle ( ( dgBack - dgFront).angle( dgOneT- dgFront ) ) ; const double ddangle ( dlangle - dgangle ) ; const DPlane3D dgPl ( dgFront, dgOneT, dgBack ) ; const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ; const DPt3D dgOne ( dgFront + HepGeom::Rotate3D( -ddangle, dgFront, dp2 )* DVec3D ( dgOneT - dgFront ) ) ; tr = Tr3D( dlFront , dlBack , dlOne , dgFront , dgBack , dgOne ) ; if( 0 != lptr ) (*lptr) = lc ; }
bool CaloCellGeometry::inside | ( | const GlobalPoint & | point | ) | const |
Returns true if the specified point is inside this cell.
Definition at line 181 of file CaloCellGeometry.cc.
References getCorners(), i, AlCaHLTBitMon_ParallelJobs::p, funct::true, PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by CastorGeometry::getClosestCell(), CaloDetIdAssociator::insideElement(), and HCaloDetIdAssociator::insideElement().
{ bool ans ( false ) ; const Pt3D p ( point.x(), point.y(), point.z() ) ; const CornersVec& cog ( getCorners() ) ; Pt3D co[8] ; for( unsigned int i ( 0 ) ; i != 8 ; ++i ) { co[i] = Pt3D ( cog[i].x(), cog[i].y(), cog[i].z() ) ; } const Plane3D AA ( co[0], co[1], co[2] ) ; // z<0 const Plane3D BB ( co[6], co[5], co[4] ) ; // z>0 if( AA.distance(p)*BB.distance(p) >= 0 ) { const Plane3D CC ( co[0], co[4], co[5] ) ; // x<0 const Plane3D DD ( co[2], co[6], co[7] ) ; // x>0 if( CC.distance(p)*DD.distance(p) >= 0 ) { const Plane3D EE ( co[3], co[7], co[4] ) ; // y<0 const Plane3D FF ( co[1], co[5], co[6] ) ; // y>0 if( EE.distance(p)*FF.distance(p) >= 0 ) { ans = true ; } } } return ans ; }
const CCGFloat* CaloCellGeometry::param | ( | ) | const [inline] |
Definition at line 89 of file CaloCellGeometry.h.
References m_parms.
Referenced by IdealCastorTrapezoid::an(), IdealZDCTrapezoid::an(), CaloTowerGeometry::cellGeomPtr(), HcalGeometry::cellGeomPtr(), EcalTBHodoscopeGeometry::cellGeomPtr(), HcalDDDGeometry::cellGeomPtr(), EcalPreshowerGeometry::cellGeomPtr(), ZdcGeometry::cellGeomPtr(), CastorGeometry::cellGeomPtr(), IdealObliquePrism::dEta(), IdealZPrism::dEta(), IdealCastorTrapezoid::dh(), IdealObliquePrism::dPhi(), IdealZPrism::dPhi(), IdealCastorTrapezoid::dR(), PreshowerStrip::dx(), IdealZDCTrapezoid::dx(), IdealCastorTrapezoid::dxh(), IdealCastorTrapezoid::dxl(), PreshowerStrip::dy(), IdealZDCTrapezoid::dy(), IdealZDCTrapezoid::dz(), IdealZPrism::dz(), IdealObliquePrism::dz(), IdealCastorTrapezoid::dz(), PreshowerStrip::dz(), IdealZPrism::eta(), IdealObliquePrism::eta(), IdealCastorTrapezoid::getCorners(), IdealZDCTrapezoid::getCorners(), CaloSubdetectorGeometry::getSummary(), getTransform(), operator<<(), PreshowerStrip::tilt(), IdealObliquePrism::z(), and IdealZPrism::z().
{ return m_parms ;}
float CaloCellGeometry::phiPos | ( | ) | const [inline] |
CaloCellGeometry::CornersVec & CaloCellGeometry::setCorners | ( | ) | const [protected] |
Definition at line 53 of file CaloCellGeometry.cc.
References m_corners.
Referenced by IdealCastorTrapezoid::getCorners(), IdealZDCTrapezoid::getCorners(), IdealZPrism::getCorners(), IdealObliquePrism::getCorners(), and PreshowerStrip::getCorners().
{ return m_corners ; }
virtual void CaloCellGeometry::vocalCorners | ( | Pt3DVec & | vec, |
const CCGFloat * | pv, | ||
Pt3D & | ref | ||
) | const [pure virtual] |
Implemented in IdealObliquePrism, IdealZPrism, PreshowerStrip, GCC11_FINAL< T >, IdealCastorTrapezoid, and IdealZDCTrapezoid.
Referenced by getTransform().
const float CaloCellGeometry::k_ScaleFromDDDtoGeant [static] |
Definition at line 70 of file CaloCellGeometry.h.
Referenced by EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry().
CornersVec CaloCellGeometry::m_corners [mutable, private] |
Definition at line 122 of file CaloCellGeometry.h.
Referenced by emptyCorners(), getCorners(), and setCorners().
float CaloCellGeometry::m_eta [private] |
Definition at line 124 of file CaloCellGeometry.h.
Referenced by etaPos().
const CCGFloat* CaloCellGeometry::m_parms [private] |
Definition at line 123 of file CaloCellGeometry.h.
Referenced by param().
float CaloCellGeometry::m_phi [private] |
Definition at line 124 of file CaloCellGeometry.h.
Referenced by phiPos().
GlobalPoint CaloCellGeometry::m_refPoint [private] |
Definition at line 121 of file CaloCellGeometry.h.
Referenced by getPosition().