16 float rcheck = dets.front()->surface().
position().
perp();
17 float zcheck = dets.front()->surface().position().z();
18 for ( vector<const GeomDet*>::const_iterator
i = dets.begin();
i != dets.end();
i++){
19 float rdiff = (**i).surface().position().perp()-rcheck;
21 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet: Trying to build Petal Wedge from "
22 <<
"Dets at different radii !! Delta_r = " << rdiff ;
23 float zdiff = zcheck - (**i).surface().position().z();
25 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet: Trying to build Petal Wedge from "
26 <<
"Dets at different z positions !! Delta_z = " << zdiff ;
29 auto bo = computeBounds( dets );
36 pair<DiskSectorBounds*, GlobalVector>
40 float rmin = (**(dets.begin())).surface().position().perp();
42 float zmin((**(dets.begin())).surface().position().z());
44 float phimin((**(dets.begin())).surface().position().phi());
48 for (vector<const GeomDet*>::const_iterator idet=dets.begin();
49 idet != dets.end(); idet++) {
50 vector<const GeomDet*> detUnits = (**idet).components();
51 if( detUnits.size() ){
52 for (vector<const GeomDet*>::const_iterator detu=detUnits.begin();
53 detu!=detUnits.end(); detu++) {
55 vector<GlobalPoint> corners = computeTrapezoidalCorners(*detu) ;
56 for (vector<GlobalPoint>::const_iterator
i=corners.begin();
57 i!=corners.end();
i++) {
66 if (
PhiLess()( phimax, phi)) phimax = phi;
71 float rdet = (**detu).position().perp();
72 float len = (**detu).surface().bounds().length();
73 float width = (**detu).surface().bounds().width();
83 rmin =
min( rmin, rdet-width/2.
F);
84 rmax =
max( rmax, rdet+width/2.
F);
86 rmin =
min( rmin, rdet-len/2.
F);
87 rmax =
max( rmax, rdet+len/2.
F);
91 vector<GlobalPoint> corners = computeTrapezoidalCorners(*idet) ;
92 for (vector<GlobalPoint>::const_iterator
i=corners.begin();
93 i!=corners.end();
i++) {
100 zmax =
max( zmax, z);
102 if (
PhiLess()( phimax, phi)) phimax = phi;
108 float rdet = (**idet).position().perp();
109 float len = (**idet).surface().bounds().length();
110 float width = (**idet).surface().bounds().width();
116 double xAxisCos = xAxis.
unit().
dot(perpDir.
unit());
117 double yAxisCos = yAxis.
unit().
dot(perpDir.
unit());
120 rmin =
min( rmin, rdet-width/2.
F);
121 rmax =
max( rmax, rdet+width/2.
F);
123 rmin =
min( rmin, rdet-len/2.
F);
124 rmax =
max( rmax, rdet+len/2.
F);
131 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet : "
132 <<
"Something went wrong with Phi Sorting !" ;
133 float zPos = (zmax+
zmin)/2.;
134 float phiWin = phimax -
phimin;
135 float phiPos = (phimax+
phimin)/2.;
136 float rmed = (rmin+rmax)/2.;
139 edm::LogError(
"TkDetLayers") <<
" Debug: something strange going on, please check " ;
180 auto const &
parameters = (*myBounds).parameters();
182 if ( parameters[0] == 0 ) {
183 edm::LogError(
"TkDetLayers") <<
"ForwardDiskSectorBuilder: something weird going on !" ;
184 edm::LogError(
"TkDetLayers") <<
" Trapezoidal parameters of GeomDet (L2/L1/T/H): " ;
191 float hbotedge = parameters[0];
192 float htopedge = parameters[1];
193 float hapothem = parameters[3];
194 float hthick = parameters[2];
196 vector<GlobalPoint> corners;
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( htopedge, 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)));
205 corners.push_back( plane.toGlobal(
LocalPoint( -hbotedge, -hapothem, -hthick)));
Local3DVector LocalVector
std::pair< DiskSectorBounds *, GlobalVector > computeBounds(const std::vector< const GeomDet * > &dets) 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)
Vector3DBase unit() const
BoundDiskSector * operator()(const std::vector< const GeomDet * > &dets) const
std::vector< GlobalPoint > computeTrapezoidalCorners(const GeomDet *detu) const
Geom::Phi< T > phi() 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