17 #include <boost/function.hpp>
18 #include <boost/bind.hpp>
35 float operator()(
float a,
float b)
const {
40 void fillBoundaries(std::vector<const TECWedge*>
const & dets,
41 std::vector<float> & boundaries) {
42 boundaries.resize(dets.size());
46 std::adjacent_difference(boundaries.begin(),boundaries.end(), boundaries.begin(),
Mean());
50 int findBin(std::vector<float>
const & boundaries,
float r) {
52 std::lower_bound(boundaries.begin()+1,boundaries.end(),
r)
53 -boundaries.begin()-1;
57 void fillPars(std::vector<const TECWedge*>
const & dets, std::vector<CompositeTECPetal::WedgePar> & pars) {
59 for (
auto gsdet : dets) {
63 float thetaWedgeMin = wedgeSector.
innerRadius()/ wedgeMaxZ;
64 float thetaWedgeMax = wedgeSector.
outerRadius()/ wedgeMinZ;
77 auto tsRadius = gpos.
perp();
80 auto rmax = (tsRadius +
ymax);
95 vector<const TECWedge*>& outerWedges) :
97 theFrontComps(innerWedges),
98 theBackComps(outerWedges)
108 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
111 (**it).basicComponents().begin(),
112 (**it).basicComponents().end());
120 vector<const TECWedge*> allWedges;
121 allWedges.assign(innerWedges.begin(),innerWedges.end());
122 allWedges.insert(allWedges.end(),outerWedges.begin(),outerWedges.end());
129 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for CompositeTECPetal" ;
133 LogDebug(
"TkDetLayers") <<
"frontWedge phi,z,r: "
134 << (*it)->surface().position().phi() <<
" , "
135 << (*it)->surface().position().z() <<
" , "
136 << (*it)->surface().position().perp() ;
141 LogDebug(
"TkDetLayers") <<
"backWedge phi,z,r: "
142 << (*it)->surface().position().phi() <<
" , "
143 << (*it)->surface().position().z() <<
" , "
144 << (*it)->surface().position().perp() ;
153 vector<const GeometricSearchDet*>::const_iterator
i;
160 pair<bool, TrajectoryStateOnSurface>
163 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of CompositeTECPetal::compatible()!!" ;
164 return pair<bool,TrajectoryStateOnSurface>();
172 std::vector<DetGroup> &
result)
const {
174 vector<DetGroup> closestResult;
177 if(! crossings.
isValid())
return;
180 LogDebug(
"TkDetLayers") <<
"in TECPetal, closestResult.size(): "<< closestResult.size();
182 if (closestResult.empty()){
183 vector<DetGroup> nextResult;
185 LogDebug(
"TkDetLayers") <<
"in TECPetal, nextResult.size(): "<< nextResult.size() ;
186 if(nextResult.empty())
return;
198 closestResult,
false);
200 vector<DetGroup> nextResult;
233 <<
"in TECPetal,front crossing : r,z,phi: ("
234 << gFrontPoint.perp() <<
","
235 << gFrontPoint.z() <<
","
236 << gFrontPoint.phi() <<
")";
239 <<
"in TECPetal,back crossing r,z,phi: ("
240 << gBackPoint.perp() <<
","
241 << gBackPoint.z() <<
","
242 << gBackPoint.phi() <<
")" ;
246 int frontIndex =
findBin(gFrontPoint.perp(),0);
249 int backIndex =
findBin(gBackPoint.perp(),1);
258 if (frontDist < backDist) {
270 vector<DetGroup>&
result)
const
276 <<
"in TECPetal, adding Wedge at r,z,phi: ("
277 << det->position().perp() <<
","
278 << det->position().z() <<
","
279 << det->position().phi() <<
")" ;
281 <<
"wedge comps size: "
282 << det->basicComponents().size();
296 bool checkClosest)
const
302 int negStartIndex = closestIndex-1;
303 int posStartIndex = closestIndex+1;
308 if ( gCrossingPos.
perp2() < detR*detR ) {
309 posStartIndex = closestIndex;
312 negStartIndex = closestIndex;
322 for (
int idet=negStartIndex; idet >= 0; idet--) {
327 if (!
Adder::add( neighborWedge, tsos, prop, est, result))
break;
330 for (
int idet=posStartIndex; idet <theSize; idet++) {
335 if (!
Adder::add( neighborWedge, tsos, prop, est, result))
break;
std::vector< float > theFrontBoundaries
int findBin(float R, int layer) const
virtual float thickness() const
WedgePar const & findPar(int index, int diskSectorType) const
float innerRadius() const
virtual PositionType position(double s) const
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
int closestDetIndex() const
CompositeTECPetal(std::vector< const TECWedge * > &innerWedges, std::vector< const TECWedge * > &outerWedges) __attribute__((cold))
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
std::vector< const GeometricSearchDet * > theComps
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const __attribute__((hot))
virtual PropagationDirection propagationDirection() const final
virtual void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
const Plane & surface() const
The nominal surface of the GeomDet.
DiskSectorBounds const & bounds() const
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
const GlobalPoint & position() const
~CompositeTECPetal() __attribute__((cold))
float outerRadius() const
int subLayerIndex() const
const std::vector< const TECWedge * > & subLayer(int ind) const
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
Abs< T >::type abs(const T &t)
ReferenceCountingPointer< BoundDiskSector > theDiskSector
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) __attribute__((hot))
const SubLayerCrossing & other() const
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const __attribute__((cold))
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
ReferenceCountingPointer< BoundDiskSector > theFrontSector
std::vector< const TECWedge * > theFrontComps
virtual const Surface::PositionType & position() const
Returns position of the surface.
ReferenceCountingPointer< BoundDiskSector > theBackSector
std::vector< WedgePar > theBackPars
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
std::vector< const GeomDet * > theBasicComps
virtual std::pair< bool, double > pathLength(const Plane &plane)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
const PositionType & position() const
std::vector< float > theBackBoundaries
std::vector< const TECWedge * > theBackComps
std::vector< WedgePar > theFrontPars
double transverseCurvature() const