18 PixelBlade::~PixelBlade(){}
20 PixelBlade::PixelBlade(vector<const GeomDet*>& frontDets,
21 vector<const GeomDet*>& backDets):
22 theFrontDets(frontDets), theBackDets(backDets)
24 theDets.assign(theFrontDets.begin(),theFrontDets.end());
25 theDets.insert(theDets.end(),theBackDets.begin(),theBackDets.end());
33 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelBlade" ;
34 LogDebug(
"TkDetLayers") <<
"Blade z, perp, innerRadius, outerR: "
37 << theDiskSector->innerRadius() <<
" , "
38 << theDiskSector->outerRadius() ;
40 for(vector<const GeomDet*>::const_iterator it=theFrontDets.begin();
41 it!=theFrontDets.end(); it++){
42 LogDebug(
"TkDetLayers") <<
"frontDet phi,z,r: "
43 << (*it)->position().phi() <<
" , "
44 << (*it)->position().z() <<
" , "
45 << (*it)->position().perp() ;;
48 for(vector<const GeomDet*>::const_iterator it=theBackDets.begin();
49 it!=theBackDets.end(); it++){
50 LogDebug(
"TkDetLayers") <<
"backDet phi,z,r: "
51 << (*it)->position().phi() <<
" , "
52 << (*it)->position().z() <<
" , "
53 << (*it)->position().perp() ;
60 const vector<const GeometricSearchDet*>&
65 pair<bool, TrajectoryStateOnSurface>
68 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of PixelBlade::compatible()!!" ;
69 return pair<bool,TrajectoryStateOnSurface>();
78 std::vector<DetGroup> &
result)
const{
81 if(! crossings.
isValid())
return;
83 vector<DetGroup> closestResult;
84 addClosest( tsos, prop, est, crossings.
closest(), closestResult);
86 if (closestResult.empty()){
87 vector<DetGroup> nextResult;
88 addClosest( tsos, prop, est, crossings.
other(), nextResult);
89 if(nextResult.empty())
return;
101 searchNeighbors( tsos, prop, est, crossings.
closest(),
window,
102 closestResult,
false);
104 vector<DetGroup> nextResult;
105 searchNeighbors( tsos, prop, est, crossings.
other(),
window,
122 HelixArbitraryPlaneCrossing crossing( startPos, startDir,
rho, propDir);
124 pair<bool,double> innerPath = crossing.pathLength( *theFrontDiskSector);
127 GlobalPoint gInnerPoint( crossing.position(innerPath.second));
131 int innerIndex = findBin(gInnerPoint.perp(),0);
132 float innerDist = fabs( findPosition(innerIndex,0).
perp() - gInnerPoint.perp());
135 pair<bool,double> outerPath = crossing.pathLength( *theBackDiskSector);
138 GlobalPoint gOuterPoint( crossing.position(outerPath.second));
142 int outerIndex = findBin(gOuterPoint.perp(),1);
143 float outerDist = fabs( findPosition(outerIndex,1).
perp() - gOuterPoint.perp());
146 if (innerDist < outerDist) {
162 vector<DetGroup>& result)
const
165 const vector<const GeomDet*>& sBlade( subBlade( crossing.
subLayerIndex()));
187 vector<DetGroup>& result,
188 bool checkClosest)
const
192 const vector<const GeomDet*>& sBlade( subBlade( crossing.
subLayerIndex()));
195 int negStartIndex = closestIndex-1;
196 int posStartIndex = closestIndex+1;
199 if (gCrossingPos.
perp() < sBlade[closestIndex]->surface().position().perp()) {
200 posStartIndex = closestIndex;
203 negStartIndex = closestIndex;
208 for (
int idet=negStartIndex; idet >= 0; idet--) {
209 if (!
overlap( gCrossingPos, *sBlade[idet], window))
break;
210 if (!
Adder::add( *sBlade[idet], tsos, prop, est, result))
break;
212 for (
int idet=posStartIndex; idet < static_cast<int>(sBlade.size()); idet++) {
213 if (!
overlap( gCrossingPos, *sBlade[idet], window))
break;
214 if (!
Adder::add( *sBlade[idet], tsos, prop, est, result))
break;
225 const float relativeMargin = 1.01;
233 float localX = localCrossPoint.
x();
239 if ( ( fabs(localX)-window) < relativeMargin*detHalfLength ) {
247 PixelBlade::findBin(
float R,
int diskSectorIndex)
const
249 vector<const GeomDet*> localDets = diskSectorIndex==0 ? theFrontDets : theBackDets;
252 float rDiff = fabs( R - localDets.front()->surface().position().perp());;
253 for (vector<const GeomDet*>::const_iterator
i=localDets.begin();
i !=localDets.end();
i++){
254 float testDiff = fabs( R - (**i).surface().position().perp());
255 if ( testDiff < rDiff) {
257 theBin =
i - localDets.begin();
266 PixelBlade::findPosition(
int index,
int diskSectorType)
const
268 vector<const GeomDet*> diskSector = diskSectorType == 0 ? theFrontDets : theBackDets;
269 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
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
LocalPoint toLocal(const GlobalPoint &gp) const
int subLayerIndex() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const SubLayerCrossing & other() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result)
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