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";
191 edm::LogError(
"TooManySeeds") <<
"number of pairs exceed maximum, no pairs produced";
212 float theThickness =
layer.surface().bounds().thickness();
213 return rLayer + 0.5f * theThickness;
222 float layerZ =
layer.position().z();
223 float theThickness =
layer.surface().bounds().thickness();
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 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) {
341 double sigmaCotTheta = convRegion.
errTheta() *
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)
const std::string & name() const
bool checkRZCompatibilityWithSeedTrack(const RecHitsSortedInPhi::Hit &hit, const DetLayer &layer, const ConversionRegion &convRegion)
double getCot(double dz, double dr)
GlobalPoint pvtxPoint() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
PixelRecoRange< float > Range
virtual Location location() const =0
Which part of the detector (barrel, endcap)
float getLayerRadius(const DetLayer &layer)
const unsigned int theMaxElement
Geom::Phi< T > phi() const
SeedingHitSet::ConstRecHitPointer InnerRecHit
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)
const DetLayer * detLayer() const
HitPairGeneratorFromLayerPairForPhotonConversion(edm::ConsumesCollector iC, unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
const unsigned int theInnerLayer
constexpr double nSigmaRZ
const unsigned int theOuterLayer
Abs< T >::type abs(const T &t)
std::vector< Hit > hits(float phiMin, float phiMax) 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 const BoundCylinder & specificSurface() const final
Extension of the interface.
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
bool getPhiRange(float &Phimin, float &Phimax, const DetLayer &layer, const ConversionRegion &convRegion, const MagneticField &field)
T bendingRadius(T pt, const MagneticField &field)
GlobalPoint convPoint() const
SeedingHitSet::ConstRecHitPointer OuterRecHit
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken