/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Geometry/ForwardGeometry/src/CastorGeometry.cc
71 строка
2 KB
Christopher Jones
Avoid extra memory use in CaloSubdetectorGeometry
24 окт 2024, 23:07
24 окт 2024, 23:07
6a9a979
Код
Авторство
О чём код?
#include "Geometry/CaloGeometry/interface/CaloGenericDetId.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/ForwardGeometry/interface/CastorGeometry.h" #include "Geometry/ForwardGeometry/interface/IdealCastorTrapezoid.h" #include "CastorGeometryData.h" #include <algorithm> typedef CaloCellGeometry::CCGFloat CCGFloat; typedef CaloCellGeometry::Pt3D Pt3D; typedef CaloCellGeometry::Pt3DVec Pt3DVec; CastorGeometry::CastorGeometry() : theTopology(new CastorTopology), m_ownsTopology(true), m_cellVec(k_NumberOfCellsForCorners) {} CastorGeometry::CastorGeometry(const CastorTopology* topology) : theTopology(topology), m_ownsTopology(false), m_cellVec(k_NumberOfCellsForCorners) {} CastorGeometry::~CastorGeometry() { if (m_ownsTopology) delete theTopology; } DetId CastorGeometry::getClosestCell(const GlobalPoint& r) const { DetId returnId(0); const std::vector<DetId>& detIds(getValidDetIds()); for (auto detId : detIds) { auto cell = getGeometry(detId); if (nullptr != cell && cell->inside(r)) { returnId = detId; break; } } return returnId; } unsigned int CastorGeometry::alignmentTransformIndexLocal(const DetId& id) { const CaloGenericDetId gid(id); assert(gid.isCastor()); return 0; } unsigned int CastorGeometry::alignmentTransformIndexGlobal(const DetId& /*id*/) { return (unsigned int)DetId::Calo - 1; } void CastorGeometry::localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int /*i*/, Pt3D& ref) { IdealCastorTrapezoid::localCorners(lc, pv, ref); } void CastorGeometry::newCell(const GlobalPoint& f1, const GlobalPoint& /*f2*/, const GlobalPoint& /*f3*/, const CCGFloat* parm, const DetId& detId) { const CaloGenericDetId cgid(detId); assert(cgid.isCastor()); const unsigned int di(cgid.denseIndex()); m_cellVec[di] = IdealCastorTrapezoid(f1, cornersMgr(), parm); addValidID(detId); } CaloCellGeometryPtr CastorGeometry::getGeometryRawPtr(uint32_t index) const { // Modify the RawPtr class return CaloCellGeometryPtr(m_cellVec.size() <= index || nullptr == m_cellVec[index].param() ? nullptr : &m_cellVec[index]); }