13 m_ownsTopology (
true )
19 theTopology ( topology ) ,
20 m_ownsTopology (
false )
45 for(
unsigned int i ( 0 ) ;
i != baseIds.size() ; ++
i )
81 const std::vector<DetId>&
98 double abseta = fabs(r.
eta());
111 static const double z_short=1137.0;
112 int etaring =
etaRing(bc, abseta);
126 int etabin = (r.
z() > 0) ? etaring : -etaring;
131 HcalDetId bestId(bc,etabin,phibin,((fabs(r.
z()) - z_short >-0.1)?(2):(1)));
136 int etaring =
etaRing(bc, abseta);
141 int etabin = (r.
z() > 0) ? etaring : -etaring;
145 double pointrz=0, drz=99999.;
146 HcalDetId currentId(bc, etabin, phibin, dbin);
192 static const double twopi =
M_PI+
M_PI;
194 if(phi<0.0) phi += twopi;
195 if(phi>twopi) phi -= twopi;
197 int phibin=
static_cast<int>(phi/twopi*nphibins)+1;
207 phibin=
static_cast<int>(phi/twopi*nphibins);
208 if (phibin==0) phibin=18;
212 iphi=(phibin-1)*(72/nphibins) + 1;
232 const double dR2 ( dR*dR ) ;
233 const double reta ( r.
eta() ) ;
234 const double rphi ( r.
phi() ) ;
235 const double lowEta ( reta - dR ) ;
236 const double highEta ( reta + dR ) ;
237 const double lowPhi ( rphi - dR ) ;
238 const double highPhi ( rphi + dR ) ;
243 if( highEta > -hfEtaHi &&
248 for(
unsigned int is ( 0 ) ; is != 4 ; ++is )
250 const int sign ( reta>0 ? 1 : -1 ) ;
251 const int ieta_center ( sign*
etaRing( hs[is], fabs( reta ) ) ) ;
252 const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*
etaRing( hs[is], fabs( lowEta ) ) ) ;
253 const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*
etaRing( hs[is], fabs( highEta ) ) ) ;
254 const int iphi_lo (
phiBin( lowPhi , ieta_center ) ) ;
255 const int iphi_hi (
phiBin( highPhi, ieta_center ) ) ;
256 const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ;
257 const int jphi_hi ( iphi_hi ) ;
259 const int idep_lo ( 1 == is ? 4 : 1 ) ;
260 const int idep_hi ( 1 == is ? 4 :
261 ( 2 == is ? 3 : 2 ) ) ;
262 for(
int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta )
266 for(
int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi )
268 const int iphi ( 1 > jphi ? jphi+72 : jphi ) ;
270 for(
int idep ( idep_lo ) ; idep <= idep_hi ; ++idep )
274 const HcalDetId did ( hs[is], ieta, iphi, idep ) ;
279 const double eta (
p.eta() ) ;
280 const double phi (
p.phi() ) ;
306 const int jz ( ( hid.zside() + 1 )/2 ) ;
310 const int detoff ( zoff +
319 const int iphi ( hid.iphi() ) ;
324 const int ieta ( hid.ieta() ) ;
325 const int ring ( ieta < -10 ? 0 :
328 ( ieta < 11 ? 3 : 4 ) ) ) ) ;
330 index = detoff + 12*ring + ( iphi - 1 )%6 ;
334 index = detoff + ( iphi - 1 )%4 ;
433 const unsigned int index ( din
445 const unsigned int index ( din
454 return ( 0 == cell || 0 == cell->
param() ? 0 : cell ) ;
static unsigned int numberOfBarrelAlignments()
std::vector< DetId > m_heIds
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
virtual DetId getClosestCell(const GlobalPoint &r) const
std::set< DetId > DetIdSet
static unsigned int alignmentTransformIndexLocal(const DetId &id)
std::vector< DetId > m_emptyIds
Geom::Phi< T > phi() const
int nPhiBins(int etaRing) const
how many phi segments in this ring
std::vector< IdealObliquePrism > HECellVec
std::vector< Pt3D > Pt3DVec
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
CaloCellGeometry::CCGFloat CCGFloat
const HcalTopology * theTopology
static bool validDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const CCGFloat * param() const
std::vector< DetId > m_hbIds
CaloCellGeometry::Pt3DVec Pt3DVec
std::vector< DetId > m_hoIds
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static HcalDetId detIdFromDenseIndex(uint32_t di)
std::vector< DetId > m_validIds
std::vector< IdealObliquePrism > HOCellVec
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
CaloCellGeometry::CCGFloat CCGFloat
std::vector< DetId > m_hfIds
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
double deltaR2(double eta1, double phi1, double eta2, double phi2)
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
uint32_t denseIndex() const
CaloCellGeometry::Pt3D Pt3D
std::vector< IdealZPrism > HFCellVec
bool incrementDepth(HcalDetId &id) const
static unsigned int numberOfEndcapAlignments()
static const double theHFEtaBounds[]
virtual ~HcalGeometry()
The HcalGeometry will delete all its cell geometries at destruction time.
CaloCellGeometry::CornersMgr * cornersMgr()
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
std::vector< IdealObliquePrism > HBCellVec
int firstHFQuadPhiRing() const
static unsigned int numberOfForwardAlignments()
CaloCellGeometry::Pt3D Pt3D
static const double theHBHEEtaBounds[]
int phiBin(double phi, int etaring) const
static unsigned int numberOfAlignments()