12 float zStart = wedges.front()->position().z();
13 float wphimin, wphimax;
14 for (vector<const TECWedge*>::const_iterator
i = wedges.begin();
i != wedges.end();
i++) {
15 float zdiff = (**i).surface().position().z() - zStart;
17 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromWedges: Trying to build "
18 <<
"Petal from Wedges at different z ! Delta Z = " << zdiff;
19 float wphi = (**i).surface().position().phi();
27 float phidiff = wphimax - wphimin;
31 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromWedges: Trying to build "
32 <<
"Petal from Wedges at different phi ! Delta phi = " <<
phidiff;
35 auto bo = computeBounds(wedges);
43 const vector<const TECWedge*>& wedges)
const {
45 float rmin((**(wedges.begin())).specificSurface().innerRadius());
47 float zmin((**(wedges.begin())).surface().position().z());
49 float phimin((**(wedges.begin())).surface().position().phi());
52 for (vector<const TECWedge*>::const_iterator iw = wedges.begin(); iw != wedges.end(); iw++) {
55 float ri = (**iw).specificSurface().innerRadius();
56 float ro = (**iw).specificSurface().outerRadius();
57 float zmi = (**iw).surface().position().z() - (**iw).specificSurface().bounds().thickness() / 2.;
58 float zma = (**iw).surface().position().z() + (**iw).specificSurface().bounds().thickness() / 2.;
59 float phi1 = (**iw).surface().position().phi() - (**iw).specificSurface().phiHalfExtension();
60 float phi2 = (**iw).surface().position().phi() + (**iw).specificSurface().phiHalfExtension();
63 zmin =
min(zmin, zmi);
64 zmax =
max(zmax, zma);
72 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromWedges : "
73 <<
"Something went wrong with Phi Sorting !";
74 float zPos = (zmax + zmin) / 2.;
75 float phiWin = phimax -
phimin;
76 float phiPos = (phimax +
phimin) / 2.;
77 float rmed = (rmin + rmax) / 2.;
80 edm::LogError(
"TkDetLayers") <<
" Debug: something strange going on, please check ";
89 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
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) 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 .
Log< level::Error, false > LogError
BoundDiskSector * operator()(const std::vector< const TECWedge * > &wedges) const
Surface::RotationType computeRotation(const std::vector< const TECWedge * > &wedges, Surface::PositionType pos) 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
Basic3DVector unit() const