44 : theTracker(theTracker_),
45 theTkTopol(theTkTopol_),
46 theMagneticField(theMagneticField_),
47 theSiPixelLorentzAngle(theSiPixelLorentzAngle_),
48 theSiStripLorentzAngle(theSiStripLorentzAngle_)
51 loadPixelLimits(pixelShapeFile_,pixelLimits);
52 loadPixelLimits(pixelShapeFileL1_,pixelLimitsL1);
58 cutOnPixelCharge_ = cutOnStripCharge_ =
false;
59 cutOnPixelShape_ = cutOnStripShape_ =
true;
71 ifstream inFile(fileInPath.fullPath().c_str());
74 while(inFile.eof() ==
false)
83 auto & pl = plim[
key];
85 for(
int b = 0;
b<2 ;
b++)
86 for(
int d = 0;
d<2 ;
d++)
87 for(
int k = 0;
k<2 ;
k++)
102 LogTrace(
"MinBiasTracking|ClusterShapeHitFilter")
103 <<
" [ClusterShapeHitFilter] pixel-cluster-shape filter loaded";
111 fileInPath(
"RecoPixelVertexing/PixelLowPtUtilities/data/stripShape.par");
112 ifstream inFile(fileInPath.
fullPath().c_str());
115 while(inFile.eof() ==
false)
121 auto & sl = stripLimits[
key];
123 for(
int b = 0;
b<2 ;
b++)
124 for(
int k = 0;
k<2 ;
k++)
125 inFile >> sl.data[
b][
k];
131 LogTrace(
"MinBiasTracking|ClusterShapeHitFilter")
132 <<
" [ClusterShapeHitFilter] strip-cluster-width filter loaded";
140 for (
auto det : theTracker->detsPXB()) {
150 pd.
drift=getDrift(pixelDet);
154 for (
auto det : theTracker->detsPXF()) {
164 pd.
drift=getDrift(pixelDet);
172 auto const & geom_ = *theTracker;
173 auto const & dus = geom_.detUnits();
175 for(
unsigned int i=1;
i<7;++
i) {
188 auto &
p = stripData[detid];
191 p.drift = getDrift(stripdet);
192 p.thickness = bounds.thickness();
193 p.nstrips =
p.topology->nstrips();
201 pair<float,float> cotangent;
225 theMagneticField->inTesla(
228 double theTanLorentzAnglePerTesla =
229 theSiPixelLorentzAngle->getLorentzAngle(
232 pair<float,float>
dir;
233 dir.first = - theTanLorentzAnglePerTesla * lBfield.
y();
234 dir.second = theTanLorentzAnglePerTesla * lBfield.
x();
245 theMagneticField->inTesla(
248 double theTanLorentzAnglePerTesla =
249 theSiStripLorentzAngle->getLorentzAngle(
252 float dir = theTanLorentzAnglePerTesla * lBfield.
y();
265 return (perp1 > perp0);
271 return (rot * pos > 0);
285 const PixelData & pd = getpd(recHit,ipd);
297 pred.first = ldir.
x() / ldir.
z();
298 pred.second = ldir.
y() / ldir.
z();
301 if(sizeRange.first->second < 0)
302 pred.second = - pred.second;
306 for(
auto s=sizeRange.first;
s != sizeRange.second; ++
s) {
309 if(sizeRange.first->second < 0) {
311 s.second = -
s.second;
315 std::pair<float,float>
const &
drift = pd.
drift;
316 pred.first += drift.first;
317 pred.second += drift.second;
320 std::pair<float,float>
const & cotangent = pd.
cotangent;
321 pred.first *= cotangent.first;
322 pred.second *= cotangent.second;
335 if (cutOnPixelCharge_ && (!checkClusterCharge(recHit.
geographicalId(), *(recHit.
cluster()), ldir)))
return false;
336 if (!cutOnPixelShape_)
return true;
338 const PixelData & pd = getpd(recHit,ipd);
342 pair<float,float> pred;
345 if(getSizes(recHit, ldir, clusterShapeCache, part,meas, pred,&pd))
347 for(
const auto&
m: meas)
350 if (!key.
isValid())
return true;
351 if (pl[key].isInside(pred))
return true;
366 const PixelData & pd = getpd(recHit,ipd);
370 return isCompatible(recHit, ldir, clusterShapeCache, &pd);
378 int & meas,
float & pred)
const 381 auto const &
p=getsd(
id);
390 bool usable = (fs >= 1) & (fs + meas <= ns+1);
396 pred = ldir.
x() / ldir.
z();
403 pred *= getCotangent(
p,lpos);
417 if (cutOnStripCharge_ && (!checkClusterCharge(detId, cluster, ldir)))
return false;
418 if (!cutOnStripShape_)
return true;
420 if(getSizes(detId, cluster, lpos, ldir, meas, pred))
424 return stripLimits[key].isInside(pred);
436 const GeomDet *det = getsd(detId).det;
440 lpos -= ldir * lpos.
z()/ldir.
z();
441 return isCompatible(detId, cluster, lpos, ldir);
446 return isCompatible(detId, cluster, getsd(detId).det->toLocal(gdir));
virtual const GeomDetType & type() const
std::pair< float, float > cotangent
bool checkClusterCharge(DetId detId, const SiStripCluster &cluster, const LocalVector &ldir) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
constexpr uint32_t rawId() const
get the raw id
virtual std::pair< float, float > pitch() const =0
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
const Bounds & bounds() const
uint16_t firstStrip() const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
bool isTrackerStrip() const
std::pair< float, float > getCotangent(const PixelGeomDetUnit *pixelDet) const
const PixelGeomDetUnit * det
void loadPixelLimits(std::string const &file, PixelLimits *plim)
std::pair< const_iterator, const_iterator > Range
std::pair< float, float > drift
DetId geographicalId() const
The label of this GeomDet.
bool isNormalOriented(const GeomDetUnit *geomDet) const
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
const GeomDetType & type() const override
#define TYPELOOKUP_DATA_REG(_dataclass_)
Point3DBase< float, LocalTag > Local3DPoint
const Topology & topology() const override
Returns a reference to the strip proxy topology.
std::pair< float, float > getDrift(const PixelGeomDetUnit *pixelDet) const
virtual float thickness() const =0
ClusterRef cluster() const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=0) const
ClusterShapeHitFilter(const TrackerGeometry *theTracker_, const TrackerTopology *theTkTopol_, const MagneticField *theMagneticField_, const SiPixelLorentzAngle *theSiPixelLorentzAngle_, const SiStripLorentzAngle *theSiStripLorentzAngle_, const std::string &pixelShapeFile_, const std::string &pixelShapeFileL1_)
virtual float localPitch(const LocalPoint &) const =0
Pixel cluster – collection of neighboring pixels above threshold.
char data[epos_bytes_allocation]
void push_back_unchecked(const T &value)
SiPixelClusterShapeData get(const ClusterRef &cluster, const PixelGeomDetUnit *pixDet) const
StripTopology const * topology
std::string fullPath() const
DetId geographicalId() const
const PositionType & position() const
static constexpr size_type capacity() noexcept
const std::vector< uint8_t > & amplitudes() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.