diff --git a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h index 9fd2a0b6cfda74fc7506797dc98fffbe6f0d86ca..2879259be2492d4be9d26985d895d7c1a440a07a 100644 --- a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h +++ b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/SiSPSeededTrackFinderData/SiSpacePointForSeed.h @@ -46,6 +46,7 @@ namespace InDet { void set(const Trk::SpacePoint*const&,const float*,const float*); void setQuality(float); void setParam(const float&); + void setScorePenalty(const float& par) {m_scorePenalty=par;} const Trk::SpacePoint* spacepoint; const float& x() const {return m_x;} @@ -55,8 +56,9 @@ namespace InDet { float phi() const {return atan2(m_y,m_x);} const float& covr() const {return m_covr;} const float& covz() const {return m_covz;} - const float& param() const {return m_param;} - const float& quality() const {return m_q ;} + const float& param() const {return m_param;} /// impact parameter + const float& scorePenalty() const {return m_scorePenalty;} /// penalty term in the seed score + const float& quality() const {return m_q ;} /// quality of the best seed this candidate was seen on const Trk::Surface* sur() const {return m_su;} const Trk::Surface* sun() const {return m_sn;} @@ -68,8 +70,9 @@ namespace InDet { float m_r ; // radius in beam system coordinates float m_covr; // float m_covz; // - float m_param; - float m_q ; + float m_param; /// impact parameter + float m_scorePenalty; /// penalty term in the seed score + float m_q ; /// quality of the best seed this candidate was seen on const Trk::Surface* m_su; const Trk::Surface* m_sn; }; diff --git a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx index 4abe8730ade8aa0a20832578aea99e16e1ed27b4..4894433ae64f4ca0d6a5e8f560d0c61080edb2ea 100644 --- a/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx +++ b/InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData/src/SiSpacePointsProSeed.cxx @@ -114,6 +114,7 @@ namespace InDet { m_q = q; bool pixb = !m_s0->spacepoint->clusterList().second; bool pixt = !m_s2->spacepoint->clusterList().second; + /// if PPP or SSS, just update quality, don't cut if(pixb==pixt) { m_s0->setQuality(q); m_s1->setQuality(q); diff --git a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx index 899bea403176e626d65ae3d9b9db536858b44dae..09ef2fd75b7f6e7e547495b568ec7b6f47da6a20 100644 --- a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx +++ b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx @@ -337,7 +337,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad /// the first position from the left side int n0 = 0; for (; n0!=static_cast<int>(layer[0].size()); ++n0) { - if (par_startingPoint[2] > layer[0].at(n0).z()) break; + if (par_startingPoint[2] > layer[0][n0].z()) break; } /// check the barrel layers @@ -345,13 +345,13 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad /// the first position in the radial direction int n1 = 0; for (; n1!=static_cast<int>(layer[1].size()); ++n1) { - if (par_startingPoint[3] < layer[1].at(n1).r()) break; + if (par_startingPoint[3] < layer[1][n1].r()) break; } /// and finally, the left endcap. /// this time, look for the layer closest on the right side. int n2 = 0; for (; n2!=static_cast<int>(layer[2].size()); ++n2) { - if (par_startingPoint[2] < layer[2].at(n2).z()) break; + if (par_startingPoint[2] < layer[2][n2].z()) break; } @@ -432,19 +432,19 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad /// loop over all barrel layers (starting with the closest one previously identified) for (; n1<static_cast<int>(layer[1].size()); ++n1) { /// stop if we moved past the targer point in R - if (par_targetPoint[3] < layer[1].at(n1).r()) break; - assert( used.at(1).size() > static_cast<unsigned int>(n1) ); + if (par_targetPoint[3] < layer[1][n1].r()) break; + assert( used[1].size() > static_cast<unsigned int>(n1) ); /// collect all compatible detector elements from the current layer - layer[1].at(n1).getBarrelDetElements(par_startingPoint, searchDirection, lDE, used[1][n1]); + layer[1][n1].getBarrelDetElements(par_startingPoint, searchDirection, lDE, used[1][n1]); } /// if we are moving inward in R, iterate the other way for the barrel } else { for (--n1; n1>=0; --n1) { /// stop if we moved past the test point in R - if (par_targetPoint[3] > layer[1].at(n1).r()+dr) break; - assert( used.at(1).size() > static_cast<unsigned int>(n1) ); + if (par_targetPoint[3] > layer[1][n1].r()+dr) break; + assert( used[1].size() > static_cast<unsigned int>(n1) ); /// collect all compatible detector elements - layer[1].at(n1).getBarrelDetElements(par_startingPoint, searchDirection, lDE, used[1][n1]); + layer[1][n1].getBarrelDetElements(par_startingPoint, searchDirection, lDE, used[1][n1]); } ++n1; } @@ -453,17 +453,17 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad /// again check if we are moving forward or back in z if (par_targetPoint[2]>par_startingPoint[2]) { for (; n2<static_cast<int>(layer[2].size()); ++n2) { - if (par_targetPoint[2] < layer[2].at(n2).z()) break; - assert( used.at(2).size() > static_cast<unsigned int>(n2) ); + if (par_targetPoint[2] < layer[2][n2].z()) break; + assert( used[2].size() > static_cast<unsigned int>(n2) ); /// collect all compatible detector elements - layer[2].at(n2).getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[2][n2]); + layer[2][n2].getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[2][n2]); } } else { for (--n2; n2>=0; --n2) { - if (par_targetPoint[2] > layer[2].at(n2).z()) break; - assert( used.at(2).size() > static_cast<unsigned int>(n2) ); + if (par_targetPoint[2] > layer[2][n2].z()) break; + assert( used[2].size() > static_cast<unsigned int>(n2) ); /// collect all compatible detector elements - layer[2].at(n2).getEndcapDetElements(par_startingPoint, searchDirection, lDE, used[2][n2]); + layer[2][n2].getEndcapDetElements(par_startingPoint, searchDirection, lDE, used[2][n2]); } ++n2; } @@ -472,17 +472,17 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad /// same game as above if (par_targetPoint[2]<par_startingPoint[2]) { for (; n0<static_cast<int>(layer[0].size()); ++n0) { - if (par_targetPoint[2] > layer[0].at(n0).z()) break; - assert( used.at(0).size() > static_cast<unsigned int>(n0) ); + if (par_targetPoint[2] > layer[0][n0].z()) break; + assert( used[0].size() > static_cast<unsigned int>(n0) ); /// collect all compatible detector elements - layer[0].at(n0).getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[0][n0]); + layer[0][n0].getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[0][n0]); } } else { for (--n0; n0>=0; --n0) { - if (par_targetPoint[2] < layer[0].at(n0).z()) break; - assert( used.at(0).size() > static_cast<unsigned int>(n0) ); + if (par_targetPoint[2] < layer[0][n0].z()) break; + assert( used[0].size() > static_cast<unsigned int>(n0) ); /// collect all compatible detector elements - layer[0].at(n0).getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[0][n0]); + layer[0][n0].getEndcapDetElements(par_startingPoint, searchDirection, lDE,used[0][n0]); } ++n0; } diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h index b20a86b919b1d086ffac3e6b781bbf3e66f1779f..adc213c8c9e3ad9cdbd30eb8e7ad3f0687607992 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h @@ -199,6 +199,11 @@ namespace InDet { FloatProperty m_drmin{this, "mindRadius", 5.}; FloatProperty m_maxdImpact{this, "maxdImpact", 10.}; FloatProperty m_maxdImpactSSS{this, "maxdImpactSSS", 50.}; + /// these flags allow to dynamically tighten the d0 cut on non-confirmed seeds based on + /// the penalty score they receive for kinking in the r-z plane. + /// The cut is adapted as cut_value = original - slope x penalty + FloatProperty m_dImpactCutSlopeUnconfirmedSSS{this, "dImpactCutSlopeUnconfirmedSSS", 1.0}; + FloatProperty m_dImpactCutSlopeUnconfirmedPPP{this, "dImpactCutSlopeUnconfirmedPPP", 0.}; FloatProperty m_maxdImpactDecays{this, "maxdImpactForDecays", 20.}; FloatProperty m_ptmin{this, "pTmin", 500.}; //@} @@ -246,6 +251,7 @@ namespace InDet { float m_dzdrmax0{0.}; ///< implicitly store eta cut float m_ipt{0.}; ///< inverse of 90% of the ptmin cut float m_ipt2{0.}; ///< inverse square of 90% of the pt min cut + // static constexpr float m_COF{134*.05*9}; ///< appears to be an approximated term related to multiple-scattering of particles traversing the ID during the seed formation static constexpr float m_COF{134*.05*9}; ///< appears to be an approximated term related to multiple-scattering of particles traversing the ID during the seed formation /// @name Binning parameters diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx index 9c5bbb9b71edb7559d742abeab5366d07499767e..5f097ebb3faed43f9d10ecb5d48e3486680ee718 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx @@ -1987,12 +1987,14 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp /// evaluate distance the two closest-by SP in this seed candidate float dr = data.R[b]; if (data.R[t] < data.R[b]) dr = data.R[t]; - /// update the d0 estimate - d0+=std::abs((Tzb-data.Tz[t])/(dr*sTzb2)); + /// obtain a quality score - start from the d0 estimate, and add + /// a penalty term corresponding to how far the seed segments + /// deviate from a straight line in r-z + data.SP[t]->setScorePenalty(std::abs((Tzb-data.Tz[t])/(dr*sTzb2))); + data.SP[t]->setParam(d0); /// record one possible seed candidate, sort by the curvature data.CmSp.emplace_back(std::make_pair(B/std::sqrt(onePlusAsquare), data.SP[t])); /// store the transverse IP, will later be used as a quality estimator - data.SP[t]->setParam(d0); } } ///< end loop over top space point candidates @@ -2276,8 +2278,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison for (; it_commonTopSP!=ie; ++it_commonTopSP) { /// the seed quality is set to d0 initially - float seedQuality = (*it_commonTopSP).second->param(); - float originalSeedQuality = (*it_commonTopSP).second->param(); + float seedIP = (*it_commonTopSP).second->param(); + float seedQuality = seedIP + (*it_commonTopSP).second->scorePenalty(); + float originalSeedQuality = seedQuality; if(m_maxdImpact > 50){ //This only applies to LRT @@ -2288,7 +2291,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison float eta1=-std::log(std::tan(.5*theta1)); float Zot=bottomZ - (bottomR-originalSeedQuality) * ((topZ-bottomZ)/(topR-bottomR)); - float theta0=std::atan2((*it_commonTopSP).second->param(),Zot); + float theta0=std::atan2(seedIP,Zot); float eta0=-std::log(std::tan(.5*theta0)); float deltaEta=std::abs(eta1-eta0); //For LLP daughters, the direction of the track is correlated with the direction of the LLP (which is correlated with the direction of the point of closest approach @@ -2353,16 +2356,21 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison if (seedQuality > data.maxScore) continue; /// if we have PPS seeds and no confirmation SP exists (which would give the -200 bonus) - /// or the seed quality is worse than the quality of the individual SP, skip this seed + /// or the hits on this seed were already used on a higher quality PPP/SSS seed, kick this one if (bottomSPisPixel!=topSPisPixel) { if (seedQuality > 0. || (seedQuality > bottomSPQuality && seedQuality > centralSPQuality && seedQuality > (*it_commonTopSP).second->quality()) ) continue; } - /// if we have a SSS seed, apply the d0 cut. - /// Exception: If the SSS seed has a confirmation seed (-400 from SSS and -200 from confirmation), - /// then we skip the d0 cut - if (!bottomSPisPixel && (originalSeedQuality > m_maxdImpactSSS) && (seedQuality > m_seedScoreThresholdSSSConfirmationSeed)) continue; + /// If we have a non-confirmed seed, apply a stricter d0 cut. + /// This, is determined using the original cut and the score penalty modifier. + if (!isConfirmedSeed(SPb,it_commonTopSP->second,seedQuality)){ + /// PPP seeds + double maxdImpact = m_maxdImpact - (m_dImpactCutSlopeUnconfirmedPPP * (*it_commonTopSP).second->scorePenalty()); + /// SSS seeds + if (!bottomSPisPixel) maxdImpact = m_maxdImpactSSS - (m_dImpactCutSlopeUnconfirmedSSS * (*it_commonTopSP).second->scorePenalty()); + if (seedIP > maxdImpact) continue; + } /// this is a good seed, save it (unless we have too many seeds per SP) newOneSeed(data, SPb, SP0, (*it_commonTopSP).second, Zob, seedQuality); } ///< end of loop over top SP candidates @@ -2394,7 +2402,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::fillSeeds(EventData& data) const theSeed = (*it_seedCandidate).second; /// if this is not the highest-quality seed in the list and we have the first hit in the IBL, require a confirmation seed (score is then boosted by -200 for PPP + -200 for confirmation --> below -200) if (it_seedCandidate!=it_firstSeedCandidate && theSeed->spacepoint0()->radius() < m_radiusCutIBL && quality > m_seedScoreThresholdPPPConfirmationSeed) continue; - /// this will return false for strip seeds if the quality of the seed is worse than the one of all of the space points on the seed. + /// this will set the quality member of all points on the seed to the quality score of this candidate if (!theSeed->setQuality(quality)) continue; /// if we have space, write the seed directly into an existing slot