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()) {
24 std::cout <<
"Expected total # of Geometry Modules " 47 const DetId& detId ) {
54 const uint32_t cellIndex (
topology().detId2denseGeomId(detId));
62 for (
int etaZ = 1; etaZ <= nEtaZ; ++etaZ) {
74 std::cout <<
"FastTimeGeometry::newCell-> [" << cellIndex <<
"]" 75 <<
" front:" << f1.
x() <<
'/' << f1.
y() <<
'/' << f1.
z()
76 <<
" back:" << f2.
x() <<
'/' << f2.
y() <<
'/' << f2.
z()
77 <<
" eta|phi " <<
m_cellVec[cellIndex].etaPos() <<
":" 79 <<
" with valid DetId from " << nOld <<
" to " <<
m_validIds.size()
81 std::cout <<
"Cell[" << cellIndex <<
"] " << std::hex << geomId.
rawId()
89 if (
id ==
DetId())
return nullptr;
91 const uint32_t cellIndex (
topology().detId2denseGeomId(geoId));
107 for(
const auto&
corner : corners ) {
114 int zside = (r.
z() > 0) ? 1 : -1;
115 std::pair<int,int> etaZPhi;
117 double zz = (zside > 0) ? r.
z() : -r.
z();
120 double phi = (zside > 0) ? r.
phi() : atan2(r.
y(),-r.
x());
125 std::cout <<
"getClosestCell: for (" << r.
x() <<
", " << r.
y() <<
", " 126 << r.
z() <<
") Id " <<
id.type() <<
":" <<
id.zside() <<
":" 127 <<
id.ieta() <<
":" <<
id.iphi() << std::endl;
139 if (
m_Type == 1)
return "FastTimeBarrel";
140 else if (
m_Type == 2)
return "FastTimeEndcap";
141 else return "Unknown";
145 unsigned int cellIndex =
m_cellVec.size();
150 std::cout <<
"indexFor " << std::hex <<
id.rawId() <<
":" << geoId.
rawId()
151 <<
std::dec <<
" index " << cellIndex << std::endl;
168 if (
nullptr == cell->
param())
return nullptr;
173 edm::LogError(
"FastTimeGeom") <<
"FastTimeGeometry::addValidID is not implemented";
201 iVector.reserve( numberOfCells );
202 dimVector.reserve( numberOfShapes * numberOfParametersPerShape );
203 dinsVector.reserve( numberOfCells );
208 params[1] = params[2] = 0;
212 params[6] = params[10]= 0;
213 params[11]= (
k == 0) ? 1.0 : -1.0;
214 dimVector.insert( dimVector.end(), params.begin(), params.end());
217 for (
unsigned int i( 0 );
i < numberOfCells; ++
i) {
219 dinsVector.emplace_back(
topology().detId2denseGeomId( detId ));
220 iVector.emplace_back(1);
224 if (
nullptr != ptr ) {
229 tr = HepGeom::Translate3D(
gp.x(),
gp.y(),
gp.z());
232 const CLHEP::Hep3Vector
tt( tr.getTranslation());
233 trVector.emplace_back(
tt.x());
234 trVector.emplace_back(
tt.y());
235 trVector.emplace_back(
tt.z());
237 const CLHEP::HepRotation
rr( tr.getRotation());
238 const ROOT::Math::Transform3D rtr(
rr.xx(),
rr.xy(),
rr.xz(),
tt.x(),
242 rtr.GetRotation( ea );
243 trVector.emplace_back( ea.Phi());
244 trVector.emplace_back( ea.Theta());
245 trVector.emplace_back( ea.Psi());
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
std::set< DetId > DetIdSet
DecodedDetId decode(const DetId &id) const
int ieta() const
get the absolute value of the cell #'s along x-axis (EC) | z-axis (Barel)
A base class to handle the particular shape of HGCal volumes.
std::vector< CCGFloat > DimVec
unsigned int totalGeomModules() const
const CaloCellGeometry * getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
virtual unsigned int numberOfParametersPerShape() const
std::pair< int, int > getEtaPhi(double r, double phi) const
DetId getClosestCell(const GlobalPoint &r) const override
std::vector< GlobalPoint > CornersVec
CaloCellGeometry::Pt3DVec Pt3DVec
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
int numberEtaZ(int type) const
FastTimeDetId geometryCell() const
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
std::vector< unsigned int > IVec
virtual void fillNamedParams(DDFilteredView fv)
const FastTimeTopology & topology() const
void addValidID(const DetId &id)
std::vector< float > ParmVec
std::vector< CCGFloat > TrVec
HepGeom::Transform3D Tr3D
int iphi() const
get the absolute value of the cell #'s along y-axis (EC) | phi (Barrel)
int numberPhi(int type) const
int zside() const
get the z-side of the cell (1/-1)
GlobalPoint getPosition(const DetId &id) const
CaloCellGeometry::CCGFloat CCGFloat
CaloCellGeometry::Pt3D Pt3D
FastTimeGeometry(const FastTimeTopology &topology)
uint32_t rawId() const
get the raw id
std::pair< int, int > getZPhi(double z, double phi) const
CaloCellGeometry::Tr3D Tr3D
const CCGFloat * param() const
DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
~FastTimeGeometry() override
virtual unsigned int numberOfShapes() const
virtual uint32_t detId2denseGeomId(const DetId &id) const
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
std::string cellElement() const
std::vector< DetId > m_validIds
std::vector< GlobalPoint > getCorners(int type, int izeta, int iphi, int zside) const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
#define TYPELOOKUP_DATA_REG(_dataclass_)
AlgebraicVector EulerAngles
const CaloCellGeometry * cellGeomPtr(uint32_t index) const override
unsigned int indexFor(const DetId &id) const override
void initializeParms() override
CaloCellGeometry::CornersMgr * cornersMgr()
double getRin(int type) const
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
CaloCellGeometry::Tr3D Tr3D
double getRout(int type) const
DetId encode(const DecodedDetId &id_) const
GlobalPoint getPosition(int type, int izeta, int iphi, int zside) const
double getZHalf(int type) const
virtual unsigned int numberOfTransformParms() const
const FastTimeDDDConstants & dddConstants() const
std::vector< DetId > m_validGeomIds
unsigned int sizeForDenseIndex() const
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell's volume.