10 #include <Math/Transform3D.h> 11 #include <Math/EulerAngles.h> 19 : m_topology(topology_),
20 m_cellVec(topology_.totalGeomModules()),
21 m_validGeomIds(topology_.totalGeomModules()),
22 m_Type(topology_.detectorType()),
23 m_subdet(topology_.subDetector()) {
47 const uint32_t cellIndex(
topology().detId2denseGeomId(detId));
55 for (
int etaZ = 1; etaZ <= nEtaZ; ++etaZ) {
67 edm::LogVerbatim(
"FastTimeGeom") <<
"FastTimeGeometry::newCell-> [" << cellIndex <<
"] front:" <<
f1.x() <<
'/' 68 <<
f1.y() <<
'/' <<
f1.z() <<
" back:" <<
f2.x() <<
'/' <<
f2.y() <<
'/' <<
f2.z()
69 <<
" eta|phi " <<
m_cellVec[cellIndex].etaPos() <<
":" 71 <<
" with valid DetId from " << nOld <<
" to " <<
m_validIds.size();
81 const uint32_t cellIndex(
topology().detId2denseGeomId(geoId));
104 for (
const auto&
corner : corners) {
111 int zside = (
r.z() > 0) ? 1 : -1;
112 std::pair<int, int> etaZPhi;
114 double zz = (
zside > 0) ?
r.z() : -
r.z();
117 double phi = (
zside > 0) ? static_cast<double>(
r.phi()) : atan2(
r.y(), -
r.x());
125 edm::LogVerbatim(
"FastTimeGeom") <<
"getClosestCell: for (" <<
r.x() <<
", " <<
r.y() <<
", " <<
r.z() <<
") Id " 126 <<
id.type() <<
":" <<
id.zside() <<
":" <<
id.ieta() <<
":" <<
id.iphi();
139 return "FastTimeBarrel";
141 return "FastTimeEndcap";
147 unsigned int cellIndex =
m_cellVec.size();
153 <<
" index " << cellIndex;
170 static const auto do_not_delete = [](
const void*) {};
171 auto cell = std::shared_ptr<const CaloCellGeometry>(&
m_cellVec[
index], do_not_delete);
172 if (
nullptr == cell->param())
183 cell->setPosition(
pos);
187 if (
nullptr == cell->param())
193 edm::LogError(
"FastTimeGeom") <<
"FastTimeGeometry::addValidID is not implemented";
199 bool operator()(
const DetId&
a,
const DetId&
b) {
return (
a.rawId() <
b.rawId()); }
217 iVector.reserve(numberOfCells);
219 dinsVector.reserve(numberOfCells);
229 params[11] = (
k == 0) ? 1.0 : -1.0;
230 dimVector.insert(dimVector.end(),
params.begin(),
params.end());
233 for (
unsigned int i(0);
i < numberOfCells; ++
i) {
235 dinsVector.emplace_back(
topology().detId2denseGeomId(detId));
236 iVector.emplace_back(1);
240 if (
nullptr != ptr) {
241 ptr->getTransform(tr, (
Pt3DVec*)
nullptr);
245 tr = HepGeom::Translate3D(
gp.x(),
gp.y(),
gp.z());
248 const CLHEP::Hep3Vector
tt(tr.getTranslation());
249 trVector.emplace_back(
tt.x());
250 trVector.emplace_back(
tt.y());
251 trVector.emplace_back(
tt.z());
253 const CLHEP::HepRotation
rr(tr.getRotation());
254 const ROOT::Math::Transform3D rtr(
255 rr.xx(),
rr.xy(),
rr.xz(),
tt.x(),
rr.yx(),
rr.yy(),
rr.yz(),
tt.y(),
rr.zx(),
rr.zy(),
rr.zz(),
tt.z());
258 trVector.emplace_back(ea.Phi());
259 trVector.emplace_back(ea.Theta());
260 trVector.emplace_back(ea.Psi());
Log< level::Info, true > LogVerbatim
double getRin(int type) const
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
std::set< DetId > DetIdSet
bool present(const DetId &id) const override
is this detid present in the geometry?
double getZHalf(int type) const
A base class to handle the particular shape of HGCal volumes.
unsigned int indexFor(const DetId &id) const override
std::vector< CCGFloat > DimVec
int numberEtaZ(int type) const
std::vector< GlobalPoint > CornersVec
unsigned int totalGeomModules() const
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell's volume.
CaloCellGeometry::Pt3DVec Pt3DVec
virtual unsigned int numberOfTransformParms() const
Global3DPoint GlobalPoint
std::vector< unsigned int > IVec
virtual void fillNamedParams(DDFilteredView fv)
void addValidID(const DetId &id)
std::vector< float > ParmVec
std::vector< CCGFloat > TrVec
HepGeom::Transform3D Tr3D
virtual unsigned int numberOfShapes() const
Log< level::Error, false > LogError
CaloCellGeometry::CCGFloat CCGFloat
CaloCellGeometry::Pt3D Pt3D
FastTimeGeometry(const FastTimeTopology &topology)
double getRout(int type) const
CaloCellGeometry::Tr3D Tr3D
int iphi() const
get the absolute value of the cell #'s along y-axis (EC) | phi (Barrel)
~FastTimeGeometry() override
std::vector< DetId > m_validIds
int ieta() const
get the absolute value of the cell #'s along x-axis (EC) | z-axis (Barel)
std::pair< int, int > getZPhi(double z, double phi) const
std::string cellElement() const
const FastTimeDDDConstants & dddConstants() const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
#define TYPELOOKUP_DATA_REG(_dataclass_)
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
int zside() const
get the z-side of the cell (1/-1)
AlgebraicVector EulerAngles
std::pair< int, int > getEtaPhi(double r, double phi) const
constexpr uint32_t rawId() const
get the raw id
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
void initializeParms() override
CaloCellGeometry::CornersMgr * cornersMgr()
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
const FastTimeTopology & topology() const
GlobalPoint getPosition(int type, int izeta, int iphi, int zside) const
DecodedDetId decode(const DetId &id) const
virtual uint32_t detId2denseGeomId(const DetId &id) const
unsigned int sizeForDenseIndex() const
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
DetId getClosestCell(const GlobalPoint &r) const override
CaloCellGeometry::Tr3D Tr3D
std::vector< GlobalPoint > getCorners(int type, int izeta, int iphi, int zside) const
GlobalPoint getPosition(const DetId &id) const
FastTimeDetId geometryCell() const
const CCGFloat * param() const
std::vector< DetId > m_validGeomIds
DetId encode(const DecodedDetId &id_) const
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
virtual unsigned int numberOfParametersPerShape() const
int numberPhi(int type) const