13 float rcheck = dets.front()->surface().
position().
perp();
14 float zcheck = dets.front()->surface().position().z();
15 for (vector<const GeomDet*>::const_iterator
i = dets.begin();
i != dets.end();
i++) {
16 float rdiff = (**i).surface().position().perp() - rcheck;
18 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet: Trying to build Petal Wedge from " 19 <<
"Dets at different radii !! Delta_r = " << rdiff;
20 float zdiff = zcheck - (**i).surface().position().z();
22 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet: Trying to build Petal Wedge from " 23 <<
"Dets at different z positions !! Delta_z = " << zdiff;
26 auto bo = computeBounds(dets);
34 const vector<const GeomDet*>& dets)
const {
36 float rmin = (**(dets.begin())).surface().position().perp();
38 float zmin((**(dets.begin())).surface().position().z());
40 float phimin((**(dets.begin())).surface().position().phi());
43 for (vector<const GeomDet*>::const_iterator idet = dets.begin(); idet != dets.end(); idet++) {
44 vector<const GeomDet*> detUnits = (**idet).components();
45 if (!detUnits.empty()) {
46 for (vector<const GeomDet*>::const_iterator detu = detUnits.begin(); detu != detUnits.end(); detu++) {
48 vector<GlobalPoint> corners = computeTrapezoidalCorners(*detu);
49 for (vector<GlobalPoint>::const_iterator
i = corners.begin();
i != corners.end();
i++) {
65 float rdet = (**detu).position().perp();
66 float len = (**detu).surface().bounds().length();
67 float width = (**detu).surface().bounds().width();
77 rmin =
min(rmin, rdet - width / 2.
F);
78 rmax =
max(rmax, rdet + width / 2.
F);
80 rmin =
min(rmin, rdet - len / 2.
F);
81 rmax =
max(rmax, rdet + len / 2.
F);
85 vector<GlobalPoint> corners = computeTrapezoidalCorners(*idet);
86 for (vector<GlobalPoint>::const_iterator
i = corners.begin();
i != corners.end();
i++) {
103 float rdet = (**idet).position().perp();
104 float len = (**idet).surface().bounds().length();
105 float width = (**idet).surface().bounds().width();
111 double xAxisCos = xAxis.
unit().
dot(perpDir.
unit());
112 double yAxisCos = yAxis.
unit().
dot(perpDir.
unit());
115 rmin =
min(rmin, rdet - width / 2.
F);
116 rmax =
max(rmax, rdet + width / 2.
F);
118 rmin =
min(rmin, rdet - len / 2.
F);
119 rmax =
max(rmax, rdet + len / 2.
F);
125 edm::LogError(
"TkDetLayers") <<
" ForwardDiskSectorBuilderFromDet : " 126 <<
"Something went wrong with Phi Sorting !";
127 float zPos = (zmax +
zmin) / 2.;
128 float phiWin = phimax -
phimin;
129 float phiPos = (phimax +
phimin) / 2.;
130 float rmed = (rmin + rmax) / 2.;
133 edm::LogError(
"TkDetLayers") <<
" Debug: something strange going on, please check ";
170 if (parameters[0] == 0) {
171 edm::LogError(
"TkDetLayers") <<
"ForwardDiskSectorBuilder: something weird going on !";
172 edm::LogError(
"TkDetLayers") <<
" Trapezoidal parameters of GeomDet (L2/L1/T/H): ";
173 for (
int i = 0;
i < 4;
i++)
174 edm::LogError(
"TkDetLayers") <<
" " << 2. * parameters[
i] <<
"\n";
177 float hbotedge = parameters[0];
178 float htopedge = parameters[1];
179 float hapothem = parameters[3];
180 float hthick = parameters[2];
182 vector<GlobalPoint> corners;
184 corners.push_back(plane.toGlobal(
LocalPoint(-htopedge, hapothem, hthick)));
185 corners.push_back(plane.toGlobal(
LocalPoint(-htopedge, hapothem, -hthick)));
186 corners.push_back(plane.toGlobal(
LocalPoint(htopedge, hapothem, hthick)));
187 corners.push_back(plane.toGlobal(
LocalPoint(htopedge, hapothem, -hthick)));
188 corners.push_back(plane.toGlobal(
LocalPoint(hbotedge, -hapothem, hthick)));
189 corners.push_back(plane.toGlobal(
LocalPoint(hbotedge, -hapothem, -hthick)));
190 corners.push_back(plane.toGlobal(
LocalPoint(-hbotedge, -hapothem, hthick)));
191 corners.push_back(plane.toGlobal(
LocalPoint(-hbotedge, -hapothem, -hthick)));
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
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
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
Basic3DVector unit() const