ATLAS Offline Software
MuonHoughTransformSteering.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 
8 #include "GaudiKernel/MsgStream.h"
11 
12 MuonHoughTransformSteering::MuonHoughTransformSteering(std::unique_ptr<MuonHoughTransformer> houghtransformer) :
13  AthMessaging{"MuonHoughTransformSteering"},
14  m_houghtransformer{std::move(houghtransformer)} {}
15 
17 
19  double residu_grad, int max_patterns) const {
20  MuonHoughPatternCollection houghpatterns;
21  houghpatterns.reserve(max_patterns);
22  std::vector<std::pair<int, int> > maxima = m_houghtransformer->getMaxima(max_patterns); // sector,binnumber , sorted vector
23 
24  for (const auto& [sector, binnumber] : maxima) {
25  if (binnumber == -1) {
26  ATH_MSG_VERBOSE("binnumber == -1 (no max found), max patterns = " << max_patterns );
27  break;
28  }
29  std::unique_ptr<MuonHoughPattern> houghpattern = constructHoughPattern(event, binnumber, residu_mm,
30  residu_grad, sector);
31  houghpatterns.emplace_back(std::move(houghpattern));
32  }
33 
34  // subtract all hits that were just added to a pattern
35  // m_houghtransformer->fill(event,true);
36 
37  return houghpatterns;
38 }
39 
40 std::unique_ptr<MuonHoughPattern> MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer& event, double residu_mm,
41  double residu_grad, int maximum_number) const {
42  ATH_MSG_DEBUG("MuonHoughTransformSteering::constructHoughPattern (start) ");
43 
44  std::unique_ptr<MuonHoughPattern> houghpattern = m_houghtransformer->associateHitsToMaximum(event, residu_mm, residu_grad,
45  maximum_number);
46 
47  ATH_MSG_DEBUG("MuonHoughTransformSteering::constructHoughPattern (end) ");
48 
49  return houghpattern;
50 }
51 
52 std::unique_ptr<MuonHoughPattern> MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer& event, std::pair<double, double> coords,
53  double residu_mm, double residu_grad, int sector) const {
54  return m_houghtransformer->associateHitsToCoords(event, coords, residu_mm, residu_grad, sector);
55 }
56 
57 std::unique_ptr<MuonHoughPattern> MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer& event, int binnumber, double residu_mm,
58  double residu_grad, int sector) const {
59  return m_houghtransformer->associateHitsToBinnumber(event, binnumber, residu_mm, residu_grad, sector);
60 }
61 
63 
MuonHoughTransformer.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonHoughTransformSteering::resetHisto
void resetHisto()
reset histograms
Definition: MuonHoughTransformSteering.cxx:64
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonHoughTransformSteering::fill
void fill(const MuonHoughHitContainer &event)
fill histograms
Definition: MuonHoughTransformSteering.cxx:62
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonHoughTransformSteering::~MuonHoughTransformSteering
~MuonHoughTransformSteering()
destructor
MuonHoughHitContainer
Definition: MuonHoughHitContainer.h:15
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonHoughTransformSteering::m_houghtransformer
std::unique_ptr< MuonHoughTransformer > m_houghtransformer
the actual houghtransform
Definition: MuonHoughTransformSteering.h:57
MuonHoughTransformSteering::constructHoughPattern
std::unique_ptr< MuonHoughPattern > constructHoughPattern(const MuonHoughHitContainer &event, double residu_mm, double residu_grad, int maximum_number) const
construct hough pattern on a certain maxima number of histogram
Definition: MuonHoughTransformSteering.cxx:40
MuonHoughTransformSteering::MuonHoughTransformSteering
MuonHoughTransformSteering(std::unique_ptr< MuonHoughTransformer >)
Class is build as Strategy, Context pattern.
Definition: MuonHoughTransformSteering.cxx:12
MuonHoughPattern.h
MuonHoughTransformSteering::constructHoughPatterns
MuonHoughPatternCollection constructHoughPatterns(const MuonHoughHitContainer &event, double residu_mm, double residu_grad, int max_patterns) const
construct hough patterns
Definition: MuonHoughTransformSteering.cxx:18
MuonHoughPatternCollection
std::vector< std::unique_ptr< MuonHoughPattern > > MuonHoughPatternCollection
This typedef represents a collection and container of MuonHoughPattern objects.
Definition: MuonHoughPatternCollection.h:13
MuonHoughTransformSteering.h