41 : theLayerCache(*layerCache), theOuterLayer(outer), theInnerLayer(inner), theMaxElement(max) {}
49 auto oldSize = result.
size();
64 ss <<
"In " << innerLayerObj.
name() <<
" Out " << outerLayerObj.
name() << std::endl;
74 if (innerHitsMap.
empty())
78 if (outerHitsMap.
empty())
87 vector<RecHitsSortedInPhi::Hit> innerHits, outerHits;
88 float outerPhimin, outerPhimax;
89 float innerPhimin, innerPhimax;
94 outerHitsMap.
hits(outerPhimin, outerPhimax, outerHits);
97 ss <<
"\tophimin, ophimax " << outerPhimin <<
" " << outerPhimax << std::endl;
101 for (vector<RecHitsSortedInPhi::Hit>::const_iterator oh = outerHits.begin(); oh != outerHits.end(); ++oh) {
106 ss <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z() / oPos.
perp()
125 ss <<
"*******\nNo valid checkRZ\n*******" << std::endl;
134 innerHitsMap.
hits(innerPhimin, innerPhimax, innerHits);
137 ss <<
"\tiphimin, iphimax " << innerPhimin <<
" " << innerPhimax << std::endl;
141 for (vector<RecHitsSortedInPhi::Hit>::const_iterator ih = innerHits.begin(), ieh = innerHits.end(); ih < ieh;
146 ss <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta " 147 << innPos.
z() / innPos.
perp() << std::endl;
158 allowed = checkRZ->
range(r_reduced);
159 float zErr = nSigmaRZ * (*ih)->errorGlobalZ();
160 hitRZ =
Range(innPos.
z() - zErr, innPos.
z() + zErr);
162 allowed = checkRZ->
range(innPos.
z());
163 float rErr = nSigmaRZ * (*ih)->errorGlobalR();
164 hitRZ =
Range(r_reduced - rErr, r_reduced + rErr);
169 ss <<
"\n\t\t allowed Range " << allowed.min() <<
" \t, " << allowed.max() <<
"\n\t\t hitRz Range " 170 << hitRZ.min() <<
" \t, " << hitRZ.max() <<
"\n\t\t Cross Range " << crossRange.min() <<
" \t, " 171 << crossRange.max() <<
"\n\t\t the seed track has origin " << convRegion.
convPoint() <<
" \t cotTheta " 172 << convRegion.
cotTheta() << std::endl;
175 if (!crossRange.empty()) {
177 ss <<
"\n\t\t !!!!ACCEPTED!!! \n\n";
180 result.resize(oldSize);
182 edm::LogError(
"TooManySeeds") <<
"number of pairs exceed maximum, no pairs produced";
209 return rLayer + 0.5f * theThickness;
220 float layerZmax = layerZ > 0 ? layerZ + 0.5f * theThickness : layerZ - 0.5f * theThickness;
232 float minZEndCap = 130;
233 if (fabs(convRegion.
convPoint().
z()) > minZEndCap) {
235 ss <<
"\tthe conversion seems to be in the endcap. Zconv " << convRegion.
convPoint().
z() << std::endl;
245 ss <<
"\tthis layer is before the conversion : R layer " << R <<
" [ Rconv " << convRegion.
convPoint().
perp()
246 <<
" Zconv " << convRegion.
convPoint().
z() << std::endl;
254 ss <<
"\tthis layer is far from the conversion more than cut " << maxSearchR <<
" cm. R layer " << R
266 ss <<
"\tthis layer is before the conversion : Z layer " << Z <<
" [ Rconv " << convRegion.
convPoint().
perp()
267 <<
" Zconv " << convRegion.
convPoint().
z() << std::endl;
273 if (fabs(Z - convRegion.
convPoint().
z()) > maxSearchZ) {
275 ss <<
"\tthis layer is far from the conversion more than cut " << maxSearchZ <<
" cm. Z layer " << Z
295 return getPhiRange(Phimin, Phimax, R, convRegion, es);
316 if (theRCurvatureMin < DeltaL)
317 dphi = atan(DeltaL / layerR);
319 dphi = atan(theRCurvatureMin / layerR * (1 -
sqrt(1 -
sqr(DeltaL / theRCurvatureMin))));
321 if (convRegion.
charge() > 0) {
323 Phimin = Phimax - dphi;
325 Phimax = Phimin + dphi;
337 double sigmaCotTheta = convRegion.
errTheta() *
339 Range allowedCotTheta(convRegion.
cotTheta() - nSigmaRZ * sigmaCotTheta,
340 convRegion.
cotTheta() + nSigmaRZ * sigmaCotTheta);
342 double dz = hit->globalPosition().z() - convRegion.
pvtxPoint().
z();
344 sqr(hit->globalPosition().y() - convRegion.
pvtxPoint().
y()));
347 float zErr = nSigmaRZ * hit->errorGlobalZ();
350 float rErr = nSigmaRZ * hit->errorGlobalR();
360 ss <<
"\n\t\t cotTheta allowed Range " << allowedCotTheta.min() <<
" \t, " << allowedCotTheta.max()
361 <<
"\n\t\t hitCotTheta Range " << hitCotTheta.min() <<
" \t, " << hitCotTheta.max() <<
"\n\t\t Cross Range " 362 << crossRange.min() <<
" \t, " << crossRange.max() <<
"\n\t\t the seed track has origin " << convRegion.
convPoint()
363 <<
" \t cotTheta " << convRegion.
cotTheta() << std::endl;
366 return crossRange.empty();
constexpr double deltaPhi(double phi1, double phi2)
std::vector< Hit > hits(float phiMin, float phiMax) const
bool checkRZCompatibilityWithSeedTrack(const RecHitsSortedInPhi::Hit &hit, const DetLayer &layer, const ConversionRegion &convRegion)
double getCot(double dz, double dr)
GlobalPoint const & origin() const
PixelRecoRange< float > Range
float getLayerRadius(const DetLayer &layer)
GlobalPoint pvtxPoint() const
const unsigned int theMaxElement
virtual Location location() const =0
Which part of the detector (barrel, endcap)
Geom::Phi< T > phi() const
SeedingHitSet::ConstRecHitPointer InnerRecHit
GlobalPoint convPoint() const
const Bounds & bounds() const
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
void hitPairs(const ConversionRegion &convRegion, const TrackingRegion ®, OrderedHitPairs &prs, const Layers &layers, const edm::Event &ev, const edm::EventSetup &es)
const unsigned int theInnerLayer
virtual Range range(const float &rORz) const =0
bool getPhiRange(float &Phimin, float &Phimax, const DetLayer &layer, const ConversionRegion &convRegion, const edm::EventSetup &es)
unsigned int size() const override
const unsigned int theOuterLayer
Abs< T >::type abs(const T &t)
virtual HitRZCompatibility * checkRZ(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer=0, float lr=0, float gz=0, float dr=0, float dz=0) const =0
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
const std::string & name() const
SeedingHitSet::ConstRecHitPointer Hit
LayerCacheType & theLayerCache
BaseTrackerRecHit const * Hit
float getLayerZ(const DetLayer &layer)
bool checkBoundaries(const DetLayer &layer, const ConversionRegion &convRegion, float maxSearchR, float maxSearchZ)
virtual float thickness() const =0
virtual const Surface::PositionType & position() const
Returns position of the surface.
const DetLayer * detLayer() const
T bendingRadius(T pt, const edm::EventSetup &iSetup)
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
HitPairGeneratorFromLayerPairForPhotonConversion(unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
SeedingHitSet::ConstRecHitPointer OuterRecHit