diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx index f35203989a2987f350f79388c395e651c60d7805..a63d5a2fac2d953ca634cad0dab131e4cf35da63 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx @@ -40,7 +40,7 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* i double bw_ftf[3]={0.,0.,0.}; // intercept of FTF Road for Inner/Middle/Outer // Inner - auto extFtfInner = extTrack( idtrack, 5000., 6000., muonRoad.ext_ftf_flag[0][0]); //Large secotr + auto extFtfInner = extTrack( idtrack, 4700., 7500., muonRoad.ext_ftf_flag[0][0]); if( !extFtfInner ) { ATH_MSG_DEBUG("extrapolated track parameters on BarrelInner is null"); } else { @@ -56,7 +56,7 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* i } // Middle - auto extFtfMiddle = extTrack( idtrack , 8000., 9000., muonRoad.ext_ftf_flag[1][0]); + auto extFtfMiddle = extTrack( idtrack , 7300., 14000., muonRoad.ext_ftf_flag[1][0]); if( !extFtfMiddle ) { ATH_MSG_DEBUG("extrapolated track parameters on BarrelMiddle is null"); } else { @@ -72,7 +72,7 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* i } // Outer - auto extFtfOuter = extTrack( idtrack , 10000., 12500., muonRoad.ext_ftf_flag[2][0]); + auto extFtfOuter = extTrack( idtrack , 9800., 21500., muonRoad.ext_ftf_flag[2][0]); if( !extFtfOuter ) { ATH_MSG_DEBUG("extrapolated track parameters on BarrelOuter is null"); } else { diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx index 387117905730271f42f5c6a4659a474f533c837c..510d0da21e53aad66b828382392145d3be911d34 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx @@ -1830,34 +1830,38 @@ bool MuFastSteering::storeMSRoiDescriptor(const TrigRoiDescriptor* const xAOD::L2StandAloneMuon* muonSA = outputTracks[0]; - // store TrigRoiDescriptor - if (fabs(muonSA->pt()) > ZERO_LIMIT ) { - - // set width of 0.1 so that ID tracking monitoring works - const float phiHalfWidth = 0.1; - const float etaHalfWidth = 0.1; - - TrigRoiDescriptor* MSroiDescriptor = new TrigRoiDescriptor(roids->roiWord(), - roids->l1Id(), - roids->roiId(), - pattern.etaMap, - pattern.etaMap - etaHalfWidth, - pattern.etaMap + etaHalfWidth, - pattern.phiMS, - pattern.phiMS - phiHalfWidth, - pattern.phiMS + phiHalfWidth); + float mseta = pattern.etaMap; + float msphi = pattern.phiMS; - ATH_MSG_VERBOSE("...TrigRoiDescriptor for MS " - << "pattern.etaMap/pattern.phiMS=" - << pattern.etaMap << "/" << pattern.phiMS); - - ATH_MSG_VERBOSE("will Record an RoiDescriptor for TrigMoore:" - << " phi=" << MSroiDescriptor->phi() - << ", eta=" << MSroiDescriptor->eta()); - - outputMS.push_back(MSroiDescriptor); - - } + // store TrigRoiDescriptor + if (fabs(muonSA->pt()) < ZERO_LIMIT ) { + mseta = roids->eta(); + msphi = roids->phi(); + } + + // set width of 0.1 so that ID tracking monitoring works + const float phiHalfWidth = 0.1; + const float etaHalfWidth = 0.1; + + TrigRoiDescriptor* MSroiDescriptor = new TrigRoiDescriptor(roids->roiWord(), + roids->l1Id(), + roids->roiId(), + mseta, + mseta - etaHalfWidth, + mseta + etaHalfWidth, + msphi, + msphi - phiHalfWidth, + msphi + phiHalfWidth); + + ATH_MSG_VERBOSE("...TrigRoiDescriptor for MS " + << "mseta/msphi=" + << mseta << "/" << msphi); + + ATH_MSG_VERBOSE("will Record an RoiDescriptor for TrigMoore:" + << " phi=" << MSroiDescriptor->phi() + << ", eta=" << MSroiDescriptor->eta()); + + outputMS.push_back(MSroiDescriptor); return true; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx index a788e0f2d403e2a68bb0940a0fb4207768613d42..8393b03f6df06ba5cd77a43fb82fbd9c18e59d44 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx @@ -123,13 +123,13 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* else if (i_station==5) muonRoad.rWidth[10][i_layer] = 650;//BMG else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed; } else { - if (i_station==0) muonRoad.rWidth[i_station][i_layer] = 400;//for inner - else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 200;//for middle - else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 400;//for outer - else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 400;//EndcapInner - else if (i_station==4) muonRoad.rWidth[9][i_layer] = m_rWidth_RPC_Failed;//BME - else if (i_station==5) muonRoad.rWidth[10][i_layer] = m_rWidth_RPC_Failed;//BMG - else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed; + if (i_station==0) muonRoad.rWidth[i_station][i_layer] = 250;//for inner + else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 400;//for middle + else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 600;//for outer + else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 300;//EndcapInner + else if (i_station==4) muonRoad.rWidth[9][i_layer] = 400;//BME + else if (i_station==5) muonRoad.rWidth[10][i_layer] = 400;//BMG + else muonRoad.rWidth[i_station][i_layer] = 400; } } else { diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx index f9b9fd27d446b74327c9db96d7b37a567e91fb95..fff0da1c403fe8e6d72b1f1f0a398728191b6654 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx @@ -267,6 +267,7 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* } else { // If no TGC hit are available, estimate the road from RoI + // or if inside-out mode, width is tuned based on FTF track extrapolation resolution ATH_MSG_DEBUG("Because no TGC hits are available, estimate the road from RoI"); roiEta = p_roi->eta(); @@ -288,13 +289,23 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* muonRoad.aw[csc][0] = aw; muonRoad.bw[csc][0] = 0; for (int i_layer=0; i_layer<N_LAYER; i_layer++) { - muonRoad.rWidth[endcap_inner][i_layer] = m_rWidth_TGC_Failed; - muonRoad.rWidth[endcap_middle][i_layer] = m_rWidth_TGC_Failed; - muonRoad.rWidth[endcap_outer][i_layer] = m_rWidth_TGC_Failed; - muonRoad.rWidth[endcap_extra][i_layer] = m_rWidth_TGC_Failed; - muonRoad.rWidth[barrel_inner][i_layer] = m_rWidth_TGC_Failed; - muonRoad.rWidth[bee][i_layer] = m_rWidth_TGC_Failed; - muonRoad.rWidth[csc][i_layer] = m_rWidth_TGC_Failed; + if(insideOut) { + muonRoad.rWidth[endcap_inner][i_layer] = 300; + muonRoad.rWidth[endcap_middle][i_layer] = 400; + muonRoad.rWidth[endcap_outer][i_layer] = 600; + muonRoad.rWidth[endcap_extra][i_layer] = 400; + muonRoad.rWidth[barrel_inner][i_layer] = 250; + muonRoad.rWidth[bee][i_layer] = 500; + muonRoad.rWidth[csc][i_layer] = 200; + } else { + muonRoad.rWidth[endcap_inner][i_layer] = m_rWidth_TGC_Failed; + muonRoad.rWidth[endcap_middle][i_layer] = m_rWidth_TGC_Failed; + muonRoad.rWidth[endcap_outer][i_layer] = m_rWidth_TGC_Failed; + muonRoad.rWidth[endcap_extra][i_layer] = m_rWidth_TGC_Failed; + muonRoad.rWidth[barrel_inner][i_layer] = m_rWidth_TGC_Failed; + muonRoad.rWidth[bee][i_layer] = m_rWidth_TGC_Failed; + muonRoad.rWidth[csc][i_layer] = m_rWidth_TGC_Failed; + } } } diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoTool.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoTool.cxx index 78c4ede0260031c7e3075f2d7a412f8f1547ef77..7202dcaef3091ae9f1e6d2386e5be6065668b306 100644 --- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigmuCombHypoTool.cxx @@ -638,6 +638,7 @@ double TrigmuCombHypoTool::invMass(double m1, double pt1, double eta1, double ph StatusCode TrigmuCombHypoTool::chooseBestMuon(std::vector<TrigmuCombHypoTool::CombinedMuonInfo*>& input, std::vector<unsigned int> mucombResult) const { + const double ZERO_LIMIT = 1e-4; size_t numMuon = input.size(); unsigned int i,j,k; @@ -669,15 +670,41 @@ StatusCode TrigmuCombHypoTool::chooseBestMuon(std::vector<TrigmuCombHypoTool::Co ATH_MSG_DEBUG( " overlapped objects among: " << others ); unsigned int best_ev = 0; float maxPtCombMf = 0; + float mindRRoadRoI = 999; for(k=0; k<others.size(); k++) { j=others[k]; float ptCombMf = 0.; const xAOD::L2CombinedMuon* combMf = (*input[j]).muComb; ptCombMf = fabs(combMf->pt()/Gaudi::Units::GeV); - ATH_MSG_DEBUG(" j="<< j << " , ptCombMf=" << ptCombMf); - if( ptCombMf > maxPtCombMf ) { + + const xAOD::L2StandAloneMuon* mf = (*input[j]).muComb->muSATrack(); + const float roadPhiP = atan2(mf->dirPhiMS(),1.); + const float roadPhiM = atan2(-1*mf->dirPhiMS(),-1.); + const float roadPhi = (std::abs(CxxUtils::deltaPhi(roadPhiP, mf->roiPhi())) < std::abs(CxxUtils::deltaPhi(roadPhiM, mf->roiPhi())))? roadPhiP : roadPhiM; + float roadAw = 0; + if(std::abs(mf->roiEta()) < 1.05) { // barrel + if( std::abs(mf->roadAw(1,0)) > ZERO_LIMIT ) roadAw = mf->roadAw(1,0); + else if( std::abs(mf->roadAw(2,0)) > ZERO_LIMIT ) roadAw = mf->roadAw(2,0); + else if( std::abs(mf->roadAw(0,0)) > ZERO_LIMIT ) roadAw = mf->roadAw(0,0); + } + else { // endcap + if( std::abs(mf->roadAw(4,0)) > ZERO_LIMIT ) roadAw = mf->roadAw(4,0); + else if( std::abs(mf->roadAw(5,0)) > ZERO_LIMIT ) roadAw = mf->roadAw(5,0); + else if( std::abs(mf->roadAw(3,0)) > ZERO_LIMIT ) roadAw = mf->roadAw(3,0); + } + float roadEta = 999; + if(std::abs(roadAw) > ZERO_LIMIT) + roadEta = -std::log(std::tan(0.5*std::atan(std::abs(roadAw)))); + if(roadAw < 0) roadEta *= -1.; + const double dRRoadRoI = dR(roadEta, roadPhi, mf->roiEta(), mf->roiPhi()); + ATH_MSG_DEBUG(" j="<< j << " , ptCombMf=" << ptCombMf << ", dRRoadRoI=" << dRRoadRoI); + + if( (ptCombMf > maxPtCombMf) || + (std::abs(ptCombMf - maxPtCombMf) < ZERO_LIMIT && + dRRoadRoI < mindRRoadRoI) ) { maxPtCombMf = ptCombMf; + mindRRoadRoI = dRRoadRoI; best_ev = j; } } diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref index a2f3b02ea3aa722dcaae69b7a8c7c389cbbba707..187c2476c4c061c8b5ea73f6fb2104298bf4ba9b 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref @@ -2597,7 +2597,7 @@ HLT_mu4_l2io_L1MU4: 3: 11 stepFeatures: 0: 14 - 1: 29 + 1: 30 2: 15 3: 15 HLT_mu50_L1MU20: