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) {
319 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum physical pixel hits (i.e. dead sensors do not count): "
344 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum physical SCT hits (i.e. dead sensors do not count): "
378 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum physical silicon hits (i.e. dead sensors do not count): "
397 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" No more than one shared module:" );
398 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" i.e. max 1 shared pixel hit or" );
399 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" 2 shared SCT hits, and not both." );
400 trackCuts[
"SiHits"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
406 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum silicon hits if the track has shared hits: "
422 return std::abs(helper.eta(msgHelper)) <= minEtaForStrictNSiHitsCut
430 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." );
431 trackCuts[
"PixHits"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
440 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum modified Si hits (2*pix + sct) (does not include dead sensors)= "
449 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum modified Si hits in top half = "
451 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum modified Si hits in bottom half = "
456 return top >= minNSiHitsModTop && bottom >= minNSiHitsModBottom;
474 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum TRT hits outside eta acceptance above high energy threshold: "
480 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Minimum TRT hits outside eta acceptance above high energy threshold including outliers: "
486 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Maximum ratio of high threshold to regular TRT hits outside eta acceptance: "
491 double absEta = std::abs( helper.eta( msgHelper) );
492 return (absEta <= maxTrtEtaAcceptance || absEta > maxEtaForTrtHitCuts)
498 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Maximum ratio of high threshold to regular TRT hits above eta acceptance including outliers: "
503 double absEta = std::abs( helper.eta( msgHelper) );
504 return (absEta <= maxTrtEtaAcceptance || absEta > maxEtaForTrtHitCuts)
514 double absEta = std::abs( helper.eta( msgHelper) );
516 return ( absEta <= maxTrtEtaAcceptance || absEta > maxEtaForTrtHitCuts)
524 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" Using pre-defined eta-dependent maximum chi squared (no longer recommended)." );
525 trackCuts[
"FitQuality"].push_back([](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
526 double eta = helper.eta(msgHelper);
528 double fit_ndof =
getFitNDoF(helper,msgHelper);
529 if (std::abs(
eta) < 1.9) {
530 return fit_chi_square <= fit_ndof * ( 4.4 + 0.32*
sqr(
eta) );
533 return fit_chi_square <= fit_ndof * ( 26.9 - 19.6978*std::abs(
eta) + 4.4534*
sqr(
eta) );
560 return helper.pt(msgHelper) <= minPtForProbCut
581 if constexpr(VERBOSE>0)
ATH_MSG_INFO(
" (only applied on tracks where all TRT hits are Xenon)" );
597 ATH_MSG_ERROR(
"Eta cutoffs and Silicon hit cuts must be vectors of the same length." );
598 return StatusCode::FAILURE;
600 if constexpr(VERBOSE>0) {
601 for (
size_t i_cut=0; i_cut<cutSize-1; ++i_cut) {
609 return StatusCode::FAILURE;
616 double abs_eta = std::abs(helper.eta(msgHelper));
617 unsigned int bin_i = findBin(*p_vecEtaCutoffsForSiHitsCut, abs_eta);
618 return bin_i >= p_vecMinNSiHitsAboveEta->size()
620 || getSummarySum<4,Trk_Helper>(helper, msgHelper,{xAOD::numberOfPixelHits,
621 xAOD::numberOfSCTHits,
622 xAOD::numberOfPixelDeadSensors,
623 xAOD::numberOfSCTDeadSensors}) >= (*p_vecMinNSiHitsAboveEta)[bin_i];
627 if (!m_vecEtaCutoffsForPtCut.empty() || !m_vecMinPtAboveEta.empty()) {
628 auto cutSize = m_vecEtaCutoffsForPtCut.size();
629 if (cutSize != m_vecMinPtAboveEta.size()) {
630 ATH_MSG_ERROR(
"Eta cutoffs and pT cuts must be vectors of the same length." );
631 return StatusCode::FAILURE;
633 if constexpr(VERBOSE>0) {
634 for (
size_t i_cut=0; i_cut<cutSize-1; ++i_cut) {
636 <<
" < eta < " << m_vecEtaCutoffsForPtCut[i_cut+1]
637 <<
" ,transverse momentum >= " << m_vecMinPtAboveEta[i_cut] );
640 if (!
checkOrder(m_vecEtaCutoffsForPtCut.value())) {
642 return StatusCode::FAILURE;
645 <<
" ,transverse momentum >= " << m_vecMinPtAboveEta[cutSize-1] );
646 trackCuts[
"Pt"].push_back([p_vecEtaCutoffsForPtCut = &std::as_const(m_vecEtaCutoffsForPtCut.value()),
647 p_vecMinPtAboveEta = &std::as_const(m_vecMinPtAboveEta.value())](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
648 double abs_eta = std::abs(helper.eta(msgHelper));
649 unsigned int bin_i = findBin(*p_vecEtaCutoffsForPtCut, abs_eta);
650 return bin_i >= p_vecMinPtAboveEta->size() || abs_eta > 5.0 || helper.pt(msgHelper) >= (*p_vecMinPtAboveEta)[bin_i];
654 if (!m_vecPtCutoffsForSctHitsCut.empty() || !m_vecMinNSctHitsAbovePt.empty()) {
655 auto cutSize = m_vecPtCutoffsForSctHitsCut.size();
656 if (cutSize != m_vecMinNSctHitsAbovePt.size()) {
657 ATH_MSG_ERROR(
"Pt cutoffs and SCT hit cuts must be vectors of the same length." );
658 return StatusCode::FAILURE;
661 for (
size_t i_cut=0; i_cut<cutSize-1; ++i_cut) {
662 ATH_MSG_INFO(
" for " << m_vecPtCutoffsForSctHitsCut[i_cut]
663 <<
" < pt < " << m_vecPtCutoffsForSctHitsCut[i_cut+1]
664 <<
" MeV,\tSCT hits >= " << m_vecMinNSctHitsAbovePt[i_cut] );
667 if (!
checkOrder(m_vecPtCutoffsForSctHitsCut.value())) {
669 return StatusCode::FAILURE;
671 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for pt > " << m_vecPtCutoffsForSctHitsCut[cutSize-1]
672 <<
" MeV,\t\tSCT hits >= " << m_vecMinNSctHitsAbovePt[cutSize-1] );
673 trackCuts[
"SctHits"].push_back([p_vecPtCutoffsForSctHitsCut = &std::as_const(m_vecPtCutoffsForSctHitsCut.value()),
674 p_vecMinNSctHitsAbovePt = &std::as_const(m_vecMinNSctHitsAbovePt.value())](Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
675 double pt = helper.pt(msgHelper);
676 unsigned int bin_i = findBin(*p_vecPtCutoffsForSctHitsCut, pt);
677 return bin_i >= p_vecPtCutoffsForSctHitsCut->size()
678 || getSummarySum<2,Trk_Helper>(helper, msgHelper,{xAOD::numberOfSCTHits,
679 xAOD::numberOfSCTDeadSensors}) >= (*p_vecMinNSctHitsAbovePt)[bin_i];
683 if (!m_vecPtCutoffsForZ0SinThetaCut.empty() ||
684 !m_vecEtaCutoffsForZ0SinThetaCut.empty() ||
685 !m_vecvecMaxZ0SinThetaAboveEtaPt.empty()) {
686 auto etaSize = m_vecEtaCutoffsForZ0SinThetaCut.size();
687 auto ptSize = m_vecPtCutoffsForZ0SinThetaCut.size();
688 if (etaSize != m_vecvecMaxZ0SinThetaAboveEtaPt.size()) {
689 ATH_MSG_ERROR(
"Eta cutoffs and Z0SinTheta cuts must be vectors of the same length." );
690 return StatusCode::FAILURE;
692 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
693 if (ptSize != m_vecvecMaxZ0SinThetaAboveEtaPt[i_size].
size()) {
694 ATH_MSG_ERROR(
"Pt cutoffs and Z0SinTheta cuts must be vectors of the same length." );
695 return StatusCode::FAILURE;
699 std::stringstream pTRangeBuffer;
700 std::copy(m_vecPtCutoffsForZ0SinThetaCut.begin(), m_vecPtCutoffsForZ0SinThetaCut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
701 std::string pTString=pTRangeBuffer.str();
702 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"Z0SinTheta cuts (<=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
703 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
705 std::stringstream etaRangeBuffer;
706 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForZ0SinThetaCut[i_cut_eta] <<
" < |#eta| < ";
707 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForZ0SinThetaCut[i_cut_eta+1];
708 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
710 std::stringstream cutBuffer;
711 std::copy(m_vecvecMaxZ0SinThetaAboveEtaPt[i_cut_eta].
begin(), m_vecvecMaxZ0SinThetaAboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
712 std::string cutString=cutBuffer.str();
714 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
717 if (!
checkOrder(m_vecEtaCutoffsForZ0SinThetaCut.value())) {
719 return StatusCode::FAILURE;
721 if (!
checkOrder(m_vecPtCutoffsForZ0SinThetaCut.value())) {
723 return StatusCode::FAILURE;
726 trackCuts[
"Z0SinTheta"].push_back([p_vecEtaCutoffsForZ0SinThetaCut = &std::as_const(m_vecEtaCutoffsForZ0SinThetaCut.value()),
727 p_vecPtCutoffsForZ0SinThetaCut = &std::as_const(m_vecPtCutoffsForZ0SinThetaCut.value()),
728 p_vecvecMaxZ0SinThetaAboveEtaPt = &std::as_const(m_vecvecMaxZ0SinThetaAboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
729 double eta = helper.eta(msgHelper);
730 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForZ0SinThetaCut, std::fabs(eta));
731 double pt = helper.pt(msgHelper);
732 unsigned int bin_pt = findBin(*p_vecPtCutoffsForZ0SinThetaCut, pt);
733 return bin_eta >= p_vecEtaCutoffsForZ0SinThetaCut->size()
734 || bin_pt >= p_vecPtCutoffsForZ0SinThetaCut->size()
735 || std::fabs(helper.z0(msgHelper) * std::sin(helper.theta(msgHelper))) <= (*p_vecvecMaxZ0SinThetaAboveEtaPt)[bin_eta][bin_pt];
739 if (!m_vecPtCutoffsForD0Cut.empty() ||
740 !m_vecEtaCutoffsForD0Cut.empty() ||
741 !m_vecvecMaxD0AboveEtaPt.empty()) {
742 auto etaSize = m_vecEtaCutoffsForD0Cut.size();
743 auto ptSize = m_vecPtCutoffsForD0Cut.size();
744 if (etaSize != m_vecvecMaxD0AboveEtaPt.size()) {
745 ATH_MSG_ERROR(
"Eta cutoffs and D0 cuts must be vectors of the same length." );
746 return StatusCode::FAILURE;
748 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
749 if (ptSize != m_vecvecMaxD0AboveEtaPt[i_size].
size()) {
750 ATH_MSG_ERROR(
"Pt cutoffs and D0 cuts must be vectors of the same length." );
751 return StatusCode::FAILURE;
755 std::stringstream pTRangeBuffer;
756 std::copy(m_vecPtCutoffsForD0Cut.begin(), m_vecPtCutoffsForD0Cut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
757 std::string pTString=pTRangeBuffer.str();
758 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"D0 cuts (<=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
759 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
761 std::stringstream etaRangeBuffer;
762 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForD0Cut[i_cut_eta] <<
" < |#eta| < ";
763 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForD0Cut[i_cut_eta+1];
764 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
766 std::stringstream cutBuffer;
767 std::copy(m_vecvecMaxD0AboveEtaPt[i_cut_eta].
begin(), m_vecvecMaxD0AboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
768 std::string cutString=cutBuffer.str();
770 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
773 if (!
checkOrder(m_vecEtaCutoffsForD0Cut.value())) {
775 return StatusCode::FAILURE;
777 if (!
checkOrder(m_vecPtCutoffsForD0Cut.value())) {
779 return StatusCode::FAILURE;
782 trackCuts[
"D0"].push_back([p_vecEtaCutoffsForD0Cut = &std::as_const(m_vecEtaCutoffsForD0Cut.value()),
783 p_vecPtCutoffsForD0Cut = &std::as_const(m_vecPtCutoffsForD0Cut.value()),
784 p_vecvecMaxD0AboveEtaPt = &std::as_const(m_vecvecMaxD0AboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
785 double eta = helper.eta(msgHelper);
786 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForD0Cut, std::fabs(eta));
787 double pt = helper.pt(msgHelper);
788 unsigned int bin_pt = findBin(*p_vecPtCutoffsForD0Cut, pt);
789 return bin_eta >= p_vecEtaCutoffsForD0Cut->size()
790 || bin_pt >= p_vecPtCutoffsForD0Cut->size()
791 || std::fabs(helper.d0(msgHelper)) <= (*p_vecvecMaxD0AboveEtaPt)[bin_eta][bin_pt];
795 if (!m_vecPtCutoffsForSctHolesCut.empty() ||
796 !m_vecEtaCutoffsForSctHolesCut.empty() ||
797 !m_vecvecMaxSctHolesAboveEtaPt.empty()) {
798 auto etaSize = m_vecEtaCutoffsForSctHolesCut.size();
799 auto ptSize = m_vecPtCutoffsForSctHolesCut.size();
800 if (etaSize != m_vecvecMaxSctHolesAboveEtaPt.size()) {
801 ATH_MSG_ERROR(
"Eta cutoffs and SctHoles cuts must be vectors of the same length." );
802 return StatusCode::FAILURE;
804 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
805 if (ptSize != m_vecvecMaxSctHolesAboveEtaPt[i_size].
size()) {
806 ATH_MSG_ERROR(
"Pt cutoffs and SctHoles cuts must be vectors of the same length." );
807 return StatusCode::FAILURE;
811 std::stringstream pTRangeBuffer;
812 std::copy(m_vecPtCutoffsForSctHolesCut.begin(), m_vecPtCutoffsForSctHolesCut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
813 std::string pTString=pTRangeBuffer.str();
814 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"SctHoles cuts (<=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
815 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
817 std::stringstream etaRangeBuffer;
818 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHolesCut[i_cut_eta] <<
" < |#eta| < ";
819 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHolesCut[i_cut_eta+1];
820 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
822 std::stringstream cutBuffer;
823 std::copy(m_vecvecMaxSctHolesAboveEtaPt[i_cut_eta].
begin(), m_vecvecMaxSctHolesAboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
824 std::string cutString=cutBuffer.str();
826 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
829 if (!
checkOrder(m_vecEtaCutoffsForSctHolesCut.value())) {
831 return StatusCode::FAILURE;
833 if (!
checkOrder(m_vecPtCutoffsForSctHolesCut.value())) {
835 return StatusCode::FAILURE;
838 trackCuts[
"SctHits"].push_back([p_vecEtaCutoffsForSctHolesCut = &std::as_const(m_vecEtaCutoffsForSctHolesCut.value()),
839 p_vecPtCutoffsForSctHolesCut = &std::as_const(m_vecPtCutoffsForSctHolesCut.value()),
840 p_vecvecMaxSctHolesAboveEtaPt = &std::as_const(m_vecvecMaxSctHolesAboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
841 double eta = helper.eta(msgHelper);
842 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForSctHolesCut, std::fabs(eta));
843 double pt = helper.pt(msgHelper);
844 unsigned int bin_pt = findBin(*p_vecPtCutoffsForSctHolesCut, pt);
845 return bin_eta >= p_vecEtaCutoffsForSctHolesCut->size()
846 || bin_pt >= p_vecPtCutoffsForSctHolesCut->size()
847 || getSummary(helper, msgHelper, xAOD::numberOfSCTHoles) <= (*p_vecvecMaxSctHolesAboveEtaPt)[bin_eta][bin_pt];
851 if (!m_vecPtCutoffsForSctHitsPlusDeadCut.empty() ||
852 !m_vecEtaCutoffsForSctHitsPlusDeadCut.empty() ||
853 !m_vecvecMinSctHitsPlusDeadAboveEtaPt.empty()) {
854 auto etaSize = m_vecEtaCutoffsForSctHitsPlusDeadCut.size();
855 auto ptSize = m_vecPtCutoffsForSctHitsPlusDeadCut.size();
856 if (etaSize != m_vecvecMinSctHitsPlusDeadAboveEtaPt.size()) {
857 ATH_MSG_ERROR(
"Eta cutoffs and SctHitsPlusDead cuts must be vectors of the same length." );
858 return StatusCode::FAILURE;
860 for (
size_t i_size=0; i_size<etaSize-1; ++i_size) {
861 if (ptSize != m_vecvecMinSctHitsPlusDeadAboveEtaPt[i_size].
size()) {
862 ATH_MSG_ERROR(
"Pt cutoffs and SctHitsPlusDead cuts must be vectors of the same length." );
863 return StatusCode::FAILURE;
867 std::stringstream pTRangeBuffer;
868 std::copy(m_vecPtCutoffsForSctHitsPlusDeadCut.begin(), m_vecPtCutoffsForSctHitsPlusDeadCut.end(), std::ostream_iterator<double>(pTRangeBuffer,
", "));
869 std::string pTString=pTRangeBuffer.str();
870 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
"SctHitsPlusDead cuts (>=) for pT above "<<pTString.substr(0, pTString.size()-2)<<
"MeV, respectively:");
871 for (
size_t i_cut_eta=0; i_cut_eta<etaSize; ++i_cut_eta)
873 std::stringstream etaRangeBuffer;
874 etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHitsPlusDeadCut[i_cut_eta] <<
" < |#eta| < ";
875 if(i_cut_eta!=etaSize-1) etaRangeBuffer << std::setprecision(2) << std::fixed << m_vecEtaCutoffsForSctHitsPlusDeadCut[i_cut_eta+1];
876 else etaRangeBuffer << std::setprecision(2) << std::fixed <<m_maxAbsEta;
878 std::stringstream cutBuffer;
879 std::copy(m_vecvecMinSctHitsPlusDeadAboveEtaPt[i_cut_eta].
begin(), m_vecvecMinSctHitsPlusDeadAboveEtaPt[i_cut_eta].
end(), std::ostream_iterator<double>(cutBuffer,
", "));
880 std::string cutString=cutBuffer.str();
882 if constexpr(
VERBOSE>0)
ATH_MSG_INFO(
" for "<<etaRangeBuffer.str()<<
": "<<cutString.substr(0, cutString.size()-2));
885 if (!
checkOrder(m_vecEtaCutoffsForSctHitsPlusDeadCut.value())) {
887 return StatusCode::FAILURE;
889 if (!
checkOrder(m_vecPtCutoffsForSctHitsPlusDeadCut.value())) {
891 return StatusCode::FAILURE;
894 trackCuts[
"SctHits"].push_back([p_vecEtaCutoffsForSctHitsPlusDeadCut = &std::as_const(m_vecEtaCutoffsForSctHitsPlusDeadCut.value()),
895 p_vecPtCutoffsForSctHitsPlusDeadCut = &std::as_const(m_vecPtCutoffsForSctHitsPlusDeadCut.value()),
896 p_vecvecMinSctHitsPlusDeadAboveEtaPt = &std::as_const(m_vecvecMinSctHitsPlusDeadAboveEtaPt.value())] (Trk_Helper helper,
const asg::AsgMessaging &msgHelper) {
897 double eta = helper.eta(msgHelper);
898 unsigned int bin_eta = findBin(*p_vecEtaCutoffsForSctHitsPlusDeadCut, std::fabs(eta));
899 double pt = helper.pt(msgHelper);
900 unsigned int bin_pt = findBin(*p_vecPtCutoffsForSctHitsPlusDeadCut, pt);
901 return bin_eta >= p_vecEtaCutoffsForSctHitsPlusDeadCut->size()
902 || bin_pt >= p_vecPtCutoffsForSctHitsPlusDeadCut->size()
903 || getSummarySum<2,Trk_Helper>(helper, msgHelper, {xAOD::numberOfSCTHits, xAOD::numberOfSCTDeadSensors}) >= (*p_vecvecMinSctHitsPlusDeadAboveEtaPt)[bin_eta][bin_pt];
907 return StatusCode::SUCCESS;
1169 case CutLevel::NoCut :
1173 ATH_MSG_WARNING(
"Trying to set cut level while the tool is already initialized." );
1174 ATH_MSG_WARNING(
"This will almost certainly not exhibit intended behavior." );
1233#ifndef XAOD_ANALYSIS
1258 case CutLevel::Loose :
1267 case CutLevel::LoosePrimary :
1276 case CutLevel::TightPrimary :
1287 case CutLevel::LooseMuon :
1297 case CutLevel::LooseElectron :
1302 case CutLevel::LooseTau :
1310 case CutLevel::MinBias :
1324 case CutLevel::HILoose:
1338 case CutLevel::HITight:
1354 case CutLevel::HILooseOptimized:
1364 std::vector<double>({500, 600, 700, 800, 900, 1000, 1500,
1365 2000, 2500, 3000, 5000, 8000, 12000});
1367 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},
1368 {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},
1369 {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},
1370 {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}});
1377 std::vector<double>({500, 600, 700, 800, 900, 1000, 1500,
1378 2000, 2500, 3000, 5000, 8000, 12000});
1380 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},
1381 {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},
1382 {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},
1383 {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}});
1386 case CutLevel::HITightOptimized:
1396 2000, 2500, 3000, 5000, 8000, 12000});
1398 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},
1399 {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},
1400 {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},
1401 {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}});
1408 2000, 2500, 3000, 5000, 8000, 12000});
1410 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},
1411 {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},
1412 {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},
1413 {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}});
1420 2000, 2500, 3000, 5000, 8000, 12000});
1422 std::vector<std::vector<double>>({{0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1},
1423 {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
1424 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
1425 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}});
1432 2000, 2500, 3000, 5000, 8000, 12000});
1434 std::vector<std::vector<double>>({{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1435 {0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0},
1436 {8, 8, 8, 7, 7, 6, 6, 6, 6, 6, 0, 0, 0},
1437 {7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}});
1441 ATH_MSG_ERROR(
"CutLevel not recognized. Cut selection will remain unchanged.");