11 m_ownsTopology (
true )
16 theTopology ( topology ) ,
17 m_ownsTopology (
false )
32 for(
unsigned int i ( 0 ) ;
i != baseIds.size() ; ++
i )
68 const std::vector<DetId>&
85 double abseta = fabs(r.
eta());
98 static const double z_short=1137.0;
99 int etaring =
etaRing(bc, abseta);
113 int etabin = (r.
z() > 0) ? etaring : -etaring;
115 HcalDetId bestId(bc,etabin,phibin,((fabs(r.
z())>=z_short)?(2):(1)));
120 int etaring =
etaRing(bc, abseta);
125 int etabin = (r.
z() > 0) ? etaring : -etaring;
129 double pointrz=0, drz=99999.;
130 HcalDetId currentId(bc, etabin, phibin, dbin);
176 static const double twopi =
M_PI+
M_PI;
178 if(phi<0.0) phi += twopi;
179 if(phi>twopi) phi -= twopi;
181 int phibin=
static_cast<int>(phi/twopi*nphibins)+1;
191 phibin=
static_cast<int>(phi/twopi*nphibins);
192 if (phibin==0) phibin=18;
196 iphi=(phibin-1)*(72/nphibins) + 1;
216 const double dR2 ( dR*dR ) ;
217 const double reta ( r.
eta() ) ;
218 const double rphi ( r.
phi() ) ;
219 const double lowEta ( reta - dR ) ;
220 const double highEta ( reta + dR ) ;
221 const double lowPhi ( rphi - dR ) ;
222 const double highPhi ( rphi + dR ) ;
227 if( highEta > -hfEtaHi &&
232 for(
unsigned int is ( 0 ) ; is != 4 ; ++is )
234 const int sign ( reta>0 ? 1 : -1 ) ;
235 const int ieta_center ( sign*
etaRing( hs[is], fabs( reta ) ) ) ;
236 const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*
etaRing( hs[is], fabs( lowEta ) ) ) ;
237 const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*
etaRing( hs[is], fabs( highEta ) ) ) ;
238 const int iphi_lo (
phiBin( lowPhi , ieta_center ) ) ;
239 const int iphi_hi (
phiBin( highPhi, ieta_center ) ) ;
240 const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ;
241 const int jphi_hi ( iphi_hi ) ;
243 const int idep_lo ( 1 == is ? 4 : 1 ) ;
244 const int idep_hi ( 1 == is ? 4 :
245 ( 2 == is ? 3 : 2 ) ) ;
246 for(
int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta )
250 for(
int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi )
252 const int iphi ( 1 > jphi ? jphi+72 : jphi ) ;
254 for(
int idep ( idep_lo ) ; idep <= idep_hi ; ++idep )
258 const HcalDetId did ( hs[is], ieta, iphi, idep ) ;
263 const double eta (
p.eta() ) ;
264 const double phi (
p.phi() ) ;
290 const int jz ( ( hid.zside() + 1 )/2 ) ;
294 const int detoff ( zoff +
303 const int iphi ( hid.iphi() ) ;
308 const int ieta ( hid.ieta() ) ;
309 const int ring ( ieta < -10 ? 0 :
312 ( ieta < 11 ? 3 : 4 ) ) ) ) ;
314 index = detoff + 12*ring + ( iphi - 1 )%6 ;
318 index = detoff + ( iphi - 1 )%4 ;
331 std::vector<HepGeom::Point3D<double> >
334 HepGeom::Point3D<double> & ref )
static unsigned int numberOfBarrelAlignments()
std::vector< DetId > m_heIds
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
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
int nPhiBins(int etaRing) const
how many phi segments in this ring
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.
std::vector< DetId > m_hbIds
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
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.
static HcalDetId detIdFromDenseIndex(uint32_t di)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
std::vector< DetId > m_hfIds
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, unsigned int i, HepGeom::Point3D< double > &ref)
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
double deltaR2(double eta1, double phi1, double eta2, double phi2)
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.
int firstHFQuadPhiRing() const
static unsigned int numberOfForwardAlignments()
static CaloCellGeometry * newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, CaloCellGeometry::CornersMgr *mgr, const double *parm, const DetId &detId)
const GlobalPoint & getPosition() const
static const double theHBHEEtaBounds[]
int phiBin(double phi, int etaring) const
static unsigned int numberOfAlignments()