6 #include <CLHEP/Geometry/Point3D.h>
7 #include <CLHEP/Geometry/Plane3D.h>
12 typedef HepGeom::Plane3D<CCGFloat>
Pl3D ;
25 m_cellVec( k_NumberOfCellsForCorners )
52 assert( gid.
isEE() ) ;
61 return EEDetId( 20 + 50*( iLoc%2 ), 50, 2*( iLoc/2 ) - 1 ) ;
96 const unsigned int ix ( myId.
ix() ) ;
97 const unsigned int iy ( myId.
iy() ) ;
175 const int i ( 1 +
int( ( x - xlo )/
m_wref ) ) ;
178 (
m_nref < (
unsigned int) i ?
m_nref : (
unsigned int) i ) ) ;
187 const int i ( 1 +
int( ( y - ylo )/
m_wref ) ) ;
190 (
m_nref < (
unsigned int) i ?
m_nref : (
unsigned int) i ) ) ;
199 const unsigned int ix (
xindex( x*fac, z ) ) ;
200 const unsigned int iy (
yindex( y*fac, z ) ) ;
201 const unsigned int iz ( z>0 ? 1 : -1 ) ;
209 for(
unsigned int i ( 1 ) ;
i != 6 ; ++
i )
211 for(
unsigned int k ( 0 ) ;
k != 8 ; ++
k )
213 const int jx ( 0 ==
k || 4 ==
k || 5 ==
k ? +
i :
214 ( 1 ==
k || 5 <
k ? -
i : 0 ) ) ;
215 const int jy ( 2 ==
k || 4 ==
k || 6 ==
k ? +
i :
216 ( 3 ==
k || 5 ==
k || 7 ==
k ? -
i : 0 ) ) ;
219 return EEDetId( ix + jx, iy + jy, iz ) ;
254 std::vector<CCGFloat> SS;
295 std::vector<GlobalPoint> corners;
298 for(
unsigned ic=0;ic<4;++ic)
304 for (
short i=0;
i < 4 ; ++
i)
306 A =
Pt3D(corners[
i%4].
x(),corners[
i%4].
y(),corners[
i%4].
z());
307 B =
Pt3D(corners[(
i+1)%4].
x(),corners[(
i+1)%4].
y(),corners[(
i+1)%4].
z());
308 C =
Pt3D(corners[4+(
i+1)%4].
x(),corners[4+(
i+1)%4].
y(),corners[4+(
i+1)%4].
z());
312 if (corners[0].
z()<0.) distance=-distance;
313 SS.push_back(distance);
318 const bool yout ( 0 > SS[0]*SS[2] ) ;
319 const bool xout ( 0 > SS[1]*SS[3] ) ;
323 const int ydel ( !yout ? 0 : ( 0 < SS[0] ? -1 : 1 ) ) ;
324 const int xdel ( !xout ? 0 : ( 0 < SS[1] ? -1 : 1 ) ) ;
325 const unsigned int ix ( mycellID.
ix() + xdel ) ;
326 const unsigned int iy ( mycellID.
iy() + ydel ) ;
327 const unsigned int iz ( mycellID.
zside() ) ;
329 mycellID =
EEDetId( ix, iy, iz ) ;
357 const double dR2 ( dR*dR ) ;
358 const double reta ( r.
eta() ) ;
359 const double rphi ( r.
phi() ) ;
360 const double rx ( r.
x() ) ;
361 const double ry ( r.
y() ) ;
362 const double rz ( r.
z() ) ;
363 const double fac ( fabs(
zeP/rz ) ) ;
364 const double xx (
rx*fac ) ;
365 const double yy (
ry*fac ) ;
366 const double zz ( rz*fac ) ;
368 const double xang ( atan( xx/zz ) ) ;
369 const double lowX ( zz>0 ? zz*
tan( xang - dR ) : zz*
tan( xang + dR ) ) ;
370 const double highX ( zz>0 ? zz*
tan( xang + dR ) : zz*
tan( xang - dR ) ) ;
371 const double yang ( atan( yy/zz ) ) ;
372 const double lowY ( zz>0 ? zz*
tan( yang - dR ) : zz*
tan( yang + dR ) ) ;
373 const double highY ( zz>0 ? zz*
tan( yang + dR ) : zz*
tan( yang - dR ) ) ;
375 const double refxlo ( 0 > rz ?
m_xlo[0] :
m_xlo[1] ) ;
376 const double refxhi ( 0 > rz ?
m_xhi[0] :
m_xhi[1] ) ;
377 const double refylo ( 0 > rz ?
m_ylo[0] :
m_ylo[1] ) ;
378 const double refyhi ( 0 > rz ?
m_yhi[0] :
m_yhi[1] ) ;
385 const int ix_ctr (
xindex( xx, rz ) ) ;
386 const int iy_ctr (
yindex( yy, rz ) ) ;
387 const int iz ( rz>0 ? 1 : -1 ) ;
389 const int ix_hi ( ix_ctr +
int( ( highX - xx )/
m_wref ) + 2 ) ;
390 const int ix_lo ( ix_ctr -
int( ( xx - lowX )/
m_wref ) - 2 ) ;
392 const int iy_hi ( iy_ctr +
int( ( highY - yy )/
m_wref ) + 2 ) ;
393 const int iy_lo ( iy_ctr -
int( ( yy - lowY )/
m_wref ) - 2 ) ;
395 for(
int kx ( ix_lo ) ; kx <= ix_hi ; ++kx )
400 for(
int ky ( iy_lo ) ; ky <= iy_hi ; ++ky )
412 const double eta (
p.eta() ) ;
413 const double phi (
p.phi() ) ;
431 if( 0 !=
id.rawId() &&
434 const float phi ( 370. +
436 const int iPhi ( 1 +
int(phi)%360 ) ;
437 const int iz (
id.zside() ) ;
446 for(
unsigned int i ( 0 ) ;
i != 720 ; ++
i )
448 const int kz ( 360>
i ? -1 : 1 ) ;
449 const int iEta ( kz*85 ) ;
450 const int iEtam1 ( kz*84 ) ;
451 const int iEtam2 ( kz*83 ) ;
452 const int jPhi (
i%360 + 1 ) ;
454 olist[0]=
EBDetId( iEta , jPhi ) ;
457 olist[3]=
EBDetId( iEtam1, jPhi ) ;
462 olist[8]=
EBDetId( iEtam2, jPhi ) ;
466 ptr = (*m_borderPtrVec)[ ( iPhi - 1 ) + ( 0>iz ? 0 : 360 ) ] ;
487 const unsigned int cellIndex (
EEDetId( detId ).denseIndex() ) ;
500 for(
unsigned int i ( 0 ) ;
i !=
m_cellVec.size() ; ++
i )
518 0 == cell->
param() ? 0 : cell ) ;
static EEDetId detIdFromDenseIndex(uint32_t din)
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
virtual DetId getClosestCell(const GlobalPoint &r) const
double degrees(double radiants)
def degrees
std::set< DetId > DetIdSet
tuple nN
people filling error matrix uses the naive 1/sqrt(N) errors
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
CaloCellGeometry::Pt3D Pt3D
Geom::Phi< T > phi() const
VecOrdListEBDetIdPtr * m_borderPtrVec
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
std::vector< Pt3D > Pt3DVec
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
CaloCellGeometry::CCGFloat CCGFloat
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
CCGFloat avgAbsZFrontFaceCenter() const
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 CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static unsigned int alignmentTransformIndexLocal(const DetId &id)
const CCGFloat * param() const
HepGeom::Plane3D< CCGFloat > Pl3D
unsigned int yindex(CCGFloat y, CCGFloat z) const
CaloCellGeometry::CCGFloat CCGFloat
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
CaloCellGeometry::Pt3DVec Pt3DVec
EZMgrFL< EBDetId > * m_borderMgr
std::vector< DetId > m_validIds
virtual ~EcalEndcapGeometry()
Tan< T >::type tan(const T &t)
std::vector< OrderedListOfEBDetId * > VecOrdListEBDetIdPtr
CaloCellGeometry::CCGFloat CCGFloat
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
virtual void initializeParms()
unsigned int offset(bool)
double deltaR2(double eta1, double phi1, double eta2, double phi2)
CaloCellGeometry::Pt3D Pt3D
unsigned int xindex(CCGFloat x, CCGFloat z) const
CaloCellGeometry::CornersMgr * cornersMgr()
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
EZArrayFL< EBDetId > OrderedListOfEBDetId
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
EEDetId gId(float x, float y, float z) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell's volume.