184 trackCuts[
"Pt"].push_back( [minPt =
m_minPt](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) ->
bool {
return helper.pt(msgHelper) >= minPt; } );
188 trackCuts[
"Eta"].push_back( [maxAbsEta =
m_maxAbsEta](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
return std::abs(helper.eta(msgHelper)) <= maxAbsEta; } );
192 trackCuts[
"P"].push_back( [maxInvP = 1./
m_minP](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
return std::abs(helper.qOverP(msgHelper)) <= maxInvP; } );
196 trackCuts[
"D0"].push_back( [maxD0 =
m_maxD0](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
return std::abs(helper.d0(msgHelper)) <= maxD0; } );
200 trackCuts[
"Z0"].push_back( [maxZ0 =
m_maxZ0](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
return std::abs(helper.z0(msgHelper)) <= maxZ0; } );
205 return std::abs( helper.z0(msgHelper) * std::sin(helper.theta(msgHelper))) <= maxZ0SinTheta;
211 return getDefiningParametersCov(helper,msgHelper, InDetAccessor::d0,InDetAccessor::d0) <= maxSigmaD0Squared;
217 return getDefiningParametersCov(helper,msgHelper, InDetAccessor::z0,InDetAccessor::z0) <= maxSigmaZ0Squared;
221 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Maximum uncertainty on z0*sin(theta): "
224 double theta = helper.theta(msgHelper);
225 double sinTheta = std::sin(theta);
226 double cosTheta = std::cos(theta);
227 double z0 = helper.z0(msgHelper);
229 return ( sqr(z0)*sqr(cosTheta) * getDefiningParametersCov(helper,msgHelper, InDetAccessor::theta,InDetAccessor::theta)
230 + 2*z0 *sinTheta*cosTheta * getDefiningParametersCov(helper,msgHelper, InDetAccessor::theta,InDetAccessor::z0)
231 + sqr(sinTheta) * getDefiningParametersCov(helper,msgHelper, InDetAccessor::z0, InDetAccessor::z0) ) <= maxSigmaZ0SinThetaSquared;
237 return sqr(helper.d0(msgHelper)) <= maxD0overSigmaD0Squared * getDefiningParametersCov(helper,msgHelper, InDetAccessor::d0,InDetAccessor::d0);
243 return sqr(helper.z0(msgHelper)) <= maxZ0overSigmaZ0Squared * getDefiningParametersCov(helper,msgHelper, InDetAccessor::z0,InDetAccessor::z0);
247 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Maximum significance on z0*sin(theta): "
251 double theta = helper.theta(msgHelper);
252 double sinTheta = std::sin(theta);
253 double cosTheta = std::cos(theta);
254 double z0 = helper.z0(msgHelper);
256 return sqr(z0*sinTheta) <=
257 maxZ0SinThetaoverSigmaZ0SinThetaSquared * ( sqr(z0)*sqr(cosTheta) * getDefiningParametersCov(helper,msgHelper, InDetAccessor::theta,InDetAccessor::theta)
258 + 2*z0 *sinTheta*cosTheta * getDefiningParametersCov(helper,msgHelper, InDetAccessor::theta,InDetAccessor::z0)
259 + sqr(sinTheta) * getDefiningParametersCov(helper,msgHelper, InDetAccessor::z0, InDetAccessor::z0));
266 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" (Track will pass if no hit is expected.)" );
274 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" (Track will pass if no hit is expected.)" );
282 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" (If a layer has no hits but one is not expected, the" );
283 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" number of hits in that layer will be taken to be 1.)" );
285 ATH_MSG_WARNING(
"A value of minNBothInnermostLayersHits above 2 does not make sense." );
293 >= minNBothInnermostLayersHits);
297 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" An innermost layer hit is required if expected, otherwise" );
298 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" a next-to-innermost layer hit is required if it is expected." );
299 trackCuts[
"InnermostLayersHits"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
307 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" An innermost layer hit or next-to-innermost layer hit is required. If there are" );
308 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" no innermost layer or next-to-innermost layer hits, then zero expected" );
309 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" next-to-innermost layer hits is required." );
310 trackCuts[
"InnermostLayersHits"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
329 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum physical pixel hits (i.e. dead sensors do not count): "
354 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum physical SCT hits (i.e. dead sensors do not count): "
388 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum physical silicon hits (i.e. dead sensors do not count): "
407 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" No more than one shared module:" );
408 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" i.e. max 1 shared pixel hit or" );
409 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" 2 shared SCT hits, and not both." );
410 trackCuts[
"SiHits"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
416 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum silicon hits if the track has shared hits: "
432 return std::abs(helper.eta(msgHelper)) <= minEtaForStrictNSiHitsCut
440 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Zero pixel holes allowed, except one pix hole is allowed if there is a physical IBL hit and a BLayer hit is expected but there is no BLayer hit." );
441 trackCuts[
"PixHits"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
450 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum modified Si hits (2*pix + sct) (does not include dead sensors)= "
459 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum modified Si hits in top half = "
461 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum modified Si hits in bottom half = "
466 return top >= minNSiHitsModTop && bottom >= minNSiHitsModBottom;
484 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum TRT hits outside eta acceptance above high energy threshold: "
490 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum TRT hits outside eta acceptance above high energy threshold including outliers: "
496 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Maximum ratio of high threshold to regular TRT hits outside eta acceptance: "
501 double absEta = std::abs( helper.eta( msgHelper) );
502 return (absEta <= maxTrtEtaAcceptance || absEta > maxEtaForTrtHitCuts)
508 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Maximum ratio of high threshold to regular TRT hits above eta acceptance including outliers: "
513 double absEta = std::abs( helper.eta( msgHelper) );
514 return (absEta <= maxTrtEtaAcceptance || absEta > maxEtaForTrtHitCuts)
524 double absEta = std::abs( helper.eta( msgHelper) );
526 return ( absEta <= maxTrtEtaAcceptance || absEta > maxEtaForTrtHitCuts)
534 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Using pre-defined eta-dependent maximum chi squared (no longer recommended)." );
535 trackCuts[
"FitQuality"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
536 double eta = helper.eta(msgHelper);
538 double fit_ndof =
getFitNDoF(helper,msgHelper);
539 if (std::abs(
eta) < 1.9) {
540 return fit_chi_square <= fit_ndof * ( 4.4 + 0.32*
sqr(
eta) );
543 return fit_chi_square <= fit_ndof * ( 26.9 - 19.6978*std::abs(
eta) + 4.4534*
sqr(
eta) );
570 return helper.pt(msgHelper) <= minPtForProbCut
591 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" (only applied on tracks where all TRT hits are Xenon)" );
607 ATH_MSG_ERROR(
"Eta cutoffs and Silicon hit cuts must be vectors of the same length." );
608 return StatusCode::FAILURE;
610 if constexpr(VERBOSE>0) {
611 for (
size_t i_cut=0; i_cut<cutSize-1; ++i_cut) {
619 return StatusCode::FAILURE;
626 double abs_eta = std::abs(helper.eta(msgHelper));
627 unsigned int bin_i = findBin(*p_vecEtaCutoffsForSiHitsCut, abs_eta);
628 return bin_i >= p_vecMinNSiHitsAboveEta->size()
630 || getSummarySum<4,Trk_Helper>(helper, msgHelper,{xAOD::numberOfPixelHits,
631 xAOD::numberOfSCTHits,
632 xAOD::numberOfPixelDeadSensors,
633 xAOD::numberOfSCTDeadSensors}) >= (*p_vecMinNSiHitsAboveEta)[bin_i];
637 if (!m_vecEtaCutoffsForPtCut.empty() || !m_vecMinPtAboveEta.empty()) {
638 auto cutSize = m_vecEtaCutoffsForPtCut.size();
639 if (cutSize != m_vecMinPtAboveEta.size()) {
640 ATH_MSG_ERROR(
"Eta cutoffs and pT cuts must be vectors of the same length." );
641 return StatusCode::FAILURE;
643 if constexpr(VERBOSE>0) {
644 for (
size_t i_cut=0; i_cut<cutSize-1; ++i_cut) {
646 <<
" < eta < " << m_vecEtaCutoffsForPtCut[i_cut+1]
647 <<
" ,transverse momentum >= " << m_vecMinPtAboveEta[i_cut] );
650 if (!
checkOrder(m_vecEtaCutoffsForPtCut.value())) {
652 return StatusCode::FAILURE;
655 <<
" ,transverse momentum >= " << m_vecMinPtAboveEta[cutSize-1] );
656 trackCuts[
"Pt"].push_back([p_vecEtaCutoffsForPtCut = &std::as_const(m_vecEtaCutoffsForPtCut.value()),
657 p_vecMinPtAboveEta = &std::as_const(m_vecMinPtAboveEta.value())](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
658 double abs_eta = std::abs(helper.eta(msgHelper));
659 unsigned int bin_i = findBin(*p_vecEtaCutoffsForPtCut, abs_eta);
660 return bin_i >= p_vecMinPtAboveEta->size() || abs_eta > 5.0 || helper.pt(msgHelper) >= (*p_vecMinPtAboveEta)[bin_i];
664 if (!m_vecPtCutoffsForSctHitsCut.empty() || !m_vecMinNSctHitsAbovePt.empty()) {
665 auto cutSize = m_vecPtCutoffsForSctHitsCut.size();
666 if (cutSize != m_vecMinNSctHitsAbovePt.size()) {
667 ATH_MSG_ERROR(
"Pt cutoffs and SCT hit cuts must be vectors of the same length." );
668 return StatusCode::FAILURE;
671 for (
size_t i_cut=0; i_cut<cutSize-1; ++i_cut) {
672 ATH_MSG_INFO(
" for " << m_vecPtCutoffsForSctHitsCut[i_cut]
673 <<
" < pt < " << m_vecPtCutoffsForSctHitsCut[i_cut+1]
674 <<
" MeV,\tSCT hits >= " << m_vecMinNSctHitsAbovePt[i_cut] );
677 if (!
checkOrder(m_vecPtCutoffsForSctHitsCut.value())) {
679 return StatusCode::FAILURE;
681 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for pt > " << m_vecPtCutoffsForSctHitsCut[cutSize-1]
682 <<
" MeV,\t\tSCT hits >= " << m_vecMinNSctHitsAbovePt[cutSize-1] );
683 trackCuts[
"SctHits"].push_back([p_vecPtCutoffsForSctHitsCut = &std::as_const(m_vecPtCutoffsForSctHitsCut.value()),
684 p_vecMinNSctHitsAbovePt = &std::as_const(m_vecMinNSctHitsAbovePt.value())](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
685 double pt = helper.pt(msgHelper);
686 unsigned int bin_i = findBin(*p_vecPtCutoffsForSctHitsCut, pt);
687 return bin_i >= p_vecPtCutoffsForSctHitsCut->size()
688 || getSummarySum<2,Trk_Helper>(helper, msgHelper,{xAOD::numberOfSCTHits,
689 xAOD::numberOfSCTDeadSensors}) >= (*p_vecMinNSctHitsAbovePt)[bin_i];
693 if (!m_vecPtCutoffsForZ0SinThetaCut.empty() ||
694 !m_vecEtaCutoffsForZ0SinThetaCut.empty() ||
695 !m_vecvecMaxZ0SinThetaAboveEtaPt.empty()) {
696 auto etaSize = m_vecEtaCutoffsForZ0SinThetaCut.size();
697 auto ptSize = m_vecPtCutoffsForZ0SinThetaCut.size();
698 if (etaSize != m_vecvecMaxZ0SinThetaAboveEtaPt.size()) {
699 ATH_MSG_ERROR(
"Eta cutoffs and Z0SinTheta cuts must be vectors of the same length." );
700 return StatusCode::FAILURE;
702 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
703 if (ptSize != m_vecvecMaxZ0SinThetaAboveEtaPt[i_size].
size()) {
704 ATH_MSG_ERROR(
"Pt cutoffs and Z0SinTheta cuts must be vectors of the same length." );
705 return StatusCode::FAILURE;
709 std::stringstream pTRangeBuffer;
710 std::copy(m_vecPtCutoffsForZ0SinThetaCut.begin(), m_vecPtCutoffsForZ0SinThetaCut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
711 std::string pTString=pTRangeBuffer.str();
712 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"Z0SinTheta cuts (<=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
713 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
715 std::stringstream etaRangeBuffer;
716 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForZ0SinThetaCut[i_cut_eta] <<
" < |#eta| < ";
717 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForZ0SinThetaCut[i_cut_eta+1];
718 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
720 std::stringstream cutBuffer;
721 std::copy(m_vecvecMaxZ0SinThetaAboveEtaPt[i_cut_eta].
begin(), m_vecvecMaxZ0SinThetaAboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
722 std::string cutString=cutBuffer.str();
724 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
727 if (!
checkOrder(m_vecEtaCutoffsForZ0SinThetaCut.value())) {
729 return StatusCode::FAILURE;
731 if (!
checkOrder(m_vecPtCutoffsForZ0SinThetaCut.value())) {
733 return StatusCode::FAILURE;
736 trackCuts[
"Z0SinTheta"].push_back([p_vecEtaCutoffsForZ0SinThetaCut = &std::as_const(m_vecEtaCutoffsForZ0SinThetaCut.value()),
737 p_vecPtCutoffsForZ0SinThetaCut = &std::as_const(m_vecPtCutoffsForZ0SinThetaCut.value()),
738 p_vecvecMaxZ0SinThetaAboveEtaPt = &std::as_const(m_vecvecMaxZ0SinThetaAboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
739 double eta = helper.eta(msgHelper);
740 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForZ0SinThetaCut, std::fabs(eta));
741 double pt = helper.pt(msgHelper);
742 unsigned int bin_pt = findBin(*p_vecPtCutoffsForZ0SinThetaCut, pt);
743 return bin_eta >= p_vecEtaCutoffsForZ0SinThetaCut->size()
744 || bin_pt >= p_vecPtCutoffsForZ0SinThetaCut->size()
745 || std::fabs(helper.z0(msgHelper) * std::sin(helper.theta(msgHelper))) <= (*p_vecvecMaxZ0SinThetaAboveEtaPt)[bin_eta][bin_pt];
749 if (!m_vecPtCutoffsForD0Cut.empty() ||
750 !m_vecEtaCutoffsForD0Cut.empty() ||
751 !m_vecvecMaxD0AboveEtaPt.empty()) {
752 auto etaSize = m_vecEtaCutoffsForD0Cut.size();
753 auto ptSize = m_vecPtCutoffsForD0Cut.size();
754 if (etaSize != m_vecvecMaxD0AboveEtaPt.size()) {
755 ATH_MSG_ERROR(
"Eta cutoffs and D0 cuts must be vectors of the same length." );
756 return StatusCode::FAILURE;
758 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
759 if (ptSize != m_vecvecMaxD0AboveEtaPt[i_size].
size()) {
760 ATH_MSG_ERROR(
"Pt cutoffs and D0 cuts must be vectors of the same length." );
761 return StatusCode::FAILURE;
765 std::stringstream pTRangeBuffer;
766 std::copy(m_vecPtCutoffsForD0Cut.begin(), m_vecPtCutoffsForD0Cut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
767 std::string pTString=pTRangeBuffer.str();
768 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"D0 cuts (<=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
769 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
771 std::stringstream etaRangeBuffer;
772 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForD0Cut[i_cut_eta] <<
" < |#eta| < ";
773 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForD0Cut[i_cut_eta+1];
774 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
776 std::stringstream cutBuffer;
777 std::copy(m_vecvecMaxD0AboveEtaPt[i_cut_eta].
begin(), m_vecvecMaxD0AboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
778 std::string cutString=cutBuffer.str();
780 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
783 if (!
checkOrder(m_vecEtaCutoffsForD0Cut.value())) {
785 return StatusCode::FAILURE;
787 if (!
checkOrder(m_vecPtCutoffsForD0Cut.value())) {
789 return StatusCode::FAILURE;
792 trackCuts[
"D0"].push_back([p_vecEtaCutoffsForD0Cut = &std::as_const(m_vecEtaCutoffsForD0Cut.value()),
793 p_vecPtCutoffsForD0Cut = &std::as_const(m_vecPtCutoffsForD0Cut.value()),
794 p_vecvecMaxD0AboveEtaPt = &std::as_const(m_vecvecMaxD0AboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
795 double eta = helper.eta(msgHelper);
796 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForD0Cut, std::fabs(eta));
797 double pt = helper.pt(msgHelper);
798 unsigned int bin_pt = findBin(*p_vecPtCutoffsForD0Cut, pt);
799 return bin_eta >= p_vecEtaCutoffsForD0Cut->size()
800 || bin_pt >= p_vecPtCutoffsForD0Cut->size()
801 || std::fabs(helper.d0(msgHelper)) <= (*p_vecvecMaxD0AboveEtaPt)[bin_eta][bin_pt];
805 if (!m_vecPtCutoffsForSctHolesCut.empty() ||
806 !m_vecEtaCutoffsForSctHolesCut.empty() ||
807 !m_vecvecMaxSctHolesAboveEtaPt.empty()) {
808 auto etaSize = m_vecEtaCutoffsForSctHolesCut.size();
809 auto ptSize = m_vecPtCutoffsForSctHolesCut.size();
810 if (etaSize != m_vecvecMaxSctHolesAboveEtaPt.size()) {
811 ATH_MSG_ERROR(
"Eta cutoffs and SctHoles cuts must be vectors of the same length." );
812 return StatusCode::FAILURE;
814 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
815 if (ptSize != m_vecvecMaxSctHolesAboveEtaPt[i_size].
size()) {
816 ATH_MSG_ERROR(
"Pt cutoffs and SctHoles cuts must be vectors of the same length." );
817 return StatusCode::FAILURE;
821 std::stringstream pTRangeBuffer;
822 std::copy(m_vecPtCutoffsForSctHolesCut.begin(), m_vecPtCutoffsForSctHolesCut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
823 std::string pTString=pTRangeBuffer.str();
824 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"SctHoles cuts (<=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
825 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
827 std::stringstream etaRangeBuffer;
828 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHolesCut[i_cut_eta] <<
" < |#eta| < ";
829 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHolesCut[i_cut_eta+1];
830 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
832 std::stringstream cutBuffer;
833 std::copy(m_vecvecMaxSctHolesAboveEtaPt[i_cut_eta].
begin(), m_vecvecMaxSctHolesAboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
834 std::string cutString=cutBuffer.str();
836 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
839 if (!
checkOrder(m_vecEtaCutoffsForSctHolesCut.value())) {
841 return StatusCode::FAILURE;
843 if (!
checkOrder(m_vecPtCutoffsForSctHolesCut.value())) {
845 return StatusCode::FAILURE;
848 trackCuts[
"SctHits"].push_back([p_vecEtaCutoffsForSctHolesCut = &std::as_const(m_vecEtaCutoffsForSctHolesCut.value()),
849 p_vecPtCutoffsForSctHolesCut = &std::as_const(m_vecPtCutoffsForSctHolesCut.value()),
850 p_vecvecMaxSctHolesAboveEtaPt = &std::as_const(m_vecvecMaxSctHolesAboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
851 double eta = helper.eta(msgHelper);
852 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForSctHolesCut, std::fabs(eta));
853 double pt = helper.pt(msgHelper);
854 unsigned int bin_pt = findBin(*p_vecPtCutoffsForSctHolesCut, pt);
855 return bin_eta >= p_vecEtaCutoffsForSctHolesCut->size()
856 || bin_pt >= p_vecPtCutoffsForSctHolesCut->size()
857 || getSummary(helper, msgHelper, xAOD::numberOfSCTHoles) <= (*p_vecvecMaxSctHolesAboveEtaPt)[bin_eta][bin_pt];
861 if (!m_vecPtCutoffsForSctHitsPlusDeadCut.empty() ||
862 !m_vecEtaCutoffsForSctHitsPlusDeadCut.empty() ||
863 !m_vecvecMinSctHitsPlusDeadAboveEtaPt.empty()) {
864 auto etaSize = m_vecEtaCutoffsForSctHitsPlusDeadCut.size();
865 auto ptSize = m_vecPtCutoffsForSctHitsPlusDeadCut.size();
866 if (etaSize != m_vecvecMinSctHitsPlusDeadAboveEtaPt.size()) {
867 ATH_MSG_ERROR(
"Eta cutoffs and SctHitsPlusDead cuts must be vectors of the same length." );
868 return StatusCode::FAILURE;
870 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
871 if (ptSize != m_vecvecMinSctHitsPlusDeadAboveEtaPt[i_size].
size()) {
872 ATH_MSG_ERROR(
"Pt cutoffs and SctHitsPlusDead cuts must be vectors of the same length." );
873 return StatusCode::FAILURE;
877 std::stringstream pTRangeBuffer;
878 std::copy(m_vecPtCutoffsForSctHitsPlusDeadCut.begin(), m_vecPtCutoffsForSctHitsPlusDeadCut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
879 std::string pTString=pTRangeBuffer.str();
880 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"SctHitsPlusDead cuts (>=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
881 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
883 std::stringstream etaRangeBuffer;
884 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHitsPlusDeadCut[i_cut_eta] <<
" < |#eta| < ";
885 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHitsPlusDeadCut[i_cut_eta+1];
886 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
888 std::stringstream cutBuffer;
889 std::copy(m_vecvecMinSctHitsPlusDeadAboveEtaPt[i_cut_eta].
begin(), m_vecvecMinSctHitsPlusDeadAboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
890 std::string cutString=cutBuffer.str();
892 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
895 if (!
checkOrder(m_vecEtaCutoffsForSctHitsPlusDeadCut.value())) {
897 return StatusCode::FAILURE;
899 if (!
checkOrder(m_vecPtCutoffsForSctHitsPlusDeadCut.value())) {
901 return StatusCode::FAILURE;
904 trackCuts[
"SctHits"].push_back([p_vecEtaCutoffsForSctHitsPlusDeadCut = &std::as_const(m_vecEtaCutoffsForSctHitsPlusDeadCut.value()),
905 p_vecPtCutoffsForSctHitsPlusDeadCut = &std::as_const(m_vecPtCutoffsForSctHitsPlusDeadCut.value()),
906 p_vecvecMinSctHitsPlusDeadAboveEtaPt = &std::as_const(m_vecvecMinSctHitsPlusDeadAboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
907 double eta = helper.eta(msgHelper);
908 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForSctHitsPlusDeadCut, std::fabs(eta));
909 double pt = helper.pt(msgHelper);
910 unsigned int bin_pt = findBin(*p_vecPtCutoffsForSctHitsPlusDeadCut, pt);
911 return bin_eta >= p_vecEtaCutoffsForSctHitsPlusDeadCut->size()
912 || bin_pt >= p_vecPtCutoffsForSctHitsPlusDeadCut->size()
913 || getSummarySum<2,Trk_Helper>(helper, msgHelper, {xAOD::numberOfSCTHits, xAOD::numberOfSCTDeadSensors}) >= (*p_vecvecMinSctHitsPlusDeadAboveEtaPt)[bin_eta][bin_pt];
917 return StatusCode::SUCCESS;
1179 case CutLevel::NoCut :
1183 ATH_MSG_WARNING(
"Trying to set cut level while the tool is already initialized." );
1184 ATH_MSG_WARNING(
"This will almost certainly not exhibit intended behavior." );
1244#ifndef XAOD_ANALYSIS
1269 case CutLevel::Loose :
1278 case CutLevel::LoosePrimary :
1287 case CutLevel::TightPrimary :
1298 case CutLevel::LooseMuon :
1308 case CutLevel::LooseElectron :
1313 case CutLevel::LooseTau :
1321 case CutLevel::MinBias :
1335 case CutLevel::HILoose:
1349 case CutLevel::HITight:
1365 case CutLevel::HILooseOptimized:
1375 std::vector<double>({500, 600, 700, 800, 900, 1000, 1500,
1376 2000, 2500, 3000, 5000, 8000, 12000});
1378 std::vector<std::vector<double>>({{2.10, 2.15, 6.00, 5.00, 3.10, 2.00, 1.75, 1.60, 1.43, 1.40, 1.05, 0.65, 0.60},
1379 {1.44, 1.47, 1.50, 1.55, 1.62, 1.45, 1.45, 1.78, 1.73, 1.50, 1.20, 0.97, 0.53},
1380 {1.40, 1.45, 1.50, 1.46, 1.41, 1.37, 1.25, 1.50, 1.50, 1.36, 1.10, 0.85, 0.52},
1381 {1.51, 1.70, 1.70, 1.71, 1.71, 1.53, 1.54, 1.49, 1.36, 1.20, 0.95, 0.60, 0.55}});
1388 std::vector<double>({500, 600, 700, 800, 900, 1000, 1500,
1389 2000, 2500, 3000, 5000, 8000, 12000});
1391 std::vector<std::vector<double>>({{0.81, 0.90, 0.94, 0.92, 0.90, 0.75, 0.65, 0.63, 0.62, 0.60, 0.63, 0.50, 0.55},
1392 {1.00, 0.98, 0.98, 0.92, 0.90, 0.69, 0.67, 0.86, 0.88, 0.88, 0.88, 0.87, 1.06},
1393 {1.19, 1.15, 1.10, 1.08, 1.03, 0.94, 0.85, 0.97, 0.97, 0.96, 0.95, 0.92, 1.04},
1394 {1.33, 1.23, 1.21, 1.15, 1.15, 1.07, 0.94, 0.97, 0.97, 0.97, 0.98, 1.10, 1.10}});
1397 case CutLevel::HITightOptimized:
1407 2000, 2500, 3000, 5000, 8000, 12000});
1409 std::vector<std::vector<double>>({{0.62, 0.70, 0.82, 0.87, 0.74, 0.61, 0.50, 0.48, 0.46, 0.45, 0.30, 0.24, 0.23},
1410 {0.51, 0.53, 0.53, 0.53, 0.52, 0.43, 0.28, 0.27, 0.28, 0.30, 0.24, 0.22, 0.13},
1411 {0.91, 0.89, 0.87, 0.55, 0.59, 0.37, 0.39, 0.31, 0.34, 0.35, 0.30, 0.30, 0.20},
1412 {0.76, 0.71, 0.69, 0.48, 0.48, 0.47, 0.46, 0.42, 0.38, 0.32, 0.28, 0.20, 0.15}});
1419 2000, 2500, 3000, 5000, 8000, 12000});
1421 std::vector<std::vector<double>>({{0.34, 0.39, 0.47, 0.49, 0.55, 0.47, 0.44, 0.21, 0.19, 0.17, 0.12, 0.14, 0.15},
1422 {0.32, 0.32, 0.33, 0.33, 0.33, 0.27, 0.16, 0.15, 0.13, 0.15, 0.13, 0.16, 0.20},
1423 {0.95, 0.91, 0.88, 0.35, 0.37, 0.24, 0.26, 0.22, 0.23, 0.24, 0.19, 0.19, 0.23},
1424 {0.68, 0.67, 0.65, 0.42, 0.42, 0.36, 0.35, 0.31, 0.27, 0.26, 0.27, 0.28, 0.30}});
1431 2000, 2500, 3000, 5000, 8000, 12000});
1433 std::vector<std::vector<double>>({{0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1},
1434 {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
1435 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
1436 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}});
1443 2000, 2500, 3000, 5000, 8000, 12000});
1445 std::vector<std::vector<double>>({{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1446 {0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0},
1447 {8, 8, 8, 7, 7, 6, 6, 6, 6, 6, 0, 0, 0},
1448 {7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}});
1451 case CutLevel::HILoosePixMod:
1463 ATH_MSG_ERROR(
"CutLevel not recognized. Cut selection will remain unchanged.");