ATLAS Offline Software
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 
22 public:
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 
62 protected:
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;
113  const double m_detectorsize_angle;
115  double m_binwidthx;
117  double m_binwidthy;
118 
120  double m_stepsize;
123 
126 
129 
130 private:
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 
140 inline void MuonHoughTransformer::setIP(bool ip_setting) { m_ip_setting = ip_setting; }
141 inline void MuonHoughTransformer::useNegativeWeights(bool use_negative_weights) { m_use_negative_weights = use_negative_weights; }
142 
143 #endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
MuonHoughTransformer::fillHisto
virtual int fillHisto(double coord1, double coord2, double weight=1., int sector=0)=0
fill histogram with certain coordinate
MuonHoughTransformer::useNegativeWeights
void useNegativeWeights(bool use_negative_weights)
use negative weights
Definition: MuonHoughTransformer.h:141
MuonHoughTransformer::m_weight_constant_angle
double m_weight_constant_angle
weight constant of patterns in angle coordinate
Definition: MuonHoughTransformer.h:92
MuonHoughTransformer::maximaCompare
Definition: MuonHoughTransformer.h:132
MuonHoughHisto2DContainer
Definition: MuonHoughHisto2DContainer.h:10
MuonHoughTransformer::m_threshold_histo
double m_threshold_histo
threshold of histograms
Definition: MuonHoughTransformer.h:82
MuonHoughTransformer::setIP
void setIP(bool ip_setting)
set m_ip_setting (e.g.
Definition: MuonHoughTransformer.h:140
MuonHoughTransformer::m_muonhoughmathutils
MuonHoughMathUtils m_muonhoughmathutils
object for use of mathematical formulas for trackmodels
Definition: MuonHoughTransformer.h:102
MuonHoughTransformer::m_nbins
const int m_nbins
number of bins in histograms in radius coordinate
Definition: MuonHoughTransformer.h:105
MuonHoughTransformer::m_weight_constant_radius
double m_weight_constant_radius
weight constant of patterns in radius coordinate
Definition: MuonHoughTransformer.h:96
MuonHoughTransformer::histos
const MuonHoughHisto2DContainer & histos() const
access to histograms
Definition: MuonHoughTransformer.h:60
MuonHoughTransformer::resetHisto
void resetHisto()
reset histograms
Definition: MuonHoughTransformer.cxx:120
MuonHoughMathUtils
Definition: MuonHoughMathUtils.h:35
MuonHoughTransformer::getMaxima
std::vector< std::pair< int, int > > getMaxima(int max_patterns) const
return the first certain number of maxima of histograms
Definition: MuonHoughTransformer.cxx:122
MuonHoughTransformer::m_use_negative_weights
bool m_use_negative_weights
use of negative weights
Definition: MuonHoughTransformer.h:99
MuonHoughTransformer::m_nbins_plus3
const int m_nbins_plus3
number of bins in histograms in radius coordinate
Definition: MuonHoughTransformer.h:107
MuonHoughTransformer::m_histos
MuonHoughHisto2DContainer m_histos
histogram container
Definition: MuonHoughTransformer.h:79
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
MuonHoughTransformer::fill
virtual void fill(const MuonHoughHitContainer &event, bool subtract=false)
fill histograms with hitcontainer
Definition: MuonHoughTransformer.cxx:47
MuonHoughTransformer::MuonHoughTransformer
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
Definition: MuonHoughTransformer.cxx:11
MuonHoughTransformer::m_binwidthx
double m_binwidthx
x-binwidth of histogram
Definition: MuonHoughTransformer.h:115
MuonHoughTransformer::associateHitsToMaximum
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
Definition: MuonHoughTransformer.cxx:63
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
MuonHoughTransformer::m_eventsize_weightfactor
double m_eventsize_weightfactor
weightfactor based on eventsize (used in curved hough transform)
Definition: MuonHoughTransformer.h:87
MuonHoughTransformer::hookAssociateHitsToMaximum
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
MuonHoughTransformer::m_detectorsize_angle
const double m_detectorsize_angle
range of angle coordinate
Definition: MuonHoughTransformer.h:113
MuonHoughTransformer::m_stepsize
double m_stepsize
stepsize of transform for radius coordinate
Definition: MuonHoughTransformer.h:120
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
MuonHoughTransformer::associateHitsToBinnumber
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
Definition: MuonHoughTransformer.cxx:96
MuonHoughTransformer::m_stepsize_per_angle
double m_stepsize_per_angle
stepsize of transform for angle coordinate
Definition: MuonHoughTransformer.h:122
TRT_PAI_physicsConstants::r0
const double r0
electron radius{cm}
Definition: TRT_PAI_physicsConstants.h:20
MuonHoughHisto2DContainer.h
MuonHoughHitContainer
Definition: MuonHoughHitContainer.h:15
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonHoughTransformer::weightHoughTransform
virtual float weightHoughTransform(double r0) const =0
weight houghtransform, give more importance to houghtransforms close to origin
MuonHoughHitContainer.h
MuonHoughTransformer::m_number_of_sectors
const int m_number_of_sectors
number of histograms (1 for cosmics 16 for rz)
Definition: MuonHoughTransformer.h:128
MuonHoughTransformer::fillHit
virtual void fillHit(const std::shared_ptr< MuonHoughHit > &hit, double weight=1.)=0
fill histograms with hit
MuonHoughTransformer::associateHitsToCoords
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
Definition: MuonHoughTransformer.cxx:91
MuonHoughTransformer::getEndPointsFillLoop
std::pair< double, double > getEndPointsFillLoop(double radius, double stepsize, int sector) const
returns begin and end value of the filling loop
Definition: MuonHoughTransformer.cxx:108
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
MuonHoughTransformer::m_binwidthy
double m_binwidthy
y-binwidth of histogram
Definition: MuonHoughTransformer.h:117
MuonHoughPattern.h
MuonHoughTransformer::m_ip_setting
bool m_ip_setting
use settings for patterns originating from origin
Definition: MuonHoughTransformer.h:125
MuonHoughTransformer::m_nbins_angle
const int m_nbins_angle
number of bins in histograms in angle coordinate
Definition: MuonHoughTransformer.h:109
MuonHoughTransformer::~MuonHoughTransformer
virtual ~MuonHoughTransformer()
destructor
MuonHoughTransformer::m_eventsize
unsigned int m_eventsize
size of event to be filled (can be used for weighting)
Definition: MuonHoughTransformer.h:85
MuonHoughTransformer::m_add_weight_radius
bool m_add_weight_radius
use weight of patterns in radius coordinate
Definition: MuonHoughTransformer.h:94
MuonHoughTransformer::m_detectorsize
const double m_detectorsize
range of radius coordinate
Definition: MuonHoughTransformer.h:111
MuonHoughMathUtils.h
MuonHoughTransformer::sector
virtual int sector(const std::shared_ptr< MuonHoughHit > &hit) const =0
returns sector for coords
MuonHoughTransformer::m_add_weight_angle
bool m_add_weight_angle
use weight of patterns in angle coordinate
Definition: MuonHoughTransformer.h:90
MuonHoughTransformer::maximaCompare::operator()
bool operator()(const std::pair< std::pair< int, int >, double > &lhs, const std::pair< std::pair< int, int >, double > &rhs) const
Definition: MuonHoughTransformer.h:134
MuonHoughTransformer
Abstract base class, Strategy pattern.
Definition: MuonHoughTransformer.h:21