ATLAS Offline Software
MuonHoughPatternTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include "CxxUtils/sincos.h"
18 #include "TDirectory.h"
19 #include "TFile.h"
20 #include "TH2F.h"
21 #include "TString.h"
22 #include "TrkSurfaces/Surface.h"
23 
24 MuonHoughPatternTool::MuonHoughPatternTool(const std::string& type, const std::string& name, const IInterface* parent) :
26  declareInterface<IMuonHoughPatternTool>(this);
27 
31 }
32 
37  m_use_ip = true;
38 }
39 
42  if (m_use_cosmics && m_maxNumberOfPhiHits >= 0) {
43  int phihits{0};
44  for (unsigned int hitid = 0; hitid < hitcontainer.size(); ++hitid) { phihits += hitcontainer.getMeasuresPhi(hitid); }
45  if (phihits > m_maxNumberOfPhiHits) {
46  ATH_MSG_DEBUG("Cosmic event has more than 1000 phi hits: " << phihits << " event is not reconstructed!");
47  return;
48  }
49  }
50 
52  double weightmdt{0.};
53  if (m_weightcutmdt) { setWeightMdtCutValue(hitcontainer, weightmdt); }
54 
55  ATH_MSG_DEBUG("Mdt Cut Value: " << weightmdt);
56 
57  // reset weights, based on rejection factor and weightmdt
58  calculateWeights(hitcontainer, weightmdt);
59 
60  if (msgLevel(MSG::VERBOSE)) {
61  ATH_MSG_VERBOSE("Event Info");
62  ATH_MSG_VERBOSE("Size: " << hitcontainer.size());
63 
64  for (unsigned int i = 0; i < hitcontainer.size(); ++i) {
65  const std::shared_ptr<MuonHoughHit> hit = hitcontainer.getHit(i);
66  ATH_MSG_VERBOSE(hit->getHitx() << " " << hit->getHity() << " " << hit->getHitz() << " " << hit->getMeasuresPhi() << " "
67  << hit->getWhichDetector() << " " << hit->getProbability() << " " << hit->getWeight() << " "
68  << hit->getAssociated());
69  }
70  }
71  makePatterns(MuonHough::hough_xy, weightmdt, hitcontainer, houghpattern);
72 
73  if (m_use_cosmics) {
74  makePatterns(MuonHough::hough_rzcosmics, weightmdt, hitcontainer, houghpattern);
75  } else if (m_use_curvedhough) {
76  makePatterns(MuonHough::hough_curved_at_a_cylinder, weightmdt, hitcontainer, houghpattern);
77  } else {
78  makePatterns(MuonHough::hough_rz, weightmdt, hitcontainer, houghpattern);
79  }
80 
81  ATH_MSG_VERBOSE("End makePatterns ");
82 }
83 
84 void MuonHoughPatternTool::makePatterns(int id_number, double weightmdt, const MuonHoughHitContainer& event,
85  MuonHoughPatternContainerShip& houghpattern) const {
86  ATH_MSG_DEBUG("makePatterns");
87 
88  resetAssociation(event); // resets association, for hits that are already assigned to pattern in a previous hough
89 
90  std::unique_ptr<MuonHoughHitContainer> event_for_hough{whichEventHough(id_number, event, weightmdt)};
91  std::unique_ptr<MuonHoughHitContainer> event_for_association{whichEventAssociation(id_number, event)};
92 
93  if (msgLevel(MSG::VERBOSE)) {
94  ATH_MSG_VERBOSE("Size event fill: " << event_for_hough->size());
95  for (unsigned int i = 0; i < event_for_hough->size(); ++i) {
96  const std::shared_ptr<MuonHoughHit> hit = event_for_hough->getHit(i);
97  ATH_MSG_VERBOSE(hit->getHitx() << " " << hit->getHity() << " " << hit->getHitz() << " " << hit->getMeasuresPhi() << " "
98  << hit->getWhichDetector() << " " << hit->getProbability() << " " << hit->getWeight() << " "
99  << hit->getAssociated());
100  }
101 
102  ATH_MSG_VERBOSE("Size event association: " << event_for_association->size());
103  for (unsigned int i = 0; i < event_for_association->size(); ++i) {
104  const std::shared_ptr<MuonHoughHit> hit = event_for_association->getHit(i);
105  ATH_MSG_VERBOSE(hit->getHitx() << " " << hit->getHity() << " " << hit->getHitz() << " " << hit->getMeasuresPhi() << " "
106  << hit->getWhichDetector() << " " << hit->getProbability() << " " << hit->getWeight() << " "
107  << hit->getAssociated());
108  }
109 
110  ATH_MSG_DEBUG("size of event: " << event_for_association->size() << " id_number: " << id_number);
111  }
112  std::unique_ptr<MuonHoughTransformSteering> houghtransform{whichHoughTransform(id_number)}; // const?
113 
114  ATH_MSG_DEBUG("HoughTransform chosen");
115 
116  bool test_for_next_level = true;
117 
118  for (int level = 0; level < m_maximum_level; level++) {
119  if (test_for_next_level) {
120  ATH_MSG_DEBUG("Iteration number: " << level);
121 
122  houghtransform->resetHisto();
123  ATH_MSG_DEBUG("fillHistos size hits not in patterns " << event_for_hough->size());
124  houghtransform->fill(*event_for_hough);
125 
126  if (m_use_histos && level == 0 && id_number == MuonHough::hough_curved_at_a_cylinder) {
127  const MuonHoughHisto2DContainer& histos = houghtransform->histos();
128  TDirectory* dir = gDirectory;
129  m_file->cd();
130  for (int i = 0; i < histos.size(); ++i) {
131  const std::string hname = "hough_call_" + std::to_string(m_ncalls) + "_hist_" + std::to_string(i);
132  histos.getHisto(i)->bookAndFillRootHistogram(hname)->Write();
133  }
134  gDirectory = dir;
135  ++m_ncalls;
136  }
137 
138  // hitcontainer for association not updated
139  test_for_next_level = analyseHisto(id_number, level, event_for_association, houghtransform, houghpattern);
140 
141  if (test_for_next_level) {
142  event_for_hough = whichEventHough(id_number, *event_for_hough, weightmdt);
143  ATH_MSG_DEBUG("New event size for transform: " << event_for_hough->size());
144  }
145  } else {
146  break;
147  }
148  }
149 
150 } // id_number
151 
153  if (m_use_histos) // debug histos
154  {
155  m_file = std::make_unique<TFile>("HoughPattern.root", "RECREATE");
156  }
157 
158  ATH_MSG_DEBUG("Use Cosmic Settings: " << m_use_cosmics);
159 
160  if (!m_use_cosmics) {
161  // change histogram sizes:
162  useIPMuons();
163  }
164 
165  else {
168  // only 1 maximum search (number of sectors ==1):
169  m_number_of_maxima = 1;
170  // no curved hough for cosmics (muons assumed from ip):
171  m_use_curvedhough = false;
172  }
173 
174  ATH_MSG_VERBOSE("Thresholds for histo: xyz: " << m_thresholdhisto_xyz << " rz: " << m_thresholdhisto_rz);
175 
176  ATH_MSG_VERBOSE("Thresholds for pattern: xyz: " << m_thresholdpattern_xyz << " rz: " << m_thresholdpattern_rz);
177 
178  ATH_MSG_DEBUG("Number of iterations: " << m_maximum_level << " Maxima per iteration: " << m_number_of_maxima);
179 
180  return StatusCode::SUCCESS;
181 }
182 
184  for (unsigned int i = 0; i < event.size(); ++i) {
185  std::shared_ptr<MuonHoughHit> hit = event.getHit(i);
186  hit->setAssociated(false);
187  hit->setId(-1); // ugly, to be changed?
188  }
189 }
190 
192  ATH_MSG_VERBOSE("finalize()");
193 
194  if (m_use_histos) {
195  m_file->Write();
196  m_file.reset();
197  }
198 
199  return StatusCode::SUCCESS;
200 }
201 
203  MuonHoughPatternContainerShip houghpattern;
204  houghpattern.reserve(m_number_of_ids);
205  for (int i = 0; i < m_number_of_ids; ++i) {
206  MuonHoughPatternContainer which_segment_vector;
207  which_segment_vector.reserve(m_maximum_level);
208  houghpattern.emplace_back(std::move(which_segment_vector));
209 
210  for (int lvl = 0; lvl < m_maximum_level; lvl++) {
211  MuonHoughPatternCollection level_vector;
212  level_vector.reserve(m_number_of_maxima);
213  houghpattern[i].emplace_back(std::move(level_vector));
214 
215  for (int maximum_number = 0; maximum_number < m_number_of_maxima; maximum_number++) {
216  houghpattern[i][lvl].emplace_back(nullptr);
217 
218  } // maximum_number
219  } // maximum_level
220  } // number_of_ids
221  return houghpattern;
222 } // emptyHoughPattern
223 
224 bool MuonHoughPatternTool::analyseHisto(int id_number, int level, const std::unique_ptr<MuonHoughHitContainer>& event_to_analyse,
225  std::unique_ptr<MuonHoughTransformSteering>& houghtransform,
226  MuonHoughPatternContainerShip& houghpatterns_all) const {
227  ATH_MSG_VERBOSE("analyseHisto MuonHoughPatternTool (start)");
228 
237  bool test_for_next_level = false;
238 
239  const unsigned int threshold_for_next_houghpattern = getThresholdHoughPattern(id_number);
240  double numberofmaxima = 0;
241  double maximum_residu = m_maximum_residu_mm;
242  if (m_use_cosmics) { maximum_residu = m_maximum_residu_mm_cosmics; }
243  MuonHoughPatternCollection houghpatterns = houghtransform->constructHoughPatterns(
244  *event_to_analyse, maximum_residu, m_maximum_residu_angle, m_number_of_maxima);
245 
246  for (unsigned int maximum_number = 0; maximum_number < houghpatterns.size(); ++maximum_number) {
247 
248  std::unique_ptr<MuonHoughPattern>& houghpattern = houghpatterns[maximum_number];
249  if (!houghpattern) { continue; }
250  numberofmaxima = houghpattern->getMaximumHistogram();
251  ATH_MSG_DEBUG("id_number: " << id_number << " maximum_number: " << maximum_number << " size patternseg: " << houghpattern->size());
252 
253  if (houghpattern->empty()) { ATH_MSG_DEBUG("houghpattern==0"); }
254 
255  // some print statements
256  if (houghpattern->size() < numberofmaxima) {
257  ATH_MSG_DEBUG("ERROR: houghpattern smaller than maximum, id: " << id_number << " houghpattern.size(): " << houghpattern->size()
258  << " numberofmaxima: " << numberofmaxima);
259  }
260 
261  if (m_printlevel >= 4) { houghpattern->printHoughPattern(); }
262 
263  // checks for next level / maximum
264 
265  if (houghpattern->size() >= threshold_for_next_houghpattern) {
266  if (level + 1 >= m_maximum_level) {
267  ATH_MSG_DEBUG("possibly more levels");
268  } else {
269  test_for_next_level = hitsLeft(*event_to_analyse);
270  }
271  } else if (maximum_number == 0) {
272  ATH_MSG_DEBUG("houghpattern too small for next level : " << level << " id: " << id_number);
273  }
274 
275  // print_of houghpatterns:
276  ATH_MSG_DEBUG("Size of HoughPatterns: " << houghpattern->size());
277  houghpatterns_all[id_number][level][maximum_number] = std::move(houghpattern);
278 
279  } // maximum_number
280 
281  ATH_MSG_DEBUG(" Test for next level: " << test_for_next_level);
282 
283  return test_for_next_level;
284 
285 } // analyseHisto
286 
288  int number_of_hits = event.size();
289  for (int hitid = 0; hitid < number_of_hits; ++hitid) {
290  if (!event.getHit(hitid)->getAssociated()) { return true; }
291  }
292  return false;
293 }
294 
296  int number_of_hits_left = 0;
297  int number_of_hits = event.size();
298 
299  for (int hitid = 0; hitid < number_of_hits; ++hitid) { number_of_hits_left += !event.getHit(hitid)->getAssociated(); }
300 
301  // logically impossible --- if (number_of_hits_left <0) {ATH_MSG_WARNING("number of hits smaller than 0");}
302 
303  ATH_MSG_VERBOSE("numberOfHits left: " << number_of_hits_left);
304  ATH_MSG_VERBOSE("number_of_hits: " << number_of_hits);
305  return number_of_hits_left;
306 }
307 
308 bool MuonHoughPatternTool::hitInHoughPattern(const std::shared_ptr<MuonHoughHit>& hit, const MuonHoughPatternContainer& houghpattern) const {
309  // checks if hit is already assigned to a houghpattern
310 
311  for (unsigned int i = 0; i < houghpattern.size(); ++i) {
312  for (unsigned int j = 0; j < houghpattern[i].size(); ++j) {
313  if (houghpattern[i][j]) {
314  if (houghpattern[i][j]->hitInHoughPattern(hit)) {
315  ATH_MSG_VERBOSE("Hit in hough pattern found level " << i << " max " << j << "hitid: " << hit->getId());
316  return true;
317  }
318  }
319  }
320  }
321  return false;
322 }
323 
325  double weight_trigger_hits = 1.;
326  double weight_mdt_hits = 1.;
327 
328  switch (id_number) {
329  case MuonHough::hough_xy:
330  case MuonHough::hough_yz:
331  weight_trigger_hits = 1 - (level - 1) * (1. / (m_maximum_level + 0.0)); // 1 , 1, 0.8, 0.6 , 0.4
332  if (weight_trigger_hits > 1) weight_trigger_hits = 1.;
333  weight_mdt_hits = weight_trigger_hits;
334  break;
335  case MuonHough::hough_rz:
340  switch (level) {
341  case 0:
342  weight_trigger_hits = 1.;
343  weight_mdt_hits = 1.;
344  break;
345  case 1:
346  weight_trigger_hits = 1.;
347  weight_mdt_hits = 1.;
348  break;
349  case 2:
350  weight_trigger_hits = 1.;
351  weight_mdt_hits = 0.75;
352  break;
353  case 3:
354  weight_trigger_hits = 0.75;
355  weight_mdt_hits = 0.5;
356  break;
357  case 4:
358  weight_trigger_hits = 0.5;
359  weight_mdt_hits = 0.25;
360  break;
361  default:
362  ATH_MSG_DEBUG("no weight defined for this level");
363  weight_trigger_hits = 0.5;
364  weight_mdt_hits = 0.25;
365  }
366  break;
367  default: ATH_MSG_WARNING("no valid id (id_number)");
368  }
369 
370  for (unsigned int i = 0; i < event.size(); ++i) {
371  std::shared_ptr<MuonHoughHit> hit = event.getHit(i);
372  MuonHough::DetectorTechnology technology = hit->getDetectorId();
373  switch (technology) {
374  case MuonHough::CSC:
375  case MuonHough::RPC:
376  case MuonHough::TGC: hit->setWeight(hit->getOrigWeight() * weight_trigger_hits); break;
377  case MuonHough::MDT: hit->setWeight(hit->getOrigWeight() * weight_mdt_hits); break;
378  default: ATH_MSG_WARNING("no valid detector technology");
379  }
380  }
381 }
382 
384  if (weightmdt < 0.5) return;
385  // else do nothing (e.g. cosmics case)
386  for (unsigned int i = 0; i < event.size(); ++i) {
387  std::shared_ptr<MuonHoughHit> hit = event.getHit(i);
388  MuonHough::DetectorTechnology technology = hit->getDetectorId();
389  if (technology == MuonHough::MDT) {
390  // recalculate weight, especially important for cavern background MDT events
391  double p_old = hit->getOrigWeight();
392  double p_calc = 0.25 * p_old * (1. - weightmdt);
393  double p_new = p_calc / (p_calc + weightmdt * (1 - p_old));
394  ATH_MSG_VERBOSE(" MDT probability old " << p_old << " Recalculated " << p_new);
395  hit->setWeight(p_new);
396  }
397  }
398 }
399 
400 int MuonHoughPatternTool::overlapHoughPatterns(const MuonHoughPattern& houghpattern1, const MuonHoughPattern& houghpattern2) const {
401  // both vectors houghpatterns->m_hitid[] are ordered, asked is the percentage of overlap between both vectors
402 
403  int overlap = 0;
404  unsigned int j = 0;
405 
406  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
407  while (j < houghpattern2.size()) {
408  if (houghpattern1.getHitId(i) == houghpattern2.getHitId(j)) {
409  ++overlap;
410  ++j; // this j cant be found again
411  break;
412  }
413  if (houghpattern1.getHitId(i) < houghpattern2.getHitId(j)) { break; }
414  ++j;
415  }
416  }
417  double percentage1 = (1.0 * overlap) / houghpattern1.size(); // size() gives double
418  double percentage2 = (1.0 * overlap) / houghpattern2.size();
419 
420  ATH_MSG_DEBUG("Percentage Overlap: " << percentage1 << " " << percentage2);
421  return overlap;
422 }
423 
424 std::unique_ptr<MuonHoughHitContainer> MuonHoughPatternTool::whichEventAssociation(int id_number,
425  const MuonHoughHitContainer& event) const {
426  std::unique_ptr<MuonHoughHitContainer> event_to_analyse = std::make_unique<MuonHoughHitContainer>();
427 
428  switch (id_number) {
429  case MuonHough::hough_xy:
430 
431  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
432  std::shared_ptr<MuonHoughHit> hit = event.getHit(hitid);
433  if (hit->getMeasuresPhi()) {
435  event_to_analyse->addHit(hit);
436  }
437  }
438  }
439  break;
440  case MuonHough::hough_yz:
441  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
442  std::shared_ptr<MuonHoughHit> hit = event.getHit(hitid);
443  event_to_analyse->addHit(hit);
444  }
445  break;
446  case MuonHough::hough_rz:
449  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
450  std::shared_ptr<MuonHoughHit> hit = event.getHit(hitid);
451  if (!hit->getMeasuresPhi()) {
453  event_to_analyse->addHit(hit);
454  }
455  }
456  }
457  break;
459  if (m_use_rpc_measures_eta == 1) {
460  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
461  std::shared_ptr<MuonHoughHit> hit = event.getHit(hitid);
462  if (hit->getDetectorId() == MuonHough::RPC) {
463  if (!hit->getMeasuresPhi()) { event_to_analyse->addHit(hit); }
464  }
465  }
466  } else {
467  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
468  std::shared_ptr<MuonHoughHit> hit = event.getHit(hitid);
469  if (hit->getDetectorId() == MuonHough::RPC) { event_to_analyse->addHit(hit); }
470  }
471  }
472  break;
474  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
475  std::shared_ptr<MuonHoughHit> hit = event.getHit(hitid);
476  if (hit->getDetectorId() == MuonHough::MDT) { event_to_analyse->addHit(hit); }
477  }
478  break;
479  default: ATH_MSG_WARNING(" no valid id");
480  }
481 
482  return event_to_analyse;
483 }
484 
485 std::unique_ptr<MuonHoughHitContainer> MuonHoughPatternTool::whichEventHough(int id_number, const MuonHoughHitContainer& event,
486  double weightmdt) const {
487  ATH_MSG_DEBUG("whichEventHough::size of event: " << event.size());
488  std::unique_ptr<MuonHoughHitContainer> hits_not_in_patterns{hitsNotInPattern(event, id_number)};
489  ATH_MSG_DEBUG("whichEventHough::hitsNotInPattern: " << hits_not_in_patterns->size());
490  std::unique_ptr<MuonHoughHitContainer> event_to_analyse = std::make_unique<MuonHoughHitContainer>();
491 
492  switch (id_number) {
493  case MuonHough::hough_xy:
494 
495  for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
496  std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
497  if (hit->getMeasuresPhi() == 1) {
498  if (hitThroughCut(hit, weightmdt)) {
500  event_to_analyse->addHit(hit);
501  }
502  }
503  }
504  }
505  break;
506  case MuonHough::hough_yz:
507  for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
508  std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
509  if (hitThroughCut(hit, weightmdt)) { event_to_analyse->addHit(hit); }
510  }
511  break;
512  case MuonHough::hough_rz:
515  for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
516  std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
517  if (hitThroughCut(hit, weightmdt)) {
518  if (hit->getMeasuresPhi() == 0) {
520  event_to_analyse->addHit(hit);
521  }
522  }
523  }
524  }
525  break;
527  if (m_use_rpc_measures_eta == 1) {
528  for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
529  if (hits_not_in_patterns->getDetectorId(hitid) == MuonHough::RPC) {
530  std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
531  if (hit->getMeasuresPhi() == 0) { event_to_analyse->addHit(hit); }
532  }
533  }
534  } else {
535  for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
536  if (hits_not_in_patterns->getDetectorId(hitid) == MuonHough::RPC) {
537  std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
538  event_to_analyse->addHit(hit);
539  }
540  }
541  }
542  break;
544  for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
545  if (hits_not_in_patterns->getDetectorId(hitid) == MuonHough::MDT) {
546  std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
547  if (hitThroughCut(hit, weightmdt)) { event_to_analyse->addHit(hit); }
548  }
549  }
550  break;
551  default: ATH_MSG_WARNING(" no valid id");
552  }
553 
554  return event_to_analyse;
555 }
556 
557 std::unique_ptr<MuonHoughTransformSteering> MuonHoughPatternTool::whichHoughTransform(int id_number) const {
558  std::unique_ptr<MuonHoughTransformer> houghtransformer;
559 
560  int nbins = 0;
561  int nbins_angle = 0;
562  double detectorsize_angle_xy = m_detectorsize_angle_xyz;
563  double stepsize_per_angle_xy = m_stepsize_per_angle_xyz;
564  double detectorsize_curved = m_nbins_curved / 2.;
565  double stepsize_xy = m_stepsize_xy;
566  // additional histograms for overlaps:
567  int number_of_histos_rz = 2 * m_number_of_sectors_rz;
568 
569  switch (id_number) {
570  case MuonHough::hough_xy:
571  if (m_use_cosmics) {
572  stepsize_xy = m_stepsize_xy_cosmics;
573  stepsize_per_angle_xy = m_stepsize_per_angle_xy_cosmics;
574  detectorsize_angle_xy = (m_detectorsize_angle_xyz / 2.); // patterns not split for cosmics
575  }
576  nbins = static_cast<int>(2 * m_detectorsize_xy / stepsize_xy);
577  nbins_angle = static_cast<int>(detectorsize_angle_xy / stepsize_per_angle_xy);
578  houghtransformer = std::make_unique<MuonHoughTransformer_xy>(nbins, nbins_angle, m_detectorsize_xy, detectorsize_angle_xy,
580  break;
581 
582  case MuonHough::hough_yz:
583  nbins = static_cast<int>(2 * m_detectorsize_yz / m_stepsize_yz);
584  nbins_angle = static_cast<int>(m_detectorsize_angle_xyz / m_stepsize_per_angle_xyz);
585  houghtransformer = std::make_unique<MuonHoughTransformer_yz>(nbins, nbins_angle, m_detectorsize_yz, m_detectorsize_angle_xyz,
587  break;
588 
589  case MuonHough::hough_rz:
592  nbins = static_cast<int>(2 * m_detectorsize_rz / m_stepsize_rz);
593  nbins_angle = static_cast<int>(m_detectorsize_angle_rz / m_stepsize_per_angle_rz);
594  houghtransformer = std::make_unique<MuonHoughTransformer_rz>(nbins, nbins_angle, m_detectorsize_rz, m_detectorsize_angle_rz,
596  break;
597 
599  nbins = static_cast<int>(2 * m_detectorsize_rz / m_stepsize_rz_cosmics);
600  nbins_angle = static_cast<int>(m_detectorsize_angle_rz / m_stepsize_per_angle_rz_cosmics);
601  houghtransformer = std::make_unique<MuonHoughTransformer_rzcosmics>(
603  break;
604 
607  nbins_angle = static_cast<int>(m_detectorsize_angle_rz / (2 * m_stepsize_per_angle_rz));
608  houghtransformer = std::make_unique<MuonHoughTransformer_CurvedAtACylinder>(
609  nbins, nbins_angle, detectorsize_curved, m_detectorsize_angle_rz, m_thresholdhisto_rz, number_of_histos_rz);
610  break;
611 
612  default: ATH_MSG_WARNING("no valid id");
613  }
614 
615  if (houghtransformer) {
616  houghtransformer->useNegativeWeights(m_use_negative_weights);
617  houghtransformer->setIP(!m_use_cosmics);
618  }
619 
620  ATH_MSG_DEBUG("**** histo houghtransformer: ****");
621  ATH_MSG_DEBUG("Id number: " << id_number);
622  ATH_MSG_DEBUG("NBins: " << nbins << " angle: " << nbins_angle);
623  if (m_use_negative_weights) ATH_MSG_DEBUG(" Negative weights are used ");
624  ATH_MSG_DEBUG("IP setting: " << !m_use_cosmics);
625  ATH_MSG_DEBUG("*********************************");
626  return std::make_unique<MuonHoughTransformSteering>(std::move(houghtransformer));
627 }
628 
629 std::vector<int> MuonHoughPatternTool::maxLevelHoughPattern(const MuonHoughPatternContainerShip& houghpattern) const // obsolete?
630 {
631  std::vector<int> maxlevel_houghpattern(m_number_of_ids);
632 
633  for (int id_number = 0; id_number < m_number_of_ids; id_number++) {
634  maxlevel_houghpattern[id_number] = maxLevelHoughPattern(houghpattern, id_number);
635  } // number_of_ids
636  return maxlevel_houghpattern;
637 }
638 
639 int MuonHoughPatternTool::maxLevelHoughPattern(const MuonHoughPatternContainerShip& houghpattern, int id_number) const {
640  int maxlevel = houghpattern[id_number].size();
641  bool continu = true;
642  while (maxlevel >= 1 && continu == 1) {
643  unsigned int maximum_number = 0;
644 
645  while (continu && maximum_number < houghpattern[id_number][maxlevel - 1].size()) // m_number_of_maxima)
646  {
647  ATH_MSG_DEBUG("maximum_number: " << maximum_number << " "
648  << "maxlevel_houghpattern: " << maxlevel << " id: " << id_number);
649  if (!houghpattern[id_number][maxlevel - 1][maximum_number]->empty()) { continu = false; }
650 
651  ++maximum_number;
652 
653  } // number_of_maxima
654 
655  if (continu) { maxlevel--; }
656  } // while
657  return maxlevel;
658 } // maxLevelHoughPattern
659 
660 void MuonHoughPatternTool::transformCoordsMaximum(std::pair<double, double>& coordsmaximum, double r0_true) {
661  double z_true = coordsmaximum.first;
662  double theta_true = coordsmaximum.second;
663 
664  // double theta_cor = - 0.042*(r0_true/4000.)*(r0_true/4000);
665  double theta_cor = m_theta_cor_constant * (r0_true / m_theta_cor_constant2) * (r0_true / m_theta_cor_constant2);
666 
667  // double z_cor = - 10000 * (std::cos(theta_true) * r0_true/6000.) * (std::cos(theta_true)*r0_true/6000.);
668  double z_cor =
669  m_z_cor_constant * (std::cos(theta_true) * r0_true / m_z_cor_constant2) * (std::cos(theta_true) * r0_true / m_z_cor_constant2);
670 
671  double z_rec = z_true + z_cor;
672  double theta_rec = theta_true + theta_cor;
673 
674  if (std::cos(theta_true) < 0) {
675  z_rec = z_true - z_cor;
676  theta_rec = theta_true - theta_cor;
677  }
678 
679  coordsmaximum.first = z_rec;
680  coordsmaximum.second = theta_rec;
681 } // transformCoordsMaximum
682 
683 std::unique_ptr<MuonPrdPatternCollection> MuonHoughPatternTool::getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const {
684  std::unique_ptr<MuonPrdPatternCollection> phipatterncollection = std::make_unique<MuonPrdPatternCollection>();
685  phipatterncollection->reserve(m_maximum_level * m_number_of_maxima);
686 
687  MuonHoughPatternContainer& phipatterns = houghpatterns[MuonHough::hough_xy];
688 
689  // Bookkeeping for merged or double phi pattersn
690 
691  std::map<MuonHoughPattern*, int> mergedpatterns;
692  for (unsigned int i = 0; i < phipatterns.size(); ++i) {
693  for (unsigned int j = 0; j < phipatterns[i].size(); ++j) {
694  std::unique_ptr<MuonHoughPattern>& houghpattern = phipatterns[i][j];
695  if (!houghpattern) continue;
696  mergedpatterns[houghpattern.get()] = 0;
697  }
698  }
699 
700  // Search for identical phi patterns and remove them
701  // and search for overlapping phi patterns and merge them for IP constraint (10-1-2008, does merging ever happen? JS)
702 
703  for (unsigned int i = 0; i < phipatterns.size(); ++i) {
704  for (unsigned int j = 0; j < phipatterns[i].size(); ++j) {
705  std::unique_ptr<MuonHoughPattern>& houghpattern1 = phipatterns[i][j];
706  if (!houghpattern1) continue;
707  if (phipatterns[i][j]->size() < m_thresholdpattern_xyz) continue;
708  ATH_MSG_DEBUG(" patterns size before Merge " << phipatterns[i][j]->size());
709  for (unsigned int k = i; k < phipatterns.size(); k++) {
710  for (unsigned int l = 0; l < phipatterns[k].size(); l++) {
711  std::unique_ptr<MuonHoughPattern>& houghpattern2 = phipatterns[k][l];
712  if (!houghpattern2) continue;
713  if (phipatterns[k][l]->size() < m_thresholdpattern_xyz) continue;
714  //cppcheck-suppress mismatchingContainers
715  if (houghpattern1.get() == houghpattern2.get()) continue;
716  if (mergedpatterns[houghpattern1.get()] == 1) continue;
717  if (mergedpatterns[houghpattern2.get()] == 1) continue;
718  const double phi1 = houghpattern1->getEPhi();
719  const double phi2 = houghpattern2->getEPhi();
720  CxxUtils::sincos scphi1(phi1);
721  CxxUtils::sincos scphi2(phi2);
722  double dotprod = scphi1.cs * scphi2.cs + scphi1.sn * scphi2.sn;
723  if (dotprod > 1.)
724  dotprod = 1.;
725  else if (dotprod < -1.)
726  dotprod = -1.;
727  double psi = std::acos(dotprod);
728  const double the1 = houghpattern1->getETheta();
729  const double the2 = houghpattern2->getETheta();
730  CxxUtils::sincos scthe1(the1);
731  CxxUtils::sincos scthe2(the2);
732  dotprod = scthe1.cs * scthe2.cs + scthe1.sn * scthe2.sn;
733  if (dotprod > 1.)
734  dotprod = 1.;
735  else if (dotprod < -1.)
736  dotprod = -1.;
737  double chi = std::acos(dotprod);
738  ATH_MSG_DEBUG(" patterns phi1 " << phi1 << " phi2 " << phi2 << " psi " << psi);
739  ATH_MSG_DEBUG(" patterns the1 " << the1 << " the2 " << the2 << " chi " << chi);
740  if (chi < 0.5 || psi < 0.5) {
741  int overlap = overlapHoughPatterns(*houghpattern1, *houghpattern2);
742  ATH_MSG_DEBUG(" Phi Overlap " << overlap << " size1 " << houghpattern1->size() << " size2 "
743  << houghpattern2->size());
744  int ns1 = houghpattern1->size();
745  int ns2 = houghpattern2->size();
746  if (overlap <= ns1 && overlap == ns2) {
747  ATH_MSG_DEBUG(" DROP patterns same hits ");
748  mergedpatterns[houghpattern2.get()] = 1;
749  continue;
750  }
751  if (overlap == ns1 && overlap < ns2) {
752  ATH_MSG_DEBUG(" DROP patterns same hits ");
753  mergedpatterns[houghpattern1.get()] = 1;
754  continue;
755  }
756  if (m_use_ip) {
757  // Merge and do cleaning (IP constraint)
758  std::unique_ptr<Muon::MuonPrdPattern> muonpattern;
759  if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 >= ns2) {
760  muonpattern = houghPatternsToOnePhiPattern(*phipatterns[i][j], *phipatterns[k][l]);
761  }
762  if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 < ns2) {
763  // Merge and do cleaning (IP constraint)
764  muonpattern = houghPatternsToOnePhiPattern(*phipatterns[k][l], *phipatterns[i][j]);
765  }
766  if (muonpattern) {
767  phipatterncollection->push_back(std::move(muonpattern));
768  mergedpatterns[houghpattern1.get()] = 1;
769  mergedpatterns[houghpattern2.get()] = 1;
770  continue;
771  }
772  } // use IP
773  } // angular cut
774  }
775  } // end k
776  }
777  } // end i
778 
779  for (unsigned int i = 0; i < phipatterns.size(); ++i) {
780  for (unsigned int j = 0; j < phipatterns[i].size(); ++j) {
781  std::unique_ptr<MuonHoughPattern>& houghpattern = phipatterns[i][j];
782  if (!houghpattern) { continue; }
783  if (mergedpatterns[houghpattern.get()] == 1) continue;
784 
785  if (!phipatterns[i][j]->empty()) {
786  std::unique_ptr<Muon::MuonPrdPattern> muonpattern;
787 
788  if (!m_use_ip) {
789  muonpattern = houghPatternToPhiPattern(*phipatterns[i][j]);
790  } else {
791  muonpattern = houghPatternToCleanPhiPattern(*phipatterns[i][j]);
792  }
793 
794  if (muonpattern) {
795  ATH_MSG_DEBUG(" Lift MuonPhiPattern size " << muonpattern->numberOfContainedPrds());
796  if (msgLvl(MSG::VERBOSE)) { printPattern(muonpattern.get()); }
797  phipatterncollection->push_back(std::move(muonpattern));
798  }
799  }
800  }
801  }
802 
803  return phipatterncollection;
804 }
805 
806 std::unique_ptr<MuonPrdPatternCollection> MuonHoughPatternTool::getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const {
807  std::unique_ptr<MuonPrdPatternCollection> etapatterncollection = std::make_unique<MuonPrdPatternCollection>();
808 
809  int maximum_number_of_patterns = m_maximum_level * m_number_of_maxima;
810 
811  if (m_use_curvedhough) maximum_number_of_patterns = 2 * maximum_number_of_patterns;
812 
813  etapatterncollection->reserve(maximum_number_of_patterns);
814 
815  int id = MuonHough::hough_rz;
816  if (m_use_cosmics) {
818  ATH_MSG_DEBUG(" GetEtaMuonPatterns Use RZ curved hough patterns ");
819  } else if (m_use_curvedhough) {
821  ATH_MSG_DEBUG(" GetEtaMuonPatterns Use curved hough patterns ");
822  } else {
823  ATH_MSG_DEBUG(" GetEtaMuonPatterns Use RZ hough patterns ");
824  }
825 
826  MuonHoughPatternContainer& etapatterns = houghpatterns[id];
827 
828  // Bookkeeping for merged or double eta patterns
829 
830  std::map<MuonHoughPattern*, int> mergedpatterns;
831  for (unsigned int i = 0; i < etapatterns.size(); ++i) {
832  for (unsigned int j = 0; j < etapatterns[i].size(); ++j) {
833  std::unique_ptr<MuonHoughPattern>& houghpattern = etapatterns[i][j];
834  if (!houghpattern) continue;
835  mergedpatterns[houghpattern.get()] = 0;
836  }
837  }
838 
839  // Search for identical eta patterns and remove them
840  // and search for overlapping eta patterns and merge them (10-1-2008, does merging ever happen? JS, yes it does!)
841 
842  for (unsigned int i = 0; i < etapatterns.size(); ++i) {
843  for (unsigned int j = 0; j < etapatterns[i].size(); ++j) {
844  std::unique_ptr<MuonHoughPattern>& houghpattern1 = etapatterns[i][j];
845  if (!houghpattern1) continue;
846  if (etapatterns[i][j]->size() < m_thresholdpattern_rz) continue;
847  ATH_MSG_DEBUG(" Eta patterns size before Merge " << etapatterns[i][j]->size());
848  for (unsigned int k = i; k < etapatterns.size(); k++) {
849  for (unsigned int l = 0; l < etapatterns[k].size(); l++) {
850  std::unique_ptr<MuonHoughPattern>& houghpattern2 = etapatterns[k][l];
851  if (!houghpattern2) continue;
852  if (etapatterns[k][l]->size() < m_thresholdpattern_rz) continue;
853  //cppcheck-suppress mismatchingContainers
854  if (houghpattern1.get() == houghpattern2.get()) continue;
855  if (mergedpatterns[houghpattern1.get()] == 1) continue;
856  if (mergedpatterns[houghpattern2.get()] == 1) continue;
857 
858  // calculate if curvatures are compatible, not done for cosmics
859  double alpha = 0.;
860  if (!m_use_cosmics) {
861  double curv1 = houghpattern1->getECurvature();
862  double curv2 = houghpattern2->getECurvature();
863  if (std::abs(curv1) < 1001. || std::abs(curv2) < 1001.) {
864  ATH_MSG_DEBUG("Curvature too small, should not be possible: " << curv1 << " " << curv2);
865  continue;
866  }
867 
868  double angle1 = std::acos((std::abs(curv1) - 1000.) / curv1); // angle change after 1000 (mm)
869  double angle2 = std::acos((std::abs(curv2) - 1000.) / curv2);
870  alpha = std::abs(std::sin(angle1 - angle2));
871 
872  ATH_MSG_DEBUG(" patterns curv1 " << curv1 << " curv2 " << curv2 << " alpha " << alpha);
873  }
874 
875  double phi1 = houghpattern1->getEPhi();
876  double phi2 = houghpattern2->getEPhi();
877  double dotprod = std::cos(phi1) * std::cos(phi2) + std::sin(phi1) * std::sin(phi2);
878  if (dotprod > 1.)
879  dotprod = 1.;
880  else if (dotprod < -1.)
881  dotprod = -1.;
882  double psi = std::acos(dotprod);
883  double the1 = houghpattern1->getETheta();
884  double the2 = houghpattern2->getETheta();
885  dotprod = std::cos(the1) * std::cos(the2) + std::sin(the1) * std::sin(the2);
886  if (dotprod > 1.)
887  dotprod = 1.;
888  else if (dotprod < -1.)
889  dotprod = -1.;
890  double chi = std::acos(dotprod);
891 
892  ATH_MSG_DEBUG(" patterns phi1 " << phi1 << " phi2 " << phi2 << " psi " << psi);
893  ATH_MSG_DEBUG(" patterns the1 " << the1 << " the2 " << the2 << " chi " << chi);
894 
895  if (chi < 0.5 && psi < 0.5 && alpha < 0.05) { // 0.05 (rad) corresponds with 3 degrees per m
896 
897  int overlap = overlapHoughPatterns(*houghpattern1, *houghpattern2);
898  const int ns1 = houghpattern1->size();
899  const int ns2 = houghpattern2->size();
900 
901  ATH_MSG_DEBUG(" Eta Overlap " << overlap << " size1 " << ns1 << " size2 " << ns2);
902 
903  if (overlap == ns2 && overlap <= ns1) {
904  ATH_MSG_DEBUG(" DROP patterns overlapping hits ");
905  mergedpatterns[houghpattern2.get()] = 1;
906  continue;
907  }
908  if (overlap == ns1 && overlap < ns2) {
909  ATH_MSG_DEBUG(" DROP patterns overlapping hits ");
910  mergedpatterns[houghpattern1.get()] = 1;
911  continue;
912  }
913  std::unique_ptr<Muon::MuonPrdPattern> muonpattern;
914  // Look for 80% or more overlap
915  if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 >= ns2) {
916  muonpattern = houghPatternsToOneEtaPattern(*etapatterns[i][j], *etapatterns[k][l]);
917  }
918  if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 < ns2) {
919  muonpattern = houghPatternsToOneEtaPattern(*etapatterns[k][l], *etapatterns[i][j]);
920  }
921  if (muonpattern) {
922  etapatterncollection->push_back(std::move(muonpattern));
923  mergedpatterns[houghpattern1.get()] = 1;
924  mergedpatterns[houghpattern2.get()] = 1;
925  continue;
926  }
927  } // end angular cut
928  }
929  } // end k
930  }
931  } // end i
932 
933  for (unsigned int i = 0; i < etapatterns.size(); ++i) {
934  for (unsigned int j = 0; j < etapatterns[i].size(); ++j) {
935  std::unique_ptr<MuonHoughPattern>& houghpattern = etapatterns[i][j];
936  if (!houghpattern) { continue; }
937  if (mergedpatterns[houghpattern.get()] == 1) continue;
938 
939  if (!etapatterns[i][j]->empty()) {
940  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = houghPatternToEtaPattern(*etapatterns[i][j]);
941  etapatterncollection->push_back(std::move(muonpattern));
942 
943  ATH_MSG_DEBUG(" Lift MuonEtaPattern size " << etapatterns[i][j]->size());
944  if (msgLvl(MSG::VERBOSE)) { printPattern(muonpattern.get()); }
945  }
946  }
947  }
948 
949  return etapatterncollection;
950 }
951 
952 std::unique_ptr<MuonPrdPatternCollection> MuonHoughPatternTool::getCurvedMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const {
953  std::unique_ptr<MuonPrdPatternCollection> curvedpatterncollection = std::make_unique<MuonPrdPatternCollection>();
954 
955  int maximum_number_of_patterns = m_maximum_level * m_number_of_maxima;
956 
957  curvedpatterncollection->reserve(maximum_number_of_patterns);
958 
959  MuonHoughPatternContainer& curvedpatterns = houghpatterns[MuonHough::hough_curved_at_a_cylinder];
960  for (unsigned int i = 0; i < curvedpatterns.size(); ++i) {
961  for (unsigned int j = 0; j < curvedpatterns[i].size(); ++j) {
962  std::unique_ptr<MuonHoughPattern>& houghpattern = curvedpatterns[i][j];
963  if (!houghpattern) { continue; }
964 
965  if (!curvedpatterns[i][j]->empty()) {
966  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = houghPatternToEtaPattern(*curvedpatterns[i][j]);
967  curvedpatterncollection->push_back(std::move(muonpattern));
968  ATH_MSG_DEBUG(" Lift MuoncurvedPattern size " << curvedpatterns[i][j]->size());
969  }
970  }
971  }
972  return curvedpatterncollection;
973 }
974 
975 std::unique_ptr<Muon::MuonPrdPattern> MuonHoughPatternTool::houghPatternToEtaPattern(const MuonHoughPattern& houghpattern) const {
976  ATH_MSG_VERBOSE("houghPatternToEtaPattern");
977 
978  const Amg::Vector3D position = houghpattern.getEPos();
979  const Amg::Vector3D direction = houghpattern.getEDir();
980 
981  double curvature = houghpattern.getECurvature();
982  double charge = curvature < 0 ? -1 : 1.;
983  double pscale = std::abs(curvature);
984 
985  const double r0 = m_use_cosmics ? houghpattern.getERPhi() : 0.001;
986 
987  double x0 = charge * r0 * std::sin(houghpattern.getEPhi());
988  double y0 = -charge * r0 * std::cos(houghpattern.getEPhi());
989 
990  const Amg::Vector3D pos = Amg::Vector3D(x0, y0, position[2]);
991  const Amg::Vector3D dir = Amg::Vector3D(pscale * direction[0], pscale * direction[1], pscale * direction[2]);
992 
993  ATH_MSG_DEBUG("position: " << x0 << " " << y0 << " " << position[2]);
994  ATH_MSG_DEBUG("direction: " << direction[0] << " " << direction[1] << " " << direction[2]);
995 
996  ATH_MSG_DEBUG(" Lift Eta Hough Pattern with charge " << charge << " Curvature " << pscale);
997  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(pos, dir);
998 
999  for (unsigned int i = 0; i < houghpattern.size(); ++i) { muonpattern->addPrd(houghpattern.getPrd(i)); }
1000 
1001  return muonpattern;
1002 }
1003 std::unique_ptr<Muon::MuonPrdPattern> MuonHoughPatternTool::houghPatternToPhiPattern(const MuonHoughPattern& houghpattern) const {
1004  ATH_MSG_VERBOSE("houghPatternToPhiPattern");
1005 
1006  const Amg::Vector3D pos = houghpattern.getEPos();
1007  const Amg::Vector3D dir = houghpattern.getEDir();
1008 
1009  ATH_MSG_DEBUG("position: " << pos[0] << " " << pos[1] << " " << pos[2]);
1010  ATH_MSG_DEBUG("direction: " << dir[0] << " " << dir[1] << " " << dir[2]);
1011  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(pos, dir);
1012 
1013  for (unsigned int i = 0; i < houghpattern.size(); ++i) {
1014  muonpattern->addPrd(houghpattern.getPrd(i));
1015 
1016  ATH_MSG_VERBOSE("PrepRawData Added " << houghpattern.getPrd(i));
1017  }
1018 
1019  return muonpattern;
1020 }
1021 
1022 std::unique_ptr<Muon::MuonPrdPattern> MuonHoughPatternTool::houghPatternsToOneEtaPattern(const MuonHoughPattern& houghpattern1,
1023  const MuonHoughPattern& houghpattern2) const {
1024  ATH_MSG_DEBUG("houghPatternsToOneEtaPattern");
1025 
1026  const int ns1 = houghpattern1.size();
1027  const int ns2 = houghpattern2.size();
1028 
1029  const double the1 = houghpattern1.getETheta();
1030  const double the2 = houghpattern2.getETheta();
1031  const double theta = (ns1 * the1 + ns2 * the2) / (ns1 + ns2);
1032 
1033  const double phi1 = houghpattern1.getEPhi();
1034  const double phi2 = houghpattern2.getEPhi();
1035  const double cos_phi = (ns1 * std::cos(phi1) + ns2 * std::cos(phi2)) / (ns1 + ns2);
1036  const double sin_phi = (ns1 * std::sin(phi1) + ns2 * std::sin(phi2)) / (ns1 + ns2);
1037  const double phi = std::atan2(sin_phi, cos_phi);
1038 
1039  const double invcur1 = 1. / houghpattern1.getECurvature();
1040  const double invcur2 = 1. / houghpattern2.getECurvature();
1041 
1042  const Amg::Vector3D position1 = houghpattern1.getEPos();
1043  const Amg::Vector3D position2 = houghpattern2.getEPos();
1044  const double z0 = (ns1 * position1[2] + ns2 * position2[2]) / (ns1 + ns2);
1045 
1046  const double invcur = (ns1 * invcur1 + ns2 * invcur2) / (ns1 + ns2);
1047 
1048  ATH_MSG_DEBUG("Start Making one eta pattern theta " << theta << " phi " << phi << " invcur " << invcur);
1049 
1050  ATH_MSG_DEBUG("eta patterns theta1 " << the1 << " theta2 " << the2 << " phi1 " << phi1 << " phi2 " << phi2 << " invcur1 " << invcur1
1051  << " invcur2 " << invcur2 << " ns1 " << ns1 << " ns2 " << ns2);
1052 
1053  ATH_MSG_DEBUG(" z values " << z0 << " z1 " << position1[2] << " z2 " << position2[2]);
1054 
1055  // require at least two eta hits on muon pattern
1056 
1057  if (ns1 + ns2 < 2) return nullptr;
1058 
1059  double invcurvature = invcur;
1060  double charge = 1.;
1061  if (invcurvature < 0) charge = -1;
1062  double pscale = 1.;
1063  if (invcurvature != 0) pscale = 1. / std::abs(invcurvature);
1064 
1065  double r0 = 0.001;
1066 
1067  if (m_use_cosmics) { // calculate new r0
1068  r0 = (ns1 * houghpattern1.getERPhi() + ns2 * houghpattern2.getERPhi()) / (ns1 + ns2);
1069  ATH_MSG_DEBUG("New r0: " << r0);
1070  }
1071 
1072  double x0 = charge * r0 * sin_phi;
1073  double y0 = -charge * r0 * cos_phi;
1074 
1075  ATH_MSG_DEBUG(" Lift one Eta pattern charge " << charge << " curvature " << pscale);
1076 
1077  const Amg::Vector3D pos = Amg::Vector3D(x0, y0, z0);
1078  const Amg::Vector3D dir =
1079  Amg::Vector3D(pscale * std::sin(theta) * cos_phi, pscale * std::sin(theta) * sin_phi, pscale * std::cos(theta));
1080 
1081  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(pos, dir);
1082  int neta = 0;
1083 
1084  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
1085  double the = houghpattern1.getTheta(i);
1086  muonpattern->addPrd(houghpattern1.getPrd(i));
1087  ++neta;
1088  ATH_MSG_VERBOSE("PrepRawData Added theta " << the);
1089  }
1090 
1091  for (unsigned int i = 0; i < houghpattern2.size(); ++i) {
1092  bool accept = true;
1093  double the = houghpattern2.getTheta(i);
1094  for (unsigned int j = 0; j < houghpattern1.size(); ++j) {
1095  if (houghpattern2.getPrd(i) == houghpattern1.getPrd(j)) accept = false;
1096  }
1097  if (accept) {
1098  muonpattern->addPrd(houghpattern2.getPrd(i));
1099  ++neta;
1100  ATH_MSG_VERBOSE("PrepRawData Added theta " << the);
1101  } else {
1102  ATH_MSG_VERBOSE(" PrepRawData already there " << the);
1103  }
1104  }
1105 
1106  ATH_MSG_VERBOSE(" END make One Eta pattern hits " << neta);
1107 
1108  return muonpattern;
1109 }
1110 
1111 std::unique_ptr<Muon::MuonPrdPattern> MuonHoughPatternTool::houghPatternsToOnePhiPattern(const MuonHoughPattern& houghpattern1,
1112  const MuonHoughPattern& houghpattern2) const {
1115  ATH_MSG_DEBUG("houghPatternsToOnePhiPattern");
1116 
1117  double theta = (houghpattern1.getETheta() + houghpattern2.getETheta()) / 2.;
1118  double cos_phi{0.}, sin_phi{0.};
1119  int nphi = 0;
1120  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
1121  double phi = houghpattern1.getPhi(i);
1122  cos_phi += std::cos(phi);
1123  sin_phi += std::sin(phi);
1124  ++nphi;
1125  }
1126  for (unsigned int i = 0; i < houghpattern2.size(); ++i) {
1127  double phi = houghpattern2.getPhi(i);
1128  bool accept = true;
1129  for (unsigned int j = 0; j < houghpattern1.size(); ++j) {
1130  if (houghpattern2.getPrd(i) == houghpattern1.getPrd(j)) accept = false;
1131  }
1132  if (accept) {
1133  cos_phi += std::cos(phi);
1134  sin_phi += std::sin(phi);
1135  ++nphi;
1136  }
1137  }
1138 
1139  ATH_MSG_VERBOSE("Start Merged Phi hits cleaning with " << nphi << " hits ");
1140  // require at least two phi hits on muon phi pattern
1141 
1142  if (nphi < 2) return nullptr;
1143 
1144  double cphit = cos_phi / nphi;
1145  double sphit = sin_phi / nphi;
1146 
1147  cos_phi = 0.;
1148  sin_phi = 0.;
1149  nphi = 0;
1150 
1151  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
1152  double phi = houghpattern1.getPhi(i);
1153  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1154  if (dotprod > 0.95) {
1155  cos_phi += std::cos(phi);
1156  sin_phi += std::sin(phi);
1157  ++nphi;
1158  }
1159  }
1160 
1161  for (unsigned int i = 0; i < houghpattern2.size(); ++i) {
1162  double phi = houghpattern2.getPhi(i);
1163  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1164  if (dotprod > 0.95) {
1165  bool accept = true;
1166  for (unsigned int j = 0; j < houghpattern1.size(); ++j) {
1167  if (houghpattern2.getPrd(i) == houghpattern1.getPrd(j)) accept = false;
1168  }
1169  if (accept) {
1170  cos_phi += std::cos(phi);
1171  sin_phi += std::sin(phi);
1172  ++nphi;
1173  }
1174  }
1175  }
1176 
1177  if (nphi < 2) return nullptr;
1178  cphit = cos_phi / nphi;
1179  sphit = sin_phi / nphi;
1180 
1181  cos_phi = 0.;
1182  sin_phi = 0.;
1183  nphi = 0;
1184  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
1185  double phi = houghpattern1.getPhi(i);
1186  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1187  if (dotprod > 0.99) {
1188  cos_phi += std::cos(phi);
1189  sin_phi += std::sin(phi);
1190  ++nphi;
1191  }
1192  }
1193  for (unsigned int i = 0; i < houghpattern2.size(); ++i) {
1194  double phi = houghpattern2.getPhi(i);
1195  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1196  if (dotprod > 0.99) {
1197  bool accept = true;
1198  for (unsigned int j = 0; j < houghpattern1.size(); ++j) {
1199  if (houghpattern2.getPrd(i) == houghpattern1.getPrd(j)) accept = false;
1200  }
1201  if (accept) {
1202  cos_phi += std::cos(phi);
1203  sin_phi += std::sin(phi);
1204  ++nphi;
1205  }
1206  }
1207  }
1208  if (nphi < 2) return nullptr;
1209  cphit = cos_phi / nphi;
1210  sphit = sin_phi / nphi;
1211 
1212  theta = 0;
1213  cos_phi = 0.;
1214  sin_phi = 0.;
1215  nphi = 0;
1216  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
1217  double phi = houghpattern1.getPhi(i);
1218  double thetah = houghpattern1.getTheta(i);
1219  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1220  if (dotprod > 0.995) {
1221  cos_phi += std::cos(phi);
1222  sin_phi += std::sin(phi);
1223  theta += thetah;
1224  ++nphi;
1225  }
1226  }
1227  for (unsigned int i = 0; i < houghpattern2.size(); ++i) {
1228  double phi = houghpattern2.getPhi(i);
1229  double thetah = houghpattern2.getTheta(i);
1230  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1231  if (dotprod > 0.995) {
1232  bool accept = true;
1233  for (unsigned int j = 0; j < houghpattern1.size(); ++j) {
1234  if (houghpattern2.getPrd(i) == houghpattern1.getPrd(j)) accept = false;
1235  }
1236  if (accept) {
1237  cos_phi += std::cos(phi);
1238  sin_phi += std::sin(phi);
1239  theta += thetah;
1240  ++nphi;
1241  }
1242  }
1243  }
1244  if (nphi < 2) return nullptr;
1245  cphit = cos_phi / nphi;
1246  sphit = sin_phi / nphi;
1247  theta = theta / nphi;
1248 
1249  double r0 = 1.; // put 1 mm r0 value
1250  double x0 = r0 * sphit;
1251  double y0 = -r0 * cphit;
1252  double z0 = 0.;
1253 
1254  const Amg::Vector3D pos{x0, y0, z0};
1255  const Amg::Vector3D dir{std::sin(theta) * cphit, std::sin(theta) * sphit, std::cos(theta)};
1256 
1257  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(pos, dir);
1258  nphi = 0;
1259 
1260  for (unsigned int i = 0; i < houghpattern1.size(); ++i) {
1261  double phi = houghpattern1.getPhi(i);
1262  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1263  if (dotprod > 0.995) {
1264  muonpattern->addPrd(houghpattern1.getPrd(i));
1265  ++nphi;
1266  ATH_MSG_VERBOSE("PrepRawData Merged Clean Phi Added " << phi);
1267  } else {
1268  ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
1269  }
1270  }
1271 
1272  for (unsigned int i = 0; i < houghpattern2.size(); ++i) {
1273  double phi = houghpattern2.getPhi(i);
1274  double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
1275  if (dotprod > 0.995) {
1276  bool accept = true;
1277  for (unsigned int j = 0; j < houghpattern1.size(); ++j) {
1278  if (houghpattern2.getPrd(i) == houghpattern1.getPrd(j)) accept = false;
1279  }
1280  if (accept) {
1281  muonpattern->addPrd(houghpattern2.getPrd(i));
1282  ++nphi;
1283  ATH_MSG_VERBOSE("PrepRawData Merged Clean Phi Added " << phi);
1284  } else {
1285  ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
1286  }
1287  } else {
1288  ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
1289  }
1290  }
1291 
1292  ATH_MSG_VERBOSE("END Clean Merged Phi hits " << nphi);
1293 
1294  return muonpattern;
1295 }
1296 
1297 std::unique_ptr<Muon::MuonPrdPattern> MuonHoughPatternTool::houghPatternToCleanPhiPattern(MuonHoughPattern& houghpattern) const {
1300  // TODO: rewrite with removing hits from patterns, instead of building up
1301 
1302  ATH_MSG_DEBUG("houghPatternToCleanPhiPattern");
1303 
1304  if (msgLevel(MSG::VERBOSE)) {
1305  for (unsigned int i = 0; i < houghpattern.size(); ++i) {
1306  const std::shared_ptr<MuonHoughHit> hit = houghpattern.getHit(i);
1307  ATH_MSG_VERBOSE(hit->getHitx() << " " << hit->getHity() << " " << hit->getHitz() << " " << hit->getPhi() << " "
1308  << hit->getMeasuresPhi() << " " << hit->getWhichDetector() << " " << hit->getWeight() << " "
1309  << hit->getAssociated());
1310  }
1311  }
1312 
1313  double theta = houghpattern.getETheta();
1314  unsigned int size = houghpattern.size();
1315  double phi = houghpattern.getEPhi();
1316  double r0 = houghpattern.getERPhi();
1317 
1318  ATH_MSG_DEBUG("Start Phi hits cleaning with " << size << " hits "
1319  << " theta " << theta);
1320  ATH_MSG_DEBUG("Start Phi: " << phi << " r0: " << r0);
1321  houghpattern.updateParametersRPhi();
1322  unsigned int newsize = houghpattern.size();
1323 
1324  ATH_MSG_VERBOSE("size: " << newsize << " r0: " << r0 << " phi: " << phi);
1325 
1326  CxxUtils::sincos scphi(phi);
1327 
1328  const int number_of_iterations = 4;
1329  static constexpr std::array<double, number_of_iterations> cutvalues{1000., 500., 250., 125.};
1330 
1331  const MuonHoughPattern* newpattern{&houghpattern};
1332  std::unique_ptr<MuonHoughPattern> pat_owner{};
1333  for (int it = 0; it < number_of_iterations; it++) {
1334  bool change = true;
1335  while (change) {
1336  ATH_MSG_VERBOSE("size: " << newsize << " r0: " << r0 << " phi: " << phi);
1337 
1338  double max_dist = 0.;
1339  unsigned int max_i = UINT_MAX;
1340  for (unsigned int i = 0; i < newpattern->size(); ++i) {
1341  double dist = newpattern->getHitx(i) * scphi.sn - newpattern->getHity(i) * scphi.cs - r0;
1342  ATH_MSG_VERBOSE("Dist: " << dist);
1343  if (dist > max_dist) {
1344  max_dist = dist;
1345  max_i = i;
1346  }
1347  }
1348  if (max_dist < cutvalues[it]) {
1349  change = false;
1350  } else {
1351  std::unique_ptr<MuonHoughPattern> newpattern2 = std::make_unique<MuonHoughPattern>(MuonHough::hough_xy);
1352  for (unsigned int i = 0; i < newpattern->size(); ++i) {
1353  if (i != max_i) { newpattern2->addHit(newpattern->getHit(i)); }
1354  }
1355  newpattern2->updateParametersRPhi();
1356  phi = newpattern2->getEPhi();
1357  r0 = newpattern2->getERPhi();
1358  newsize = newpattern2->size();
1359  pat_owner = std::move(newpattern2);
1360  newpattern = pat_owner.get();
1361  scphi = CxxUtils::sincos(phi);
1362  }
1363  }
1364  }
1365 
1366  ATH_MSG_DEBUG("Final size: " << newsize << " r0: " << r0 << " phi: " << phi);
1367 
1368  double thetanew = 0.;
1369  for (unsigned int i = 0; i < newpattern->size(); ++i) {
1370  double thetah = newpattern->getTheta(i);
1371  thetanew += thetah;
1372  }
1373 
1374  thetanew = thetanew / (newpattern->size() + 1e-7);
1375 
1376  double r0_new = 1.; // put 1 mm r0 value
1377  double x0_new = r0_new * scphi.sn;
1378  double y0_new = -r0_new * scphi.cs;
1379  double z0_new = 0.;
1380 
1381  CxxUtils::sincos sctheta(thetanew);
1382 
1383  const Amg::Vector3D pos = Amg::Vector3D(x0_new, y0_new, z0_new);
1384  const Amg::Vector3D dir = Amg::Vector3D(sctheta.sn * scphi.cs, sctheta.sn * scphi.sn, sctheta.cs);
1385 
1386  std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(pos, dir);
1387 
1388  for (unsigned int i = 0; i < newpattern->size(); ++i) { muonpattern->addPrd(newpattern->getPrd(i)); }
1389 
1390  ATH_MSG_DEBUG("END Clean Phi hits " << newsize << " theta " << thetanew);
1391 
1392  ATH_MSG_VERBOSE("cleaned pattern: ");
1393  if (msgLvl(MSG::VERBOSE)) { printPattern(muonpattern.get()); }
1394  return muonpattern;
1395 }
1396 
1397 std::unique_ptr<MuonHoughHitContainer> MuonHoughPatternTool::hitsNotInPattern(const MuonHoughHitContainer& event, int /*id_number*/) {
1398  std::unique_ptr<MuonHoughHitContainer> hits_not_in_patterns = std::make_unique<MuonHoughHitContainer>();
1399 
1400  for (unsigned int hitid = 0; hitid < event.size(); ++hitid) {
1401  if (!event.getHit(hitid)->getAssociated()) { hits_not_in_patterns->addHit(event.getHit(hitid)); }
1402  }
1403  return hits_not_in_patterns;
1404 }
1405 unsigned int MuonHoughPatternTool::getThresholdHoughPattern(int id_number) const {
1406  unsigned int thresholdpattern = 0;
1407  switch (id_number) {
1408  case MuonHough::hough_xy:
1409  case MuonHough::hough_yz: thresholdpattern = m_thresholdpattern_xyz; break;
1410  case MuonHough::hough_rz:
1414  case MuonHough::hough_curved_at_a_cylinder: thresholdpattern = m_thresholdpattern_rz; break;
1415  default: ATH_MSG_WARNING("no valid id (id_number)");
1416  } // switch
1417  return thresholdpattern;
1418 }
1419 
1420 double MuonHoughPatternTool::getThresholdHisto(int id_number) const {
1421  double thresholdhisto = 0.;
1422  switch (id_number) {
1423  case MuonHough::hough_xy:
1424  case MuonHough::hough_yz: thresholdhisto = m_thresholdhisto_xyz; break;
1425  case MuonHough::hough_rz:
1429  case MuonHough::hough_curved_at_a_cylinder: thresholdhisto = m_thresholdhisto_rz; break;
1430  default: ATH_MSG_WARNING("no valid id (id_number)");
1431  } // switch
1432  return thresholdhisto;
1433 }
1434 
1436  if (m_use_cosmics) {
1437  weightmdt = 0.;
1438  return;
1439  }
1440  int mdthits = event.getMDThitno(); // slow function!
1441  weightmdt = mdthits > 0. ? 1. - 5. / std::sqrt(mdthits) : 0.;
1442 }
1443 
1444 bool MuonHoughPatternTool::hitThroughCut(const std::shared_ptr<MuonHoughHit>& hit, double weightmdt) const {
1445  return (!m_weightcutmdt || hit->getDetectorId() != MuonHough::MDT || hit->getProbability() >= weightmdt) &&
1446  (!m_weightcut || hit->getProbability() >= m_weight);
1447 }
1448 
1450  if (!muonpattern) {
1451  ATH_MSG_VERBOSE("Printout of Pattern: nullptr");
1452  return;
1453  }
1454  ATH_MSG_VERBOSE("Printout of Pattern: ");
1455  for (unsigned int k = 0; k < muonpattern->numberOfContainedPrds(); k++) {
1456  const Trk::PrepRawData* prd = muonpattern->prd(k);
1457  const Muon::MdtPrepData* mdtprd = dynamic_cast<const Muon::MdtPrepData*>(prd);
1458  if (mdtprd) {
1459  const Trk::Surface& surface = mdtprd->detectorElement()->surface(mdtprd->identify());
1460  const Amg::Vector3D& gpos = surface.center();
1461  ATH_MSG_VERBOSE("mdt " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
1462  } else if (!mdtprd) {
1463  const Muon::MuonCluster* muoncluster = dynamic_cast<const Muon::MuonCluster*>(prd);
1464  if (muoncluster) {
1465  const Amg::Vector3D& gpos = muoncluster->globalPosition();
1466  ATH_MSG_VERBOSE("cluster " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
1467  }
1468  if (!muoncluster) { ATH_MSG_DEBUG("no muon prd? "); }
1469  }
1470  }
1471 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
MuonHoughPattern::getECurvature
double getECurvature() const
returns curvature of pattern
Definition: MuonHoughPattern.h:120
MuonHoughPatternTool::m_number_of_sectors_xyz
Gaudi::Property< int > m_number_of_sectors_xyz
number of sectors (different regions in which patterns can be found in the same iteration) in xyz
Definition: MuonHoughPatternTool.h:262
MuonHoughTransformer::useNegativeWeights
void useNegativeWeights(bool use_negative_weights)
use negative weights
Definition: MuonHoughTransformer.h:141
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
MuonHoughPatternTool::m_number_of_sectors_rz_cosmics
int m_number_of_sectors_rz_cosmics
number of sectors (different regions in which patterns can be found in the same iteration) in rzcosmi...
Definition: MuonHoughPatternTool.h:266
MuonCluster.h
MuonHoughHisto2DContainer
Definition: MuonHoughHisto2DContainer.h:10
MuonHoughPatternTool::calculateWeights
void calculateWeights(const MuonHoughHitContainer &event, double weightmdt) const
calculates new weights based on rejection factor (1-origweight) and number of hits in event,...
Definition: MuonHoughPatternTool.cxx:383
MuonHoughPatternTool::houghPatternToPhiPattern
std::unique_ptr< Muon::MuonPrdPattern > houghPatternToPhiPattern(const MuonHoughPattern &houghpattern) const
converts hough pattern to EDM phi patterns
Definition: MuonHoughPatternTool.cxx:1003
Muon::MuonPrdPattern::prd
virtual const Trk::PrepRawData * prd(unsigned int index) const
returns the PrepRawData objects depending on the integer, return zero if index out of range
Definition: MuonPrdPattern.h:66
MuonHoughPatternTool::houghPatternToCleanPhiPattern
std::unique_ptr< Muon::MuonPrdPattern > houghPatternToCleanPhiPattern(MuonHoughPattern &houghpattern) const
converts hough pattern to EDM phi patterns and cleans it from outliers
Definition: MuonHoughPatternTool.cxx:1297
MuonHoughPatternTool::m_number_of_sectors_rz
Gaudi::Property< int > m_number_of_sectors_rz
number of sectors (different regions in which patterns can be found in the same iteration) in rz
Definition: MuonHoughPatternTool.h:264
MuonHoughPatternTool::whichHoughTransform
std::unique_ptr< MuonHoughTransformSteering > whichHoughTransform(int id) const
returns the Houghtransform for the id
Definition: MuonHoughPatternTool.cxx:557
MuonHoughPatternTool::numberOfHits
int numberOfHits(const MuonHoughHitContainer &event) const
returns number of hits left (unused)
Definition: MuonHoughPatternTool.cxx:295
MuonHoughHitContainer::getTheta
double getTheta(unsigned int hitno) const
returns theta of hit hitno
Definition: MuonHoughHitContainer.h:99
MuonHoughPatternTool::m_maximum_residu_mm
static constexpr double m_maximum_residu_mm
distance hits are associated with pattern in mm
Definition: MuonHoughPatternTool.h:169
MuonHough::hough_rzcosmics
@ hough_rzcosmics
Definition: MuonHoughPattern.h:14
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
MuonHoughPatternTool::maxLevelHoughPattern
std::vector< int > maxLevelHoughPattern(const MuonHoughPatternContainerShip &houghpattern) const
returns the maximum iteration, not in use
Definition: MuonHoughPatternTool.cxx:629
MuonHoughPatternTool::m_use_negative_weights
Gaudi::Property< bool > m_use_negative_weights
use negative weights (false)
Definition: MuonHoughPatternTool.h:144
Surface.h
MuonHoughTransformer::setIP
void setIP(bool ip_setting)
set m_ip_setting (e.g.
Definition: MuonHoughTransformer.h:140
MuonHough::hough_rz_mdt
@ hough_rz_mdt
Definition: MuonHoughPattern.h:14
Muon::MuonPrdPattern::addPrd
virtual void addPrd(const Trk::PrepRawData *prd)
add hit to pattern
Definition: MuonPrdPattern.h:60
MuonHoughHit::getHitz
double getHitz() const
returns z position
Definition: MuonHoughHit.h:161
MuonHough::CSC
@ CSC
Definition: MuonHoughHit.h:17
MuonHoughHitContainer::getMeasuresPhi
bool getMeasuresPhi(unsigned int hitno) const
returns if hit hitno measures phi
Definition: MuonHoughHitContainer.h:109
dqt_zlumi_pandas.hname
string hname
Definition: dqt_zlumi_pandas.py:279
MuonHoughPatternTool::makePatterns
virtual void makePatterns(const MuonHoughHitContainer &hitcontainer, MuonHoughPatternContainerShip &houghpatterns) const override
method that builds the patterns
Definition: MuonHoughPatternTool.cxx:40
MuonHoughPatternTool::initialize
virtual StatusCode initialize() override
initiates private members
Definition: MuonHoughPatternTool.cxx:152
MuonHoughHit::getHitx
double getHitx() const
returns x position
Definition: MuonHoughHit.h:159
MuonHoughPatternTool::whichEventAssociation
std::unique_ptr< MuonHoughHitContainer > whichEventAssociation(int id, const MuonHoughHitContainer &event) const
selects the hitcontainer to be used to associate to the maxima
Definition: MuonHoughPatternTool.cxx:424
MuonHoughPatternTool::m_stepsize_xy_cosmics
static constexpr double m_stepsize_xy_cosmics
bin width for xy cosmics
Definition: MuonHoughPatternTool.h:229
MuonHoughTransformer_yz.h
MuonHoughPattern::getEPhi
double getEPhi() const
returns phi of pattern
Definition: MuonHoughPattern.h:116
MuonHoughTransformer_CurvedAtACylinder.h
MuonHoughPatternTool::whichEventHough
std::unique_ptr< MuonHoughHitContainer > whichEventHough(int id, const MuonHoughHitContainer &event, double weightmdt) const
selects the hitcontainer to be used for filling the histograms
Definition: MuonHoughPatternTool.cxx:485
MuonHoughPatternTool::emptyHoughPattern
virtual MuonHoughPatternContainerShip emptyHoughPattern() const override
creates houghpatterns, called from FinderTool
Definition: MuonHoughPatternTool.cxx:202
MuonHoughPattern::getEPos
Amg::Vector3D getEPos() const
calulates 3d point closest to ip
Definition: MuonHoughPattern.cxx:165
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
MuonHoughHitContainer::getHit
std::shared_ptr< MuonHoughHit > getHit(int hitno) const
returns Hit at position hitno
Definition: MuonHoughHitContainer.h:91
MuonHoughPatternTool::m_stepsize_per_angle_rz
static constexpr double m_stepsize_per_angle_rz
bin width for angle in rz
Definition: MuonHoughPatternTool.h:235
MuonHough::hough_rz_rpc
@ hough_rz_rpc
Definition: MuonHoughPattern.h:14
MuonHough::hough_yz
@ hough_yz
Definition: MuonHoughPattern.h:14
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonHoughHitContainer::getPhi
double getPhi(unsigned int hitno) const
returns phi of hit hitno
Definition: MuonHoughHitContainer.h:100
sincos.h
Helper to simultaneously calculate sin and cos of the same angle.
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
MuonHoughPatternTool::m_ncalls
std::atomic_uint m_ncalls
Definition: MuonHoughPatternTool.h:271
MdtPrepData.h
MuonHoughHit::setWeight
void setWeight(double weight)
set weight
Definition: MuonHoughHit.h:179
MuonHoughPatternTool::m_maximum_level
static constexpr int m_maximum_level
// number of maximum iterations over houghtransform
Definition: MuonHoughPatternTool.h:176
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MuonHoughPatternTool::m_use_rpc_measures_eta
static constexpr bool m_use_rpc_measures_eta
use rpc phi strips in phi-patterns (true)
Definition: MuonHoughPatternTool.h:157
Muon::MuonCluster::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Returns the global position of the measurement (calculated on the fly)
MuonHoughHit::setId
void setId(int id)
set id
Definition: MuonHoughHit.h:178
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonHoughHit::getHity
double getHity() const
returns y position
Definition: MuonHoughHit.h:160
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
MuonHoughPatternTool::houghPatternToEtaPattern
std::unique_ptr< Muon::MuonPrdPattern > houghPatternToEtaPattern(const MuonHoughPattern &houghpattern) const
converts hough pattern to EDM eta patterns
Definition: MuonHoughPatternTool.cxx:975
MuonHoughPatternTool::m_thresholdpattern_rz
Gaudi::Property< unsigned int > m_thresholdpattern_rz
minimal size for a eta pattern (3)
Definition: MuonHoughPatternTool.h:164
MuonHoughPatternTool::m_stepsize_per_angle_xyz
static constexpr double m_stepsize_per_angle_xyz
bin width for angle in xyz
Definition: MuonHoughPatternTool.h:233
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
MuonHoughPatternTool::m_detectorsize_angle_rz
static constexpr double m_detectorsize_angle_rz
max range of angle in rz in degrees (180)
Definition: MuonHoughPatternTool.h:216
Muon::MuonPrdPattern
Class to store a pattern in the muon system containing PrepRawData pointers.
Definition: MuonPrdPattern.h:27
MuonHoughPatternTool::printPattern
void printPattern(Muon::MuonPrdPattern *muonpattern) const
print out pattern hits
Definition: MuonHoughPatternTool.cxx:1449
MuonHoughHitContainer::addHit
void addHit(const std::shared_ptr< MuonHoughHit > &hit)
add hit to container
Definition: MuonHoughHitContainer.cxx:8
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
MuonHoughPatternTool::m_stepsize_rz_cosmics
static constexpr double m_stepsize_rz_cosmics
bin width for rzcosmics
Definition: MuonHoughPatternTool.h:231
MuonHoughPatternTool::getPhiMuonPatterns
virtual std::unique_ptr< MuonPrdPatternCollection > getPhiMuonPatterns(MuonHoughPatternContainerShip &houghpatterns) const override
returns phipattern container in EDM
Definition: MuonHoughPatternTool.cxx:683
MuonHoughPatternTool::resetAssociation
static void resetAssociation(const MuonHoughHitContainer &event)
reset association flag of hits in m_event
Definition: MuonHoughPatternTool.cxx:183
MuonHoughPatternTool::weightRescaling
void weightRescaling(const MuonHoughHitContainer &event, int id_number, int level) const
rescales hits per iteration to reduce number of patterns when already some have been found
Definition: MuonHoughPatternTool.cxx:324
MuonHoughPatternTool::m_detectorsize_yz_ip
static constexpr double m_detectorsize_yz_ip
acceptancy of patterns for ip in yz (not used) in mm
Definition: MuonHoughPatternTool.h:209
MuonHoughPatternTool::m_use_cosmics
Gaudi::Property< bool > m_use_cosmics
use cosmic settings (false)
Definition: MuonHoughPatternTool.h:138
MuonHoughHitContainer::getHitId
int getHitId(unsigned int hitno) const
returns hitid of hit hitno
Definition: MuonHoughHitContainer.h:93
MuonHoughTransformer_rz.h
MuonHoughPatternTool::m_use_histos
Gaudi::Property< bool > m_use_histos
output histograms (false)
Definition: MuonHoughPatternTool.h:136
MuonHoughPatternTool::m_maximum_residu_angle
static constexpr double m_maximum_residu_angle
distance hits are associated with pattern in degrees
Definition: MuonHoughPatternTool.h:173
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
GeoPrimitives.h
MuonHoughPatternTool::analyseHisto
bool analyseHisto(int id_number, int level, const std::unique_ptr< MuonHoughHitContainer > &event_to_analyse, std::unique_ptr< MuonHoughTransformSteering > &houghtransform, MuonHoughPatternContainerShip &houghpatterns) const
analyses the hough histograms
Definition: MuonHoughPatternTool.cxx:224
MuonHough::hough_xy
@ hough_xy
Definition: MuonHoughPattern.h:14
MuonHoughPatternTool::m_detectorsize_xy_full
static constexpr double m_detectorsize_xy_full
size of full detector in xy (phi) in mm, used as acceptancy for cosmics
Definition: MuonHoughPatternTool.h:200
MuonHoughPatternTool::getThresholdHoughPattern
unsigned int getThresholdHoughPattern(int id_number) const
returns minimum number of hits a hough pattern can contain
Definition: MuonHoughPatternTool.cxx:1405
CxxUtils::sincos::cs
double cs
Definition: sincos.h:95
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
MuonHoughHit::getDetectorId
MuonHough::DetectorTechnology getDetectorId() const
return DetectorTechnology
Definition: MuonHoughHit.h:154
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonHoughPatternTool::transformCoordsMaximum
static void transformCoordsMaximum(std::pair< double, double > &coordsmaximum, double r0_true)
corrects the maximum of the histogram with a factor (not in use anymore, used for old rz transform)
Definition: MuonHoughPatternTool.cxx:660
MuonHoughPatternTool::m_maxNumberOfPhiHits
Gaudi::Property< int > m_maxNumberOfPhiHits
maximum number of phi hits to do pattern recognition, if small zero no cut is applied
Definition: MuonHoughPatternTool.h:274
MuonHoughHit::getWhichDetector
std::string getWhichDetector() const
return DetectorTechnology in string
Definition: MuonHoughHit.cxx:51
MuonHoughHitContainer::size
unsigned int size() const
returns size of hitcontainer
Definition: MuonHoughHitContainer.h:104
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonHoughTransformer_xy.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonHoughHit::getPhi
double getPhi() const
returns phi
Definition: MuonHoughHit.h:169
MuonHoughPatternTool::m_weightcut
Gaudi::Property< bool > m_weightcut
weight_cut for hits in hough
Definition: MuonHoughPatternTool.h:247
MuonHoughPattern::getETheta
double getETheta() const
returns theta of pattern
Definition: MuonHoughPattern.h:118
MuonHoughPatternTool::houghPatternsToOnePhiPattern
std::unique_ptr< Muon::MuonPrdPattern > houghPatternsToOnePhiPattern(const MuonHoughPattern &houghpattern1, const MuonHoughPattern &houghpattern2) const
converts and combines two hough patterns to one EDM phi pattern
Definition: MuonHoughPatternTool.cxx:1111
MuonHoughPatternTool::m_detectorsize_rz_full
static constexpr double m_detectorsize_rz_full
size of full detector in rz (eta) in mm, used as acceptancy for cosmics
Definition: MuonHoughPatternTool.h:204
MuonHoughHitContainer::getPrd
const Trk::PrepRawData * getPrd(unsigned int hitno) const
returns preprawdata pointer of hit hitno
Definition: MuonHoughHitContainer.h:110
MuonHoughPatternTool::m_weight
Gaudi::Property< double > m_weight
value of weight cut
Definition: MuonHoughPatternTool.h:250
TRT_PAI_physicsConstants::r0
const double r0
electron radius{cm}
Definition: TRT_PAI_physicsConstants.h:20
MuonHoughPatternTool::m_z_cor_constant2
static constexpr double m_z_cor_constant2
constant 2 for z for hough correction
Definition: MuonHoughPatternTool.h:185
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonHoughHitContainer
Definition: MuonHoughHitContainer.h:15
MuonHoughPatternTool::m_number_of_maxima
Gaudi::Property< int > m_number_of_maxima
number of iterations (5)
Definition: MuonHoughPatternTool.h:152
MuonHoughPatternTool::m_weightcutmdt
Gaudi::Property< bool > m_weightcutmdt
weight_cut for mdt hits in hough
Definition: MuonHoughPatternTool.h:253
MuonHoughPatternTool::m_thresholdhisto_xyz
Gaudi::Property< double > m_thresholdhisto_xyz
threshold histogram in xyz
Definition: MuonHoughPatternTool.h:257
MuonHoughPatternTool::m_use_curvedhough
Gaudi::Property< bool > m_use_curvedhough
use curved hough transformation for eta patterns (true)
Definition: MuonHoughPatternTool.h:146
MuonHoughPatternTool::MuonHoughPatternTool
MuonHoughPatternTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: MuonHoughPatternTool.cxx:24
MuonHoughPatternTool::m_thresholdhisto_rz
Gaudi::Property< double > m_thresholdhisto_rz
threshold histogram in rz
Definition: MuonHoughPatternTool.h:259
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
MuonHough::hough_curved_at_a_cylinder
@ hough_curved_at_a_cylinder
Definition: MuonHoughPattern.h:14
MuonHoughPatternTool::setWeightMdtCutValue
void setWeightMdtCutValue(const MuonHoughHitContainer &event, double &weightmdt) const
calculates the mdt weight cut value
Definition: MuonHoughPatternTool.cxx:1435
MuonHoughPattern::updateParametersRPhi
void updateParametersRPhi(bool cosmics=false)
update parameters in rphi plane based on weighted fit
Definition: MuonHoughPattern.cxx:192
MuonHoughPatternTool::m_detectorsize_xy_ip
static constexpr double m_detectorsize_xy_ip
acceptancy of patterns for ip in xy (phi) in mm
Definition: MuonHoughPatternTool.h:207
MuonHoughPatternTool::m_stepsize_per_angle_rz_cosmics
static constexpr double m_stepsize_per_angle_rz_cosmics
bin width for angle in rzcosmics
Definition: MuonHoughPatternTool.h:239
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::PrepRawData
Definition: PrepRawData.h:62
MuonHough::RPC
@ RPC
Definition: MuonHoughHit.h:17
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
MuonHoughPattern::printHoughPattern
void printHoughPattern() const
prints out info about hough pattern
Definition: MuonHoughPattern.cxx:91
MuonHoughPatternTool::hitInHoughPattern
bool hitInHoughPattern(const std::shared_ptr< MuonHoughHit > &hit, const MuonHoughPatternContainer &houghpattern) const
checks if hit is already in one of the found houghpatterns (unused)
Definition: MuonHoughPatternTool.cxx:308
MuonHough::TGC
@ TGC
Definition: MuonHoughHit.h:17
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
MuonHoughPatternTool::m_detectorsize_rz_ip
static constexpr double m_detectorsize_rz_ip
acceptancy of patterns for ip in rz (eta) in mm
Definition: MuonHoughPatternTool.h:211
charge
double charge(const T &p)
Definition: AtlasPID.h:538
MuonHoughPatternTool::m_maximum_residu_mm_cosmics
static constexpr double m_maximum_residu_mm_cosmics
distance hits are associated with pattern in mm for cosmics
Definition: MuonHoughPatternTool.h:171
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonHoughPatternTool::m_use_ip
bool m_use_ip
use interaction point constraint (true)
Definition: MuonHoughPatternTool.h:159
MuonHoughHit::getProbability
double getProbability() const
returns probability that hit is part of pattern (true muon)
Definition: MuonHoughHit.h:164
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
MuonHoughPatternTool::m_stepsize_xy
static constexpr double m_stepsize_xy
max range of 1/sqrt(curvature) for curved transform, corresponds to 0.02 ~ 2,5m ~ 1....
Definition: MuonHoughPatternTool.h:223
MuonHoughHit::getWeight
double getWeight() const
returns weight in histogram after rescaling
Definition: MuonHoughHit.h:162
MuonHoughPatternTool::m_detectorsize_yz_full
static constexpr double m_detectorsize_yz_full
size of full detector in yz (not used) in mm, used as acceptancy for cosmics
Definition: MuonHoughPatternTool.h:202
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonHoughPatternTool::finalize
virtual StatusCode finalize() override
deletes private members
Definition: MuonHoughPatternTool.cxx:191
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CxxUtils::sincos::sn
double sn
Definition: sincos.h:92
MuonHoughPatternTool::m_thresholdpattern_xyz
Gaudi::Property< unsigned int > m_thresholdpattern_xyz
minimal size for a phi pattern (1)
Definition: MuonHoughPatternTool.h:162
MuonHoughPatternContainer
std::vector< MuonHoughPatternCollection > MuonHoughPatternContainer
Definition: MuonHoughPatternCollection.h:14
MuonHoughPatternTool::m_number_of_ids
int m_number_of_ids
number of hough transforms currently supported (7)
Definition: MuonHoughPatternTool.h:149
MuonHoughPatternTool::m_file
std::unique_ptr< TFile > m_file
pointer to the file name for the hough histograms
Definition: MuonHoughPatternTool.h:131
MuonHoughPattern.h
MuonHoughHitContainer::empty
bool empty() const
returns if hitcontainer is empty
Definition: MuonHoughHitContainer.h:105
MuonHoughPatternTool::getEtaMuonPatterns
virtual std::unique_ptr< MuonPrdPatternCollection > getEtaMuonPatterns(MuonHoughPatternContainerShip &houghpatterns) const override
returns etapattern container in EDM
Definition: MuonHoughPatternTool.cxx:806
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonHoughPatternTool::houghPatternsToOneEtaPattern
std::unique_ptr< Muon::MuonPrdPattern > houghPatternsToOneEtaPattern(const MuonHoughPattern &houghpattern1, const MuonHoughPattern &houghpattern2) const
converts and combines two hough patterns to one EDM phi pattern
Definition: MuonHoughPatternTool.cxx:1022
MuonHoughPatternTool::m_detectorsize_angle_xyz
static constexpr double m_detectorsize_angle_xyz
max range of angle in xyz in degrees (360)
Definition: MuonHoughPatternTool.h:214
MuonHoughPattern::getEDir
Amg::Vector3D getEDir() const
calculates direction at point closest to ip
Definition: MuonHoughPattern.cxx:185
MuonHoughPatternTool::m_stepsize_rz
static constexpr double m_stepsize_rz
bin width for rz
Definition: MuonHoughPatternTool.h:227
MuonHoughPatternTool::getCurvedMuonPatterns
std::unique_ptr< MuonPrdPatternCollection > getCurvedMuonPatterns(MuonHoughPatternContainerShip &houghpatterns) const
returns curvedpattern container in EDM
Definition: MuonHoughPatternTool.cxx:952
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonHoughHit::setAssociated
void setAssociated(bool associated)
set associated
Definition: MuonHoughHit.h:181
MuonHoughPatternTool::m_detectorsize_xy
double m_detectorsize_xy
acceptancy of patterns in xy (phi) in mm
Definition: MuonHoughPatternTool.h:194
MuonHoughTransformer_rzcosmics.h
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:891
MuonHoughPattern::getERPhi
double getERPhi() const
returns r0/d0 of pattern
Definition: MuonHoughPattern.h:117
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
MuonHoughHit::getMeasuresPhi
bool getMeasuresPhi() const
hit measures phi?
Definition: MuonHoughHit.h:175
MuonHoughHit::getOrigWeight
double getOrigWeight() const
returns original weight
Definition: MuonHoughHit.h:163
Muon::MuonPrdPattern::numberOfContainedPrds
virtual unsigned int numberOfContainedPrds() const
Number or PrepRawData contained by this Pattern.
Definition: MuonPrdPattern.h:64
MuonHoughPattern
Definition: MuonHoughPattern.h:17
Muon::MuonCluster
Class representing clusters in the muon system.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonCluster.h:37
MuonHoughPatternTool::overlapHoughPatterns
int overlapHoughPatterns(const MuonHoughPattern &houghpattern1, const MuonHoughPattern &houghpattern2) const
returns number of hits that are in both hough patterns
Definition: MuonHoughPatternTool.cxx:400
checkCorrelInHIST.histos
dictionary histos
Definition: checkCorrelInHIST.py:413
MuonHoughPattern::getMaximumHistogram
double getMaximumHistogram() const
returns maximum of histogram used to generate pattern
Definition: MuonHoughPattern.h:121
MuonHoughPatternTool::m_theta_cor_constant
static constexpr double m_theta_cor_constant
constant 1 for theta for hough correction
Definition: MuonHoughPatternTool.h:187
MuonHoughPatternTool::m_detectorsize_yz
double m_detectorsize_yz
acceptancy of patterns in yz (not used) in mm
Definition: MuonHoughPatternTool.h:196
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
AthAlgTool
Definition: AthAlgTool.h:26
MuonHoughPatternTool::hitThroughCut
bool hitThroughCut(const std::shared_ptr< MuonHoughHit > &hit, double weightmdt) const
hit through weight cut?
Definition: MuonHoughPatternTool.cxx:1444
MuonHoughPatternTool::m_printlevel
Gaudi::Property< int > m_printlevel
output level (range 0-10) (default 0)
Definition: MuonHoughPatternTool.h:269
MuonHoughPatternTool::useIPMuons
void useIPMuons()
reduces Detector sizes for Hough Histograms to find patterns from muons from the Interaction Point (d...
Definition: MuonHoughPatternTool.cxx:33
MuonHoughTransformSteering::constructHoughPatterns
MuonHoughPatternCollection constructHoughPatterns(const MuonHoughHitContainer &event, double residu_mm, double residu_grad, int max_patterns) const
construct hough patterns
Definition: MuonHoughTransformSteering.cxx:18
MuonHough::DetectorTechnology
DetectorTechnology
enum to identify the muondetectortechnology
Definition: MuonHoughHit.h:17
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
MuonHoughPatternTool::m_detectorsize_rz
double m_detectorsize_rz
acceptancy of patterns in rz (eta) in mm
Definition: MuonHoughPatternTool.h:198
MuonHoughPatternTool::hitsNotInPattern
static std::unique_ptr< MuonHoughHitContainer > hitsNotInPattern(const MuonHoughHitContainer &event, int id_number)
returns a hitcontainer with hits not yet used in pattern
Definition: MuonHoughPatternTool.cxx:1397
MuonHoughPatternTool::m_stepsize_yz
static constexpr double m_stepsize_yz
bin width for yz
Definition: MuonHoughPatternTool.h:225
MuonHoughPatternTool::hitsLeft
static bool hitsLeft(const MuonHoughHitContainer &event)
returns if there are hits left
Definition: MuonHoughPatternTool.cxx:287
MuonHoughPatternContainerShip
std::vector< MuonHoughPatternContainer > MuonHoughPatternContainerShip
Definition: MuonHoughPatternCollection.h:15
MuonHoughPatternTool.h
MuonHough::MDT
@ MDT
Definition: MuonHoughHit.h:17
MuonHoughHit::getAssociated
bool getAssociated() const
return if hit already associated to pattern
Definition: MuonHoughHit.h:176
Muon::MdtPrepData::detectorElement
virtual const MuonGM::MdtReadoutElement * detectorElement() const override
Returns the detector element corresponding to this PRD.
Definition: MdtPrepData.h:141
MuonHoughPatternTool::m_nbins_curved
static constexpr int m_nbins_curved
bin width for 1/sqrt(curvature)
Definition: MuonHoughPatternTool.h:244
MuonHoughPatternCollection
std::vector< std::unique_ptr< MuonHoughPattern > > MuonHoughPatternCollection
This typedef represents a collection and container of MuonHoughPattern objects.
Definition: MuonHoughPatternCollection.h:13
MuonHoughPatternTool::m_use_csc_in_hough
Gaudi::Property< bool > m_use_csc_in_hough
use csc hits in histogram (false)
Definition: MuonHoughPatternTool.h:142
MuonHoughPatternTool::m_z_cor_constant
static constexpr double m_z_cor_constant
use hough correction to correct the maximum found in rz-plane slightly as there is a bias in the houg...
Definition: MuonHoughPatternTool.h:183
MuonHoughHit::getId
int getId() const
returns id
Definition: MuonHoughHit.h:156
fitman.k
k
Definition: fitman.py:528
MuonHoughPatternTool::m_theta_cor_constant2
static constexpr double m_theta_cor_constant2
constant 2 for theta for hough correction
Definition: MuonHoughPatternTool.h:189
MuonHoughTransformSteering.h
MuonHough::hough_rz
@ hough_rz
Definition: MuonHoughPattern.h:14
MuonHoughPatternTool::m_stepsize_per_angle_xy_cosmics
static constexpr double m_stepsize_per_angle_xy_cosmics
bin width for angle in xy cosmics
Definition: MuonHoughPatternTool.h:237
MuonHoughPatternTool::getThresholdHisto
double getThresholdHisto(int id_number) const
returns minimum number for the maximum of a hough transform
Definition: MuonHoughPatternTool.cxx:1420
MuonHoughPatternTool::m_use_csc_in_pattern
Gaudi::Property< bool > m_use_csc_in_pattern
use csc hits in association / pattern (true)
Definition: MuonHoughPatternTool.h:140