22 theDets(theGeomDets.
begin(),theGeomDets.
end())
36 LogDebug(
"TkDetLayers") <<
"==== DEBUG TIBRing =====" ;
37 LogDebug(
"TkDetLayers") <<
"radius, thickness, lenght: "
38 << theCylinder->radius() <<
" , "
39 << theCylinder->bounds().thickness() <<
" , "
40 << theCylinder->bounds().length() ;
42 for (vector<const GeomDet*>::const_iterator
i=
theDets.begin();
44 LogDebug(
"TkDetLayers") <<
"Ring's Det pos z,perp,eta,phi: "
45 << (**i).position().z() <<
" , "
46 << (**i).position().perp() <<
" , "
47 << (**i).position().eta() <<
" , "
48 << (**i).position().phi() ;
50 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TIBRing =====" ;
56 const vector<const GeometricSearchDet*>&
63 vector<const GeomDet*>::const_iterator
last)
68 for (vector<const GeomDet*>::const_iterator
i=first;
i!=
last;
i++) {
69 float r = (**i).surface().position().perp();
70 if (r < rMin) rMin =
r;
71 if (r > rMax) rMax =
r;
74 "TIBRing construction failed: detectors not at constant radius");
79 vector<const GeomDet*>::const_iterator
last)
81 vector<double> adj_diff(last-first-1);
82 for (
int i=0; i < static_cast<int>(adj_diff.size());
i++) {
83 vector<const GeomDet*>::const_iterator curent = first +
i;
84 adj_diff[
i] = (**(curent+1)).surface().position().phi() -
85 (**curent).surface().position().phi();
90 if ( fabs(step-phi_step)/phi_step > 0.01) {
91 int ndets = last-
first;
92 edm::LogError(
"TkDetLayers") <<
"TIBRing Warning: not periodic. ndets=" << ndets ;
93 for (
int j=0;
j<ndets;
j++) {
95 <<
"," <<
theDets[
j]->surface().position().phi() <<
") " ;
106 if(normal.
dot(radial)<=0)normal*=-1;
123 pair<bool, TrajectoryStateOnSurface>
126 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of TIBRing::compatible()!!" ;
127 return pair<bool,TrajectoryStateOnSurface>();
135 vector<DetGroup> &
result)
const
137 vector<DetGroup> closestResult;
144 tsos, prop, est, closestResult);
146 if(closestResult.empty()){
156 float detWidth = closestGel.det()->surface().bounds().width();
158 vector<DetGroup> nextResult;
160 tsos, prop, est, nextResult)) {
174 result.swap(closestResult);
177 result.swap(closestResult);
181 if (window > 0.5*detWidth) {
191 vector<DetGroup>&
result)
const
200 int quarter =
theDets.size()/4;
201 vector<DetGroup>
tmp;
202 vector<DetGroup> newResult;
203 for (
int idet=negStart; idet >= negStart - quarter+1; idet--) {
209 if (!
Adder::add( *neighbor, tsos, prop, est, tmp))
break;
210 Merger::orderAndMergeTwoLevels( tmp, result, newResult,
theHelicity, crossingSide);
211 result.swap(newResult);
213 for (
int idet=posStart; idet < posStart + quarter-1; idet++) {
219 if (!
Adder::add( *neighbor, tsos, prop, est, tmp))
break;
220 Merger::orderAndMergeTwoLevels( result, tmp, newResult,
theHelicity, crossingSide);
221 result.swap(newResult);
248 LocalPoint closestPos = Crossing( cylPoint, cylDir,
rho, closestPlane).position();
249 float closestDist = closestPos.
x();
253 closestIndex+1 : closestIndex-1;
256 LocalPoint nextPos = Crossing( cylPoint, cylDir,
rho, nextPlane).position();
257 float nextDist = nextPos.
x();
259 if (fabs(closestDist) < fabs(nextDist)) {
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
static void orderAndMergeTwoLevels(const std::vector< DetGroup > &one, const std::vector< DetGroup > &two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
Local3DVector LocalVector
virtual const std::vector< const GeometricSearchDet * > & components() const
Returns basic components, if any.
BinFinderType theBinFinder
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
virtual PropagationDirection propagationDirection() const
PeriodicBinFinderInPhi< double > BinFinderType
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
std::vector< const GeomDet * > theDets
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
void checkRadius(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Vector2DBase< float, LocalTag > Local2DVector
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
double stat_mean(const CONT &cont)
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
ReferenceCountingPointer< BoundCylinder > theCylinder
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubRingCrossings &crossings, float window, std::vector< DetGroup > &result) const
void checkPeriodicity(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
const T & max(const T &a, const T &b)
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const
TIBRing(std::vector< const GeomDet * > &theGeomDets)
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
SubRingCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const
virtual const BoundCylinder & specificSurface() const
Return the ring surface as a.
int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
returns 0 if barrel layer crossed from inside, 1 if from outside
std::vector< std::vector< double > > tmp
GlobalVector globalMomentum() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
virtual void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
const PositionType & position() const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
double transverseCurvature() const