18 PixelBlade::~PixelBlade(){}
20 PixelBlade::PixelBlade(vector<const GeomDet*>& frontDets,
21 vector<const GeomDet*>& backDets):
23 theFrontDets(frontDets), theBackDets(backDets)
25 theDets.assign(theFrontDets.begin(),theFrontDets.end());
26 theDets.insert(theDets.end(),theBackDets.begin(),theBackDets.end());
34 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelBlade" ;
35 LogDebug(
"TkDetLayers") <<
"Blade z, perp, innerRadius, outerR: "
38 << theDiskSector->innerRadius() <<
" , "
39 << theDiskSector->outerRadius() ;
41 for(vector<const GeomDet*>::const_iterator it=theFrontDets.begin();
42 it!=theFrontDets.end(); it++){
43 LogDebug(
"TkDetLayers") <<
"frontDet phi,z,r: "
44 << (*it)->position().phi() <<
" , "
45 << (*it)->position().z() <<
" , "
46 << (*it)->position().perp() ;;
49 for(vector<const GeomDet*>::const_iterator it=theBackDets.begin();
50 it!=theBackDets.end(); it++){
51 LogDebug(
"TkDetLayers") <<
"backDet phi,z,r: "
52 << (*it)->position().phi() <<
" , "
53 << (*it)->position().z() <<
" , "
54 << (*it)->position().perp() ;
61 const vector<const GeometricSearchDet*>&
66 pair<bool, TrajectoryStateOnSurface>
69 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of PixelBlade::compatible()!!" ;
70 return pair<bool,TrajectoryStateOnSurface>();
79 std::vector<DetGroup> &
result)
const{
82 if(! crossings.
isValid())
return;
84 vector<DetGroup> closestResult;
85 addClosest( tsos, prop, est, crossings.
closest(), closestResult);
87 if (closestResult.empty()){
88 vector<DetGroup> nextResult;
89 addClosest( tsos, prop, est, crossings.
other(), nextResult);
90 if(nextResult.empty())
return;
102 searchNeighbors( tsos, prop, est, crossings.
closest(),
window,
103 closestResult,
false);
105 vector<DetGroup> nextResult;
106 searchNeighbors( tsos, prop, est, crossings.
other(),
window,
123 HelixArbitraryPlaneCrossing crossing( startPos, startDir,
rho, propDir);
125 pair<bool,double> innerPath = crossing.pathLength( *theFrontDiskSector);
128 GlobalPoint gInnerPoint( crossing.position(innerPath.second));
132 int innerIndex = findBin(gInnerPoint.perp(),0);
133 float innerDist =
std::abs( findPosition(innerIndex,0).
perp() - gInnerPoint.perp());
136 pair<bool,double> outerPath = crossing.pathLength( *theBackDiskSector);
139 GlobalPoint gOuterPoint( crossing.position(outerPath.second));
143 int outerIndex = findBin(gOuterPoint.perp(),1);
144 float outerDist =
std::abs( findPosition(outerIndex,1).
perp() - gOuterPoint.perp());
147 if (innerDist < outerDist) {
163 vector<DetGroup>& result)
const
166 const vector<const GeomDet*>& sBlade( subBlade( crossing.
subLayerIndex()));
188 vector<DetGroup>& result,
189 bool checkClosest)
const
193 const vector<const GeomDet*>& sBlade( subBlade( crossing.
subLayerIndex()));
196 int negStartIndex = closestIndex-1;
197 int posStartIndex = closestIndex+1;
200 if (gCrossingPos.
perp() < sBlade[closestIndex]->surface().position().perp()) {
201 posStartIndex = closestIndex;
204 negStartIndex = closestIndex;
209 for (
int idet=negStartIndex; idet >= 0; idet--) {
210 if (!
overlap( gCrossingPos, *sBlade[idet], window))
break;
211 if (!
Adder::add( *sBlade[idet], tsos, prop, est, result))
break;
213 for (
int idet=posStartIndex; idet < static_cast<int>(sBlade.size()); idet++) {
214 if (!
overlap( gCrossingPos, *sBlade[idet], window))
break;
215 if (!
Adder::add( *sBlade[idet], tsos, prop, est, result))
break;
226 const float relativeMargin = 1.01;
234 float localX = localCrossPoint.
x();
240 if ( (
std::abs(localX)-window) < relativeMargin*detHalfLength ) {
248 PixelBlade::findBin(
float R,
int diskSectorIndex)
const
250 vector<const GeomDet*> localDets = diskSectorIndex==0 ? theFrontDets : theBackDets;
253 float rDiff =
std::abs( R - localDets.front()->surface().position().perp());;
254 for (vector<const GeomDet*>::const_iterator
i=localDets.begin();
i !=localDets.end();
i++){
255 float testDiff =
std::abs( R - (**i).surface().position().perp());
256 if ( testDiff < rDiff) {
258 theBin =
i - localDets.begin();
267 PixelBlade::findPosition(
int index,
int diskSectorType)
const
269 vector<const GeomDet*> diskSector = diskSectorType == 0 ? theFrontDets : theBackDets;
270 return (diskSector[index])->surface().position();
virtual float length() const =0
int closestDetIndex() const
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
const Bounds & bounds() const
const Plane & surface() const
The nominal surface of the GeomDet.
static int position[TOTALCHAMBERS][3]
virtual PropagationDirection propagationDirection() const GCC11_FINAL
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
LocalPoint toLocal(const GlobalPoint &gp) const
int subLayerIndex() const
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
const SubLayerCrossing & other() const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
static BoundDiskSector * build(const std::vector< const GeomDet * > &dets) __attribute__((cold))
const SubLayerCrossing & closest() const
T perp() const
Magnitude of transverse component.
GlobalVector globalMomentum() const
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)
double transverseCurvature() const