19 : mTopology (topology_) {
23 std::cout <<
"Expected total # of Geometry Modules "
39 const DetId& detId ) {
40 const uint32_t cellIndex (
topology().detId2denseGeomId(detId));
52 unsigned int nNew = nOld + (
unsigned int)(
m_halfType ? cells : 2*cells);
54 for (
int cell = 0; cell < cells; ++cell) {
58 id.iSubSec = -
id.iSubSec;
60 id.iSubSec = -
id.iSubSec;
64 std::cout <<
"HGCalGeometry::newCell-> [" << cellIndex <<
"]"
65 <<
" front:" << f1.
x() <<
'/' << f1.
y() <<
'/' << f1.
z()
66 <<
" back:" << f2.
x() <<
'/' << f2.
y() <<
'/' << f2.
z()
67 <<
" eta|phi " <<
m_cellVec[cellIndex].etaPos() <<
":"
68 <<
m_cellVec[cellIndex].phiPos() <<
" id:";
71 std::cout <<
" with valid DetId from " << nOld <<
" to " << nNew
73 std::cout <<
"Cell[" << cellIndex <<
"] " << std::hex << geomId.
rawId()
80 if (
id ==
DetId())
return 0;
84 const uint32_t cellIndex (
topology().detId2denseGeomId(geoId));
100 unsigned int cellIndex =
indexFor(
id);
104 const HepGeom::Point3D<float> lcoord(xy.first,xy.second,0);
106 std::cout <<
"getPosition:: index " << cellIndex <<
" Local " << xy.first
107 <<
":" << xy.second <<
" ID " << id_.
iCell <<
":" << id_.
iLay
108 <<
" Global " <<
m_cellVec[cellIndex].getPosition(lcoord)
111 return m_cellVec[cellIndex].getPosition(lcoord);
119 unsigned int cellIndex =
indexFor(
id);
123 float dz =
m_cellVec[cellIndex].param()[0];
124 float dx = 0.5*
m_cellVec[cellIndex].param()[11];
125 static const int signx[] = {-1,-1,1,1,-1,-1,1,1};
126 static const int signy[] = {-1,1,1,-1,-1,1,1,-1};
127 static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
128 for (
unsigned int i = 0;
i != 8; ++
i) {
129 const HepGeom::Point3D<float> lcoord(xy.first+signx[
i]*dx,xy.second+signy[
i]*dx,signz[
i]*dz);
130 co[
i] =
m_cellVec[cellIndex].getPosition(lcoord);
139 const HepGeom::Point3D<float> local =
m_cellVec[cellIndex].getLocal(r);
141 std::pair<int,int> kxy =
144 id_.
iCell = kxy.second;
147 std::cout <<
"getClosestCell: local " << local <<
" Id " << id_.
zside
168 else return "Unknown";
172 unsigned int cellIndex =
m_cellVec.size();
179 std::cout <<
"indexFor " << std::hex <<
id.rawId() <<
":" << geoId.
rawId()
180 <<
std::dec <<
" index " << cellIndex << std::endl;
197 if (0 == cell->
param())
return 0;
202 edm::LogError(
"HGCalGeom") <<
"HGCalGeometry::addValidID is not implemented";
208 float phip = r.
phi();
210 unsigned int cellIndex =
m_cellVec.size();
211 float dzmin(9999), dphimin(9999), dphi10(0.175);
215 while (dphi <= -
M_PI) dphi += 2*
M_PI;
216 if (fabs(dphi) < dphi10) {
218 if (dz < (dzmin+0.001)) {
220 if (fabs(dphi) < (dphimin+0.01)) {
222 dphimin = fabs(dphi);
224 if (cellIndex >=
m_cellVec.size()) cellIndex =
k;
230 std::cout <<
"getClosestCellIndex::Input " << zp <<
":" << phip <<
" Index "
234 << dzmin <<
" phi " <<
m_cellVec[cellIndex].phiPos() <<
":"
std::vector< DetId > m_validGeomIds
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
A base class to handle the particular shape of HGCal volumes.
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
std::string cellElement() const
virtual unsigned int sizeForDenseIndex() const
unsigned int getClosestCellIndex(const GlobalPoint &r) const
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
std::vector< GlobalPoint > CornersVec
GlobalPoint getPosition(const DetId &id) const
bool detectorType() const
CaloCellGeometry::CCGFloat CCGFloat
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell's volume.
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
uint32_t rawId() const
get the raw id
unsigned int totalGeomModules() const
HGCalGeometry(const HGCalTopology &topology)
const CCGFloat * param() const
virtual uint32_t detId2denseGeomId(const DetId &id) const
HGCHEDetId geometryCell() const
DetId encode(const DecodedDetId &id_) const
std::vector< DetId > m_validIds
const HGCalTopology & topology() const
std::set< DetId > DetIdSet
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual unsigned int indexFor(const DetId &id) const
#define TYPELOOKUP_DATA_REG(_dataclass_)
DecodedDetId decode(const DetId &id) const
ForwardSubdetector m_subdet
const HGCalDDDConstants & dddConstants() const
HGCEEDetId geometryCell() const
CaloCellGeometry::CornersMgr * cornersMgr()
ForwardSubdetector subDetector() const
virtual void fillNamedParams(DDFilteredView fv)
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
virtual void initializeParms()
void addValidID(const DetId &id)
std::pair< float, float > locateCell(int cell, int lay, int subSec, bool reco) const
int maxCells(bool reco) const
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual DetId getClosestCell(const GlobalPoint &r) const