16 using namespace GeomDetEnumerators;
45 : theLayerCache(*layerCache),
57 auto oldSize = result.
size();
72 ss <<
"In " << innerLayerObj.
name() <<
" Out " << outerLayerObj.
name() << std::endl;
82 if (innerHitsMap.
empty())
86 if (outerHitsMap.
empty())
95 vector<RecHitsSortedInPhi::Hit> innerHits, outerHits;
96 float outerPhimin, outerPhimax;
97 float innerPhimin, innerPhimax;
103 outerHitsMap.
hits(outerPhimin, outerPhimax, outerHits);
106 ss <<
"\tophimin, ophimax " << outerPhimin <<
" " << outerPhimax << std::endl;
110 for (vector<RecHitsSortedInPhi::Hit>::const_iterator oh = outerHits.begin(); oh != outerHits.end(); ++oh) {
115 ss <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z() / oPos.
perp()
131 std::unique_ptr<const HitRZCompatibility> checkRZ = region.
checkRZ(innerLayerObj.
detLayer(), ohit);
134 ss <<
"*******\nNo valid checkRZ\n*******" << std::endl;
143 innerHitsMap.
hits(innerPhimin, innerPhimax, innerHits);
146 ss <<
"\tiphimin, iphimax " << innerPhimin <<
" " << innerPhimax << std::endl;
150 for (vector<RecHitsSortedInPhi::Hit>::const_iterator ih = innerHits.begin(), ieh = innerHits.end(); ih < ieh;
155 ss <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta "
156 << innPos.
z() / innPos.
perp() << std::endl;
167 allowed = checkRZ->range(r_reduced);
168 float zErr = nSigmaRZ * (*ih)->errorGlobalZ();
169 hitRZ =
Range(innPos.
z() - zErr, innPos.
z() + zErr);
171 allowed = checkRZ->range(innPos.
z());
172 float rErr = nSigmaRZ * (*ih)->errorGlobalR();
173 hitRZ =
Range(r_reduced - rErr, r_reduced + rErr);
178 ss <<
"\n\t\t allowed Range " << allowed.min() <<
" \t, " << allowed.max() <<
"\n\t\t hitRz Range "
179 << hitRZ.min() <<
" \t, " << hitRZ.max() <<
"\n\t\t Cross Range " << crossRange.min() <<
" \t, "
180 << crossRange.max() <<
"\n\t\t the seed track has origin " << convRegion.
convPoint() <<
" \t cotTheta "
181 << convRegion.
cotTheta() << std::endl;
184 if (!crossRange.empty()) {
186 ss <<
"\n\t\t !!!!ACCEPTED!!! \n\n";
189 result.resize(oldSize);
191 edm::LogError(
"TooManySeeds") <<
"number of pairs exceed maximum, no pairs produced";
213 return rLayer + 0.5f * theThickness;
224 float layerZmax = layerZ > 0 ? layerZ + 0.5f * theThickness : layerZ - 0.5f * theThickness;
236 float minZEndCap = 130;
237 if (fabs(convRegion.
convPoint().
z()) > minZEndCap) {
239 ss <<
"\tthe conversion seems to be in the endcap. Zconv " << convRegion.
convPoint().
z() << std::endl;
249 ss <<
"\tthis layer is before the conversion : R layer " << R <<
" [ Rconv " << convRegion.
convPoint().
perp()
250 <<
" Zconv " << convRegion.
convPoint().
z() << std::endl;
258 ss <<
"\tthis layer is far from the conversion more than cut " << maxSearchR <<
" cm. R layer " << R
270 ss <<
"\tthis layer is before the conversion : Z layer " << Z <<
" [ Rconv " << convRegion.
convPoint().
perp()
271 <<
" Zconv " << convRegion.
convPoint().
z() << std::endl;
277 if (fabs(Z - convRegion.
convPoint().
z()) > maxSearchZ) {
279 ss <<
"\tthis layer is far from the conversion more than cut " << maxSearchZ <<
" cm. Z layer " << Z
299 return getPhiRange(Phimin, Phimax, R, convRegion, field);
320 if (theRCurvatureMin < DeltaL)
321 dphi = atan(DeltaL / layerR);
323 dphi = atan(theRCurvatureMin / layerR * (1 -
sqrt(1 -
sqr(DeltaL / theRCurvatureMin))));
325 if (convRegion.
charge() > 0) {
327 Phimin = Phimax - dphi;
329 Phimax = Phimin + dphi;
341 double sigmaCotTheta = convRegion.
errTheta() *
343 Range allowedCotTheta(convRegion.
cotTheta() - nSigmaRZ * sigmaCotTheta,
344 convRegion.
cotTheta() + nSigmaRZ * sigmaCotTheta);
346 double dz = hit->globalPosition().z() - convRegion.
pvtxPoint().
z();
348 sqr(hit->globalPosition().y() - convRegion.
pvtxPoint().
y()));
351 float zErr = nSigmaRZ * hit->errorGlobalZ();
354 float rErr = nSigmaRZ * hit->errorGlobalR();
364 ss <<
"\n\t\t cotTheta allowed Range " << allowedCotTheta.min() <<
" \t, " << allowedCotTheta.max()
365 <<
"\n\t\t hitCotTheta Range " << hitCotTheta.min() <<
" \t, " << hitCotTheta.max() <<
"\n\t\t Cross Range "
366 << crossRange.min() <<
" \t, " << crossRange.max() <<
"\n\t\t the seed track has origin " << convRegion.
convPoint()
367 <<
" \t cotTheta " << convRegion.
cotTheta() << std::endl;
370 return crossRange.empty();
constexpr double deltaPhi(double phi1, double phi2)
std::vector< Hit > hits(float phiMin, float phiMax) const
virtual std::unique_ptr< HitRZCompatibility > checkRZ(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer=nullptr, 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.
bool checkRZCompatibilityWithSeedTrack(const RecHitsSortedInPhi::Hit &hit, const DetLayer &layer, const ConversionRegion &convRegion)
double getCot(double dz, double dr)
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
GlobalPoint const & origin() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
PixelRecoRange< float > Range
float getLayerRadius(const DetLayer &layer)
GlobalPoint pvtxPoint() const
const unsigned int theMaxElement
Geom::Phi< T > phi() const
SeedingHitSet::ConstRecHitPointer InnerRecHit
GlobalPoint convPoint() const
const Bounds & bounds() const
Log< level::Error, false > LogError
void hitPairs(const ConversionRegion &convRegion, const TrackingRegion ®, OrderedHitPairs &prs, const Layers &layers, const edm::Event &ev, const edm::EventSetup &es)
constexpr std::array< uint8_t, layerIndexSize > layer
HitPairGeneratorFromLayerPairForPhotonConversion(edm::ConsumesCollector iC, unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
virtual float thickness() const =0
bool getData(T &iHolder) const
const unsigned int theInnerLayer
constexpr double nSigmaRZ
const unsigned int theOuterLayer
Abs< T >::type abs(const T &t)
const std::string & name() const
unsigned int size() const override
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 const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
const DetLayer * detLayer() const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
bool getPhiRange(float &Phimin, float &Phimax, const DetLayer &layer, const ConversionRegion &convRegion, const MagneticField &field)
T bendingRadius(T pt, const MagneticField &field)
SeedingHitSet::ConstRecHitPointer OuterRecHit
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken