46 if(ph < 0) ph += 2 *
M_PI;
70 theTracker = trackerHandle.
product();
75 theGSTracker = geometricSearchTrackerHandle.
product();
80 theMagneticField = magneticFieldHandle.
product();
86 thePropagator = thePropagatorHandle.
product();
89 rzBounds[0].resize(8); phBounds[0].resize(20);
90 rzBounds[1].resize(8); phBounds[1].resize(32);
91 rzBounds[2].resize(8); phBounds[2].resize(44);
93 rzBounds[3].resize(7); phBounds[3].resize(24);
94 rzBounds[4].resize(7); phBounds[4].resize(24);
95 rzBounds[5].resize(7); phBounds[5].resize(24);
96 rzBounds[6].resize(7); phBounds[6].resize(24);
99 <<
" [ValidHitPairFilter] initializing pixel barrel";
101 for(TrackerGeometry::DetContainer::const_iterator
102 det = theTracker->detsPXB().begin();
103 det!= theTracker->detsPXB().end(); det++)
107 int il = tTopo->pxbLayer(pid) - 1;
108 int irz = tTopo->pxbModule(pid) - 1;
109 int iph = tTopo->pxbLadder(pid) - 1;
111 rzBounds[il][irz] = (*det)->position().z();
112 phBounds[il][iph] =
spin((*det)->position().phi());
116 <<
" [ValidHitPairFilter] initializing pixel endcap";
118 for(TrackerGeometry::DetContainer::const_iterator
119 det = theTracker->detsPXF().begin();
120 det!= theTracker->detsPXF().end(); det++)
125 int il =
BPix3 + ((tTopo->pxfSide(pid) -1) << 1) + (tTopo->pxfDisk(pid) -1);
126 int irz = ((tTopo->pxfModule(pid)-1) << 1) + (tTopo->pxfPanel(pid)-1);
127 int iph = (tTopo->pxfBlade(pid) -1);
129 rzBounds[il][irz] = (*det)->position().perp();
130 phBounds[il][iph] =
spin((*det)->position().phi());
133 for(
int i = 0;
i < 7;
i++)
161 pair<int,int>
c(a,b);
203 track.
charge(), theMagneticField);
213 float rz,
const vector<float>& rzB,
214 float ph,
const vector<float>& phB,
217 vector<int> rzVec, phVec;
220 vector<float>::const_iterator irz = lower_bound(rzB.begin(),rzB.end(), rz);
221 if(irz > rzB.begin()) rzVec.push_back(irz - rzB.begin() - 1);
222 if(irz < rzB.end() ) rzVec.push_back(irz - rzB.begin() );
225 vector<float>::const_iterator iph = lower_bound(phB.begin(),phB.end(), ph);
226 if(iph > phB.begin()) phVec.push_back(iph - phB.begin() - 1);
227 else phVec.push_back(phB.end() - phB.begin() - 1);
228 if(iph < phB.end() ) phVec.push_back(iph - phB.begin() );
229 else phVec.push_back(phB.begin() - phB.begin() );
232 vector<const GeomDet *> dets;
234 for(vector<int>::const_iterator irz = rzVec.begin(); irz!= rzVec.end(); irz++)
235 for(vector<int>::const_iterator iph = phVec.begin(); iph!= phVec.end(); iph++)
240 int ladder = *iph + 1;
244 <<
" [ValidHitPairFilter] third ("<<layer<<
"|"<<ladder<<
"|"<<module<<
")";
247 dets.push_back(theTracker->idToDet(
id));
251 int side = (il -
BPix3) / 2 +1;
252 int disk = (il -
BPix3) % 2 + 1;
253 int blade = *iph + 1;
254 int panel = (*irz) % 2 + 1;
255 int module = (*irz) / 2 + 1;
258 <<
" [ValidHitPairFilter] third ("<<side<<
"|"<<disk<<
"|"<<blade<<
"|"<<panel<<
"|"<<module<<
")";
262 dets.push_back(theTracker->idToDet(
id));
288 vector<int> missingLayers = getMissingLayers(getLayer(*(
recHits[0]),tTopo),
289 getLayer(*(
recHits[1]),tTopo));
291 for(vector<int>::const_iterator missingLayer = missingLayers.begin();
292 missingLayer!= missingLayers.end();
295 int il = *missingLayer - 1;
305 (theGSTracker->pixelBarrelLayers())[il];
307 tsos = thePropagator->propagate(fts, layer->
surface());
316 layer = (theGSTracker->negPixelForwardLayers())[il -
BPix3 ];
318 layer = (theGSTracker->posPixelForwardLayers())[il -
BPix3 - 2];
320 tsos = thePropagator->propagate(fts, layer->
surface());
331 vector<const GeomDet *> closeDets =
332 getCloseDets(il, rz ,rzBounds[il], phi,phBounds[il], tTopo);
334 for(vector<const GeomDet *>::const_iterator det = closeDets.begin();
335 det!= closeDets.end();
339 thePropagator->propagate(fts, (*det)->surface());
342 if((*det)->surface().bounds().inside(tsos.
localPosition(), le, sc))
351 LogTrace(
"MinBiasTracking") <<
" [ValidHitPairFilter] has gap --> good";
353 LogTrace(
"MinBiasTracking") <<
" [ValidHitPairFilter] no gap --> rejected";
std::vector< const GeomDet * > getCloseDets(int il, float rz, const std::vector< float > &rzB, float ph, const std::vector< float > &phB, const TrackerTopology *tTopo) const
unsigned int pxfDisk(const DetId &id) const
LocalPoint localPosition() const
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
Geom::Phi< T > phi() const
GlobalPoint globalPosition() const
const Vector & momentum() const
track momentum vector
DetId pxfDetId(uint32_t side, uint32_t disk, uint32_t blade, uint32_t panel, uint32_t module) const
void update(const edm::Event &ev, const edm::EventSetup &es) override
ValidHitPairFilter(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
virtual ~ValidHitPairFilter()
std::vector< int > getMissingLayers(int a, int b) const
unsigned int pxbLayer(const DetId &id) const
virtual const BoundSurface & surface() const
GeometricSearchDet interface.
T const * product() const
Geom::Phi< T > phi() const
static int position[264][3]
unsigned int pxfSide(const DetId &id) const
int charge() const
track electric charge
DetId geographicalId() const
DetId pxbDetId(uint32_t layer, uint32_t ladder, uint32_t module) const
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
int getLayer(const TrackingRecHit &recHit, const TrackerTopology *tTopo) const
FreeTrajectoryState getTrajectory(const reco::Track &track) const