16 #include "GaudiKernel/IIncidentSvc.h"
117 if (
m_jobOptionsSvc->has(
"MuonHltCalibrationConfig.MuonCalBufferName")) {
122 ATH_MSG_DEBUG(
"Could not parse MuonHltCalibrationConfig.MuonCalBufferName from JobOptionsSvc");
124 if (
m_jobOptionsSvc->has(
"MuonHltCalibrationConfig.MuonCalBufferSize")) {
130 ATH_MSG_DEBUG(
"Could not parse MuonHltCalibrationConfig.MuonCalBufferSize from JobOptionsSvc");
147 return StatusCode::SUCCESS;
156 if (
sc != StatusCode::SUCCESS ) {
163 return StatusCode::SUCCESS;
180 ATH_MSG_DEBUG(
"=================================================");
207 for (
auto recRoI: collection ) {
208 if ( recRoI->roiWord() ==
roiWord ){
221 for (
auto recRoI: collection ) {
222 if ( recRoI->roiWord() ==
roiWord ){
240 if (!roiCollectionHandle.isValid()){
242 return StatusCode::FAILURE;
249 if (!recRoiCollectionHandle.isValid()){
251 return StatusCode::FAILURE;
254 std::vector< const TrigRoiDescriptor* > internalRoI;
258 for(; p_roids != p_roidsEn; ++p_roids ) {
259 internalRoI.push_back(*p_roids);
260 ATH_MSG_DEBUG(
"REGTEST: " <<
m_roiCollectionKey.
key() <<
" eta = " <<
"(" << (*p_roids)->etaMinus() <<
")" << (*p_roids)->eta() <<
"(" << (*p_roids)->etaPlus() <<
")");
261 ATH_MSG_DEBUG(
"REGTEST: " <<
m_roiCollectionKey.
key() <<
" phi = " <<
"(" << (*p_roids)->phiMinus() <<
")" << (*p_roids)->phi() <<
"(" << (*p_roids)->phiPlus() <<
")");
262 ATH_MSG_DEBUG(
"REGTEST: " <<
m_roiCollectionKey.
key() <<
" zed = " <<
"(" << (*p_roids)->zedMinus() <<
")" << (*p_roids)->zed() <<
"(" << (*p_roids)->zedPlus() <<
")");
267 std::vector< const xAOD::MuonRoI* > recRoIVector;
268 std::vector< const xAOD::MuonRoI* > surrRoIs;
272 if( recRoI ==
nullptr )
continue;
273 recRoIVector.push_back(recRoI);
278 bool dynamicDeltaRpc =
false;
279 int nPassedBarrelSurrRoi = 0;
281 for(
const auto recRoI: *recRoiCollection ){
282 if(
std::find(recRoIVector.begin(), recRoIVector.end(), recRoI) != recRoIVector.end())
continue;
284 bool surrounding =
false;
285 for(
const auto matchedRoI: recRoIVector ){
286 float deta = std::abs(recRoI->eta() - matchedRoI->eta());
287 float dphi = std::abs(recRoI->phi() - matchedRoI->phi());
288 if( dphi >
M_PI )dphi = 2.*
M_PI - dphi;
294 surrRoIs.push_back(recRoI);
298 for(
const auto recRoI: surrRoIs ){
300 if( std::abs((recRoI)->
eta()) <= 1.05 && (recRoI)->getThrNumber() >= 1 )nPassedBarrelSurrRoi++;
302 ATH_MSG_DEBUG(
"nPassedBarrelSurrRoi = " << nPassedBarrelSurrRoi);
304 if( nPassedBarrelSurrRoi >= 1 )
305 dynamicDeltaRpc =
true;
310 ATH_CHECK(muFastContainer.record(std::make_unique<xAOD::L2StandAloneMuonContainer>(), std::make_unique<xAOD::L2StandAloneMuonAuxContainer>()));
313 ATH_CHECK(muCompositeContainer.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()));
316 ATH_CHECK(muIdContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
319 ATH_CHECK(muMsContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
327 ATH_CHECK( muonCBColl.record (std::make_unique<xAOD::L2CombinedMuonContainer>(),
328 std::make_unique<xAOD::L2CombinedMuonAuxContainer>()) );
331 if (!trackHandle.isValid()){
333 return StatusCode::FAILURE;
338 *muonCBColl, *muFastContainer, dynamicDeltaRpc, ctx ));
342 for (
const auto p_CBmuon : *muonCBColl){
356 *muFastContainer, *muIdContainer, *muMsContainer, dynamicDeltaRpc, ctx));
364 for (
auto p_muon : *muFastContainer) {
370 for (
auto p_muonID : *muIdContainer) {
375 for (
auto p_muonMS : *muMsContainer) {
385 if (!recRoiCollectionHandle.isValid()){
387 return StatusCode::FAILURE;
390 std::vector< const TrigRoiDescriptor* > internalRoI;
394 for(; p_roids != p_roidsEn; ++p_roids ) {
395 internalRoI.push_back(*p_roids);
396 ATH_MSG_DEBUG(
"REGTEST: " <<
m_roiCollectionKey.
key() <<
" eta = " <<
"(" << (*p_roids)->etaMinus() <<
")" << (*p_roids)->eta() <<
"(" << (*p_roids)->etaPlus() <<
")");
397 ATH_MSG_DEBUG(
"REGTEST: " <<
m_roiCollectionKey.
key() <<
" phi = " <<
"(" << (*p_roids)->phiMinus() <<
")" << (*p_roids)->phi() <<
"(" << (*p_roids)->phiPlus() <<
")");
398 ATH_MSG_DEBUG(
"REGTEST: " <<
m_roiCollectionKey.
key() <<
" zed = " <<
"(" << (*p_roids)->zedMinus() <<
")" << (*p_roids)->zed() <<
"(" << (*p_roids)->zedPlus() <<
")");
403 std::vector< const LVL1::RecMuonRoI* > recRoIVector;
404 std::vector< const LVL1::RecMuonRoI* > surrRoIs;
408 if( recRoI ==
nullptr )
continue;
409 recRoIVector.push_back(recRoI);
414 bool dynamicDeltaRpc =
false;
415 int nPassedBarrelSurrRoi = 0;
417 for(
const auto recRoI: *recRoiCollection ){
418 if(
std::find(recRoIVector.begin(), recRoIVector.end(), recRoI) != recRoIVector.end())
continue;
420 bool surrounding =
false;
421 for(
const auto matchedRoI: recRoIVector ){
422 float deta = std::abs(recRoI->eta() - matchedRoI->eta());
423 float dphi = std::abs(recRoI->phi() - matchedRoI->phi());
424 if( dphi >
M_PI )dphi = 2.*
M_PI - dphi;
430 surrRoIs.push_back(recRoI);
434 for(
const auto recRoI: surrRoIs ){
436 if( std::abs((recRoI)->
eta()) <= 1.05 && (recRoI)->getThresholdNumber() >= 1 )nPassedBarrelSurrRoi++;
438 ATH_MSG_DEBUG(
"nPassedBarrelSurrRoi = " << nPassedBarrelSurrRoi);
440 if( nPassedBarrelSurrRoi >= 1 )
441 dynamicDeltaRpc =
true;
446 ATH_CHECK(muFastContainer.record(std::make_unique<xAOD::L2StandAloneMuonContainer>(), std::make_unique<xAOD::L2StandAloneMuonAuxContainer>()));
449 ATH_CHECK(muCompositeContainer.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()));
452 ATH_CHECK(muIdContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
455 ATH_CHECK(muMsContainer.record(std::make_unique<TrigRoiDescriptorCollection>()));
463 ATH_CHECK( muonCBColl.record (std::make_unique<xAOD::L2CombinedMuonContainer>(),
464 std::make_unique<xAOD::L2CombinedMuonAuxContainer>()) );
467 if (!trackHandle.isValid()){
469 return StatusCode::FAILURE;
474 *muonCBColl, *muFastContainer, dynamicDeltaRpc, ctx ));
478 for (
const auto p_CBmuon : *muonCBColl){
492 *muFastContainer, *muIdContainer, *muMsContainer, dynamicDeltaRpc, ctx));
500 for (
auto p_muon : *muFastContainer) {
506 for (
auto p_muonID : *muIdContainer) {
511 for (
auto p_muonMS : *muMsContainer) {
518 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::execute() success");
519 return StatusCode::SUCCESS;
526 const std::vector<const LVL1::RecMuonRoI*>& muonRoIs,
530 const bool dynamicDeltaRpc,
531 const EventContext& ctx)
const
533 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignature start");
544 trackFitterTimer, trackExtraTimer, calibrationTimer );
562 p_roids = roids.begin();
563 for (p_roi=(muonRoIs).
begin(); p_roi!=(muonRoIs).
end(); ++p_roi) {
566 std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
571 rpcFitResult.
Clear();
572 tgcFitResult.
Clear();
573 mdtHits_normal.clear();
574 mdtHits_overlap.clear();
597 if (!
sc.isSuccess()) {
600 trackPatterns.push_back(trackPattern);
603 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
605 trackPatterns, outputTracks, outputID, outputMS, ctx);
611 patternTimer.start();
615 if (!
sc.isSuccess()) {
619 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
621 trackPatterns, outputTracks, outputID, outputMS, ctx);
627 stationFitterTimer.start();
632 if (!
sc.isSuccess()) {
636 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
638 trackPatterns, outputTracks, outputID, outputMS, ctx);
641 stationFitterTimer.stop();
644 trackFitterTimer.start();
649 if (!
sc.isSuccess()) {
653 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
655 trackPatterns, outputTracks, outputID, outputMS, ctx);
658 trackFitterTimer.stop();
677 if (!
sc.isSuccess()) {
680 trackPatterns.push_back(trackPattern);
683 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
685 trackPatterns, outputTracks, outputID, outputMS, ctx);
691 patternTimer.start();
700 if (!
sc.isSuccess()) {
704 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
706 trackPatterns, outputTracks, outputID, outputMS, ctx);
712 stationFitterTimer.start();
729 m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
731 if (!
sc.isSuccess()) {
735 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
737 trackPatterns, outputTracks, outputID, outputMS, ctx);
741 stationFitterTimer.stop();
744 trackFitterTimer.start();
750 if (!
sc.isSuccess()) {
754 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
756 trackPatterns, outputTracks, outputID, outputMS, ctx);
759 trackFitterTimer.stop();
763 const float ETA_LIMIT = 2.8;
764 const float DELTA_ETA_LIMIT = 1.0;
767 float roiEta = (*p_roi)->eta();
769 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
775 trackExtraTimer.start();
779 if (
sc != StatusCode::SUCCESS) {
783 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
785 trackPatterns, outputTracks, outputID, outputMS, ctx);
788 trackExtraTimer.stop();
792 if (
sc != StatusCode::SUCCESS) {
796 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
798 trackPatterns, outputTracks, outputID, outputMS, ctx);
804 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
806 trackPatterns, outputTracks, outputID, outputMS, ctx);
810 if (p_roids==roids.end())
break;
813 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignature success");
814 return StatusCode::SUCCESS;
821 const std::vector<const xAOD::MuonRoI*>& muonRoIs,
825 const bool dynamicDeltaRpc,
826 const EventContext& ctx)
const
828 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignature start");
839 trackFitterTimer, trackExtraTimer, calibrationTimer );
857 p_roids = roids.begin();
858 for (p_roi=(muonRoIs).
begin(); p_roi!=(muonRoIs).
end(); ++p_roi) {
861 std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
866 rpcFitResult.
Clear();
867 tgcFitResult.
Clear();
868 mdtHits_normal.clear();
869 mdtHits_overlap.clear();
892 if (!
sc.isSuccess()) {
895 trackPatterns.push_back(trackPattern);
898 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
900 trackPatterns, outputTracks, outputID, outputMS, ctx);
906 patternTimer.start();
910 if (!
sc.isSuccess()) {
914 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
916 trackPatterns, outputTracks, outputID, outputMS, ctx);
922 stationFitterTimer.start();
927 if (!
sc.isSuccess()) {
931 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
933 trackPatterns, outputTracks, outputID, outputMS, ctx);
936 stationFitterTimer.stop();
939 trackFitterTimer.start();
944 if (!
sc.isSuccess()) {
948 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
950 trackPatterns, outputTracks, outputID, outputMS, ctx);
953 trackFitterTimer.stop();
972 if (!
sc.isSuccess()) {
975 trackPatterns.push_back(trackPattern);
978 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
980 trackPatterns, outputTracks, outputID, outputMS, ctx);
986 patternTimer.start();
995 if (!
sc.isSuccess()) {
999 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1001 trackPatterns, outputTracks, outputID, outputMS, ctx);
1004 patternTimer.stop();
1007 stationFitterTimer.start();
1024 m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
1026 if (!
sc.isSuccess()) {
1030 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1032 trackPatterns, outputTracks, outputID, outputMS, ctx);
1036 stationFitterTimer.stop();
1039 trackFitterTimer.start();
1045 if (!
sc.isSuccess()) {
1049 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1051 trackPatterns, outputTracks, outputID, outputMS, ctx);
1054 trackFitterTimer.stop();
1058 const float ETA_LIMIT = 2.8;
1059 const float DELTA_ETA_LIMIT = 1.0;
1062 float roiEta = (*p_roi)->eta();
1064 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
1070 trackExtraTimer.start();
1074 if (
sc != StatusCode::SUCCESS) {
1078 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1080 trackPatterns, outputTracks, outputID, outputMS, ctx);
1083 trackExtraTimer.stop();
1087 if (
sc != StatusCode::SUCCESS) {
1091 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1093 trackPatterns, outputTracks, outputID, outputMS, ctx);
1099 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1101 trackPatterns, outputTracks, outputID, outputMS, ctx);
1109 bool updateTriggerElement =
false;
1117 updateTriggerElement,ctx);
1118 if (
sc != StatusCode::SUCCESS ) {
1126 if (p_roids==roids.end())
break;
1129 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignature success");
1130 return StatusCode::SUCCESS;
1139 const std::vector<const TrigRoiDescriptor*>& roids,
1140 const std::vector<const LVL1::RecMuonRoI*>& muonRoIs,
1143 const bool dynamicDeltaRpc,
1144 const EventContext& ctx)
const
1146 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignatureIO start");
1158 trackFitterTimer, trackExtraTimer, calibrationTimer );
1174 p_roids = roids.begin();
1175 for (
const auto p_roi : muonRoIs) {
1176 ATH_MSG_DEBUG(
"roi eta/phi: " << (*p_roi).eta() <<
"/" << (*p_roi).phi());
1179 if ( (idtracks).
empty() )
ATH_MSG_DEBUG(
"IO TEST: xAOD::TrackParticleContainer has 0 tracks --> Can not use FTF tracks...");
1180 else ATH_MSG_DEBUG(
"IO TEST: xAOD::TrackParticleContainer has " << (idtracks).
size() <<
" tracks --> Start inside-out mode!");
1182 std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
1183 int idtrack_idx = -1;
1184 for (
auto idtrack : idtracks) {
1200 rpcFitResult.
Clear();
1201 tgcFitResult.
Clear();
1202 mdtHits_normal.clear();
1203 mdtHits_overlap.clear();
1207 trackPatterns.clear();
1210 if (!
sc.isSuccess()) {
1217 if ( std::abs(idtrack->eta()) < 1.05 ){
1218 ATH_MSG_DEBUG(
"FTF track at IP is in Barrel: " << idtrack->eta());
1220 ATH_MSG_DEBUG(
"FTF track at IP is in Endcap: " << idtrack->eta());
1243 if (!
sc.isSuccess()) {
1252 patternTimer.start();
1256 if (!
sc.isSuccess()) {
1260 patternTimer.stop();
1263 stationFitterTimer.start();
1268 if (!
sc.isSuccess()) {
1272 stationFitterTimer.stop();
1275 trackFitterTimer.start();
1279 if (!
sc.isSuccess()) {
1283 trackFitterTimer.stop();
1303 if (!
sc.isSuccess()) {
1312 patternTimer.start();
1318 if (!
sc.isSuccess()) {
1322 patternTimer.stop();
1325 stationFitterTimer.start();
1333 m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
1334 if (!
sc.isSuccess()) {
1338 stationFitterTimer.stop();
1341 trackFitterTimer.start();
1346 if (!
sc.isSuccess()) {
1350 trackFitterTimer.stop();
1356 const float ETA_LIMIT = 2.8;
1357 const float DELTA_ETA_LIMIT = 1.0;
1358 float roiEta = (*p_roi).eta();
1360 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
1361 trackPatterns.back().etaMap =
roiEta;
1366 if (
sc != StatusCode::SUCCESS) {
1371 if ( std::abs(trackPatterns.back().pt) >
ZERO_LIMIT ) {
1372 storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1373 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1375 trackPatterns.back(), outputSAs, ctx);
1380 muonCB->
setPt(idtrack->pt());
1381 muonCB->
setEta(idtrack->eta());
1382 muonCB->
setPhi(idtrack->phi());
1393 if(outputSAs.
size()==0) {
1399 rpcFitResult.
Clear();
1400 tgcFitResult.
Clear();
1401 mdtHits_normal.clear();
1405 trackPatterns.clear();
1407 storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1408 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1410 trackPattern, outputSAs, ctx);
1427 for (
auto outputSA : outputSAs){
1428 ATH_MSG_DEBUG(
"outputSA pt/eta/phi: " << outputSA->pt() <<
"/" << outputSA->etaMS() <<
"/" << outputSA->phiMS());
1432 for (
auto outputCB : outputCBs){
1433 ATH_MSG_DEBUG(
"outputCB pt/eta/phi: " << outputCB->pt() <<
"/" << outputCB->eta() <<
"/" << outputCB->phi());
1438 if (p_roids==roids.end())
break;
1441 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignatureIO success");
1442 return StatusCode::SUCCESS;
1451 const std::vector<const TrigRoiDescriptor*>& roids,
1452 const std::vector<const xAOD::MuonRoI*>& muonRoIs,
1455 const bool dynamicDeltaRpc,
1456 const EventContext& ctx)
const
1458 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignatureIO start");
1470 trackFitterTimer, trackExtraTimer, calibrationTimer );
1486 p_roids = roids.begin();
1487 for (
const auto p_roi : muonRoIs) {
1488 ATH_MSG_DEBUG(
"roi eta/phi: " << (*p_roi).eta() <<
"/" << (*p_roi).phi());
1491 if ( (idtracks).
empty() )
ATH_MSG_DEBUG(
"IO TEST: xAOD::TrackParticleContainer has 0 tracks --> Can not use FTF tracks...");
1492 else ATH_MSG_DEBUG(
"IO TEST: xAOD::TrackParticleContainer has " << (idtracks).
size() <<
" tracks --> Start inside-out mode!");
1494 std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
1495 int idtrack_idx = -1;
1496 for (
auto idtrack : idtracks) {
1512 rpcFitResult.
Clear();
1513 tgcFitResult.
Clear();
1514 mdtHits_normal.clear();
1515 mdtHits_overlap.clear();
1519 trackPatterns.clear();
1522 if (!
sc.isSuccess()) {
1529 if ( std::abs(idtrack->eta()) < 1.05 ){
1530 ATH_MSG_DEBUG(
"FTF track at IP is in Barrel: " << idtrack->eta());
1532 ATH_MSG_DEBUG(
"FTF track at IP is in Endcap: " << idtrack->eta());
1555 if (!
sc.isSuccess()) {
1564 patternTimer.start();
1568 if (!
sc.isSuccess()) {
1572 patternTimer.stop();
1575 stationFitterTimer.start();
1580 if (!
sc.isSuccess()) {
1584 stationFitterTimer.stop();
1587 trackFitterTimer.start();
1591 if (!
sc.isSuccess()) {
1595 trackFitterTimer.stop();
1615 if (!
sc.isSuccess()) {
1624 patternTimer.start();
1630 if (!
sc.isSuccess()) {
1634 patternTimer.stop();
1637 stationFitterTimer.start();
1645 m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
1646 if (!
sc.isSuccess()) {
1650 stationFitterTimer.stop();
1653 trackFitterTimer.start();
1658 if (!
sc.isSuccess()) {
1662 trackFitterTimer.stop();
1668 const float ETA_LIMIT = 2.8;
1669 const float DELTA_ETA_LIMIT = 1.0;
1670 float roiEta = (*p_roi).eta();
1672 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
1673 trackPatterns.back().etaMap =
roiEta;
1678 if (
sc != StatusCode::SUCCESS) {
1683 if ( std::abs(trackPatterns.back().pt) >
ZERO_LIMIT ) {
1684 storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1685 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1687 trackPatterns.back(), outputSAs, ctx);
1692 muonCB->
setPt(idtrack->pt());
1693 muonCB->
setEta(idtrack->eta());
1694 muonCB->
setPhi(idtrack->phi());
1705 if(outputSAs.
size()==0) {
1711 rpcFitResult.
Clear();
1712 tgcFitResult.
Clear();
1713 mdtHits_normal.clear();
1717 trackPatterns.clear();
1719 storeMuonSA(p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1720 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1722 trackPattern, outputSAs, ctx);
1738 for (
auto outputSA : outputSAs){
1739 ATH_MSG_DEBUG(
"outputSA pt/eta/phi: " << outputSA->pt() <<
"/" << outputSA->etaMS() <<
"/" << outputSA->phiMS());
1743 for (
auto outputCB : outputCBs){
1744 ATH_MSG_DEBUG(
"outputCB pt/eta/phi: " << outputCB->pt() <<
"/" << outputCB->eta() <<
"/" << outputCB->phi());
1748 if (p_roids==roids.end())
break;
1751 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMuonSignatureIO success");
1752 return StatusCode::SUCCESS;
1760 const std::vector<const LVL1::RecMuonRoI*>& muonRoIs,
1762 const bool dynamicDeltaRpc,
1763 const EventContext& ctx)
const
1765 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMultiTrackSignature start");
1770 std::vector<TrigL2MuonSA::RpcFitResult> clusterFitResults;
1771 std::vector< TrigL2MuonSA::MuonRoad > clusterRoad;
1772 std::vector<TrigL2MuonSA::MdtHits> mdtHits_cluster_normal;
1783 trackFitterTimer, trackExtraTimer, calibrationTimer );
1801 p_roids = roids.begin();
1802 for (p_roi=(muonRoIs).
begin(); p_roi!=(muonRoIs).
end(); ++p_roi) {
1805 std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
1810 rpcFitResult.
Clear();
1811 tgcFitResult.
Clear();
1812 mdtHits_normal.clear();
1813 mdtHits_overlap.clear();
1818 clusterFitResults.clear();
1819 clusterRoad.clear();
1820 mdtHits_cluster_normal.clear();
1836 mdtHits_cluster_normal,
1839 if (!
sc.isSuccess()) {
1847 for(
unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
1849 std::vector<TrigL2MuonSA::TrackPattern> tmp_trkPats; tmp_trkPats.clear();
1851 patternTimer.start();
1853 mdtHits_cluster_normal.at(i_road),
1855 if (!
sc.isSuccess()) {
1859 patternTimer.stop();
1862 stationFitterTimer.start();
1864 clusterRoad.at(i_road),
1865 clusterFitResults.at(i_road),
1867 if (!
sc.isSuccess()) {
1872 stationFitterTimer.stop();
1875 trackFitterTimer.start();
1877 clusterFitResults.at(i_road),
1880 if (!
sc.isSuccess()) {
1884 trackFitterTimer.stop();
1887 const float ETA_LIMIT = 2.8;
1888 const float DELTA_ETA_LIMIT = 1.0;
1890 float roiEta = (*p_roi)->eta();
1892 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
1898 trackExtraTimer.start();
1903 if (
sc != StatusCode::SUCCESS) {
1908 trackExtraTimer.stop();
1910 if(tmp_trkPats.size() > 0){
1911 ATH_MSG_DEBUG(
"temp pT calculated 2mu-in-1RoI alg = " << tmp_trkPats[0].
pt <<
" GeV");
1912 if( (std::abs(tmp_trkPats[0].barrelSagitta) <
ZERO_LIMIT &&
1916 trackPatterns.push_back(tmp_trkPats[0]);
1919 storeMuonSA(*p_roi, *p_roids, clusterRoad.at(i_road), mdtRegion, rpcHits, tgcHits,
1920 clusterFitResults.at(i_road), tgcFitResult, mdtHits_cluster_normal.at(i_road), cscHits,
1921 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1924 if(trackPatterns.empty()){
1925 ATH_MSG_DEBUG(
"multi-track SA falied to reconstruct muons");
1927 trackPatterns.push_back(trackPattern);
1928 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1929 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1930 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1937 ATH_MSG_DEBUG(
"multi-track SA does nothings and skips for EndcapRoI");
1953 if (!
sc.isSuccess()) {
1956 trackPatterns.push_back(trackPattern);
1958 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1959 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1960 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1966 patternTimer.start();
1975 if (!
sc.isSuccess()) {
1978 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
1979 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
1980 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
1983 patternTimer.stop();
1986 stationFitterTimer.start();
2003 m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
2005 if (!
sc.isSuccess()) {
2007 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2008 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2009 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2013 stationFitterTimer.stop();
2016 trackFitterTimer.start();
2022 if (!
sc.isSuccess()) {
2024 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2025 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2026 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2029 trackFitterTimer.stop();
2032 const float ETA_LIMIT = 2.8;
2033 const float DELTA_ETA_LIMIT = 1.0;
2035 float roiEta = (*p_roi)->eta();
2037 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
2043 trackExtraTimer.start();
2047 if (
sc != StatusCode::SUCCESS) {
2049 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2050 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2051 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2054 trackExtraTimer.stop();
2056 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2057 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2058 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2063 if (
sc != StatusCode::SUCCESS) {
2068 if (p_roids==roids.end())
break;
2071 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMultiTrackSignature success");
2072 return StatusCode::SUCCESS;
2080 const std::vector<const xAOD::MuonRoI*>& muonRoIs,
2082 const bool dynamicDeltaRpc,
2083 const EventContext& ctx)
const
2085 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMultiTrackSignature start");
2090 std::vector<TrigL2MuonSA::RpcFitResult> clusterFitResults;
2091 std::vector< TrigL2MuonSA::MuonRoad > clusterRoad;
2092 std::vector<TrigL2MuonSA::MdtHits> mdtHits_cluster_normal;
2103 trackFitterTimer, trackExtraTimer, calibrationTimer );
2121 p_roids = roids.begin();
2122 for (p_roi=(muonRoIs).
begin(); p_roi!=(muonRoIs).
end(); ++p_roi) {
2125 std::vector<TrigL2MuonSA::TrackPattern> trackPatterns;
2130 rpcFitResult.
Clear();
2131 tgcFitResult.
Clear();
2132 mdtHits_normal.clear();
2133 mdtHits_overlap.clear();
2138 clusterFitResults.clear();
2139 clusterRoad.clear();
2140 mdtHits_cluster_normal.clear();
2156 mdtHits_cluster_normal,
2159 if (!
sc.isSuccess()) {
2167 for(
unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
2169 std::vector<TrigL2MuonSA::TrackPattern> tmp_trkPats; tmp_trkPats.clear();
2171 patternTimer.start();
2173 mdtHits_cluster_normal.at(i_road),
2175 if (!
sc.isSuccess()) {
2179 patternTimer.stop();
2182 stationFitterTimer.start();
2184 clusterRoad.at(i_road),
2185 clusterFitResults.at(i_road),
2187 if (!
sc.isSuccess()) {
2192 stationFitterTimer.stop();
2195 trackFitterTimer.start();
2197 clusterFitResults.at(i_road),
2200 if (!
sc.isSuccess()) {
2204 trackFitterTimer.stop();
2207 const float ETA_LIMIT = 2.8;
2208 const float DELTA_ETA_LIMIT = 1.0;
2210 float roiEta = (*p_roi)->eta();
2212 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
2218 trackExtraTimer.start();
2223 if (
sc != StatusCode::SUCCESS) {
2228 trackExtraTimer.stop();
2230 if(tmp_trkPats.size() > 0){
2231 ATH_MSG_DEBUG(
"temp pT calculated 2mu-in-1RoI alg = " << tmp_trkPats[0].
pt <<
" GeV");
2232 if( (std::abs(tmp_trkPats[0].barrelSagitta) <
ZERO_LIMIT &&
2236 trackPatterns.push_back(tmp_trkPats[0]);
2239 storeMuonSA(*p_roi, *p_roids, clusterRoad.at(i_road), mdtRegion, rpcHits, tgcHits,
2240 clusterFitResults.at(i_road), tgcFitResult, mdtHits_cluster_normal.at(i_road), cscHits,
2241 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2244 if(trackPatterns.empty()){
2245 ATH_MSG_DEBUG(
"multi-track SA falied to reconstruct muons");
2247 trackPatterns.push_back(trackPattern);
2248 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2249 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2250 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2257 ATH_MSG_DEBUG(
"multi-track SA does nothings and skips for EndcapRoI");
2273 if (!
sc.isSuccess()) {
2276 trackPatterns.push_back(trackPattern);
2278 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2279 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2280 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2286 patternTimer.start();
2295 if (!
sc.isSuccess()) {
2298 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2299 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2300 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2303 patternTimer.stop();
2306 stationFitterTimer.start();
2323 m_cscsegmaker->FindSuperPointCsc(cscHits,trackPatterns,tgcFitResult,muonRoad);
2325 if (!
sc.isSuccess()) {
2327 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2328 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2329 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2333 stationFitterTimer.stop();
2336 trackFitterTimer.start();
2342 if (!
sc.isSuccess()) {
2344 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2345 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2346 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2349 trackFitterTimer.stop();
2352 const float ETA_LIMIT = 2.8;
2353 const float DELTA_ETA_LIMIT = 1.0;
2355 float roiEta = (*p_roi)->eta();
2357 && ( std::abs(
track.etaMap) > ETA_LIMIT || std::abs(
track.etaMap-
roiEta) > DELTA_ETA_LIMIT ) ) {
2363 trackExtraTimer.start();
2367 if (
sc != StatusCode::SUCCESS) {
2369 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2370 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2371 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2374 trackExtraTimer.stop();
2376 storeMuonSA(*p_roi, *p_roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2377 rpcFitResult, tgcFitResult, mdtHits_normal, cscHits,
2378 stgcHits, mmHits, trackPatterns.back(), outputTracks, ctx);
2383 if (
sc != StatusCode::SUCCESS) {
2388 if (p_roids==roids.end())
break;
2391 ATH_MSG_DEBUG(
"StatusCode MuFastSteering::findMultiTrackSignature success");
2392 return StatusCode::SUCCESS;
2410 const std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns,
2414 const EventContext& ctx)
const
2417 if( trackPatterns.size() > 0 ) {
2422 storeMuonSA(roi, roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2423 rpcFitResult, tgcFitResult, mdtHits, cscHits,
2430 ATH_MSG_DEBUG(
"Not update output objects because trackPatterns has no object");
2451 const std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns,
2455 const EventContext& ctx)
const
2458 if( trackPatterns.size() > 0 ) {
2463 storeMuonSA(roi, roids, muonRoad, mdtRegion, rpcHits, tgcHits,
2464 rpcFitResult, tgcFitResult, mdtHits, cscHits,
2471 ATH_MSG_DEBUG(
"Not update output objects because trackPatterns has no object");
2492 const EventContext& ctx )
const
2496 const int currentRoIId = roids->
roiId();
2498 const EventIDBase& eventID = ctx.eventID();
2500 if (!eventInfo.isValid()) {
2510 int barrelinner = 0;
2511 int endcapinner = 3;
2532 ATH_MSG_DEBUG(
"### Hit patterns at the Muon Spectrometer ###");
2538 ATH_MSG_DEBUG(
"pattern#0: # of hits at endcap barrel inner =" <<
pattern.mdtSegments[barrelinner].size());
2542 ATH_MSG_DEBUG(
"pattern#0: # of hits at barrel endcap inner =" <<
pattern.mdtSegments[endcapinner].size());
2544 ATH_MSG_DEBUG(
"### ************************************* ###");
2600 pattern.superPoints[middle].Alin,
pattern.superPoints[middle].Blin,
pattern.superPoints[middle].Chi2);
2607 pattern.superPoints[barrelinner].Alin,
pattern.superPoints[barrelinner].Blin,
pattern.superPoints[barrelinner].Chi2);
2612 pattern.superPoints[endcapinner].Alin,
pattern.superPoints[endcapinner].Blin,
pattern.superPoints[endcapinner].Chi2);
2625 muonSA->
setLvl1Id( eventInfo->extendedLevel1ID() );
2658 std::vector<std::string> mdtId;
2660 if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
2661 muonSA->
setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
2662 mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
2663 mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
2664 mdtId.push_back(mdtHit.Id.getString());
2668 accessor_mdthitid( *muonSA ) = mdtId;
2671 std::vector<float> cscResol;
2674 if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
2675 muonSA->
setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
2676 cscHit.StationEta, cscHit.StationPhi,
2677 cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
2678 cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
2679 cscHit.charge, cscHit.time, cscHit.Residual);
2680 cscResol.push_back(cscHit.resolution);
2682 <<
"OL=" << cscHit.isOutlier <<
","
2683 <<
"Ch=" << cscHit.Chamber <<
","
2684 <<
"StationName=" << cscHit.StationName <<
","
2685 <<
"StationEta=" << cscHit.StationEta <<
","
2686 <<
"StationPhi=" << cscHit.StationPhi <<
","
2687 <<
"ChamberLayer=" << cscHit.ChamberLayer <<
","
2688 <<
"WireLayer=" << cscHit.WireLayer <<
","
2689 <<
"MeasuresPhi=" << cscHit.MeasuresPhi <<
","
2690 <<
"Strip=" << cscHit.Strip <<
","
2691 <<
"eta=" << cscHit.eta <<
","
2692 <<
"phi=" << cscHit.phi <<
","
2693 <<
"r=" << cscHit.r <<
","
2694 <<
"z=" << cscHit.z <<
","
2695 <<
"charge=" << cscHit.charge <<
","
2696 <<
"Rs=" << cscHit.Residual <<
","
2697 <<
"t=" << cscHit.time);
2702 accessor_cschitresol( *muonSA ) = cscResol;
2705 float sumbeta[8]={0};
2706 float nhit_layer[8]={0};
2708 muonSA->
setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
2709 rpcHit.x, rpcHit.y, rpcHit.z,
2710 rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
2711 rpcHit.stationName);
2713 <<
"stationName=" << rpcHit.stationName <<
","
2714 <<
"layer=" << rpcHit.layer <<
","
2715 <<
"measuresPhi=" << rpcHit.measuresPhi <<
","
2716 <<
"x=" << rpcHit.x <<
","
2717 <<
"y=" << rpcHit.y <<
","
2718 <<
"y=" << rpcHit.z);
2721 if(dRMS>0.05)
continue;
2723 float Tprop = rpcHit.distToPhiReadout/1000*4.8;
2725 sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+
beta;
2726 nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
2729 std::vector<float> Avebeta_layer;
2730 for(
int i_layer=0;i_layer<8;i_layer++){
2731 if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
2733 if(Avebeta_layer.size()>0) muonSA->
setBeta(
std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
2735 Avebeta_layer.clear();
2739 muonSA->
setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
2740 tgcHit.width, tgcHit.sta, tgcHit.isStrip,
2741 tgcHit.bcTag, tgcHit.inRoad);
2743 <<
"eta=" << tgcHit.eta <<
","
2744 <<
"phi=" << tgcHit.phi <<
","
2745 <<
"r=" << tgcHit.r <<
","
2746 <<
"z=" << tgcHit.z <<
","
2747 <<
"width=" << tgcHit.width <<
","
2748 <<
"stationNum=" << tgcHit.sta <<
","
2749 <<
"isStrip=" << tgcHit.isStrip <<
","
2750 <<
"bcTag=" << tgcHit.bcTag <<
","
2751 <<
"inRoad=" << tgcHit.inRoad);
2756 for(
unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
2757 if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
2760 muonSA->
setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
2761 stgcHits[i_hit].
eta, stgcHits[i_hit].
phi, stgcHits[i_hit].
r, stgcHits[i_hit].
z,
2762 stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
2766 <<
"eta=" << stgcHits[i_hit].
eta <<
","
2767 <<
"phi=" << stgcHits[i_hit].
phi <<
","
2768 <<
"r=" << stgcHits[i_hit].
r <<
","
2769 <<
"z=" << stgcHits[i_hit].
z <<
","
2770 <<
"z=" << stgcHits[i_hit].ResidualR <<
","
2771 <<
"z=" << stgcHits[i_hit].ResidualPhi);
2776 for(
unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
2777 if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
2780 muonSA->
setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
2781 mmHits[i_hit].
eta, mmHits[i_hit].
phi, mmHits[i_hit].
r, mmHits[i_hit].
z,
2782 mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
2786 <<
"eta=" << tgcHits[i_hit].
eta <<
","
2787 <<
"phi=" << tgcHits[i_hit].
phi <<
","
2788 <<
"r=" << tgcHits[i_hit].
r <<
","
2789 <<
"z=" << tgcHits[i_hit].
z <<
","
2790 <<
"width=" << tgcHits[i_hit].
width <<
","
2791 <<
"stationNum=" << tgcHits[i_hit].sta <<
","
2792 <<
"isStrip=" << tgcHits[i_hit].
isStrip <<
","
2793 <<
"bcTag=" << tgcHits[i_hit].
bcTag <<
","
2794 <<
"inRoad=" << tgcHits[i_hit].inRoad);
2802 for (
int i_station=0; i_station<8; i_station++) {
2803 for (
int i_sector=0; i_sector<2; i_sector++) {
2804 muonSA->
setRoad(i_station, i_sector, muonRoad.
aw[i_station][i_sector], muonRoad.
bw[i_station][i_sector]);
2805 muonSA->
setRegionZ(i_station, i_sector, mdtRegion.
zMin[i_station][i_sector], mdtRegion.
zMax[i_station][i_sector]);
2806 muonSA->
setRegionR(i_station, i_sector, mdtRegion.
rMin[i_station][i_sector], mdtRegion.
rMax[i_station][i_sector]);
2807 muonSA->
setRegionEta(i_station, i_sector, mdtRegion.
etaMin[i_station][i_sector], mdtRegion.
etaMax[i_station][i_sector]);
2857 double phi1 = tgcFitResult.
tgcMid1[1];
2858 double phi2 = tgcFitResult.
tgcMid2[1];
2859 if ( tgcFitResult.
tgcMid1[3]==0. || tgcFitResult.
tgcMid2[3]==0. ) {
2862 }
else if( phi1*phi2 < 0 && std::abs(phi1)>(
M_PI/2.) ) {
2863 double tmp1 = (phi1>0)? phi1 -
M_PI : phi1 +
M_PI;
2868 phi = (phi2+phi1)/2.;
2915 const EventContext& ctx )
const
2919 const int currentRoIId = roids->
roiId();
2921 const EventIDBase& eventID = ctx.eventID();
2923 if (!eventInfo.isValid()) {
2933 int barrelinner = 0;
2934 int endcapinner = 3;
2955 ATH_MSG_DEBUG(
"### Hit patterns at the Muon Spectrometer ###");
2961 ATH_MSG_DEBUG(
"pattern#0: # of hits at endcap barrel inner =" <<
pattern.mdtSegments[barrelinner].size());
2965 ATH_MSG_DEBUG(
"pattern#0: # of hits at barrel endcap inner =" <<
pattern.mdtSegments[endcapinner].size());
2967 ATH_MSG_DEBUG(
"### ************************************* ###");
3023 pattern.superPoints[middle].Alin,
pattern.superPoints[middle].Blin,
pattern.superPoints[middle].Chi2);
3030 pattern.superPoints[barrelinner].Alin,
pattern.superPoints[barrelinner].Blin,
pattern.superPoints[barrelinner].Chi2);
3035 pattern.superPoints[endcapinner].Alin,
pattern.superPoints[endcapinner].Blin,
pattern.superPoints[endcapinner].Chi2);
3048 muonSA->
setLvl1Id( eventInfo->extendedLevel1ID() );
3081 std::vector<std::string> mdtId;
3083 if ( mdtHit.isOutlier==0 || mdtHit.isOutlier==1 ) {
3084 muonSA->
setMdtHit(mdtHit.OnlineId, mdtHit.isOutlier, mdtHit.Chamber,
3085 mdtHit.R, mdtHit.Z, mdtHit.cPhi0, mdtHit.Residual,
3086 mdtHit.DriftTime, mdtHit.DriftSpace, mdtHit.DriftSigma);
3087 mdtId.push_back(mdtHit.Id.getString());
3091 accessor_mdthitid( *muonSA ) = mdtId;
3094 std::vector<float> cscResol;
3097 if ( cscHit.isOutlier==0 || cscHit.isOutlier==1 ) {
3098 muonSA->
setCscHit(cscHit.isOutlier, cscHit.Chamber, cscHit.StationName,
3099 cscHit.StationEta, cscHit.StationPhi,
3100 cscHit.ChamberLayer, cscHit.WireLayer, cscHit.MeasuresPhi, cscHit.Strip,
3101 cscHit.eta, cscHit.phi, cscHit.r, cscHit.z,
3102 cscHit.charge, cscHit.time, cscHit.Residual);
3103 cscResol.push_back(cscHit.resolution);
3105 <<
"OL=" << cscHit.isOutlier <<
","
3106 <<
"Ch=" << cscHit.Chamber <<
","
3107 <<
"StationName=" << cscHit.StationName <<
","
3108 <<
"StationEta=" << cscHit.StationEta <<
","
3109 <<
"StationPhi=" << cscHit.StationPhi <<
","
3110 <<
"ChamberLayer=" << cscHit.ChamberLayer <<
","
3111 <<
"WireLayer=" << cscHit.WireLayer <<
","
3112 <<
"MeasuresPhi=" << cscHit.MeasuresPhi <<
","
3113 <<
"Strip=" << cscHit.Strip <<
","
3114 <<
"eta=" << cscHit.eta <<
","
3115 <<
"phi=" << cscHit.phi <<
","
3116 <<
"r=" << cscHit.r <<
","
3117 <<
"z=" << cscHit.z <<
","
3118 <<
"charge=" << cscHit.charge <<
","
3119 <<
"Rs=" << cscHit.Residual <<
","
3120 <<
"t=" << cscHit.time);
3125 accessor_cschitresol( *muonSA ) = cscResol;
3128 float sumbeta[8]={0};
3129 float nhit_layer[8]={0};
3131 muonSA->
setRpcHit(rpcHit.layer, rpcHit.measuresPhi,
3132 rpcHit.x, rpcHit.y, rpcHit.z,
3133 rpcHit.time, rpcHit.distToEtaReadout, rpcHit.distToPhiReadout,
3134 rpcHit.stationName);
3136 <<
"stationName=" << rpcHit.stationName <<
","
3137 <<
"layer=" << rpcHit.layer <<
","
3138 <<
"measuresPhi=" << rpcHit.measuresPhi <<
","
3139 <<
"x=" << rpcHit.x <<
","
3140 <<
"y=" << rpcHit.y <<
","
3141 <<
"y=" << rpcHit.z);
3144 if(dRMS>0.05)
continue;
3146 float Tprop = rpcHit.distToPhiReadout/1000*4.8;
3148 sumbeta[rpcHit.layer]=sumbeta[rpcHit.layer]+
beta;
3149 nhit_layer[rpcHit.layer]=nhit_layer[rpcHit.layer]+1;
3152 std::vector<float> Avebeta_layer;
3153 for(
int i_layer=0;i_layer<8;i_layer++){
3154 if(nhit_layer[i_layer]!=0)Avebeta_layer.push_back( sumbeta[i_layer]/nhit_layer[i_layer] );
3156 if(Avebeta_layer.size()>0) muonSA->
setBeta(
std::accumulate(Avebeta_layer.begin(),Avebeta_layer.end(),0.0)/Avebeta_layer.size() );
3158 Avebeta_layer.clear();
3162 muonSA->
setTgcHit(tgcHit.eta, tgcHit.phi, tgcHit.r, tgcHit.z,
3163 tgcHit.width, tgcHit.sta, tgcHit.isStrip,
3164 tgcHit.bcTag, tgcHit.inRoad);
3166 <<
"eta=" << tgcHit.eta <<
","
3167 <<
"phi=" << tgcHit.phi <<
","
3168 <<
"r=" << tgcHit.r <<
","
3169 <<
"z=" << tgcHit.z <<
","
3170 <<
"width=" << tgcHit.width <<
","
3171 <<
"stationNum=" << tgcHit.sta <<
","
3172 <<
"isStrip=" << tgcHit.isStrip <<
","
3173 <<
"bcTag=" << tgcHit.bcTag <<
","
3174 <<
"inRoad=" << tgcHit.inRoad);
3179 for(
unsigned int i_hit=0; i_hit<stgcHits.size(); i_hit++) {
3180 if ( stgcHits[i_hit].isOutlier==0 || stgcHits[i_hit].isOutlier==1 ) {
3183 muonSA->
setStgcCluster(stgcHits[i_hit].layerNumber, stgcHits[i_hit].isOutlier, stgcHits[i_hit].channelType,
3184 stgcHits[i_hit].
eta, stgcHits[i_hit].
phi, stgcHits[i_hit].
r, stgcHits[i_hit].
z,
3185 stgcHits[i_hit].ResidualR, stgcHits[i_hit].ResidualPhi,
3189 <<
"eta=" << stgcHits[i_hit].
eta <<
","
3190 <<
"phi=" << stgcHits[i_hit].
phi <<
","
3191 <<
"r=" << stgcHits[i_hit].
r <<
","
3192 <<
"z=" << stgcHits[i_hit].
z <<
","
3193 <<
"z=" << stgcHits[i_hit].ResidualR <<
","
3194 <<
"z=" << stgcHits[i_hit].ResidualPhi);
3199 for(
unsigned int i_hit=0; i_hit<mmHits.size(); i_hit++) {
3200 if ( mmHits[i_hit].isOutlier==0 || mmHits[i_hit].isOutlier==1 ) {
3203 muonSA->
setMmCluster(mmHits[i_hit].layerNumber, mmHits[i_hit].isOutlier,
3204 mmHits[i_hit].
eta, mmHits[i_hit].
phi, mmHits[i_hit].
r, mmHits[i_hit].
z,
3205 mmHits[i_hit].ResidualR, mmHits[i_hit].ResidualPhi,
3209 <<
"eta=" << tgcHits[i_hit].
eta <<
","
3210 <<
"phi=" << tgcHits[i_hit].
phi <<
","
3211 <<
"r=" << tgcHits[i_hit].
r <<
","
3212 <<
"z=" << tgcHits[i_hit].
z <<
","
3213 <<
"width=" << tgcHits[i_hit].
width <<
","
3214 <<
"stationNum=" << tgcHits[i_hit].sta <<
","
3215 <<
"isStrip=" << tgcHits[i_hit].
isStrip <<
","
3216 <<
"bcTag=" << tgcHits[i_hit].
bcTag <<
","
3217 <<
"inRoad=" << tgcHits[i_hit].inRoad);
3225 for (
int i_station=0; i_station<8; i_station++) {
3226 for (
int i_sector=0; i_sector<2; i_sector++) {
3227 muonSA->
setRoad(i_station, i_sector, muonRoad.
aw[i_station][i_sector], muonRoad.
bw[i_station][i_sector]);
3228 muonSA->
setRegionZ(i_station, i_sector, mdtRegion.
zMin[i_station][i_sector], mdtRegion.
zMax[i_station][i_sector]);
3229 muonSA->
setRegionR(i_station, i_sector, mdtRegion.
rMin[i_station][i_sector], mdtRegion.
rMax[i_station][i_sector]);
3230 muonSA->
setRegionEta(i_station, i_sector, mdtRegion.
etaMin[i_station][i_sector], mdtRegion.
etaMax[i_station][i_sector]);
3280 double phi1 = tgcFitResult.
tgcMid1[1];
3281 double phi2 = tgcFitResult.
tgcMid2[1];
3282 if ( tgcFitResult.
tgcMid1[3]==0. || tgcFitResult.
tgcMid2[3]==0. ) {
3285 }
else if( phi1*phi2 < 0 && std::abs(phi1)>(
M_PI/2.) ) {
3286 double tmp1 = (phi1>0)? phi1 -
M_PI : phi1 +
M_PI;
3291 phi = (phi2+phi1)/2.;
3339 mseta = roids->
eta();
3340 msphi = roids->
phi();
3344 const float phiHalfWidth = 0.1;
3345 const float etaHalfWidth = 0.1;
3351 mseta - etaHalfWidth,
3352 mseta + etaHalfWidth,
3354 msphi - phiHalfWidth,
3355 msphi + phiHalfWidth);
3359 << mseta <<
"/" << msphi);
3362 <<
" phi=" << MSroiDescriptor->
phi()
3363 <<
", eta=" << MSroiDescriptor->
eta());
3385 const double scalePhiWidthForFailure = 2;
3386 const double scaleRoIforZeroPt = 2;
3394 float phiHalfWidth = 0.1;
3395 float etaHalfWidth = 0.1;
3411 phiHalfWidth *= scalePhiWidthForFailure;
3417 pattern.etaVtx - etaHalfWidth,
3418 pattern.etaVtx + etaHalfWidth,
3420 pattern.phiVtx - phiHalfWidth,
3421 pattern.phiVtx + phiHalfWidth);
3424 <<
"pattern.etaVtx/pattern.phiVtx="
3428 <<
" phi=" << IDroiDescriptor->
phi()
3429 <<
", eta=" << IDroiDescriptor->
eta());
3439 roids->
eta() - (roids->
eta() - roids->
etaMinus()) * scaleRoIforZeroPt,
3440 roids->
eta() + (roids->
etaPlus() - roids->
eta()) * scaleRoIforZeroPt,
3445 ATH_MSG_VERBOSE(
"will Record an RoiDescriptor for Inner Detector in case with zero pT:"
3446 <<
" phi=" << IDroiDescriptor->
phi()
3447 <<
", phi min=" << IDroiDescriptor->
phiMinus()
3448 <<
", phi max=" << IDroiDescriptor->
phiPlus()
3449 <<
", eta=" << IDroiDescriptor->
eta()
3450 <<
", eta min=" << IDroiDescriptor->
etaMinus()
3451 <<
", eta max=" << IDroiDescriptor->
etaPlus());
3466 if (
name ==
"MuFastSteering_Muon") {
3468 }
else if (
name ==
"MuFastSteering_900GeV") {
3485 float pt = muonSA->
pt();
3488 const int N_PARAMS = 2;
3491 const float etaMinWin_brl = 0.10;
3492 const float etaMinWin_ec1 = 0.10;
3493 const float etaMinWin_ec2 = 0.10;
3494 const float etaMinWin_ec3 = 0.10;
3495 const float etaMinWin_ecA = 0.10;
3496 const float etaMinWin_ecB = 0.10;
3498 const float etaMaxWin_brl = 0.20;
3499 const float etaMaxWin_ec1 = 0.20;
3500 const float etaMaxWin_ec2 = 0.20;
3501 const float etaMaxWin_ec3 = 0.20;
3502 const float etaMaxWin_ecA = 0.20;
3503 const float etaMaxWin_ecB = 0.20;
3505 const float etaParams_brl[N_PARAMS] = { 0.038, 0.284};
3506 const float etaParams_ec1[N_PARAMS] = { 0.011, 0.519};
3507 const float etaParams_ec2[N_PARAMS] = { 0.023, 0.253};
3508 const float etaParams_ec3[N_PARAMS] = { 0.018, 0.519};
3509 const float etaParams_ecA[N_PARAMS] = { 0.010, 0.431};
3510 const float etaParams_ecB[N_PARAMS] = { 0.023, 0.236};
3513 const float phiMinWin_brl = 0.125;
3514 const float phiMinWin_ec1 = 0.125;
3515 const float phiMinWin_ec2 = 0.125;
3516 const float phiMinWin_ec3 = 0.10;
3517 const float phiMinWin_ecA = 0.15;
3518 const float phiMinWin_ecB = 0.15;
3520 const float phiMaxWin_brl = 0.20;
3521 const float phiMaxWin_ec1 = 0.20;
3522 const float phiMaxWin_ec2 = 0.20;
3523 const float phiMaxWin_ec3 = 0.20;
3524 const float phiMaxWin_ecA = 0.25;
3525 const float phiMaxWin_ecB = 0.20;
3527 const float phiParams_brl[N_PARAMS] = { 0.000, 0.831};
3528 const float phiParams_ec1[N_PARAMS] = { 0.000, 0.885};
3529 const float phiParams_ec2[N_PARAMS] = { 0.015, 0.552};
3530 const float phiParams_ec3[N_PARAMS] = { 0.008, 0.576};
3531 const float phiParams_ecA[N_PARAMS] = { 0.000, 0.830};
3532 const float phiParams_ecB[N_PARAMS] = { 0.006, 1.331};
3541 minWin = etaMinWin_brl;
3542 maxWin = etaMaxWin_brl;
3546 minWin = phiMinWin_brl;
3547 maxWin = phiMaxWin_brl;
3556 minWin = etaMinWin_ecA;
3557 maxWin = etaMaxWin_ecA;
3561 minWin = phiMinWin_ecA;
3562 maxWin = phiMaxWin_ecA;
3568 minWin = etaMinWin_ecB;
3569 maxWin = etaMaxWin_ecB;
3573 minWin = phiMinWin_ecB;
3574 maxWin = phiMaxWin_ecB;
3578 if( std::abs(
eta) < 1.5 ) {
3581 minWin = etaMinWin_ec1;
3582 maxWin = etaMaxWin_ec1;
3586 minWin = phiMinWin_ec1;
3587 maxWin = phiMaxWin_ec1;
3590 else if( std::abs(
eta) < 2.0 ) {
3593 minWin = etaMinWin_ec2;
3594 maxWin = etaMaxWin_ec2;
3598 minWin = phiMinWin_ec2;
3599 maxWin = phiMaxWin_ec2;
3605 minWin = etaMinWin_ec3;
3606 maxWin = etaMaxWin_ec3;
3610 minWin = phiMinWin_ec3;
3611 maxWin = phiMaxWin_ec3;
3620 if(
x < minWin )
retval = minWin;
3621 if(
x > maxWin )
retval = maxWin;
3631 std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns )
const
3646 std::vector<float> t_eta, t_phi;
3647 std::vector<float> f_eta, f_phi;
3648 std::vector<float> r_inner, r_middle, r_outer;
3649 std::vector<float> f_residuals;
3658 f_residuals.clear();
3670 invalid_rpc_roi_number,
3672 track_eta, track_phi, failed_eta, failed_phi,
3673 res_inner, res_middle, res_outer, fit_residuals );
3677 if( trackPatterns.size() > 0 ) {
3684 float count_inner = 0;
3685 float count_middle = 0;
3686 float count_outer = 0;
3690 if (std::abs(mdtHit.DriftSpace) <
ZERO_LIMIT)
continue;
3692 char st = mdtHit.cType[1];
3696 r_inner.push_back(mdtHit.Residual/
norm);
3697 if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/
norm);
3702 r_middle.push_back(mdtHit.Residual/
norm);
3703 if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/
norm);
3708 r_outer.push_back(mdtHit.Residual/
norm);
3709 if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/
norm);
3713 inner_mdt_hits = count_inner;
3714 middle_mdt_hits = count_middle;
3715 outer_mdt_hits = count_outer;
3718 absolute_pt = std::abs(track_pt);
3721 t_eta.push_back(
pattern.etaMap);
3722 t_phi.push_back(
pattern.phiMS);
3725 f_eta.push_back(roi->
eta());
3726 f_phi.push_back(roi->
phi());
3734 return StatusCode::SUCCESS;
3742 std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns )
const
3757 std::vector<float> t_eta, t_phi;
3758 std::vector<float> f_eta, f_phi;
3759 std::vector<float> r_inner, r_middle, r_outer;
3760 std::vector<float> f_residuals;
3769 f_residuals.clear();
3781 invalid_rpc_roi_number,
3783 track_eta, track_phi, failed_eta, failed_phi,
3784 res_inner, res_middle, res_outer, fit_residuals );
3788 if( trackPatterns.size() > 0 ) {
3795 float count_inner = 0;
3796 float count_middle = 0;
3797 float count_outer = 0;
3801 if (std::abs(mdtHit.DriftSpace) <
ZERO_LIMIT)
continue;
3803 char st = mdtHit.cType[1];
3807 r_inner.push_back(mdtHit.Residual/
norm);
3808 if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/
norm);
3813 r_middle.push_back(mdtHit.Residual/
norm);
3814 if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/
norm);
3819 r_outer.push_back(mdtHit.Residual/
norm);
3820 if (mdtHit.isOutlier==0) f_residuals.push_back(mdtHit.Residual/
norm);
3824 inner_mdt_hits = count_inner;
3825 middle_mdt_hits = count_middle;
3826 outer_mdt_hits = count_outer;
3829 absolute_pt = std::abs(track_pt);
3832 t_eta.push_back(
pattern.etaMap);
3833 t_phi.push_back(
pattern.phiMS);
3836 f_eta.push_back(roi->
eta());
3837 f_phi.push_back(roi->
phi());
3845 return StatusCode::SUCCESS;