ATLAS Offline Software
Loading...
Searching...
No Matches
MuonHoughTransformer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
6#define MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
7
8#include <cmath>
9#include <map>
10
15
16
17
20
22public:
25
27 virtual float weightHoughTransform(double r0) const = 0;
29 virtual void fill(const MuonHoughHitContainer& event, bool subtract = false);
31 virtual void fillHit(const std::shared_ptr<MuonHoughHit>& hit, double weight = 1.) = 0;
33 virtual int fillHisto(double coord1, double coord2, double weight = 1., int sector = 0) = 0;
34
36 std::unique_ptr<MuonHoughPattern> associateHitsToMaximum(const MuonHoughHitContainer& event, double residu_mm,
37 double residu_grad, int maximum_number) const;
38
40 std::unique_ptr<MuonHoughPattern> associateHitsToCoords(const MuonHoughHitContainer& event, std::pair<double, double> coords, double residu_mm,
41 double residu_angle, int sector = 0) const;
42 // residu_mm for id=0,1,2 ; residu_angle for id=3,4
43
45 std::unique_ptr<MuonHoughPattern> associateHitsToBinnumber(const MuonHoughHitContainer& event, int binnumber, double maximum_residu_mm,
46 double maximum_residu_angle, int sector = 0) const;
47
49 void resetHisto();
51 void useNegativeWeights(bool use_negative_weights);
52
54 std::vector<std::pair<int, int> > getMaxima(int max_patterns) const;
55
57 void setIP(bool ip_setting);
58
60 const MuonHoughHisto2DContainer& histos() const { return m_histos; }
61
62protected:
64 MuonHoughTransformer(const std::string& tr_name,
65 int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
66 int number_of_sectors = 1);
67
69 virtual std::unique_ptr<MuonHoughPattern> hookAssociateHitsToMaximum(const MuonHoughHitContainer& event, std::pair<double, double> coordsmaximum,
70 double residu_mm, double residu_angle, int sector) const = 0;
71
73 std::pair<double, double> getEndPointsFillLoop(double radius, double stepsize, int sector) const;
74
76 virtual int sector(const std::shared_ptr<MuonHoughHit>& hit) const = 0;
77
80
83
85 unsigned int m_eventsize;
88
97
100
103
105 const int m_nbins;
107 const int m_nbins_plus3;
109 const int m_nbins_angle;
111 const double m_detectorsize;
118
123
126
129
130private:
131
133 public:
134 bool operator()(const std::pair<std::pair<int, int>, double>& lhs, const std::pair<std::pair<int, int>, double>& rhs) const {
135 return lhs.second > rhs.second;
136 }
137 };
138};
139
140inline void MuonHoughTransformer::setIP(bool ip_setting) { m_ip_setting = ip_setting; }
141inline void MuonHoughTransformer::useNegativeWeights(bool use_negative_weights) { m_use_negative_weights = use_negative_weights; }
142
143#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
bool operator()(const std::pair< std::pair< int, int >, double > &lhs, const std::pair< std::pair< int, int >, double > &rhs) const
const double m_detectorsize_angle
range of angle coordinate
MuonHoughHisto2DContainer m_histos
histogram container
bool m_ip_setting
use settings for patterns originating from origin
virtual int fillHisto(double coord1, double coord2, double weight=1., int sector=0)=0
fill histogram with certain coordinate
virtual float weightHoughTransform(double r0) const =0
weight houghtransform, give more importance to houghtransforms close to origin
bool m_use_negative_weights
use of negative weights
bool m_add_weight_angle
use weight of patterns in angle coordinate
virtual std::unique_ptr< MuonHoughPattern > hookAssociateHitsToMaximum(const MuonHoughHitContainer &event, std::pair< double, double > coordsmaximum, double residu_mm, double residu_angle, int sector) const =0
pure virtual method for derived class implementation of associateHitsToMaximum method
void setIP(bool ip_setting)
set m_ip_setting (e.g.
const int m_nbins_angle
number of bins in histograms in angle coordinate
const int m_nbins
number of bins in histograms in radius coordinate
std::vector< std::pair< int, int > > getMaxima(int max_patterns) const
return the first certain number of maxima of histograms
virtual void fillHit(const std::shared_ptr< MuonHoughHit > &hit, double weight=1.)=0
fill histograms with hit
double m_weight_constant_radius
weight constant of patterns in radius coordinate
virtual void fill(const MuonHoughHitContainer &event, bool subtract=false)
fill histograms with hitcontainer
unsigned int m_eventsize
size of event to be filled (can be used for weighting)
void useNegativeWeights(bool use_negative_weights)
use negative weights
void resetHisto()
reset histograms
MuonHoughMathUtils m_muonhoughmathutils
object for use of mathematical formulas for trackmodels
double m_stepsize_per_angle
stepsize of transform for angle coordinate
const int m_number_of_sectors
number of histograms (1 for cosmics 16 for rz)
std::unique_ptr< MuonHoughPattern > associateHitsToBinnumber(const MuonHoughHitContainer &event, int binnumber, double maximum_residu_mm, double maximum_residu_angle, int sector=0) const
associate hits to certain binnumber and sector
double m_eventsize_weightfactor
weightfactor based on eventsize (used in curved hough transform)
double m_stepsize
stepsize of transform for radius coordinate
double m_binwidthx
x-binwidth of histogram
virtual ~MuonHoughTransformer()
destructor
const MuonHoughHisto2DContainer & histos() const
access to histograms
const int m_nbins_plus3
number of bins in histograms in radius coordinate
double m_threshold_histo
threshold of histograms
const double m_detectorsize
range of radius coordinate
virtual int sector(const std::shared_ptr< MuonHoughHit > &hit) const =0
returns sector for coords
double m_binwidthy
y-binwidth of histogram
std::unique_ptr< MuonHoughPattern > associateHitsToMaximum(const MuonHoughHitContainer &event, double residu_mm, double residu_grad, int maximum_number) const
associate hits to certain maximum number of histograms
bool m_add_weight_radius
use weight of patterns in radius coordinate
std::pair< double, double > getEndPointsFillLoop(double radius, double stepsize, int sector) const
returns begin and end value of the filling loop
double m_weight_constant_angle
weight constant of patterns in angle coordinate
MuonHoughTransformer(const std::string &tr_name, int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors=1)
constructor, input values are those of histograms
std::unique_ptr< MuonHoughPattern > associateHitsToCoords(const MuonHoughHitContainer &event, std::pair< double, double > coords, double residu_mm, double residu_angle, int sector=0) const
associate hits to certain coordinates and sector