46 if(ph < 0) ph += 2 *
M_PI;
61 theTracker = trackerHandle.
product();
66 theGSTracker = geometricSearchTrackerHandle.
product();
71 theMagneticField = magneticFieldHandle.
product();
77 thePropagator = thePropagatorHandle.
product();
80 rzBounds[0].resize(8); phBounds[0].resize(20);
81 rzBounds[1].resize(8); phBounds[1].resize(32);
82 rzBounds[2].resize(8); phBounds[2].resize(44);
84 rzBounds[3].resize(7); phBounds[3].resize(24);
85 rzBounds[4].resize(7); phBounds[4].resize(24);
86 rzBounds[5].resize(7); phBounds[5].resize(24);
87 rzBounds[6].resize(7); phBounds[6].resize(24);
90 <<
" [ValidHitPairFilter] initializing pixel barrel";
92 for(TrackerGeometry::DetContainer::const_iterator
93 det = theTracker->detsPXB().begin();
94 det!= theTracker->detsPXB().end(); det++)
98 int il = tTopo->pxbLayer(pid) - 1;
99 int irz = tTopo->pxbModule(pid) - 1;
100 int iph = tTopo->pxbLadder(pid) - 1;
102 rzBounds[il][irz] = (*det)->position().z();
103 phBounds[il][iph] =
spin((*det)->position().phi());
107 <<
" [ValidHitPairFilter] initializing pixel endcap";
109 for(TrackerGeometry::DetContainer::const_iterator
110 det = theTracker->detsPXF().begin();
111 det!= theTracker->detsPXF().end(); det++)
116 int il =
BPix3 + ((tTopo->pxfSide(pid) -1) << 1) + (tTopo->pxfDisk(pid) -1);
117 int irz = ((tTopo->pxfModule(pid)-1) << 1) + (tTopo->pxfPanel(pid)-1);
118 int iph = (tTopo->pxfBlade(pid) -1);
120 rzBounds[il][irz] = (*det)->position().perp();
121 phBounds[il][iph] =
spin((*det)->position().phi());
124 for(
int i = 0;
i < 7;
i++)
144 return tTopo->pxbLayer(
id);
149 return BPix3 + ((tTopo->pxfSide(
id)-1) << 1) + tTopo->pxfDisk(
id);
157 pair<int,int>
c(a,b);
199 track.
charge(), theMagneticField);
209 float rz,
const vector<float>& rzB,
210 float ph,
const vector<float>& phB)
const 212 vector<int> rzVec, phVec;
215 vector<float>::const_iterator irz =
lower_bound(rzB.begin(),rzB.end(), rz);
216 if(irz > rzB.begin()) rzVec.push_back(irz - rzB.begin() - 1);
217 if(irz < rzB.end() ) rzVec.push_back(irz - rzB.begin() );
220 vector<float>::const_iterator iph =
lower_bound(phB.begin(),phB.end(), ph);
221 if(iph > phB.begin()) phVec.push_back(iph - phB.begin() - 1);
222 else phVec.push_back(phB.end() - phB.begin() - 1);
223 if(iph < phB.end() ) phVec.push_back(iph - phB.begin() );
224 else phVec.push_back(phB.begin() - phB.begin() );
227 vector<const GeomDet *> dets;
229 for(vector<int>::const_iterator irz = rzVec.begin(); irz!= rzVec.end(); irz++)
230 for(vector<int>::const_iterator iph = phVec.begin(); iph!= phVec.end(); iph++)
239 <<
" [ValidHitPairFilter] third ("<<layer<<
"|"<<ladder<<
"|"<<module<<
")";
241 DetId id=tTopo->pxbDetId(layer,ladder,module);
242 dets.push_back(theTracker->idToDet(
id));
246 int side = (il -
BPix3) / 2 +1;
247 int disk = (il -
BPix3) % 2 + 1;
248 int blade = *iph + 1;
249 int panel = (*irz) % 2 + 1;
250 int module = (*irz) / 2 + 1;
253 <<
" [ValidHitPairFilter] third ("<<side<<
"|"<<disk<<
"|"<<blade<<
"|"<<panel<<
"|"<<module<<
")";
256 DetId id=tTopo->pxfDetId(side,disk,blade,panel,module);
257 dets.push_back(theTracker->idToDet(
id));
271 if(recHits.size() == 2)
282 vector<int> missingLayers = getMissingLayers(getLayer(*(recHits[0])),
283 getLayer(*(recHits[1])));
285 for(vector<int>::const_iterator missingLayer = missingLayers.begin();
286 missingLayer!= missingLayers.end();
289 int il = *missingLayer - 1;
299 (theGSTracker->pixelBarrelLayers())[il];
301 tsos = thePropagator->propagate(fts, layer->
surface());
310 layer = (theGSTracker->negPixelForwardLayers())[il -
BPix3 ];
312 layer = (theGSTracker->posPixelForwardLayers())[il -
BPix3 - 2];
314 tsos = thePropagator->propagate(fts, layer->
surface());
325 vector<const GeomDet *> closeDets =
326 getCloseDets(il, rz ,rzBounds[il], phi,phBounds[il]);
328 for(vector<const GeomDet *>::const_iterator det = closeDets.begin();
329 det!= closeDets.end();
333 thePropagator->propagate(fts, (*det)->surface());
345 LogTrace(
"MinBiasTracking") <<
" [ValidHitPairFilter] has gap --> good";
347 LogTrace(
"MinBiasTracking") <<
" [ValidHitPairFilter] no gap --> rejected";
int getLayer(const TrackingRecHit &recHit) const
LocalPoint localPosition() const
ValidHitPairFilter(const edm::EventSetup &es)
Geom::Phi< T > phi() const
GlobalPoint globalPosition() const
const Vector & momentum() const
track momentum vector
~ValidHitPairFilter() override
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
std::vector< int > getMissingLayers(int a, int b) const
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
static int position[264][3]
int charge() const
track electric charge
DetId geographicalId() const
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
T const * product() const
const BoundSurface & surface() const final
GeometricSearchDet interface.
FreeTrajectoryState getTrajectory(const reco::Track &track) const
std::vector< const GeomDet * > getCloseDets(int il, float rz, const std::vector< float > &rzB, float ph, const std::vector< float > &phB) const