33 LogDebug(
"TkDetLayers") <<
"==== DEBUG TIBRing =====";
34 LogDebug(
"TkDetLayers") <<
"radius, thickness, lenght: " << theCylinder->radius() <<
" , " 35 << theCylinder->bounds().thickness() <<
" , " << theCylinder->bounds().length();
37 for (vector<const GeomDet*>::const_iterator
i =
theDets.begin();
i !=
theDets.end();
i++) {
38 LogDebug(
"TkDetLayers") <<
"Ring's Det pos z,perp,eta,phi: " << (**i).position().z() <<
" , " 39 << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , " 40 << (**i).position().phi();
42 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TIBRing =====";
53 for (vector<const GeomDet*>::const_iterator
i = first;
i !=
last;
i++) {
54 float r = (**i).surface().position().perp();
60 if (rMax - rMin > 0.1)
61 throw DetLayerException(
"TIBRing construction failed: detectors not at constant radius");
65 vector<const GeomDet*>::const_iterator
last) {
66 vector<double> adj_diff(last - first - 1);
67 for (
int i = 0; i < static_cast<int>(adj_diff.size());
i++) {
68 vector<const GeomDet*>::const_iterator curent = first +
i;
69 adj_diff[
i] = (**(curent + 1)).surface().position().phi() - (**curent).surface().position().phi();
74 if (
std::abs(step - phi_step) / phi_step > 0.01) {
75 int ndets = last -
first;
76 edm::LogError(
"TkDetLayers") <<
"TIBRing Warning: not periodic. ndets=" << ndets;
77 for (
int j = 0;
j < ndets;
j++) {
79 <<
theDets[
j]->surface().position().phi() <<
") ";
89 if (normal.
dot(radial) <= 0)
105 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of TIBRing::compatible()!!";
106 return pair<bool, TrajectoryStateOnSurface>();
112 vector<DetGroup>&
result)
const {
113 vector<DetGroup> closestResult;
122 if (closestResult.empty()) {
130 float detWidth = closestGel.det()->surface().bounds().width();
132 vector<DetGroup> nextResult;
143 result.swap(closestResult);
146 result.swap(closestResult);
150 if (window > 0.5
f * detWidth) {
160 vector<DetGroup>&
result)
const {
168 int quarter =
theDets.size() / 4;
169 for (
int idet = negStart; idet >= negStart - quarter + 1; idet--) {
173 vector<DetGroup> tmp1;
174 if (!
Adder::add(*neighbor, tsos, prop, est, tmp1))
176 vector<DetGroup> tmp2;
178 vector<DetGroup> newResult;
180 result.swap(newResult);
182 for (
int idet = posStart; idet < posStart + quarter - 1; idet++) {
186 vector<DetGroup> tmp1;
187 if (!
Adder::add(*neighbor, tsos, prop, est, tmp1))
189 vector<DetGroup> tmp2;
191 vector<DetGroup> newResult;
193 result.swap(newResult);
218 LocalPoint closestPos = Crossing::positionOnly(cylPoint, cylDir, rho, closestPlane);
219 float closestDist = closestPos.
x();
226 LocalPoint nextPos = Crossing::positionOnly(cylPoint, cylDir, rho, nextPlane);
227 float nextDist = nextPos.x();
const BoundSurface & surface() const override
The surface of the GeometricSearchDet.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Local3DVector LocalVector
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
BinFinderType theBinFinder
TIBRing(std::vector< const GeomDet * > &theGeomDets) __attribute__((cold))
void computeHelicity() __attribute__((cold))
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override __attribute__((cold))
GeometricSearchDet::DetWithState DetWithState
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
std::vector< const GeomDet * > theDets
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
PositionType position() const
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
const std::vector< const GeometricSearchDet * > & components() const override __attribute__((cold))
Returns basic components, if any.
double stat_mean(const CONT &cont)
const Plane & surface() const
The nominal surface of the GeomDet.
void checkRadius(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last) __attribute__((cold))
ReferenceCountingPointer< BoundCylinder > theCylinder
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
virtual PropagationDirection propagationDirection() const final
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __attribute__((hot))
Abs< T >::type abs(const T &t)
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubRingCrossings &crossings, float window, std::vector< DetGroup > &result) const __attribute__((hot))
bool phiLess(float phi1, float phi2)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
PeriodicBinFinderInPhi< float > BinFinderType
virtual const BoundCylinder & specificSurface() const
Return the ring surface as a.
~TIBRing() override __attribute__((cold))
SubRingCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const __attribute__((hot))
GlobalVector globalMomentum() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
Vector2DBase< float, LocalTag > Local2DVector
DirectionType direction() const
void checkPeriodicity(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last) __attribute__((cold))
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const PositionType & position() const
double transverseCurvature() const