12 const std::string&
name,
27 ATH_CHECK(m_rpcDataPreparator.retrieve());
31 ATH_CHECK(m_tgcDataPreparator.retrieve());
34 ATH_CHECK(m_mdtDataPreparator.retrieve());
37 ATH_CHECK(m_cscDataPreparator.retrieve(DisableTool{m_cscDataPreparator.empty()}));
41 ATH_CHECK(m_stgcDataPreparator.retrieve(DisableTool{m_stgcDataPreparator.empty()}));
46 ATH_CHECK(m_mmDataPreparator.retrieve(DisableTool{m_mmDataPreparator.empty()}));
59 ATH_CHECK(m_clusterRoadDefiner.retrieve());
65 return StatusCode::SUCCESS;
74 m_tgcDataPreparator->setOptions(
options.tgcOptions());
83 m_use_mcLUT = use_mcLUT;
87 if ( ptEndcapLUTSvc.retrieve().isFailure() ) {
89 return StatusCode::FAILURE;
91 m_tgcRoadDefiner->setPtLUT(&*ptEndcapLUTSvc);
94 if ( ptEndcapLUTSvc.retrieve().isFailure() ) {
96 return StatusCode::FAILURE;
98 m_tgcRoadDefiner->setPtLUT(&*ptEndcapLUTSvc);
101 return StatusCode::SUCCESS;
108 double rWidth_TGC_Failed)
110 m_rpcRoadDefiner->setRoadWidthForFailure(rWidth_RPC_Failed);
111 m_tgcRoadDefiner->setRoadWidthForFailure(rWidth_TGC_Failed);
120 m_rpcRoadDefiner->setRpcGeometry(use_rpc);
129 bool use_RoIBasedDataAccess_RPC,
130 bool use_RoIBasedDataAccess_TGC,
131 bool use_RoIBasedDataAccess_CSC,
132 bool use_RoIBasedDataAccess_STGC,
133 bool use_RoIBasedDataAccess_MM)
135 m_mdtDataPreparator ->setRoIBasedDataAccess(use_RoIBasedDataAccess_MDT);
136 m_rpcDataPreparator ->setRoIBasedDataAccess(use_RoIBasedDataAccess_RPC);
137 m_tgcDataPreparator ->setRoIBasedDataAccess(use_RoIBasedDataAccess_TGC);
138 if(!m_cscDataPreparator.empty()) m_cscDataPreparator->setRoIBasedDataAccess(use_RoIBasedDataAccess_CSC);
139 if(!m_stgcDataPreparator.empty()) m_stgcDataPreparator->setRoIBasedDataAccess(use_RoIBasedDataAccess_STGC);
140 if(!m_mmDataPreparator.empty()) m_mmDataPreparator->setRoIBasedDataAccess(use_RoIBasedDataAccess_MM);
149 m_backExtrapolatorTool = backExtrapolator;
150 m_tgcRoadDefiner->setExtrapolatorTool(m_backExtrapolatorTool);
159 const bool insideOut,
166 const bool dynamicDeltaRpc)
const
176 rpcLayerHits.
clear();
178 if(m_use_rpc && !insideOut) {
180 sc = m_rpcDataPreparator->prepareData(p_roids,
186 if (!
sc.isSuccess()) {
187 ATH_MSG_DEBUG(
"Error in RPC data prepapration. Continue using RoI");
195 if (!
sc.isSuccess()){
199 double roiEtaMinLow = 0.;
200 double roiEtaMaxLow = 0.;
201 double roiEtaMinHigh = 0.;
202 double roiEtaMaxHigh = 0.;
203 if(!m_recRPCRoiTool->etaDimLow(
data, roiEtaMinLow, roiEtaMaxLow)) {
204 roiEtaMinLow = p_roids->
eta();
205 roiEtaMaxLow = p_roids->
eta();
207 if(!m_recRPCRoiTool->etaDimHigh(
data, roiEtaMinHigh, roiEtaMaxHigh)) {
208 roiEtaMinHigh = p_roids->
eta();
209 roiEtaMaxHigh = p_roids->
eta();
214 sc = m_rpcRoadDefiner->defineRoad(p_roi,
225 if (!
sc.isSuccess()) {
230 sc = m_mdtDataPreparator->prepareData(p_roids,
237 if (!
sc.isSuccess()) {
241 ATH_MSG_DEBUG(
"nr of MDT (normal) hits=" << mdtHits_normal.size());
242 ATH_MSG_DEBUG(
"nr of MDT (overlap) hits=" << mdtHits_overlap.size());
244 return StatusCode::SUCCESS;
252 const bool insideOut,
259 const bool dynamicDeltaRpc)
const
269 rpcLayerHits.
clear();
271 if(m_use_rpc && !insideOut) {
273 sc = m_rpcDataPreparator->prepareData(p_roids,
279 if (!
sc.isSuccess()) {
280 ATH_MSG_DEBUG(
"Error in RPC data prepapration. Continue using RoI");
288 if (!
sc.isSuccess()){
292 double roiEtaMinLow = 0.;
293 double roiEtaMaxLow = 0.;
294 double roiEtaMinHigh = 0.;
295 double roiEtaMaxHigh = 0.;
296 if(!m_recRPCRoiTool->etaDimLow(
data, roiEtaMinLow, roiEtaMaxLow)) {
297 roiEtaMinLow = p_roids->
eta();
298 roiEtaMaxLow = p_roids->
eta();
300 if(!m_recRPCRoiTool->etaDimHigh(
data, roiEtaMinHigh, roiEtaMaxHigh)) {
301 roiEtaMinHigh = p_roids->
eta();
302 roiEtaMaxHigh = p_roids->
eta();
307 sc = m_rpcRoadDefiner->defineRoad(p_roi,
318 if (!
sc.isSuccess()) {
323 sc = m_mdtDataPreparator->prepareData(p_roids,
330 if (!
sc.isSuccess()) {
334 ATH_MSG_DEBUG(
"nr of MDT (normal) hits=" << mdtHits_normal.size());
335 ATH_MSG_DEBUG(
"nr of MDT (overlap) hits=" << mdtHits_overlap.size());
337 return StatusCode::SUCCESS;
347 std::vector<TrigL2MuonSA::MuonRoad>& clusterRoad,
348 std::vector<TrigL2MuonSA::RpcFitResult>& clusterFitResults,
351 std::vector<TrigL2MuonSA::MdtHits>& mdtHits_cluster_normal,
352 const bool dynamicDeltaRpc)
const
358 rpcLayerClusters.
clear();
370 sc = m_rpcDataPreparator->prepareData(p_roids,
375 if (!
sc.isSuccess()) {
376 ATH_MSG_DEBUG(
"Error in RPC data prepapration and clustering. Continue using RoI");
383 if (!
sc.isSuccess()){
387 double roiEtaMinLow = 0.;
388 double roiEtaMaxLow = 0.;
389 double roiEtaMinHigh = 0.;
390 double roiEtaMaxHigh = 0.;
391 if(!m_recRPCRoiTool->etaDimLow(
data, roiEtaMinLow, roiEtaMaxLow)) {
392 roiEtaMinLow = p_roids->
eta();
393 roiEtaMaxLow = p_roids->
eta();
395 if(!m_recRPCRoiTool->etaDimHigh(
data, roiEtaMinHigh, roiEtaMaxHigh)) {
396 roiEtaMinHigh = p_roids->
eta();
397 roiEtaMaxHigh = p_roids->
eta();
400 sc = m_clusterRoadDefiner->defineRoad(p_roi,
409 if (!
sc.isSuccess()) {
414 if(!clusterRoad.empty()){
415 sc = m_mdtDataPreparator->prepareData(p_roids,
416 clusterFitResults.back(),
421 if (!
sc.isSuccess()) {
426 ATH_MSG_DEBUG(
"nr of MDT (normal) hits=" << mdtHits_normal.size());
427 ATH_MSG_DEBUG(
"nr of MDT (overlap) hits=" << mdtHits_overlap.size());
429 for(
unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
431 for(
unsigned int i_hit = 0; i_hit < mdtHits_normal.size(); i_hit++){
432 unsigned int chamber = mdtHits_normal[i_hit].Chamber;
435 double Z = mdtHits_normal[i_hit].Z;
436 double R = mdtHits_normal[i_hit].R;
438 unsigned int clusterRoadID = 9999;
439 for(
unsigned int j_road = 0; j_road < clusterRoad.size(); j_road++){
440 double aw = clusterRoad.at(j_road).aw[
chamber][0];
441 double bw = clusterRoad.at(j_road).bw[
chamber][0];
449 double dz = Z - (R-bw)*ia;
450 tmp_residual = dz/std::sqrt(1.+iaq);
452 if(std::abs(
residual) > std::abs(tmp_residual)){
454 clusterRoadID = j_road;
457 if(clusterRoadID == i_road){
458 mdt_normal.push_back(mdtHits_normal[i_hit]);
461 mdtHits_cluster_normal.push_back(mdt_normal);
465 return StatusCode::SUCCESS;
475 std::vector<TrigL2MuonSA::MuonRoad>& clusterRoad,
476 std::vector<TrigL2MuonSA::RpcFitResult>& clusterFitResults,
479 std::vector<TrigL2MuonSA::MdtHits>& mdtHits_cluster_normal,
480 const bool dynamicDeltaRpc)
const
486 rpcLayerClusters.
clear();
498 sc = m_rpcDataPreparator->prepareData(p_roids,
503 if (!
sc.isSuccess()) {
504 ATH_MSG_DEBUG(
"Error in RPC data prepapration and clustering. Continue using RoI");
511 if (!
sc.isSuccess()){
515 double roiEtaMinLow = 0.;
516 double roiEtaMaxLow = 0.;
517 double roiEtaMinHigh = 0.;
518 double roiEtaMaxHigh = 0.;
519 if(!m_recRPCRoiTool->etaDimLow(
data, roiEtaMinLow, roiEtaMaxLow)) {
520 roiEtaMinLow = p_roids->
eta();
521 roiEtaMaxLow = p_roids->
eta();
523 if(!m_recRPCRoiTool->etaDimHigh(
data, roiEtaMinHigh, roiEtaMaxHigh)) {
524 roiEtaMinHigh = p_roids->
eta();
525 roiEtaMaxHigh = p_roids->
eta();
528 sc = m_clusterRoadDefiner->defineRoad(p_roi,
537 if (!
sc.isSuccess()) {
542 if(!clusterRoad.empty()){
543 sc = m_mdtDataPreparator->prepareData(p_roids,
544 clusterFitResults.back(),
549 if (!
sc.isSuccess()) {
554 ATH_MSG_DEBUG(
"nr of MDT (normal) hits=" << mdtHits_normal.size());
555 ATH_MSG_DEBUG(
"nr of MDT (overlap) hits=" << mdtHits_overlap.size());
557 for(
unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
559 for(
unsigned int i_hit = 0; i_hit < mdtHits_normal.size(); i_hit++){
560 unsigned int chamber = mdtHits_normal[i_hit].Chamber;
563 double Z = mdtHits_normal[i_hit].Z;
564 double R = mdtHits_normal[i_hit].R;
566 unsigned int clusterRoadID = 9999;
567 for(
unsigned int j_road = 0; j_road < clusterRoad.size(); j_road++){
568 double aw = clusterRoad.at(j_road).aw[
chamber][0];
569 double bw = clusterRoad.at(j_road).bw[
chamber][0];
577 double dz = Z - (R-bw)*ia;
578 tmp_residual = dz/std::sqrt(1.+iaq);
580 if(std::abs(
residual) > std::abs(tmp_residual)){
582 clusterRoadID = j_road;
585 if(clusterRoadID == i_road){
586 mdt_normal.push_back(mdtHits_normal[i_hit]);
589 mdtHits_cluster_normal.push_back(mdt_normal);
593 return StatusCode::SUCCESS;
601 const bool insideOut,
616 sc = m_tgcDataPreparator->prepareData(p_roi,
622 if (!
sc.isSuccess()) {
623 ATH_MSG_DEBUG(
"Error in TGC data preparation. Continue using RoI");
627 sc = m_tgcRoadDefiner->defineRoad(p_roids,
632 if (!
sc.isSuccess()) {
637 sc = m_mdtDataPreparator->prepareData(p_roids,
643 if (!
sc.isSuccess()) {
647 ATH_MSG_DEBUG(
"nr of MDT (normal) hits=" << mdtHits_normal.size());
648 ATH_MSG_DEBUG(
"nr of MDT (overlap) hits=" << mdtHits_overlap.size());
650 if(!m_cscDataPreparator.empty()) {
651 sc = m_cscDataPreparator->prepareData(muonRoad,
653 if (!
sc.isSuccess()) {
660 if(m_use_stgc && !m_stgcDataPreparator.empty()){
661 sc = m_stgcDataPreparator->prepareData(p_roids,
663 if (!
sc.isSuccess()) {
670 if(m_use_mm && !m_mmDataPreparator.empty()){
671 sc = m_mmDataPreparator->prepareData(p_roids,
673 if (!
sc.isSuccess()) {
680 return StatusCode::SUCCESS;
688 const bool insideOut,
703 sc = m_tgcDataPreparator->prepareData(p_roi,
709 if (!
sc.isSuccess()) {
710 ATH_MSG_DEBUG(
"Error in TGC data preparation. Continue using RoI");
714 sc = m_tgcRoadDefiner->defineRoad(p_roids,
719 if (!
sc.isSuccess()) {
724 sc = m_mdtDataPreparator->prepareData(p_roids,
730 if (!
sc.isSuccess()) {
734 ATH_MSG_DEBUG(
"nr of MDT (normal) hits=" << mdtHits_normal.size());
735 ATH_MSG_DEBUG(
"nr of MDT (overlap) hits=" << mdtHits_overlap.size());
737 if(!m_cscDataPreparator.empty()) {
738 sc = m_cscDataPreparator->prepareData(muonRoad,
740 if (!
sc.isSuccess()) {
747 if(m_use_stgc && !m_stgcDataPreparator.empty()){
748 sc = m_stgcDataPreparator->prepareData(p_roids,
750 if (!
sc.isSuccess()) {
757 if(m_use_mm && !m_mmDataPreparator.empty()){
758 sc = m_mmDataPreparator->prepareData(p_roids,
760 if (!
sc.isSuccess()) {
767 return StatusCode::SUCCESS;