14 float zStart = wedges.front()->position().z();
15 float wphimin, wphimax;
16 for (vector<const TECWedge*>::const_iterator
i = wedges.begin();
i != wedges.end();
i++){
17 float zdiff = (**i).surface().position().z() - zStart;
19 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromWedges: Trying to build " 20 <<
"Petal from Wedges at different z ! Delta Z = " << zdiff ;
21 float wphi = (**i).surface().position().phi();
29 float phidiff = wphimax - wphimin;
30 if ( phidiff < 0.) phidiff += 2.*
Geom::pi();
32 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromWedges: Trying to build " 33 <<
"Petal from Wedges at different phi ! Delta phi = " 37 auto bo = computeBounds( wedges );
44 pair<DiskSectorBounds*, GlobalVector>
49 float rmin((**(wedges.begin())).specificSurface().innerRadius());
51 float zmin((**(wedges.begin())).surface().position().z());
53 float phimin((**(wedges.begin())).surface().position().phi());
56 for (vector<const TECWedge*>::const_iterator iw=wedges.begin();
57 iw != wedges.end(); iw++) {
60 float ri = (**iw).specificSurface().innerRadius();
61 float ro = (**iw).specificSurface().outerRadius();
62 float zmi = (**iw).surface().position().z() - (**iw).specificSurface().bounds().thickness()/2.;
63 float zma = (**iw).surface().position().z() + (**iw).specificSurface().bounds().thickness()/2.;
64 float phi1 = (**iw).surface().position().phi() - (**iw).specificSurface().phiHalfExtension();
65 float phi2 = (**iw).surface().position().phi() + (**iw).specificSurface().phiHalfExtension();
66 rmin =
min( rmin, ri);
67 rmax =
max( rmax, ro);
68 zmin =
min( zmin, zmi);
69 zmax =
max( zmax, zma);
75 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromWedges : " 76 <<
"Something went wrong with Phi Sorting !";
77 float zPos = (zmax+zmin)/2.;
78 float phiWin = phimax -
phimin;
79 float phiPos = (phimax+
phimin)/2.;
80 float rmed = (rmin+rmax)/2.;
83 edm::LogError(
"TkDetLayers") <<
" Debug: something strange going on, please check " ;
92 return make_pair(
new DiskSectorBounds(rmin,rmax,zmin-zPos,zmax-zPos,phiWin), pos);
std::pair< DiskSectorBounds *, GlobalVector > computeBounds(const std::vector< const TECWedge * > &wedges) const
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
BoundDiskSector * operator()(const std::vector< const TECWedge * > &wedges) const
Surface::RotationType computeRotation(const std::vector< const TECWedge * > &wedges, Surface::PositionType pos) 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)
TkRotation< float > RotationType
const PositionType & position() const
Global3DVector GlobalVector