ATLAS Offline Software
MuFastDataPreparator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MuFastDataPreparator.h"
7 
8 // --------------------------------------------------------------------------------
9 // --------------------------------------------------------------------------------
10 
12  const std::string& name,
13  const IInterface* parent):
15 {
16 }
17 
18 
19 // --------------------------------------------------------------------------------
20 // --------------------------------------------------------------------------------
21 
23 {
24  ATH_CHECK(m_recRPCRoiTool.retrieve());
25 
26  if (m_use_rpc) {
27  ATH_CHECK(m_rpcDataPreparator.retrieve());
28  ATH_MSG_DEBUG("Retrieved service " << m_rpcDataPreparator);
29  }
30 
31  ATH_CHECK(m_tgcDataPreparator.retrieve());
32  ATH_MSG_DEBUG("Retrieved service " << m_tgcDataPreparator);
33 
34  ATH_CHECK(m_mdtDataPreparator.retrieve());
35  ATH_MSG_DEBUG("Retrieved service " << m_mdtDataPreparator);
36 
37  ATH_CHECK(m_cscDataPreparator.retrieve(DisableTool{m_cscDataPreparator.empty()}));
38  ATH_MSG_DEBUG("Retrieved service " << m_cscDataPreparator);
39 
40  if (m_use_stgc) {
41  ATH_CHECK(m_stgcDataPreparator.retrieve(DisableTool{m_stgcDataPreparator.empty()}));
42  ATH_MSG_DEBUG("Retrieved service " << m_stgcDataPreparator);
43  }
44 
45  if (m_use_mm) {
46  ATH_CHECK(m_mmDataPreparator.retrieve(DisableTool{m_mmDataPreparator.empty()}));
47  ATH_MSG_DEBUG("Retrieved service " << m_mmDataPreparator);
48  }
49 
50  ATH_CHECK(m_rpcRoadDefiner.retrieve());
51  ATH_MSG_DEBUG("Retrieved service " << m_rpcRoadDefiner);
52 
53  ATH_CHECK(m_tgcRoadDefiner.retrieve());
54  ATH_MSG_DEBUG("Retrieved service " << m_tgcRoadDefiner);
55 
56  ATH_CHECK(m_rpcPatFinder.retrieve());
57  ATH_MSG_DEBUG("Retrieved service " << m_rpcPatFinder);
58 
59  ATH_CHECK(m_clusterRoadDefiner.retrieve());
60  ATH_MSG_DEBUG("Retrieved service " << m_clusterRoadDefiner);
61 
62  ATH_CHECK(m_clusterPatFinder.retrieve());
63  ATH_MSG_DEBUG("Retrieved service " << m_clusterPatFinder);
64 
65  return StatusCode::SUCCESS;
66 }
67 
68 // --------------------------------------------------------------------------------
69 // --------------------------------------------------------------------------------
70 
72 {
73  m_options = options;
74  m_tgcDataPreparator->setOptions(options.tgcOptions());
75  return;
76 }
77 
78 // --------------------------------------------------------------------------------
79 // --------------------------------------------------------------------------------
80 
82 {
83  m_use_mcLUT = use_mcLUT;
84 
85  if (m_use_mcLUT) {
86  const ServiceHandle<TrigL2MuonSA::PtEndcapLUTSvc> ptEndcapLUTSvc("PtEndcapLUTSvc_MC", name());
87  if ( ptEndcapLUTSvc.retrieve().isFailure() ) {
88  ATH_MSG_DEBUG("Could not retrieve PtEndcapLUTSvc_MC");
89  return StatusCode::FAILURE;
90  }
91  m_tgcRoadDefiner->setPtLUT(&*ptEndcapLUTSvc);
92  } else {
93  const ServiceHandle<TrigL2MuonSA::PtEndcapLUTSvc> ptEndcapLUTSvc("PtEndcapLUTSvc", name());
94  if ( ptEndcapLUTSvc.retrieve().isFailure() ) {
95  ATH_MSG_DEBUG("Could not retrieve PtEndcapLUTSvc");
96  return StatusCode::FAILURE;
97  }
98  m_tgcRoadDefiner->setPtLUT(&*ptEndcapLUTSvc);
99  }
100 
101  return StatusCode::SUCCESS;
102 }
103 
104 // --------------------------------------------------------------------------------
105 // --------------------------------------------------------------------------------
106 
108  double rWidth_TGC_Failed)
109 {
110  m_rpcRoadDefiner->setRoadWidthForFailure(rWidth_RPC_Failed);
111  m_tgcRoadDefiner->setRoadWidthForFailure(rWidth_TGC_Failed);
112  return;
113 }
114 
115 // --------------------------------------------------------------------------------
116 // --------------------------------------------------------------------------------
117 
119 {
120  m_rpcRoadDefiner->setRpcGeometry(use_rpc);
121 
122  m_use_rpc = use_rpc;
123  return;
124 }
125 
126 // --------------------------------------------------------------------------------
127 
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)
134 {
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);
141  return;
142 }
143 
144 // --------------------------------------------------------------------------------
145 // --------------------------------------------------------------------------------
146 
147 void TrigL2MuonSA::MuFastDataPreparator::setExtrapolatorTool(ToolHandle<ITrigMuonBackExtrapolator>* backExtrapolator)
148 {
149  m_backExtrapolatorTool = backExtrapolator;
150  m_tgcRoadDefiner->setExtrapolatorTool(m_backExtrapolatorTool);
151  return;
152 }
153 
154 // --------------------------------------------------------------------------------
155 // --------------------------------------------------------------------------------
156 
158  const TrigRoiDescriptor* p_roids,
159  const bool insideOut,
160  TrigL2MuonSA::RpcHits& rpcHits,
161  TrigL2MuonSA::MuonRoad& muonRoad,
162  TrigL2MuonSA::MdtRegion& mdtRegion,
163  TrigL2MuonSA::RpcFitResult& rpcFitResult,
164  TrigL2MuonSA::MdtHits& mdtHits_normal,
165  TrigL2MuonSA::MdtHits& mdtHits_overlap,
166  const bool dynamicDeltaRpc) const
167 {
168 
169  ATH_MSG_DEBUG("RoI eta/phi=" << p_roi->eta() << "/" << p_roi->phi());
170 
171  StatusCode sc = StatusCode::SUCCESS;
172 
173  //Storing rpc hits by each layers and eta/phi strip for creating road
174  //RpcLayerHits class is defined in RpcPatFinder.h
175  TrigL2MuonSA::RpcLayerHits rpcLayerHits;
176  rpcLayerHits.clear();
177 
178  if(m_use_rpc && !insideOut) {
179 
180  sc = m_rpcDataPreparator->prepareData(p_roids,
181  rpcHits,
182  rpcLayerHits,
183  &m_rpcPatFinder,
184  dynamicDeltaRpc);
185 
186  if (!sc.isSuccess()) {
187  ATH_MSG_DEBUG("Error in RPC data prepapration. Continue using RoI");
188  }
189  } else {
190  ATH_MSG_DEBUG("Skip RpcDataPreparator");
191  }
192 
194  sc = m_recRPCRoiTool->roiData(p_roi->roiWord(),data);
195  if (!sc.isSuccess()){
196  ATH_MSG_WARNING("Error in roiWord decode");
197  return sc;
198  }
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();
206  }
207  if(!m_recRPCRoiTool->etaDimHigh(data, roiEtaMinHigh, roiEtaMaxHigh)) {
208  roiEtaMinHigh = p_roids->eta();
209  roiEtaMaxHigh = p_roids->eta();
210  }
211 
212  ATH_MSG_DEBUG("nr of RPC hits=" << rpcHits.size());
213 
214  sc = m_rpcRoadDefiner->defineRoad(p_roi,
215  insideOut,
216  muonRoad,
217  rpcHits,
218  rpcLayerHits,
219  &m_rpcPatFinder,
220  rpcFitResult,
221  roiEtaMinLow,
222  roiEtaMaxLow,
223  roiEtaMinHigh,
224  roiEtaMaxHigh);
225  if (!sc.isSuccess()) {
226  ATH_MSG_WARNING("Error in road definition.");
227  return sc;
228  }
229 
230  sc = m_mdtDataPreparator->prepareData(p_roids,
231  rpcFitResult,
232  muonRoad,
233  mdtRegion,
234  mdtHits_normal);
235 
236 
237  if (!sc.isSuccess()) {
238  ATH_MSG_WARNING("Error in MDT data preparation.");
239  return sc;
240  }
241  ATH_MSG_DEBUG("nr of MDT (normal) hits=" << mdtHits_normal.size());
242  ATH_MSG_DEBUG("nr of MDT (overlap) hits=" << mdtHits_overlap.size());
243 
244  return StatusCode::SUCCESS;
245 }
246 
247 // --------------------------------------------------------------------------------
248 // --------------------------------------------------------------------------------
249 
251  const TrigRoiDescriptor* p_roids,
252  const bool insideOut,
253  TrigL2MuonSA::RpcHits& rpcHits,
254  TrigL2MuonSA::MuonRoad& muonRoad,
255  TrigL2MuonSA::MdtRegion& mdtRegion,
256  TrigL2MuonSA::RpcFitResult& rpcFitResult,
257  TrigL2MuonSA::MdtHits& mdtHits_normal,
258  TrigL2MuonSA::MdtHits& mdtHits_overlap,
259  const bool dynamicDeltaRpc) const
260 {
261 
262  ATH_MSG_DEBUG("RoI eta/phi=" << p_roi->eta() << "/" << p_roi->phi());
263 
264  StatusCode sc = StatusCode::SUCCESS;
265 
266  //Storing rpc hits by each layers and eta/phi strip for creating road
267  //RpcLayerHits class is defined in RpcPatFinder.h
268  TrigL2MuonSA::RpcLayerHits rpcLayerHits;
269  rpcLayerHits.clear();
270 
271  if(m_use_rpc && !insideOut) {
272 
273  sc = m_rpcDataPreparator->prepareData(p_roids,
274  rpcHits,
275  rpcLayerHits,
276  &m_rpcPatFinder,
277  dynamicDeltaRpc);
278 
279  if (!sc.isSuccess()) {
280  ATH_MSG_DEBUG("Error in RPC data prepapration. Continue using RoI");
281  }
282  } else {
283  ATH_MSG_DEBUG("Skip RpcDataPreparator");
284  }
285 
287  sc = m_recRPCRoiTool->roiData(p_roi->roiWord(),data);
288  if (!sc.isSuccess()){
289  ATH_MSG_WARNING("Error in roiWord decode");
290  return sc;
291  }
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();
299  }
300  if(!m_recRPCRoiTool->etaDimHigh(data, roiEtaMinHigh, roiEtaMaxHigh)) {
301  roiEtaMinHigh = p_roids->eta();
302  roiEtaMaxHigh = p_roids->eta();
303  }
304 
305  ATH_MSG_DEBUG("nr of RPC hits=" << rpcHits.size());
306 
307  sc = m_rpcRoadDefiner->defineRoad(p_roi,
308  insideOut,
309  muonRoad,
310  rpcHits,
311  rpcLayerHits,
312  &m_rpcPatFinder,
313  rpcFitResult,
314  roiEtaMinLow,
315  roiEtaMaxLow,
316  roiEtaMinHigh,
317  roiEtaMaxHigh);
318  if (!sc.isSuccess()) {
319  ATH_MSG_WARNING("Error in road definition.");
320  return sc;
321  }
322 
323  sc = m_mdtDataPreparator->prepareData(p_roids,
324  rpcFitResult,
325  muonRoad,
326  mdtRegion,
327  mdtHits_normal);
328 
329 
330  if (!sc.isSuccess()) {
331  ATH_MSG_WARNING("Error in MDT data preparation.");
332  return sc;
333  }
334  ATH_MSG_DEBUG("nr of MDT (normal) hits=" << mdtHits_normal.size());
335  ATH_MSG_DEBUG("nr of MDT (overlap) hits=" << mdtHits_overlap.size());
336 
337  return StatusCode::SUCCESS;
338 }
339 
340 //for multi-track SA mode
341 //do Rpc clustering and create multi muon candidate
342 // --------------------------------------------------------------------------------
343 // --------------------------------------------------------------------------------
344 
346  const TrigRoiDescriptor* p_roids,
347  std::vector<TrigL2MuonSA::MuonRoad>& clusterRoad,
348  std::vector<TrigL2MuonSA::RpcFitResult>& clusterFitResults,
349  TrigL2MuonSA::MdtHits& mdtHits_normal,
350  TrigL2MuonSA::MdtHits& mdtHits_overlap,
351  std::vector<TrigL2MuonSA::MdtHits>& mdtHits_cluster_normal,
352  const bool dynamicDeltaRpc) const
353 {
354 
355  ATH_MSG_DEBUG("RoI eta/phi=" << p_roi->eta() << "/" << p_roi->phi());
356  //RpcLayerClusters class is defined in ClusterPatFinder.h
357  TrigL2MuonSA::RpcLayerClusters rpcLayerClusters;
358  rpcLayerClusters.clear();
359 
360  // for MdtDataPreparator's input
361  TrigL2MuonSA::MdtRegion mdtRegion;
362  mdtRegion.Clear();
363 
364  StatusCode sc = StatusCode::SUCCESS;
365 
366  if(!m_use_rpc){
367 
368  } else {
369 
370  sc = m_rpcDataPreparator->prepareData(p_roids,
371  rpcLayerClusters,
372  &m_clusterPatFinder,
373  dynamicDeltaRpc);
374 
375  if (!sc.isSuccess()) {
376  ATH_MSG_DEBUG("Error in RPC data prepapration and clustering. Continue using RoI");
377  return sc;
378  }
379  }
380 
382  sc = m_recRPCRoiTool->roiData(p_roi->roiWord(),data);
383  if (!sc.isSuccess()){
384  ATH_MSG_WARNING("Error in roiWord decode");
385  return sc;
386  }
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();
394  }
395  if(!m_recRPCRoiTool->etaDimHigh(data, roiEtaMinHigh, roiEtaMaxHigh)) {
396  roiEtaMinHigh = p_roids->eta();
397  roiEtaMaxHigh = p_roids->eta();
398  }
399 
400  sc = m_clusterRoadDefiner->defineRoad(p_roi,
401  clusterRoad,
402  rpcLayerClusters,
403  &m_clusterPatFinder,
404  clusterFitResults,
405  roiEtaMinLow,
406  roiEtaMaxLow,
407  roiEtaMinHigh,
408  roiEtaMaxHigh);
409  if (!sc.isSuccess()) {
410  ATH_MSG_WARNING("Error in clusterRoad definition.");
411  return sc;
412 
413  }
414  if(!clusterRoad.empty()){
415  sc = m_mdtDataPreparator->prepareData(p_roids,
416  clusterFitResults.back(),
417  clusterRoad.back(),
418  mdtRegion,
419  mdtHits_normal);
420 
421  if (!sc.isSuccess()) {
422  ATH_MSG_WARNING("Error in MDT data preparation.");
423  return sc;
424  }
425 
426  ATH_MSG_DEBUG("nr of MDT (normal) hits=" << mdtHits_normal.size());
427  ATH_MSG_DEBUG("nr of MDT (overlap) hits=" << mdtHits_overlap.size());
428 
429  for(unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
430  TrigL2MuonSA::MdtHits mdt_normal;
431  for(unsigned int i_hit = 0; i_hit < mdtHits_normal.size(); i_hit++){
432  unsigned int chamber = mdtHits_normal[i_hit].Chamber;
433 
435  double Z = mdtHits_normal[i_hit].Z;
436  double R = mdtHits_normal[i_hit].R;
437  double residual = 999999;
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];
442  double tmp_residual;
443  const double ZERO_LIMIT = 1e-4;
444  if( std::abs(aw) < ZERO_LIMIT ){
445  tmp_residual = R-bw;
446  } else {
447  double ia = 1/aw;
448  double iaq = ia*ia;
449  double dz = Z - (R-bw)*ia;
450  tmp_residual = dz/std::sqrt(1.+iaq);
451  }
452  if(std::abs(residual) > std::abs(tmp_residual)){
453  residual = tmp_residual;
454  clusterRoadID = j_road;
455  }
456  }
457  if(clusterRoadID == i_road){
458  mdt_normal.push_back(mdtHits_normal[i_hit]);
459  }
460  }
461  mdtHits_cluster_normal.push_back(mdt_normal);
462  }
463  }
464 
465  return StatusCode::SUCCESS;
466 }
467 
468 //for multi-track SA mode
469 //do Rpc clustering and create multi muon candidate
470 // --------------------------------------------------------------------------------
471 // --------------------------------------------------------------------------------
472 
474  const TrigRoiDescriptor* p_roids,
475  std::vector<TrigL2MuonSA::MuonRoad>& clusterRoad,
476  std::vector<TrigL2MuonSA::RpcFitResult>& clusterFitResults,
477  TrigL2MuonSA::MdtHits& mdtHits_normal,
478  TrigL2MuonSA::MdtHits& mdtHits_overlap,
479  std::vector<TrigL2MuonSA::MdtHits>& mdtHits_cluster_normal,
480  const bool dynamicDeltaRpc) const
481 {
482 
483  ATH_MSG_DEBUG("RoI eta/phi=" << p_roi->eta() << "/" << p_roi->phi());
484  //RpcLayerClusters class is defined in ClusterPatFinder.h
485  TrigL2MuonSA::RpcLayerClusters rpcLayerClusters;
486  rpcLayerClusters.clear();
487 
488  // for MdtDataPreparator's input
489  TrigL2MuonSA::MdtRegion mdtRegion;
490  mdtRegion.Clear();
491 
492  StatusCode sc = StatusCode::SUCCESS;
493 
494  if(!m_use_rpc){
495 
496  } else {
497 
498  sc = m_rpcDataPreparator->prepareData(p_roids,
499  rpcLayerClusters,
500  &m_clusterPatFinder,
501  dynamicDeltaRpc);
502 
503  if (!sc.isSuccess()) {
504  ATH_MSG_DEBUG("Error in RPC data prepapration and clustering. Continue using RoI");
505  return sc;
506  }
507  }
508 
510  sc = m_recRPCRoiTool->roiData(p_roi->roiWord(),data);
511  if (!sc.isSuccess()){
512  ATH_MSG_WARNING("Error in roiWord decode");
513  return sc;
514  }
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();
522  }
523  if(!m_recRPCRoiTool->etaDimHigh(data, roiEtaMinHigh, roiEtaMaxHigh)) {
524  roiEtaMinHigh = p_roids->eta();
525  roiEtaMaxHigh = p_roids->eta();
526  }
527 
528  sc = m_clusterRoadDefiner->defineRoad(p_roi,
529  clusterRoad,
530  rpcLayerClusters,
531  &m_clusterPatFinder,
532  clusterFitResults,
533  roiEtaMinLow,
534  roiEtaMaxLow,
535  roiEtaMinHigh,
536  roiEtaMaxHigh);
537  if (!sc.isSuccess()) {
538  ATH_MSG_WARNING("Error in clusterRoad definition.");
539  return sc;
540 
541  }
542  if(!clusterRoad.empty()){
543  sc = m_mdtDataPreparator->prepareData(p_roids,
544  clusterFitResults.back(),
545  clusterRoad.back(),
546  mdtRegion,
547  mdtHits_normal);
548 
549  if (!sc.isSuccess()) {
550  ATH_MSG_WARNING("Error in MDT data preparation.");
551  return sc;
552  }
553 
554  ATH_MSG_DEBUG("nr of MDT (normal) hits=" << mdtHits_normal.size());
555  ATH_MSG_DEBUG("nr of MDT (overlap) hits=" << mdtHits_overlap.size());
556 
557  for(unsigned int i_road = 0; i_road < clusterRoad.size(); i_road++){
558  TrigL2MuonSA::MdtHits mdt_normal;
559  for(unsigned int i_hit = 0; i_hit < mdtHits_normal.size(); i_hit++){
560  unsigned int chamber = mdtHits_normal[i_hit].Chamber;
561 
563  double Z = mdtHits_normal[i_hit].Z;
564  double R = mdtHits_normal[i_hit].R;
565  double residual = 999999;
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];
570  double tmp_residual;
571  const double ZERO_LIMIT = 1e-4;
572  if( std::abs(aw) < ZERO_LIMIT ){
573  tmp_residual = R-bw;
574  } else {
575  double ia = 1/aw;
576  double iaq = ia*ia;
577  double dz = Z - (R-bw)*ia;
578  tmp_residual = dz/std::sqrt(1.+iaq);
579  }
580  if(std::abs(residual) > std::abs(tmp_residual)){
581  residual = tmp_residual;
582  clusterRoadID = j_road;
583  }
584  }
585  if(clusterRoadID == i_road){
586  mdt_normal.push_back(mdtHits_normal[i_hit]);
587  }
588  }
589  mdtHits_cluster_normal.push_back(mdt_normal);
590  }
591  }
592 
593  return StatusCode::SUCCESS;
594 }
595 
596 // --------------------------------------------------------------------------------
597 // --------------------------------------------------------------------------------
598 
600  const TrigRoiDescriptor* p_roids,
601  const bool insideOut,
602  TrigL2MuonSA::TgcHits& tgcHits,
603  TrigL2MuonSA::MuonRoad& muonRoad,
604  TrigL2MuonSA::MdtRegion& mdtRegion,
605  TrigL2MuonSA::TgcFitResult& tgcFitResult,
606  TrigL2MuonSA::MdtHits& mdtHits_normal,
607  TrigL2MuonSA::MdtHits& mdtHits_overlap,
608  TrigL2MuonSA::CscHits& cscHits,
609  TrigL2MuonSA::StgcHits& stgcHits,
610  TrigL2MuonSA::MmHits& mmHits) const
611 {
612  StatusCode sc = StatusCode::SUCCESS;
613  ATH_MSG_DEBUG("RoI eta/phi=" << p_roi->eta() << "/" << p_roi->phi());
614 
615  if(!insideOut) {
616  sc = m_tgcDataPreparator->prepareData(p_roi,
617  tgcHits);
618  } else {
619  ATH_MSG_DEBUG("Skip TgcDataPreparator");
620  }
621 
622  if (!sc.isSuccess()) {
623  ATH_MSG_DEBUG("Error in TGC data preparation. Continue using RoI");
624  }
625  ATH_MSG_DEBUG("nr of TGC hits=" << tgcHits.size());
626 
627  sc = m_tgcRoadDefiner->defineRoad(p_roids,
628  insideOut,
629  tgcHits,
630  muonRoad,
631  tgcFitResult);
632  if (!sc.isSuccess()) {
633  ATH_MSG_WARNING("Error in road definition.");
634  return sc;
635  }
636 
637  sc = m_mdtDataPreparator->prepareData(p_roids,
638  tgcFitResult,
639  muonRoad,
640  mdtRegion,
641  mdtHits_normal);
642 
643  if (!sc.isSuccess()) {
644  ATH_MSG_WARNING("Error in MDT data preparation.");
645  return sc;
646  }
647  ATH_MSG_DEBUG("nr of MDT (normal) hits=" << mdtHits_normal.size());
648  ATH_MSG_DEBUG("nr of MDT (overlap) hits=" << mdtHits_overlap.size());
649 
650  if(!m_cscDataPreparator.empty()) {
651  sc = m_cscDataPreparator->prepareData(muonRoad,
652  cscHits);
653  if (!sc.isSuccess()) {
654  ATH_MSG_WARNING("Error in CSC data preparation.");
655  return sc;
656  }
657  ATH_MSG_DEBUG("nr of CSC hits=" << cscHits.size());
658  }
659 
660  if(m_use_stgc && !m_stgcDataPreparator.empty()){
661  sc = m_stgcDataPreparator->prepareData(p_roids,
662  stgcHits);
663  if (!sc.isSuccess()) {
664  ATH_MSG_WARNING("Error in sTGC data preparation.");
665  return sc;
666  }
667  ATH_MSG_DEBUG("nr of sTGC hits=" << stgcHits.size());
668  }
669 
670  if(m_use_mm && !m_mmDataPreparator.empty()){
671  sc = m_mmDataPreparator->prepareData(p_roids,
672  mmHits);
673  if (!sc.isSuccess()) {
674  ATH_MSG_WARNING("Error in MM data preparation.");
675  return sc;
676  }
677  ATH_MSG_DEBUG("nr of MM hits=" << mmHits.size());
678  }
679 
680  return StatusCode::SUCCESS;
681 }
682 
683 // --------------------------------------------------------------------------------
684 // --------------------------------------------------------------------------------
685 
687  const TrigRoiDescriptor* p_roids,
688  const bool insideOut,
689  TrigL2MuonSA::TgcHits& tgcHits,
690  TrigL2MuonSA::MuonRoad& muonRoad,
691  TrigL2MuonSA::MdtRegion& mdtRegion,
692  TrigL2MuonSA::TgcFitResult& tgcFitResult,
693  TrigL2MuonSA::MdtHits& mdtHits_normal,
694  TrigL2MuonSA::MdtHits& mdtHits_overlap,
695  TrigL2MuonSA::CscHits& cscHits,
696  TrigL2MuonSA::StgcHits& stgcHits,
697  TrigL2MuonSA::MmHits& mmHits) const
698 {
699  StatusCode sc = StatusCode::SUCCESS;
700  ATH_MSG_DEBUG("RoI eta/phi=" << p_roi->eta() << "/" << p_roi->phi());
701 
702  if(!insideOut) {
703  sc = m_tgcDataPreparator->prepareData(p_roi,
704  tgcHits);
705  } else {
706  ATH_MSG_DEBUG("Skip TgcDataPreparator");
707  }
708 
709  if (!sc.isSuccess()) {
710  ATH_MSG_DEBUG("Error in TGC data preparation. Continue using RoI");
711  }
712  ATH_MSG_DEBUG("nr of TGC hits=" << tgcHits.size());
713 
714  sc = m_tgcRoadDefiner->defineRoad(p_roids,
715  insideOut,
716  tgcHits,
717  muonRoad,
718  tgcFitResult);
719  if (!sc.isSuccess()) {
720  ATH_MSG_WARNING("Error in road definition.");
721  return sc;
722  }
723 
724  sc = m_mdtDataPreparator->prepareData(p_roids,
725  tgcFitResult,
726  muonRoad,
727  mdtRegion,
728  mdtHits_normal);
729 
730  if (!sc.isSuccess()) {
731  ATH_MSG_WARNING("Error in MDT data preparation.");
732  return sc;
733  }
734  ATH_MSG_DEBUG("nr of MDT (normal) hits=" << mdtHits_normal.size());
735  ATH_MSG_DEBUG("nr of MDT (overlap) hits=" << mdtHits_overlap.size());
736 
737  if(!m_cscDataPreparator.empty()) {
738  sc = m_cscDataPreparator->prepareData(muonRoad,
739  cscHits);
740  if (!sc.isSuccess()) {
741  ATH_MSG_WARNING("Error in CSC data preparation.");
742  return sc;
743  }
744  ATH_MSG_DEBUG("nr of CSC hits=" << cscHits.size());
745  }
746 
747  if(m_use_stgc && !m_stgcDataPreparator.empty()){
748  sc = m_stgcDataPreparator->prepareData(p_roids,
749  stgcHits);
750  if (!sc.isSuccess()) {
751  ATH_MSG_WARNING("Error in sTGC data preparation.");
752  return sc;
753  }
754  ATH_MSG_DEBUG("nr of sTGC hits=" << stgcHits.size());
755  }
756 
757  if(m_use_mm && !m_mmDataPreparator.empty()){
758  sc = m_mmDataPreparator->prepareData(p_roids,
759  mmHits);
760  if (!sc.isSuccess()) {
761  ATH_MSG_WARNING("Error in MM data preparation.");
762  return sc;
763  }
764  ATH_MSG_DEBUG("nr of MM hits=" << mmHits.size());
765  }
766 
767  return StatusCode::SUCCESS;
768 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
LVL1::TrigT1MuonRecRoiData
Definition: TrigT1MuonRecRoiData.h:10
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TrigL2MuonSA::MuFastDataPreparator::setRpcGeometry
void setRpcGeometry(bool use_rpc)
Definition: MuFastDataPreparator.cxx:118
TrigL2MuonSA::RpcHits
std::vector< RpcHitData > RpcHits
Definition: RpcData.h:57
TrigL2MuonSA::RpcLayerClusters::clear
void clear()
Definition: ClusterPatFinder.h:63
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
TrigL2MuonSA::RpcFitResult
Definition: RpcFitResult.h:14
calibdata.chamber
chamber
Definition: calibdata.py:32
TrigL2MuonSA::MuFastDataPreparatorOptions
Definition: MuFastDataPreparatorOptions.h:17
TrigL2MuonSA::TgcFitResult
Definition: TgcFitResult.h:11
TrigL2MuonSA::MdtHits
std::vector< MdtHitData > MdtHits
Definition: MdtData.h:57
TrigL2MuonSA::TgcHits
std::vector< TgcHitData > TgcHits
Definition: TgcData.h:43
xAOD::MuonRoI_v1::eta
float eta() const
The pseudorapidity ( ) of the muon candidate.
TrigL2MuonSA::MdtRegion::Clear
void Clear()
Definition: MdtRegion.h:18
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
LVL1::RecMuonRoI::eta
virtual double eta() const
returns eta coord of ROI
Definition: RecMuonRoI.h:117
TrigL2MuonSA::CscHits
std::vector< CscHitData > CscHits
Definition: CscData.h:40
TrigL2MuonSA::MuFastDataPreparator::setRoIBasedDataAccess
void setRoIBasedDataAccess(bool use_RoIBasedDataAccess_MDT, bool use_RoIBasedDataAccess_RPC, bool use_RoIBasedDataAccess_TGC, bool use_RoIBasedDataAccess_CSC, bool use_RoIBasedDataAccess_STGC, bool use_RoIBasedDataAccess_MM)
Definition: MuFastDataPreparator.cxx:128
TrigL2MuonSA::MdtRegion
Definition: MdtRegion.h:14
LVL1::RecMuonRoI::roiWord
virtual unsigned int roiWord() const
returns roi word
Definition: RecMuonRoI.h:102
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuFastDataPreparator.h
TrigL2MuonSA::MuFastDataPreparator::setOptions
void setOptions(const TrigL2MuonSA::MuFastDataPreparatorOptions &options)
Definition: MuFastDataPreparator.cxx:71
LVL1::RecMuonRoI
This class defines the reconstructed Muon ROI.
Definition: RecMuonRoI.h:60
TrigL2MuonSA::MuonRoad
Definition: MuonRoad.h:20
xAOD::L2MuonParameters::MaxChamber
@ MaxChamber
Number of measurement point definitions.
Definition: TrigMuonDefs.h:27
TrigL2MuonSA::MuFastDataPreparator::MuFastDataPreparator
MuFastDataPreparator(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuFastDataPreparator.cxx:11
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::MuonRoI_v1
Class describing a LVL1 muon region of interest.
Definition: MuonRoI_v1.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::RpcLayerClusters
Definition: ClusterPatFinder.h:58
TrigL2MuonSA::MuFastDataPreparator::initialize
virtual StatusCode initialize() override
Definition: MuFastDataPreparator.cxx:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigL2MuonSA::MuFastDataPreparator::setExtrapolatorTool
void setExtrapolatorTool(ToolHandle< ITrigMuonBackExtrapolator > *backExtrapolator)
Definition: MuFastDataPreparator.cxx:147
python.AtlRunQueryLib.options
options
Definition: AtlRunQueryLib.py:379
ZERO_LIMIT
const float ZERO_LIMIT
Definition: VP1TriggerHandleL2.cxx:37
TrigL2MuonSA::RpcLayerHits::clear
void clear()
Definition: RpcPatFinder.h:25
LVL1::RecMuonRoI::phi
virtual double phi() const
returns phi coord of ROI
Definition: RecMuonRoI.h:114
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigL2MuonSA::RpcLayerHits
Definition: RpcPatFinder.h:20
TrigL2MuonSA::MuFastDataPreparator::setRoadWidthForFailure
void setRoadWidthForFailure(double rWidth_RPC_Failed, double rWidth_TGC_Failed)
Definition: MuFastDataPreparator.cxx:107
TrigMuonDefs.h
TrigL2MuonSA::MmHits
std::vector< MmHitData > MmHits
Definition: MmData.h:47
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigL2MuonSA::StgcHits
std::vector< StgcHitData > StgcHits
Definition: StgcData.h:49
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
TrigL2MuonSA::MuFastDataPreparator::setMCFlag
StatusCode setMCFlag(const BooleanProperty &use_mcLUT)
Definition: MuFastDataPreparator.cxx:81
TrigL2MuonSA::MuFastDataPreparator::prepareData
StatusCode prepareData(const LVL1::RecMuonRoI *p_roi, const TrigRoiDescriptor *p_roids, const bool insideOut, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::MuonRoad &muonRoad, TrigL2MuonSA::MdtRegion &mdtRegion, TrigL2MuonSA::RpcFitResult &rpcFitResult, TrigL2MuonSA::MdtHits &mdtHits_normal, TrigL2MuonSA::MdtHits &mdtHits_overlap, const bool dynamicDeltaRpc) const
Definition: MuFastDataPreparator.cxx:157
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::MuonRoI_v1::roiWord
uint32_t roiWord() const
The "raw" RoI word describing the muon candidate.
ServiceHandle
Definition: ClusterMakerTool.h:37
xAOD::MuonRoI_v1::phi
float phi() const
The azimuthal angle ( ) of the muon candidate.