diff --git a/Geometry/HGCalGeometry/interface/FastTimeGeometry.h b/Geometry/HGCalGeometry/interface/FastTimeGeometry.h deleted file mode 100644 index 4e6355eab7da8..0000000000000 --- a/Geometry/HGCalGeometry/interface/FastTimeGeometry.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef GeometryHGCalGeometryFastTimeGeometry_h -#define GeometryHGCalGeometryFastTimeGeometry_h - -/* - * Geometry for Fast Timing Layer - * This geometry is essentially driven by topology, - * which is thus encapsulated in this class. - * This makes this geometry not suitable to be loaded - * by regular CaloGeometryLoader - */ - -#include "DataFormats/Common/interface/AtomicPtrCache.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloGeometry/interface/FlatTrd.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "DetectorDescription/Core/interface/DDFilteredView.h" -#include "Geometry/CaloTopology/interface/FastTimeTopology.h" -#include "Geometry/Records/interface/FastTimeGeometryRecord.h" -#include - -class FlatTrd; - -class FastTimeGeometry final : public CaloSubdetectorGeometry { -public: - typedef std::vector CellVec; - - typedef CaloCellGeometry::CCGFloat CCGFloat; - typedef CaloCellGeometry::Pt3D Pt3D; - typedef CaloCellGeometry::Pt3DVec Pt3DVec; - - typedef std::set DetIdSet; - typedef std::vector CornersVec; - - typedef FastTimeGeometryRecord AlignedRecord; // NOTE: not aligned yet - typedef PFastTimeRcd PGeometryRecord; - - enum { k_NumberOfParametersPerShape = 12 }; // FlatTrd - enum { k_NumberOfShapes = 50 }; - - static std::string dbString() { return "PFastTimeRcd"; } - - FastTimeGeometry(const FastTimeTopology& topology); - - ~FastTimeGeometry() override; - - void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref); - - void newCell(const GlobalPoint& f1, - const GlobalPoint& f2, - const GlobalPoint& f3, - const CCGFloat* parm, - const DetId& detId) override; - - /// Get the cell geometry of a given detector id. Should return false if not found. - std::shared_ptr getGeometry(const DetId& id) const override; - - bool present(const DetId& id) const override; - - void getSummary(CaloSubdetectorGeometry::TrVec& trVector, - CaloSubdetectorGeometry::IVec& iVector, - CaloSubdetectorGeometry::DimVec& dimVector, - CaloSubdetectorGeometry::IVec& dinsVector) const override; - - GlobalPoint getPosition(const DetId& id) const; - - /// Returns the corner points of this cell's volume. - CornersVec getCorners(const DetId& id) const; - - // avoid sorting set in base class - const std::vector& getValidDetIds(DetId::Detector det = DetId::Detector(0), int subdet = 0) const override { - return m_validIds; - } - const std::vector& getValidGeomDetIds(void) const { return m_validGeomIds; } - - // Get closest cell, etc... - DetId getClosestCell(const GlobalPoint& r) const override; - - /** \brief Get a list of all cells within a dR of the given cell - - The default implementation makes a loop over all cell geometries. - Cleverer implementations are suggested to use rough conversions between - eta/phi and ieta/iphi and test on the boundaries. - */ - DetIdSet getCells(const GlobalPoint& r, double dR) const override; - - virtual void fillNamedParams(DDFilteredView fv); - void initializeParms() override; - - static std::string producerTag() { return "FastTime"; } - std::string cellElement() const; - - const FastTimeTopology& topology() const { return m_topology; } - void sortDetIds(); - -protected: - unsigned int indexFor(const DetId& id) const override; - using CaloSubdetectorGeometry::sizeForDenseIndex; - unsigned int sizeForDenseIndex() const; - - // Modify the RawPtr class - const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override; - std::shared_ptr cellGeomPtr(uint32_t index) const override; - - void addValidID(const DetId& id); - -private: - std::shared_ptr cellGeomPtr(uint32_t index, const GlobalPoint& p) const; - - const FastTimeTopology& m_topology; - - CellVec m_cellVec; - std::vector m_validGeomIds; - int m_Type; - ForwardSubdetector m_subdet; -}; - -#endif diff --git a/Geometry/HGCalGeometry/interface/FastTimeGeometryLoader.h b/Geometry/HGCalGeometry/interface/FastTimeGeometryLoader.h deleted file mode 100644 index d62d7f07080fd..0000000000000 --- a/Geometry/HGCalGeometry/interface/FastTimeGeometryLoader.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef GeometryHGCalGeometryFastTimeGeometryLoader_h -#define GeometryHGCalGeometryFastTimeGeometryLoader_h -#include "Geometry/HGCalGeometry/interface/FastTimeGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/FlatTrd.h" -#include "Geometry/CaloTopology/interface/FastTimeTopology.h" - -class FastTimeGeometryLoader { -public: - typedef CaloCellGeometry::CCGFloat CCGFloat; - typedef std::vector ParmVec; - - FastTimeGeometryLoader(); - ~FastTimeGeometryLoader(); - - FastTimeGeometry* build(const FastTimeTopology&); - -private: - void buildGeom(const ParmVec&, const HepGeom::Transform3D&, const DetId&, const FastTimeTopology&, FastTimeGeometry*); -}; - -#endif diff --git a/Geometry/HGCalGeometry/plugins/FastTimeGeometryESProducer.cc b/Geometry/HGCalGeometry/plugins/FastTimeGeometryESProducer.cc deleted file mode 100644 index 7a797052ceb21..0000000000000 --- a/Geometry/HGCalGeometry/plugins/FastTimeGeometryESProducer.cc +++ /dev/null @@ -1,77 +0,0 @@ -// -*- C++ -*- -// -// Package: HGCalGeometry -// Class: FastTimeGeometryESProducer -// -/**\class FastTimeGeometryESProducer FastTimeGeometryESProducer.h - - Description: - - Implementation: - -*/ -// -// Original Author: Sunanda Banerjee -// -// - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/ModuleFactory.h" -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloTopology/interface/FastTimeTopology.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometry.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometryLoader.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" - -//#define EDM_ML_DEBUG - -// -// class decleration -// - -class FastTimeGeometryESProducer : public edm::ESProducer { -public: - FastTimeGeometryESProducer(const edm::ParameterSet& iP); - ~FastTimeGeometryESProducer() override = default; - - using ReturnType = std::unique_ptr; - - ReturnType produce(const IdealGeometryRecord&); - -private: - // ----------member data --------------------------- - edm::ESGetToken topologyToken_; -}; - -FastTimeGeometryESProducer::FastTimeGeometryESProducer(const edm::ParameterSet& iConfig) { - auto name = iConfig.getUntrackedParameter("Name"); -#ifdef EDM_ML_DEBUG - auto type = iConfig.getUntrackedParameter("Type"); - edm::LogVerbatim("HGCalGeom") << "constructing FastTimeGeometry for " << name << " Type " << type; -#endif - auto cc = setWhatProduced(this, name); - topologyToken_ = cc.consumes(edm::ESInputTag{"", name}); -} - -// -// member functions -// - -// ------------ method called to produce the data ------------ -FastTimeGeometryESProducer::ReturnType FastTimeGeometryESProducer::produce(const IdealGeometryRecord& iRecord) { - const auto& topo = iRecord.get(topologyToken_); - - FastTimeGeometryLoader builder; -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "Create FastTimeGeometry (topo)"; -#endif - return ReturnType(builder.build(topo)); -} - -DEFINE_FWK_EVENTSETUP_MODULE(FastTimeGeometryESProducer); diff --git a/Geometry/HGCalGeometry/python/FastTimeGeometryESProducer_cfi.py b/Geometry/HGCalGeometry/python/FastTimeGeometryESProducer_cfi.py deleted file mode 100644 index 83e7b036fc16b..0000000000000 --- a/Geometry/HGCalGeometry/python/FastTimeGeometryESProducer_cfi.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# -# This cfi should be included to build the FastTime Geometry -# - -FastTimeBarrelGeometryESProducer = cms.ESProducer("FastTimeGeometryESProducer", - Name = cms.untracked.string("FastTimeBarrel"), - Type = cms.untracked.int32(1) - ) - - -FastTimeEndcapGeometryESProducer = cms.ESProducer("FastTimeGeometryESProducer", - Name = cms.untracked.string("SFBX"), - Type = cms.untracked.int32(2) - ) diff --git a/Geometry/HGCalGeometry/src/FastTimeGeometry.cc b/Geometry/HGCalGeometry/src/FastTimeGeometry.cc deleted file mode 100644 index 1d1d269956afc..0000000000000 --- a/Geometry/HGCalGeometry/src/FastTimeGeometry.cc +++ /dev/null @@ -1,268 +0,0 @@ -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGenericDetId.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/TruncatedPyramid.h" -#include "FWCore/Utilities/interface/Exception.h" - -#include - -#include -#include - -typedef CaloCellGeometry::Tr3D Tr3D; -typedef std::vector ParmVec; - -//#define EDM_ML_DEBUG - -FastTimeGeometry::FastTimeGeometry(const FastTimeTopology& topology_) - : m_topology(topology_), - m_cellVec(topology_.totalGeomModules()), - m_validGeomIds(topology_.totalGeomModules()), - m_Type(topology_.detectorType()), - m_subdet(topology_.subDetector()) { - m_validIds.reserve(topology().totalModules()); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "Expected total # of Geometry Modules " << topology().totalGeomModules(); -#endif -} - -FastTimeGeometry::~FastTimeGeometry() {} - -void FastTimeGeometry::fillNamedParams(DDFilteredView fv) {} - -void FastTimeGeometry::initializeParms() {} - -void FastTimeGeometry::localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref) { - FlatTrd::localCorners(lc, pv, ref); -} - -void FastTimeGeometry::newCell( - const GlobalPoint& f1, const GlobalPoint& f2, const GlobalPoint& f3, const CCGFloat* parm, const DetId& detId) { - FastTimeTopology::DecodedDetId id = topology().decode(detId); - DetId geomId = (DetId)(FastTimeDetId(detId).geometryCell()); - int nEtaZ = topology().dddConstants().numberEtaZ(m_Type); - int nPhi = topology().dddConstants().numberPhi(m_Type); - - const uint32_t cellIndex(topology().detId2denseGeomId(detId)); - - m_cellVec.at(cellIndex) = FlatTrd(cornersMgr(), f1, f2, f3, parm); - m_validGeomIds.at(cellIndex) = geomId; - -#ifdef EDM_ML_DEBUG - unsigned int nOld = m_validIds.size(); -#endif - for (int etaZ = 1; etaZ <= nEtaZ; ++etaZ) { - id.iEtaZ = etaZ; - for (int phi = 1; phi <= nPhi; ++phi) { - id.iPhi = phi; - DetId idc = topology().encode(id); - if (topology().valid(idc)) { - m_validIds.emplace_back(idc); - } - } - } - -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "FastTimeGeometry::newCell-> [" << cellIndex << "] front:" << f1.x() << '/' - << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/' << f2.y() << '/' << f2.z() - << " eta|phi " << m_cellVec[cellIndex].etaPos() << ":" - << m_cellVec[cellIndex].phiPos() << " id:" << FastTimeDetId(detId) - << " with valid DetId from " << nOld << " to " << m_validIds.size(); - edm::LogVerbatim("FastTimeGeom") << "Cell[" << cellIndex << "] " << std::hex << geomId.rawId() << ":" - << m_validGeomIds[cellIndex].rawId() << std::dec; -#endif -} - -std::shared_ptr FastTimeGeometry::getGeometry(const DetId& id) const { - if (id == DetId()) - return nullptr; // nothing to get - DetId geoId = (DetId)(FastTimeDetId(id).geometryCell()); - const uint32_t cellIndex(topology().detId2denseGeomId(geoId)); - const GlobalPoint pos = (id != geoId) ? getPosition(id) : GlobalPoint(); - return cellGeomPtr(cellIndex, pos); -} - -bool FastTimeGeometry::present(const DetId& id) const { - if (id == DetId()) - return false; - DetId geoId = (DetId)(FastTimeDetId(id).geometryCell()); - const uint32_t index(topology().detId2denseGeomId(geoId)); - return (nullptr != getGeometryRawPtr(index)); -} - -GlobalPoint FastTimeGeometry::getPosition(const DetId& id) const { - FastTimeDetId id_ = FastTimeDetId(id); - auto pos = topology().dddConstants().getPosition(m_Type, id_.ieta(), id_.iphi(), id_.zside()); - return GlobalPoint(0.1 * pos.x(), 0.1 * pos.y(), 0.1 * pos.z()); -} - -FastTimeGeometry::CornersVec FastTimeGeometry::getCorners(const DetId& id) const { - FastTimeDetId id_ = FastTimeDetId(id); - auto corners = topology().dddConstants().getCorners(m_Type, id_.ieta(), id_.iphi(), id_.zside()); - FastTimeGeometry::CornersVec out; - for (const auto& corner : corners) { - out.emplace_back(0.1 * corner.x(), 0.1 * corner.y(), 0.1 * corner.z()); - } - return out; -} - -DetId FastTimeGeometry::getClosestCell(const GlobalPoint& r) const { - int zside = (r.z() > 0) ? 1 : -1; - std::pair etaZPhi; - if (m_Type == 1) { - double zz = (zside > 0) ? r.z() : -r.z(); - etaZPhi = topology().dddConstants().getZPhi(zz, r.phi()); - } else { - double phi = (zside > 0) ? static_cast(r.phi()) : atan2(r.y(), -r.x()); - // Cast needed to resolve compile-time ambiguity of ? operator between - // convertible Phi class and atan2 template function. - - etaZPhi = topology().dddConstants().getEtaPhi(r.perp(), phi); - } - FastTimeDetId id = FastTimeDetId(m_Type, etaZPhi.first, etaZPhi.second, zside); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "getClosestCell: for (" << r.x() << ", " << r.y() << ", " << r.z() << ") Id " - << id.type() << ":" << id.zside() << ":" << id.ieta() << ":" << id.iphi(); -#endif - - return (topology().valid(id) ? DetId(id) : DetId()); -} - -FastTimeGeometry::DetIdSet FastTimeGeometry::getCells(const GlobalPoint& r, double dR) const { - FastTimeGeometry::DetIdSet dss; - return dss; -} - -std::string FastTimeGeometry::cellElement() const { - if (m_Type == 1) - return "FastTimeBarrel"; - else if (m_Type == 2) - return "FastTimeEndcap"; - else - return "Unknown"; -} - -unsigned int FastTimeGeometry::indexFor(const DetId& id) const { - unsigned int cellIndex = m_cellVec.size(); - if (id != DetId()) { - DetId geoId = (DetId)(FastTimeDetId(id).geometryCell()); - cellIndex = topology().detId2denseGeomId(geoId); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "indexFor " << std::hex << id.rawId() << ":" << geoId.rawId() << std::dec - << " index " << cellIndex; -#endif - } - return cellIndex; -} - -unsigned int FastTimeGeometry::sizeForDenseIndex() const { return topology().totalGeomModules(); } - -const CaloCellGeometry* FastTimeGeometry::getGeometryRawPtr(uint32_t index) const { - // Modify the RawPtr class - const CaloCellGeometry* cell(&m_cellVec[index]); - return (m_cellVec.size() < index || nullptr == cell->param() ? nullptr : cell); -} - -std::shared_ptr FastTimeGeometry::cellGeomPtr(uint32_t index) const { - if ((index >= m_cellVec.size()) || (m_validGeomIds[index].rawId() == 0)) - return nullptr; - static const auto do_not_delete = [](const void*) {}; - auto cell = std::shared_ptr(&m_cellVec[index], do_not_delete); - if (nullptr == cell->param()) - return nullptr; - return cell; -} - -std::shared_ptr FastTimeGeometry::cellGeomPtr(uint32_t index, const GlobalPoint& pos) const { - if ((index >= m_cellVec.size()) || (m_validGeomIds[index].rawId() == 0)) - return nullptr; - if (pos == GlobalPoint()) - return cellGeomPtr(index); - auto cell = std::make_shared(m_cellVec[index]); - cell->setPosition(pos); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeomX") << "cellGeomPtr " << pos << ":" << cell; -#endif - if (nullptr == cell->param()) - return nullptr; - return cell; -} - -void FastTimeGeometry::addValidID(const DetId& id) { - edm::LogError("FastTimeGeom") << "FastTimeGeometry::addValidID is not implemented"; -} - -// FIXME: Change sorting algorithm if needed -namespace { - struct rawIdSort { - bool operator()(const DetId& a, const DetId& b) { return (a.rawId() < b.rawId()); } - }; -} // namespace - -void FastTimeGeometry::sortDetIds(void) { - m_validIds.shrink_to_fit(); - std::sort(m_validIds.begin(), m_validIds.end(), rawIdSort()); -} - -void FastTimeGeometry::getSummary(CaloSubdetectorGeometry::TrVec& trVector, - CaloSubdetectorGeometry::IVec& iVector, - CaloSubdetectorGeometry::DimVec& dimVector, - CaloSubdetectorGeometry::IVec& dinsVector) const { - unsigned int numberOfCells = topology().totalGeomModules(); // total Geom Modules both sides - unsigned int numberOfShapes = FastTimeGeometry::k_NumberOfShapes; - unsigned int numberOfParametersPerShape = FastTimeGeometry::k_NumberOfParametersPerShape; - - trVector.reserve(numberOfCells * numberOfTransformParms()); - iVector.reserve(numberOfCells); - dimVector.reserve(numberOfShapes * numberOfParametersPerShape); - dinsVector.reserve(numberOfCells); - - for (unsigned int k = 0; k < topology().totalGeomModules(); ++k) { - ParmVec params(FastTimeGeometry::k_NumberOfParametersPerShape, 0); - params[0] = topology().dddConstants().getZHalf(m_Type); - params[1] = params[2] = 0; - params[3] = params[7] = topology().dddConstants().getRin(m_Type); - params[4] = params[8] = topology().dddConstants().getRout(m_Type); - params[5] = params[9] = topology().dddConstants().getRout(m_Type); - params[6] = params[10] = 0; - params[11] = (k == 0) ? 1.0 : -1.0; - dimVector.insert(dimVector.end(), params.begin(), params.end()); - } - - for (unsigned int i(0); i < numberOfCells; ++i) { - DetId detId = m_validGeomIds[i]; - dinsVector.emplace_back(topology().detId2denseGeomId(detId)); - iVector.emplace_back(1); - - Tr3D tr; - auto ptr(cellGeomPtr(i)); - if (nullptr != ptr) { - ptr->getTransform(tr, (Pt3DVec*)nullptr); - - if (Tr3D() == tr) { // there is no rotation - const GlobalPoint& gp(ptr->getPosition()); - tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z()); - } - - const CLHEP::Hep3Vector tt(tr.getTranslation()); - trVector.emplace_back(tt.x()); - trVector.emplace_back(tt.y()); - trVector.emplace_back(tt.z()); - if (6 == numberOfTransformParms()) { - const CLHEP::HepRotation rr(tr.getRotation()); - const ROOT::Math::Transform3D rtr( - rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z()); - ROOT::Math::EulerAngles ea; - rtr.GetRotation(ea); - trVector.emplace_back(ea.Phi()); - trVector.emplace_back(ea.Theta()); - trVector.emplace_back(ea.Psi()); - } - } - } -} - -#include "FWCore/Utilities/interface/typelookup.h" - -TYPELOOKUP_DATA_REG(FastTimeGeometry); diff --git a/Geometry/HGCalGeometry/src/FastTimeGeometryLoader.cc b/Geometry/HGCalGeometry/src/FastTimeGeometryLoader.cc deleted file mode 100644 index 86b045517fe08..0000000000000 --- a/Geometry/HGCalGeometry/src/FastTimeGeometryLoader.cc +++ /dev/null @@ -1,109 +0,0 @@ -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometryLoader.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/FlatTrd.h" -#include "Geometry/HGCalCommonData/interface/FastTimeDDDConstants.h" -#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" - -#include - -//#define EDM_ML_DEBUG - -typedef CaloCellGeometry::CCGFloat CCGFloat; -typedef std::vector ParmVec; - -FastTimeGeometryLoader::FastTimeGeometryLoader() {} -FastTimeGeometryLoader::~FastTimeGeometryLoader() {} - -FastTimeGeometry* FastTimeGeometryLoader::build(const FastTimeTopology& topology) { - // allocate geometry - FastTimeGeometry* geom = new FastTimeGeometry(topology); - unsigned int numberOfCells = topology.totalGeomModules(); // both sides - int detType = topology.detectorType(); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "Number of Cells " << numberOfCells << " for type " << detType - << " of sub-detector " << topology.subDetector() << " Shape parameters " - << FastTimeGeometry::k_NumberOfShapes << ":" - << FastTimeGeometry::k_NumberOfParametersPerShape; -#endif - geom->allocateCorners(numberOfCells); - geom->allocatePar(FastTimeGeometry::k_NumberOfShapes, FastTimeGeometry::k_NumberOfParametersPerShape); - - // loop over modules - ParmVec params(FastTimeGeometry::k_NumberOfParametersPerShape, 0); - unsigned int counter(0); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "FastTimeGeometryLoader with # of transformation matrices " << numberOfCells; -#endif - for (unsigned itr = 0; itr < numberOfCells; ++itr) { - int zside = (itr == 0) ? 1 : -1; -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "FastTimeGeometryLoader:: Z:Layer:Type " << zside << ":" << detType; -#endif - double zv = zside * (topology.dddConstants().getZPos(detType)); - const CLHEP::HepRep3x3 rotation = - (zside > 0) ? CLHEP::HepRep3x3(1, 0, 0, 0, 1, 0, 0, 0, 1) : CLHEP::HepRep3x3(-1, 0, 0, 0, 1, 0, 0, 0, -1); - const CLHEP::HepRotation hr(rotation); - const CLHEP::Hep3Vector h3v(0, 0, zv); - const HepGeom::Transform3D ht3d(hr, h3v); - DetId detId = (DetId)(FastTimeDetId(detType, 0, 0, zside)); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("FastTimeGeom") << "FastTimeGeometryLoader:: transf " << ht3d.getTranslation() << " and " - << ht3d.getRotation(); -#endif - params[0] = topology.dddConstants().getZHalf(detType); - params[1] = params[2] = 0; - params[3] = params[7] = topology.dddConstants().getRin(detType); - params[4] = params[8] = topology.dddConstants().getRout(detType); - params[5] = params[9] = topology.dddConstants().getRout(detType); - params[6] = params[10] = 0; - params[11] = zside; - buildGeom(params, ht3d, detId, topology, geom); - counter++; - } - - geom->sortDetIds(); - - if (counter != numberOfCells) { - edm::LogWarning("FastTimeGeom") << "inconsistent # of cells: expected " << numberOfCells << " , inited " << counter; - assert(counter == numberOfCells); - } - - return geom; -} - -void FastTimeGeometryLoader::buildGeom(const ParmVec& params, - const HepGeom::Transform3D& ht3d, - const DetId& detId, - const FastTimeTopology& topology, - FastTimeGeometry* geom) { -#ifdef EDM_ML_DEBUG - std::ostringstream st1; - st1 << "Volume Parameters"; - for (unsigned int i = 0; i < 12; ++i) - st1 << " : " << params[i]; - edm::LogVerbatim("FastTimeGeom") << st1.str(); -#endif - FastTimeDetId id = FastTimeDetId(detId); - std::vector corners = topology.dddConstants().getCorners(id.type(), 1, 1, id.zside()); - - FlatTrd::createCorners(params, ht3d, corners); - - const CCGFloat* parmPtr(CaloCellGeometry::getParmPtr(params, geom->parMgr(), geom->parVecVec())); - - GlobalPoint front(0.25 * (corners[0].x() + corners[1].x() + corners[2].x() + corners[3].x()), - 0.25 * (corners[0].y() + corners[1].y() + corners[2].y() + corners[3].y()), - 0.25 * (corners[0].z() + corners[1].z() + corners[2].z() + corners[3].z())); - - GlobalPoint back(0.25 * (corners[4].x() + corners[5].x() + corners[6].x() + corners[7].x()), - 0.25 * (corners[4].y() + corners[5].y() + corners[6].y() + corners[7].y()), - 0.25 * (corners[4].z() + corners[5].z() + corners[6].z() + corners[7].z())); - - if (front.mag2() > back.mag2()) { // front should always point to the center, so swap front and back - std::swap(front, back); - std::swap_ranges(corners.begin(), corners.begin() + 4, corners.begin() + 4); - } - - geom->newCell(front, back, corners[0], parmPtr, detId); -} diff --git a/Geometry/HGCalGeometry/test/CaloCellGeometryTester.cc b/Geometry/HGCalGeometry/test/CaloCellGeometryTester.cc index 1117aac5a02cf..057e59c6c2d6e 100644 --- a/Geometry/HGCalGeometry/test/CaloCellGeometryTester.cc +++ b/Geometry/HGCalGeometry/test/CaloCellGeometryTester.cc @@ -6,7 +6,6 @@ #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include #include diff --git a/Geometry/HGCalGeometry/test/FastTimeGeometryTester.cc b/Geometry/HGCalGeometry/test/FastTimeGeometryTester.cc deleted file mode 100644 index 0e392d7c5fe7e..0000000000000 --- a/Geometry/HGCalGeometry/test/FastTimeGeometryTester.cc +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/one/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/HGCalGeometry/interface/FastTimeGeometry.h" -#include "DataFormats/ForwardDetId/interface/FastTimeDetId.h" -#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" -#include "CoralBase/Exception.h" - -class FastTimeGeometryTester : public edm::one::EDAnalyzer<> { -public: - explicit FastTimeGeometryTester(const edm::ParameterSet&); - ~FastTimeGeometryTester() override = default; - - void analyze(edm::Event const& iEvent, edm::EventSetup const&) override; - -private: - void doTest(const FastTimeGeometry* geom, ForwardSubdetector subdet); - - const std::string name_; - const edm::ESGetToken geomToken_; - int type_; -}; - -FastTimeGeometryTester::FastTimeGeometryTester(const edm::ParameterSet& iC) - : name_(iC.getParameter("Detector")), - geomToken_(esConsumes(edm::ESInputTag{"", name_})) { - type_ = (name_ == "FastTimeBarrel") ? 1 : 2; -} - -void FastTimeGeometryTester::analyze(const edm::Event&, const edm::EventSetup& iSetup) { - ForwardSubdetector subdet = FastTime; - - const auto& geomR = iSetup.getData(geomToken_); - const FastTimeGeometry* geom = &geomR; - - doTest(geom, subdet); -} - -void FastTimeGeometryTester::doTest(const FastTimeGeometry* geom, ForwardSubdetector subdet) { - const std::vector& ids = geom->getValidDetIds(); - edm::LogVerbatim("FastTimeGeom") << ids.size() << " valid ids for " << geom->cellElement() << std::endl; - - int iEtaZ[] = {1, 7, 13}; - int iPhis[] = {1, 5, 10}; - int zsides[] = {1, -1}; - for (int zside : zsides) { - for (int etaZ : iEtaZ) { - for (int phi : iPhis) { - DetId id1 = (DetId)(FastTimeDetId(type_, etaZ, phi, zside)); - auto icell1 = geom->getGeometry(id1); - GlobalPoint global1 = geom->getPosition(id1); - DetId idc1 = geom->getClosestCell(global1); - std::string cherr = (id1.rawId() != idc1.rawId()) ? " ***** ERROR *****" : ""; - edm::LogVerbatim("FastTimeGeom") << "Input " << FastTimeDetId(id1) << " geometry " << icell1 << " position (" - << global1.x() << ", " << global1.y() << ", " << global1.z() << " Output " - << FastTimeDetId(idc1) << cherr; - } - } - } -} - -//define this as a plug-in -DEFINE_FWK_MODULE(FastTimeGeometryTester); diff --git a/Geometry/Records/interface/CaloGeometryRecord.h b/Geometry/Records/interface/CaloGeometryRecord.h index 4195f70d3f58c..72edd23eca216 100644 --- a/Geometry/Records/interface/CaloGeometryRecord.h +++ b/Geometry/Records/interface/CaloGeometryRecord.h @@ -24,7 +24,6 @@ #include "Geometry/Records/interface/ZDCGeometryRecord.h" #include "Geometry/Records/interface/CastorGeometryRecord.h" #include "Geometry/Records/interface/HGCalGeometryRecord.h" -#include "Geometry/Records/interface/FastTimeGeometryRecord.h" #include "FWCore/Utilities/interface/mplVector.h" class CaloGeometryRecord @@ -38,7 +37,6 @@ class CaloGeometryRecord HcalRecNumberingRecord, HcalGeometryRecord, HGCalGeometryRecord, - FastTimeGeometryRecord, CaloTowerGeometryRecord, CastorGeometryRecord, ZDCGeometryRecord> > {}; diff --git a/Geometry/Records/interface/FastTimeGeometryRecord.h b/Geometry/Records/interface/FastTimeGeometryRecord.h deleted file mode 100644 index 110ebd44db988..0000000000000 --- a/Geometry/Records/interface/FastTimeGeometryRecord.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Records_FastTimeGeometryRecord_h -#define Records_FastTimeGeometryRecord_h - -#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" -#include "FWCore/Framework/interface/DependentRecordImplementation.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/Records/interface/PFastTimeRcd.h" -#include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h" -#include "FWCore/Utilities/interface/mplVector.h" - -class FastTimeGeometryRecord : public edm::eventsetup::DependentRecordImplementation< - FastTimeGeometryRecord, - edm::mpl::Vector > {}; - -#endif /* Records_FastTimeGeometryRecord_h */ diff --git a/Geometry/Records/src/FastTimeGeometryRecord.cc b/Geometry/Records/src/FastTimeGeometryRecord.cc deleted file mode 100644 index 1784191b3901e..0000000000000 --- a/Geometry/Records/src/FastTimeGeometryRecord.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include "Geometry/Records/interface/FastTimeGeometryRecord.h" -#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" - -EVENTSETUP_RECORD_REG(FastTimeGeometryRecord);