ATLAS Offline Software
Loading...
Searching...
No Matches
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
12MuonHoughTransformSteering::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
40std::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
52std::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
57std::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
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
std::vector< std::unique_ptr< MuonHoughPattern > > MuonHoughPatternCollection
This typedef represents a collection and container of MuonHoughPattern objects.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
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
MuonHoughPatternCollection constructHoughPatterns(const MuonHoughHitContainer &event, double residu_mm, double residu_grad, int max_patterns) const
construct hough patterns
~MuonHoughTransformSteering()
destructor
MuonHoughTransformSteering(std::unique_ptr< MuonHoughTransformer >)
Class is build as Strategy, Context pattern.
void fill(const MuonHoughHitContainer &event)
fill histograms
std::unique_ptr< MuonHoughTransformer > m_houghtransformer
the actual houghtransform
singleton-like access to IMessageSvc via open function and helper
STL namespace.