|
|
Go to the documentation of this file.
9 #include <Math/Transform3D.h>
10 #include <Math/EulerAngles.h>
16 : m_topology(topology_),
17 m_cellVec(topology_.totalGeomModules()),
18 m_validGeomIds(topology_.totalGeomModules()),
19 m_Type(topology_.detectorType()),
20 m_subdet(topology_.subDetector()) {
44 const uint32_t cellIndex(
topology().detId2denseGeomId(detId));
52 for (
int etaZ = 1; etaZ <= nEtaZ; ++etaZ) {
64 std::cout <<
"FastTimeGeometry::newCell-> [" << cellIndex <<
"]"
65 <<
" front:" <<
f1.x() <<
'/' <<
f1.y() <<
'/' <<
f1.z() <<
" back:" <<
f2.x() <<
'/' <<
f2.y() <<
'/'
66 <<
f2.z() <<
" eta|phi " <<
m_cellVec[cellIndex].etaPos() <<
":" <<
m_cellVec[cellIndex].phiPos()
78 const uint32_t cellIndex(
topology().detId2denseGeomId(geoId));
101 for (
const auto&
corner : corners) {
108 int zside = (
r.z() > 0) ? 1 : -1;
109 std::pair<int, int> etaZPhi;
111 double zz = (
zside > 0) ?
r.z() : -
r.z();
114 double phi = (
zside > 0) ? static_cast<double>(
r.phi()) : atan2(
r.y(), -
r.x());
122 std::cout <<
"getClosestCell: for (" <<
r.x() <<
", " <<
r.y() <<
", " <<
r.z() <<
") Id " <<
id.type() <<
":"
123 <<
id.zside() <<
":" <<
id.ieta() <<
":" <<
id.iphi() << std::endl;
136 return "FastTimeBarrel";
138 return "FastTimeEndcap";
144 unsigned int cellIndex =
m_cellVec.size();
149 std::cout <<
"indexFor " << std::hex <<
id.rawId() <<
":" << geoId.
rawId() <<
std::dec <<
" index " << cellIndex
167 static const auto do_not_delete = [](
const void*) {};
168 auto cell = std::shared_ptr<const CaloCellGeometry>(&
m_cellVec[
index], do_not_delete);
169 if (
nullptr == cell->param())
180 cell->setPosition(
pos);
184 if (
nullptr == cell->param())
190 edm::LogError(
"FastTimeGeom") <<
"FastTimeGeometry::addValidID is not implemented";
196 bool operator()(
const DetId&
a,
const DetId&
b) {
return (
a.rawId() <
b.rawId()); }
214 iVector.reserve(numberOfCells);
216 dinsVector.reserve(numberOfCells);
226 params[11] = (
k == 0) ? 1.0 : -1.0;
227 dimVector.insert(dimVector.end(),
params.begin(),
params.end());
230 for (
unsigned int i(0);
i < numberOfCells; ++
i) {
232 dinsVector.emplace_back(
topology().detId2denseGeomId(detId));
233 iVector.emplace_back(1);
237 if (
nullptr != ptr) {
238 ptr->getTransform(tr, (
Pt3DVec*)
nullptr);
242 tr = HepGeom::Translate3D(
gp.x(),
gp.y(),
gp.z());
245 const CLHEP::Hep3Vector
tt(tr.getTranslation());
246 trVector.emplace_back(
tt.x());
247 trVector.emplace_back(
tt.y());
248 trVector.emplace_back(
tt.z());
250 const CLHEP::HepRotation
rr(tr.getRotation());
251 const ROOT::Math::Transform3D rtr(
252 rr.xx(),
rr.xy(),
rr.xz(),
tt.x(),
rr.yx(),
rr.yy(),
rr.yz(),
tt.y(),
rr.zx(),
rr.zy(),
rr.zz(),
tt.z());
255 trVector.emplace_back(ea.Phi());
256 trVector.emplace_back(ea.Theta());
257 trVector.emplace_back(ea.Psi());
HepGeom::Transform3D Tr3D
CaloCellGeometry::Pt3DVec Pt3DVec
double getRout(int type) const
virtual unsigned int numberOfParametersPerShape() const
int ieta() const
get the absolute value of the cell #'s along x-axis (EC) | z-axis (Barel)
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
std::set< DetId > DetIdSet
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
std::vector< CCGFloat > DimVec
A base class to handle the particular shape of HGCal volumes.
CaloCellGeometry::Pt3D Pt3D
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
int iphi() const
get the absolute value of the cell #'s along y-axis (EC) | phi (Barrel)
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
std::vector< CCGFloat > TrVec
virtual unsigned int numberOfTransformParms() const
std::vector< unsigned int > IVec
std::vector< float > ParmVec
unsigned int indexFor(const DetId &id) const override
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfShapes() const
const FastTimeDDDConstants & dddConstants() const
~FastTimeGeometry() override
CaloCellGeometry::CCGFloat CCGFloat
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell's volume.
DecodedDetId decode(const DetId &id) const
double getRin(int type) const
void addValidID(const DetId &id)
std::pair< int, int > getZPhi(double z, double phi) const
std::vector< DetId > m_validIds
bool present(const DetId &id) const override
is this detid present in the geometry?
CaloCellGeometry::Tr3D Tr3D
Global3DPoint GlobalPoint
virtual uint32_t detId2denseGeomId(const DetId &id) const
unsigned int totalGeomModules() const
GlobalPoint getPosition(const DetId &id) const
int numberPhi(int type) const
int zside() const
get the z-side of the cell (1/-1)
const CCGFloat * param() const
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
void initializeParms() override
DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
int numberEtaZ(int type) const
std::pair< int, int > getEtaPhi(double r, double phi) const
FastTimeDetId geometryCell() const
Log< level::Error, false > LogError
AlgebraicVector EulerAngles
#define TYPELOOKUP_DATA_REG(_dataclass_)
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.
DetId encode(const DecodedDetId &id_) const
constexpr uint32_t rawId() const
get the raw id
std::vector< DetId > m_validGeomIds
CaloCellGeometry::CornersMgr * cornersMgr()
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
unsigned int sizeForDenseIndex() const
const FastTimeTopology & topology() const
std::string cellElement() const
double getZHalf(int type) const
DetId getClosestCell(const GlobalPoint &r) const override
FastTimeGeometry(const FastTimeTopology &topology)
std::vector< GlobalPoint > getCorners(int type, int izeta, int iphi, int zside) const
GlobalPoint getPosition(int type, int izeta, int iphi, int zside) const
virtual void fillNamedParams(DDFilteredView fv)
std::vector< GlobalPoint > CornersVec