15 float rcheck = dets.front()->surface().
position().
perp();
16 float zcheck = dets.front()->surface().position().z();
17 for ( vector<const GeomDet*>::const_iterator
i = dets.begin();
i != dets.end();
i++){
18 float rdiff = (**i).surface().position().perp()-rcheck;
20 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet: Trying to build Petal Wedge from " 21 <<
"Dets at different radii !! Delta_r = " << rdiff ;
22 float zdiff = zcheck - (**i).surface().position().z();
24 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet: Trying to build Petal Wedge from " 25 <<
"Dets at different z positions !! Delta_z = " << zdiff ;
28 auto bo = computeBounds( dets );
35 pair<DiskSectorBounds*, GlobalVector>
39 float rmin = (**(dets.begin())).surface().position().perp();
41 float zmin((**(dets.begin())).surface().position().z());
43 float phimin((**(dets.begin())).surface().position().phi());
47 for (vector<const GeomDet*>::const_iterator idet=dets.begin();
48 idet != dets.end(); idet++) {
49 vector<const GeomDet*> detUnits = (**idet).components();
50 if( !detUnits.empty() ){
51 for (vector<const GeomDet*>::const_iterator detu=detUnits.begin();
52 detu!=detUnits.end(); detu++) {
54 vector<GlobalPoint> corners = computeTrapezoidalCorners(*detu) ;
55 for (vector<GlobalPoint>::const_iterator
i=corners.begin();
56 i!=corners.end();
i++) {
70 float rdet = (**detu).position().perp();
71 float len = (**detu).surface().bounds().length();
72 float width = (**detu).surface().bounds().width();
82 rmin =
min( rmin, rdet-width/2.
F);
83 rmax =
max( rmax, rdet+width/2.
F);
85 rmin =
min( rmin, rdet-len/2.
F);
86 rmax =
max( rmax, rdet+len/2.
F);
90 vector<GlobalPoint> corners = computeTrapezoidalCorners(*idet) ;
91 for (vector<GlobalPoint>::const_iterator
i=corners.begin();
92 i!=corners.end();
i++) {
107 float rdet = (**idet).position().perp();
108 float len = (**idet).surface().bounds().length();
109 float width = (**idet).surface().bounds().width();
115 double xAxisCos = xAxis.
unit().
dot(perpDir.
unit());
116 double yAxisCos = yAxis.
unit().
dot(perpDir.
unit());
119 rmin =
min( rmin, rdet-width/2.
F);
120 rmax =
max( rmax, rdet+width/2.
F);
122 rmin =
min( rmin, rdet-len/2.
F);
123 rmax =
max( rmax, rdet+len/2.
F);
130 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet : " 131 <<
"Something went wrong with Phi Sorting !" ;
132 float zPos = (zmax+zmin)/2.;
133 float phiWin = phimax -
phimin;
134 float phiPos = (phimax+
phimin)/2.;
135 float rmed = (rmin+rmax)/2.;
138 edm::LogError(
"TkDetLayers") <<
" Debug: something strange going on, please check " ;
146 return make_pair(
new DiskSectorBounds(rmin,rmax,zmin-zPos,zmax-zPos,phiWin), pos);
181 if ( parameters[0] == 0 ) {
182 edm::LogError(
"TkDetLayers") <<
"ForwardDiskSectorBuilder: something weird going on !" ;
183 edm::LogError(
"TkDetLayers") <<
" Trapezoidal parameters of GeomDet (L2/L1/T/H): " ;
190 float hbotedge = parameters[0];
191 float htopedge = parameters[1];
192 float hapothem = parameters[3];
193 float hthick = parameters[2];
195 vector<GlobalPoint> corners;
197 corners.push_back( plane.toGlobal(
LocalPoint( -htopedge, hapothem, hthick)));
198 corners.push_back( plane.toGlobal(
LocalPoint( -htopedge, hapothem, -hthick)));
199 corners.push_back( plane.toGlobal(
LocalPoint( htopedge, hapothem, hthick)));
200 corners.push_back( plane.toGlobal(
LocalPoint( htopedge, hapothem, -hthick)));
201 corners.push_back( plane.toGlobal(
LocalPoint( hbotedge, -hapothem, hthick)));
202 corners.push_back( plane.toGlobal(
LocalPoint( hbotedge, -hapothem, -hthick)));
203 corners.push_back( plane.toGlobal(
LocalPoint( -hbotedge, -hapothem, hthick)));
204 corners.push_back( plane.toGlobal(
LocalPoint( -hbotedge, -hapothem, -hthick)));
Local3DVector LocalVector
std::pair< DiskSectorBounds *, GlobalVector > computeBounds(const std::vector< const GeomDet * > &dets) const
virtual const std::array< const float, 4 > parameters() const
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
bool phiLess(float phi1, float phi2)
Vector3DBase unit() const
BoundDiskSector * operator()(const std::vector< const GeomDet * > &dets) const
std::vector< GlobalPoint > computeTrapezoidalCorners(const GeomDet *detu) const
TkRotation< float > RotationType
Surface::RotationType computeRotation(const std::vector< const GeomDet * > &dets, Surface::PositionType pos) const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
const PositionType & position() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Global3DVector GlobalVector