10 m_xInterLadGap ( 0.05 ) ,
11 m_xIntraLadGap ( 0.04 ) ,
25 assert( gid.
isES() ) ;
44 const int jx ( esid.six() - 1 ) ;
45 const int jy ( esid.siy() - 1 ) ;
46 const int jz ( esid.zside() + 1 ) ;
47 const int pl ( esid.plane() - 1 ) ;
48 const bool second ( 1 == pl ) ;
49 const bool top ( 19 < jy ) ;
50 const bool negz ( 0 == jz ) ;
51 const int lrl ( 20>jx ? 0 : 1 ) ;
52 const int lrr ( 22>jx ? 0 : 1 ) ;
54 return ( second ? jx/20 + 3*jz :
55 ( negz && !top ? lrl + 2 :
56 ( negz && top ? lrr + 2 :
57 ( !negz && !top ? lrr + 4 : lrl + 4 ) ) ) ) ;
63 return ESDetId( 1, 10 + 20*( iLoc%2 ), 10, 2>iLoc || 5<iLoc ? 2 : 1, 2*( iLoc/4 ) - 1 ) ;
77 unsigned int n1minus ( 0 ) ;
78 unsigned int n2minus ( 0 ) ;
79 unsigned int n1plus ( 0 ) ;
80 unsigned int n2plus ( 0 ) ;
81 double z1minus ( 0 ) ;
82 double z2minus ( 0 ) ;
86 for(
unsigned int i ( 0 ) ;
i != con.size() ; ++
i )
89 if( 1 == esid.
plane() )
91 if( 0 > esid.
zside() )
93 z1minus += con[
i]->getPosition().z() ;
98 z1plus += con[
i]->getPosition().z() ;
102 if( 2 == esid.
plane() )
104 if( 0 > esid.
zside() )
106 z2minus += con[
i]->getPosition().z() ;
111 z2plus += con[
i]->getPosition().z() ;
119 assert( 0 != n1minus &&
123 z1minus /= (1.*n1minus) ;
124 z2minus /= (1.*n2minus) ;
125 z1plus /= (1.*n1plus) ;
126 z2plus /= (1.*n2plus) ;
127 assert( 0 != z1minus &&
131 setzPlanes( z1minus, z2minus, z1plus, z2plus ) ;
141 assert( 0 > z1minus &&
164 const double x ( point.
x() ) ;
165 const double y ( point.
y() ) ;
166 const double z ( point.
z() ) ;
170 2 < plane )
return DetId( 0 ) ;
172 const unsigned int iz ( ( 0>
z ? 0 : 2 ) + plane - 1 ) ;
175 const double xe (
x * ze/
z ) ;
176 const double ye (
y * ze/
z ) ;
178 const double x0 ( 1 == plane ? xe : ye ) ;
179 const double y0 ( 1 == plane ? ye : xe ) ;
184 const int col ( 1 +
int( ( x0 + 20.*xWid )/xWid ) ) ;
186 double closest ( 1e9 ) ;
190 const int jz ( 0 > ze ? -1 : 1 ) ;
195 for(
int ix ( -1 ); ix != 2 ; ++ix )
197 for(
int iy ( -1 ); iy != 2 ; ++iy )
201 const int jx ( 1 == plane ? col + ix : row + iy ) ;
202 const int jy ( 1 == plane ? row + iy : col + ix ) ;
205 const ESDetId esId ( jstrip, jx, jy, plane, jz ) ;
208 const double dist2 ( (p.x()-xe)*(p.x()-xe) + (p.y()-ye)*(p.y()-ye) ) ;
209 if( dist2 < closest &&
present( esId ) )
221 std::vector<HepGeom::Point3D<double> >
224 HepGeom::Point3D<double> & ref )
std::vector< const CaloCellGeometry * > CellCont
const double m_xInterLadGap
void setzPlanes(float z1minus, float z2minus, float z1plus, float z2plus)
virtual DetId getClosestCell(const GlobalPoint &r) const
static const int ISTRIP_MAX
virtual void initializeParms()
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)
A base class to handle the shape of preshower strips.
U second(std::pair< T, U > const &p)
virtual bool present(const DetId &id) const
is this detid present in the geometry?
const CellCont & cellGeometries() const
the cells
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, unsigned int i, HepGeom::Point3D< double > &ref)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
virtual DetId getClosestCellInPlane(const GlobalPoint &r, int plane) const
static unsigned int alignmentTransformIndexLocal(const DetId &id)
virtual ~EcalPreshowerGeometry()
The EcalPreshowerGeometry will delete all its cell geometries at destruction time.
uint32_t denseIndex() const
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
static CaloCellGeometry * newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, CaloCellGeometry::CornersMgr *mgr, const double *parm, const DetId &detId)
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
const double m_xIntraLadGap
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
static const int ISTRIP_MIN
*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