#include <CaloGeometry.h>
Public Member Functions | |
CaloGeometry () | |
const CaloCellGeometry * | getGeometry (const DetId &id) const |
Get the cell geometry of a given detector id. | |
const GlobalPoint & | getPosition (const DetId &id) const |
Get the position of a given detector id. | |
const CaloSubdetectorGeometry * | getSubdetectorGeometry (DetId::Detector det, int subdet) const |
access the subdetector geometry for the given subdetector directly | |
const CaloSubdetectorGeometry * | getSubdetectorGeometry (const DetId &id) const |
access the subdetector geometry for the given subdetector directly | |
std::vector< DetId > | getValidDetIds () const |
Get the list of all valid detector ids. | |
const std::vector< DetId > & | getValidDetIds (DetId::Detector det, int subdet) const |
Get the list of valid detector ids for the given subdetector. | |
bool | present (const DetId &id) const |
is this detid present in the geometry? | |
void | setSubdetGeometry (DetId::Detector det, int subdet, const CaloSubdetectorGeometry *geom) |
Register a subdetector geometry. | |
Private Types | |
enum | { kMaxDet = 5, kMinDet = 3, kNDets = kMaxDet - kMinDet + 1, kMaxSub = 4, kLength = kNDets*kMaxSub } |
Private Member Functions | |
unsigned int | makeIndex (DetId::Detector det, int subdet, bool &ok) const |
Private Attributes | |
std::vector< const CaloSubdetectorGeometry * > | m_geos |
Static Private Attributes | |
static const std::vector< DetId > | k_emptyVec |
Interface class to the geometry information for all calorimetry subdetectors.
Definition at line 21 of file CaloGeometry.h.
anonymous enum [private] |
CaloGeometry::CaloGeometry | ( | ) |
Definition at line 7 of file CaloGeometry.cc.
const CaloCellGeometry * CaloGeometry::getGeometry | ( | const DetId & | id | ) | const |
Get the cell geometry of a given detector id.
Definition at line 76 of file CaloGeometry.cc.
References relativeConstraints::geom, CaloSubdetectorGeometry::getGeometry(), and getSubdetectorGeometry().
Referenced by EcalSimple2007H4TBAnalyzer::analyze(), CaloTowersCreationAlgo::assignHit(), CaloTowersCreationAlgo::emCrystalShwrPos(), GlobalHitsProducer::fillECal(), GlobalHitsProdHist::fillECal(), GlobalHitsAnalyzer::fillECal(), GlobalHitsAnalyzer::fillHCal(), GlobalHitsProducer::fillHCal(), GlobalHitsProdHist::fillHCal(), ParticleTowerProducer::getNearestTower(), CaloTowersCreationAlgo::hadSegmentShwrPos(), CaloTowersCreationAlgo::hadShwPosFromCells(), ParticleTowerProducer::produce(), and ParticleTowerProducer::resetTowers().
{ const CaloSubdetectorGeometry* geom ( getSubdetectorGeometry( id ) ) ; const CaloCellGeometry* cell ( 0 == geom ? 0 : geom->getGeometry( id ) ) ; return cell ; }
const GlobalPoint & CaloGeometry::getPosition | ( | const DetId & | id | ) | const |
Get the position of a given detector id.
Definition at line 68 of file CaloGeometry.cc.
References relativeConstraints::geom, CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), getSubdetectorGeometry(), and notFound.
Referenced by HFClusterAlgo::clusterize(), egammaisolation::EgammaRecHitExtractor::collect(), egammaisolation::EgammaHcalExtractor::deposit(), ecalEnergyInCone(), EcalRecHitWorkerRecover::estimateEnergy(), Numbers::eta(), reco::HcalNoiseInfoProducer::fillrechits(), filterCellsInCone(), spr::findCone(), PileUpSubtractor::getCone(), ParametrizedSubtractor::getEt(), ParametrizedSubtractor::getEta(), spr::getGpos(), EgammaHLTHcalIsolationDoubleCone::isolPtSum(), HFClusterAlgo::makeCluster(), spr::matrixECALIds(), spr::matrixHCALIds(), Numbers::phi(), EcalIsolatedParticleCandidateProducer::produce(), AlCaIsoTracksProducer::produce(), cms::AlCaDiJetsProducer::produce(), EcalRecHitWorkerRecover::run(), and spr::timeOfFlight().
{ const CaloSubdetectorGeometry* geom=getSubdetectorGeometry( id ) ; const CaloCellGeometry* cell ( ( 0 == geom ? 0 : geom->getGeometry( id ) ) ) ; return ( 0 == cell ? notFound : cell->getPosition() ) ; }
const CaloSubdetectorGeometry * CaloGeometry::getSubdetectorGeometry | ( | DetId::Detector | det, |
int | subdet | ||
) | const |
access the subdetector geometry for the given subdetector directly
Definition at line 54 of file CaloGeometry.cc.
References getHLTprescales::index, m_geos, makeIndex(), and convertSQLiteXML::ok.
const CaloSubdetectorGeometry * CaloGeometry::getSubdetectorGeometry | ( | const DetId & | id | ) | const |
access the subdetector geometry for the given subdetector directly
Definition at line 43 of file CaloGeometry.cc.
References getHLTprescales::index, m_geos, makeIndex(), and convertSQLiteXML::ok.
Referenced by IsolatedTracksCone::analyze(), EcalHaloAlgo::Calculate(), spr::chargeIsolationEcal(), EcalClusterPUCleaningTools::CleanedSuperCluster(), EcalClusterTools::covariances(), HcalRecHitsMaker::createVectorOfSubdetectorCells(), egammaisolation::EgammaRecHitExtractor::deposit(), InvRingCalib::EERingDef(), EgammaRecHitIsolation::EgammaRecHitIsolation(), EcalClusterLazyTools::eseffsirir(), EcalClusterLazyTools::eseffsixix(), EcalClusterLazyTools::eseffsiyiy(), HCALRecHitAnalyzer::FillGeometry(), spr::findDetIdECAL(), spr::findDetIdHCAL(), BetaCalculatorECAL::getDetailedTrackLengthInXtals(), HCaloDetIdAssociator::getDetIdPoints(), CaloDetIdAssociator::getDetIdPoints(), EcalClusterTools::getEnergyDepTopology(), EcalClusterLazyTools::getESHits(), getGeometry(), HoECalculator::getHoE(), getPosition(), CaloDetIdAssociator::getPosition(), HCaloDetIdAssociator::getPosition(), PhotonFixCMS::initialise(), EcalRingCalibrationTools::initializeFromGeometry(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), spr::matrixECALIds(), EcalClusterTools::meanClusterPosition(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), present(), CastorEventDisplay::processEvent(), HybridClusterProducer::produce(), EgammaHLTHybridClusterProducer::produce(), spr::propagateCALO(), CaloConeSelector::select(), CaloDualConeSelector::select(), CaloTowersCreationAlgo::setGeometry(), EcalGeomPhiSymHelper::setup(), Calorimeter::setupGeometry(), CaloHitResponse::timeOfFlight(), and EcalDigiProducer::updateGeometry().
std::vector< DetId > CaloGeometry::getValidDetIds | ( | ) | const |
Get the list of all valid detector ids.
Definition at line 90 of file CaloGeometry.cc.
References DetId::Hcal, i, kLength, m_geos, and funct::true.
Referenced by cms::DiJetAnalyzer::analyze(), cms::HcalConstantsASCIIWriter::analyze(), EcalMixingModuleValidation::computeSDBunchDigi(), EcalEleCalibLooper::duringLoop(), InvRingCalib::duringLoop(), Pi0FixedMassWindowCalibration::duringLoop(), HEcalDetIdAssociator::getASetOfValidDetIds(), HCaloDetIdAssociator::getASetOfValidDetIds(), HHcalDetIdAssociator::getASetOfValidDetIds(), ParticleTowerProducer::getNearestTower(), CaloDetIdAssociator::getValidDetIds(), HcalDetIdAssociator::getValidDetIds(), PreshowerDetIdAssociator::getValidDetIds(), EcalDetIdAssociator::getValidDetIds(), getValidDetIds(), HODetIdAssociator::getValidDetIds(), EcalRingCalibrationTools::initializeFromGeometry(), ParticleTowerProducer::resetTowers(), EcalGeomPhiSymHelper::setup(), PileUpSubtractor::setupGeometryMap(), ParametrizedSubtractor::setupGeometryMap(), HcalTBDigiProducer::updateGeometry(), and HcalDigitizer::updateGeometry().
{ std::vector<DetId> returnValue ; returnValue.reserve( kLength ) ; bool doneHcal ( false ) ; for( unsigned int i ( 0 ) ; i != m_geos.size() ; ++i ) { if( 0 != m_geos[i] ) { const std::vector< DetId >& aVec ( m_geos[i]->getValidDetIds() ) ; const bool isHcal ( DetId::Hcal == aVec.front().det() ) ; if( !doneHcal || !isHcal ) { returnValue.insert( returnValue.end(), aVec.begin(), aVec.end() ) ; if( !doneHcal && isHcal ) doneHcal = true ; } } } return returnValue ; }
const std::vector< DetId > & CaloGeometry::getValidDetIds | ( | DetId::Detector | det, |
int | subdet | ||
) | const |
Get the list of valid detector ids for the given subdetector.
Definition at line 115 of file CaloGeometry.cc.
References getValidDetIds(), getHLTprescales::index, k_emptyVec, m_geos, makeIndex(), and convertSQLiteXML::ok.
{ bool ok ; const unsigned int index ( makeIndex( det, subdet, ok ) ) ; return ( ok && ( 0 != m_geos[ index ] ) ? m_geos[ index ]->getValidDetIds( det, subdet ) : k_emptyVec ) ; }
unsigned int CaloGeometry::makeIndex | ( | DetId::Detector | det, |
int | subdet, | ||
bool & | ok | ||
) | const [private] |
Definition at line 13 of file CaloGeometry.cc.
References kMaxDet, kMaxSub, and kMinDet.
Referenced by getSubdetectorGeometry(), getValidDetIds(), and setSubdetGeometry().
bool CaloGeometry::present | ( | const DetId & | id | ) | const |
is this detid present in the geometry?
Definition at line 84 of file CaloGeometry.cc.
References relativeConstraints::geom, getSubdetectorGeometry(), and CaloSubdetectorGeometry::present().
{ const CaloSubdetectorGeometry* geom ( getSubdetectorGeometry( id ) ) ; return ( 0 == geom ? false : geom->present( id ) ) ; }
void CaloGeometry::setSubdetGeometry | ( | DetId::Detector | det, |
int | subdet, | ||
const CaloSubdetectorGeometry * | geom | ||
) |
Register a subdetector geometry.
Definition at line 28 of file CaloGeometry.cc.
References relativeConstraints::geom, getHLTprescales::index, m_geos, makeIndex(), and convertSQLiteXML::ok.
const std::vector< DetId > CaloGeometry::k_emptyVec [static, private] |
Definition at line 59 of file CaloGeometry.h.
Referenced by getValidDetIds().
std::vector< const CaloSubdetectorGeometry* > CaloGeometry::m_geos [private] |
Definition at line 61 of file CaloGeometry.h.
Referenced by getSubdetectorGeometry(), getValidDetIds(), and setSubdetGeometry().