#include <CaloCellGeometry.h>
Public Types | |
typedef EZMgrFL< GlobalPoint > | CornersMgr |
enum | CornersSize { k_cornerSize = 8 } |
typedef EZArrayFL< GlobalPoint > | CornersVec |
typedef EZMgrFL< double > | ParMgr |
typedef EZArrayFL< double > | ParVec |
typedef std::vector< ParVec > | ParVecVec |
Public Member Functions | |
bool | emptyCorners () const |
virtual const CornersVec & | getCorners () const =0 |
const GlobalPoint & | getPosition () const |
virtual HepGeom::Transform3D | getTransform (std::vector< HepGeom::Point3D< double > > *lptr) const |
bool | inside (const GlobalPoint &point) const |
const double * | param () const |
virtual std::vector < HepGeom::Point3D< double > > | vocalCorners (const double *pv, HepGeom::Point3D< double > &ref) const =0 |
virtual | ~CaloCellGeometry () |
Static Public Member Functions | |
static const double * | checkParmPtr (const std::vector< double > &vd, ParVecVec &pvv) |
static const double * | getParmPtr (const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv) |
Static Public Attributes | |
static const float | k_ScaleFromDDDtoGeant |
Protected Member Functions | |
CaloCellGeometry (CornersVec::const_reference gp, const CornersMgr *mgr, const double *par) | |
CaloCellGeometry (const CornersVec &cv, const double *par) | |
CornersVec & | setCorners () const |
Private Attributes | |
CornersVec | m_corners |
const double * | m_parms |
const GlobalPoint | m_refPoint |
Abstract base class for an individual cell's geometry.
Definition at line 25 of file CaloCellGeometry.h.
typedef EZMgrFL< GlobalPoint > CaloCellGeometry::CornersMgr |
Definition at line 30 of file CaloCellGeometry.h.
typedef EZArrayFL< GlobalPoint > CaloCellGeometry::CornersVec |
Definition at line 29 of file CaloCellGeometry.h.
typedef EZMgrFL< double > CaloCellGeometry::ParMgr |
Definition at line 34 of file CaloCellGeometry.h.
typedef EZArrayFL<double> CaloCellGeometry::ParVec |
Definition at line 32 of file CaloCellGeometry.h.
typedef std::vector<ParVec> CaloCellGeometry::ParVecVec |
Definition at line 33 of file CaloCellGeometry.h.
virtual CaloCellGeometry::~CaloCellGeometry | ( | ) | [inline, virtual] |
Definition at line 40 of file CaloCellGeometry.h.
{}
CaloCellGeometry::CaloCellGeometry | ( | CornersVec::const_reference | gp, |
const CornersMgr * | mgr, | ||
const double * | par | ||
) | [inline, protected] |
Definition at line 72 of file CaloCellGeometry.h.
: m_refPoint ( gp ), m_corners ( mgr ), m_parms ( par ) {}
CaloCellGeometry::CaloCellGeometry | ( | const CornersVec & | cv, |
const double * | par | ||
) | [inline, protected] |
const double * CaloCellGeometry::checkParmPtr | ( | const std::vector< double > & | vd, |
CaloCellGeometry::ParVecVec & | pvv | ||
) | [static] |
Definition at line 78 of file CaloCellGeometry.cc.
References EZArrayFL< T >::begin(), j, EZArrayFL< T >::size(), and v.
Referenced by getParmPtr().
{ const double* 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 51 of file CaloCellGeometry.h.
References EZArrayFL< T >::empty(), and m_corners.
Referenced by operator<<().
const CaloCellGeometry::CornersVec & CaloCellGeometry::getCorners | ( | ) | const [pure virtual] |
Implemented in calogeom::IdealObliquePrism, calogeom::IdealZPrism, PreshowerStrip, TruncatedPyramid, calogeom::IdealCastorTrapezoid, and calogeom::IdealZDCTrapezoid.
Definition at line 7 of file CaloCellGeometry.cc.
References m_corners.
Referenced by CaloGeometryHelper::buildCrystalArray(), PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), CaloSubdetectorGeometry::deltaEta(), CaloSubdetectorGeometry::deltaPhi(), CaloTowersCreationAlgo::emCrystalShwrPos(), EcalEndcapGeometry::getClosestCell(), calogeom::IdealCastorTrapezoid::getCorners(), calogeom::IdealObliquePrism::getCorners(), calogeom::IdealZPrism::getCorners(), calogeom::IdealZDCTrapezoid::getCorners(), TruncatedPyramid::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 double * CaloCellGeometry::getParmPtr | ( | const std::vector< double > & | vd, |
CaloCellGeometry::ParMgr * | mgr, | ||
CaloCellGeometry::ParVecVec & | pvv | ||
) | [static] |
Definition at line 105 of file CaloCellGeometry.cc.
References prof2calltree::back, checkParmPtr(), and i.
Referenced by CaloTowerHardcodeGeometryLoader::makeCell(), HcalHardcodeGeometryLoader::makeCell(), CastorHardcodeGeometryLoader::makeCell(), HcalDDDGeometryLoader::makeCell(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), and CaloGeometryDBEP< T, U >::produceAligned().
const GlobalPoint& CaloCellGeometry::getPosition | ( | ) | const [inline] |
Definition at line 46 of file CaloCellGeometry.h.
References m_refPoint.
Referenced by EcalTPGParamBuilder::analyze(), HcalRecHitsValidation::analyze(), CaloTowersCreationAlgo::assignHit(), CaloRecoTauAlgorithm::buildCaloTau(), CaloGeometryHelper::buildCrystalArray(), EcalHaloAlgo::Calculate(), SuperClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_EnergyDepTopology(), compEcalEnergySum(), compHcalEnergySum(), CaloTowersCreationAlgo::convert(), EcalClusterTools::covariances(), PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), DistanceToCell::DistanceToCell(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), CaloTowersCreationAlgo::emCrystalShwrPos(), GlobalHitsProducer::fillECal(), GlobalHitsProdHist::fillECal(), GlobalHitsAnalyzer::fillECal(), ECALRecHitAnalyzer::FillGeometry(), HCALRecHitAnalyzer::FillGeometry(), GlobalRecHitsAnalyzer::fillHCal(), GlobalHitsAnalyzer::fillHCal(), GlobalHitsProducer::fillHCal(), GlobalHitsProdHist::fillHCal(), GlobalRecHitsProducer::fillHCal(), PFRecHitProducerECAL::findEcalRecHitGeometry(), TCTauAlgorithm::getCellMomentum(), EcalEndcapGeometry::getCells(), HcalGeometry::getCells(), EcalBarrelGeometry::getCells(), HcalGeometry::getClosestCell(), CaloGeometryHelper::getClosestCell(), EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), calogeom::IdealCastorTrapezoid::getCorners(), calogeom::IdealObliquePrism::getCorners(), calogeom::IdealZPrism::getCorners(), calogeom::IdealZDCTrapezoid::getCorners(), PreshowerStrip::getCorners(), L2TauModularIsolationProducer::getECALHits(), L2TauNarrowConeIsolationProducer::getECALHits(), L2TauIsolationProducer::getECALHits(), EcalClusterTools::getEnergyDepTopology(), CaloGeometry::getPosition(), CaloDetIdAssociator::getPosition(), HCaloDetIdAssociator::getPosition(), TruncatedPyramid::getPosition(), TruncatedPyramid::getTransform(), getTransform(), CaloTowersCreationAlgo::hadSegmentShwrPos(), CaloTowersCreationAlgo::hadShwPosFromCells(), EcalEndcapRecHitsMaker::init(), EcalBarrelRecHitsMaker::init(), CaloGeometryHelper::initialize(), EcalRingCalibrationTools::initializeFromGeometry(), TruncatedPyramid::makeAxis(), CosmicClusterAlgo::makeClusters(), HybridClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), IslandClusterAlgo::makeClusters(), PreshowerClusterAlgo::makeOneCluster(), EcalClusterTools::meanClusterPosition(), DistanceToCell::operator()(), operator<<(), calogeom::operator<<(), PlotEcalRecHits::printEcalRecHit(), CastorEventDisplay::processEvent(), JetCrystalsAssociator::produce(), EcalRecHitWorkerRecover::run(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), and CaloHitRespoNew::timeOfFlight().
{ return m_refPoint ; }
HepGeom::Transform3D CaloCellGeometry::getTransform | ( | std::vector< HepGeom::Point3D< double > > * | lptr | ) | const [virtual] |
Reimplemented in PreshowerStrip, and TruncatedPyramid.
Definition at line 32 of file CaloCellGeometry.cc.
References angle(), getCorners(), getPosition(), i, mag(), L1TEmulatorMonitor_cff::p, p2, param(), csvLumiCalc::unit, vocalCorners(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
{ const GlobalPoint& p ( CaloCellGeometry::getPosition() ) ; const HepGeom::Point3D<double> gFront ( p.x(), p.y(), p.z() ) ; HepGeom::Point3D<double> lFront ; assert( 0 != param() ) ; std::vector<HepGeom::Point3D<double> > lc ( vocalCorners( param(), lFront ) ) ; HepGeom::Point3D<double> lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ; const HepGeom::Point3D<double> lOne ( lc[0] ) ; const CornersVec& cor ( getCorners() ) ; std::vector<HepGeom::Point3D<double> > kor ( 8, HepGeom::Point3D<double> (0,0,0) ) ; for( unsigned int i ( 0 ) ; i != 8 ; ++i ) { kor[i] = HepGeom::Point3D<double> ( cor[i].x(), cor[i].y(), cor[i].z() ) ; } HepGeom::Point3D<double> gBack ( 0.25*( kor[4]+kor[5]+kor[6]+kor[7] ) ) ; const HepGeom::Vector3D<double> gAxis ( (gBack-gFront).unit() ) ; gBack = ( gFront + (lBack-lFront).mag()*gAxis ) ; const HepGeom::Point3D<double> gOneT ( gFront + ( lOne - lFront ).mag()*( kor[0] - gFront ).unit() ) ; const double langle ( ( lBack - lFront).angle( lOne - lFront ) ) ; const double gangle ( ( gBack - gFront).angle( gOneT- gFront ) ) ; const double dangle ( langle - gangle ) ; const HepGeom::Plane3D<double> gPl ( gFront, gOneT, gBack ) ; const HepGeom::Point3D<double> p2 ( gFront + gPl.normal().unit() ) ; const HepGeom::Point3D<double> gOne ( gFront + HepGeom::Rotate3D( -dangle, gFront, p2 )* HepGeom::Vector3D<double> ( gOneT - gFront ) ) ; const HepGeom::Transform3D tr ( lFront , lBack , lOne , gFront , gBack , gOne ) ; if( 0 != lptr ) (*lptr) = lc ; return tr ; }
bool CaloCellGeometry::inside | ( | const GlobalPoint & | point | ) | const |
Definition at line 126 of file CaloCellGeometry.cc.
References getCorners(), i, L1TEmulatorMonitor_cff::p, funct::true, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by CastorGeometry::getClosestCell(), ZdcGeometry::getClosestCell(), CaloDetIdAssociator::insideElement(), and HCaloDetIdAssociator::insideElement().
{ bool ans ( false ) ; const HepGeom::Point3D<double> p ( point.x(), point.y(), point.z() ) ; const CornersVec& cog ( getCorners() ) ; HepGeom::Point3D<double> co[8] ; for( unsigned int i ( 0 ) ; i != 8 ; ++i ) { co[i] = HepGeom::Point3D<double> ( cog[i].x(), cog[i].y(), cog[i].z() ) ; } const HepGeom::Plane3D<double> AA ( co[0], co[1], co[2] ) ; // z<0 const HepGeom::Plane3D<double> BB ( co[6], co[5], co[4] ) ; // z>0 if( AA.distance(p)*BB.distance(p) >= 0 ) { const HepGeom::Plane3D<double> CC ( co[0], co[4], co[5] ) ; // x<0 const HepGeom::Plane3D<double> DD ( co[2], co[6], co[7] ) ; // x>0 if( CC.distance(p)*DD.distance(p) >= 0 ) { const HepGeom::Plane3D<double> EE ( co[3], co[7], co[4] ) ; // y<0 const HepGeom::Plane3D<double> FF ( co[1], co[5], co[6] ) ; // y>0 if( EE.distance(p)*FF.distance(p) >= 0 ) { ans = true ; } } } return ans ; }
const double* CaloCellGeometry::param | ( | ) | const [inline] |
Definition at line 53 of file CaloCellGeometry.h.
References m_parms.
Referenced by calogeom::IdealZDCTrapezoid::an(), calogeom::IdealCastorTrapezoid::an(), calogeom::IdealObliquePrism::dEta(), calogeom::IdealZPrism::dEta(), calogeom::IdealCastorTrapezoid::dh(), calogeom::IdealObliquePrism::dPhi(), calogeom::IdealZPrism::dPhi(), calogeom::IdealCastorTrapezoid::dR(), PreshowerStrip::dx(), calogeom::IdealZDCTrapezoid::dx(), calogeom::IdealCastorTrapezoid::dxh(), calogeom::IdealCastorTrapezoid::dxl(), PreshowerStrip::dy(), calogeom::IdealZDCTrapezoid::dy(), calogeom::IdealZDCTrapezoid::dz(), calogeom::IdealCastorTrapezoid::dz(), calogeom::IdealZPrism::dz(), calogeom::IdealObliquePrism::dz(), PreshowerStrip::dz(), calogeom::IdealObliquePrism::eta(), calogeom::IdealZPrism::eta(), calogeom::IdealCastorTrapezoid::getCorners(), calogeom::IdealZDCTrapezoid::getCorners(), TruncatedPyramid::getTransform(), getTransform(), calogeom::IdealObliquePrism::z(), and calogeom::IdealZPrism::z().
{ return m_parms ; }
CornersVec& CaloCellGeometry::setCorners | ( | ) | const [inline, protected] |
Definition at line 87 of file CaloCellGeometry.h.
References m_corners.
Referenced by calogeom::IdealCastorTrapezoid::getCorners(), calogeom::IdealObliquePrism::getCorners(), calogeom::IdealZPrism::getCorners(), calogeom::IdealZDCTrapezoid::getCorners(), TruncatedPyramid::getCorners(), and PreshowerStrip::getCorners().
{ return m_corners ; }
virtual std::vector<HepGeom::Point3D<double> > CaloCellGeometry::vocalCorners | ( | const double * | pv, |
HepGeom::Point3D< double > & | ref | ||
) | const [pure virtual] |
Implemented in calogeom::IdealObliquePrism, calogeom::IdealZPrism, PreshowerStrip, TruncatedPyramid, calogeom::IdealCastorTrapezoid, and calogeom::IdealZDCTrapezoid.
Referenced by getTransform().
const float CaloCellGeometry::k_ScaleFromDDDtoGeant [static] |
Definition at line 38 of file CaloCellGeometry.h.
Referenced by EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry().
CornersVec CaloCellGeometry::m_corners [mutable, private] |
Definition at line 93 of file CaloCellGeometry.h.
Referenced by emptyCorners(), getCorners(), and setCorners().
const double* CaloCellGeometry::m_parms [private] |
Definition at line 95 of file CaloCellGeometry.h.
Referenced by param().
const GlobalPoint CaloCellGeometry::m_refPoint [private] |
Definition at line 91 of file CaloCellGeometry.h.
Referenced by getPosition().