|
ATLAS Offline Software
|
abstract base class for hough transform with carthesian coordinates
More...
#include <MuonHoughTransformer_xyz.h>
|
virtual | ~MuonHoughTransformer_xyz ()=default |
| destructor More...
|
|
void | fillHit (const std::shared_ptr< MuonHoughHit > &hit, double weight) override final |
| fill hit in histogram More...
|
|
int | fillHisto (double r0, double phi, double weight, int sector) override final |
| fill transformed values in histogram More...
|
|
int | sector (const std::shared_ptr< MuonHoughHit > &hit) const override final |
| returns the rz sector More...
|
|
virtual std::unique_ptr< MuonHoughPattern > | initialiseHoughPattern () const =0 |
| build new houghpattern More...
|
|
float | weightHoughTransform (double r0) const override final |
| put weight on houghtransform dependent on r0 More...
|
|
virtual std::pair< double, double > | getHitPos (const MuonHoughHitContainer &event, int hitid) const =0 |
| returns the relevant 2d hit position More...
|
|
virtual void | fill (const MuonHoughHitContainer &event, bool subtract=false) |
| fill histograms with hitcontainer More...
|
|
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 More...
|
|
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 More...
|
|
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 More...
|
|
void | resetHisto () |
| reset histograms More...
|
|
void | useNegativeWeights (bool use_negative_weights) |
| use negative weights More...
|
|
std::vector< std::pair< int, int > > | getMaxima (int max_patterns) const |
| return the first certain number of maxima of histograms More...
|
|
void | setIP (bool ip_setting) |
| set m_ip_setting (e.g. More...
|
|
const MuonHoughHisto2DContainer & | histos () const |
| access to histograms More...
|
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
static double | calculateAngle (double hitx, double hity, double r0) |
| calcalates the phi angle for a given hit and r0 More...
|
|
|
| MuonHoughTransformer_xyz (int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors=1) |
| constructor More...
|
|
std::unique_ptr< MuonHoughPattern > | hookAssociateHitsToMaximum (const MuonHoughHitContainer &event, std::pair< double, double > coordsmaximum, double residu_mm, double residu_grad, int sector) const override final |
| associate hits to maximum found More...
|
|
std::pair< double, double > | getEndPointsFillLoop (double radius, double stepsize, int sector) const |
| returns begin and end value of the filling loop More...
|
|
|
std::string | m_nm |
| Message source name. More...
|
|
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels) More...
|
|
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. More...
|
|
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. More...
|
|
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging) More...
|
|
abstract base class for hough transform with carthesian coordinates
Definition at line 11 of file MuonHoughTransformer_xyz.h.
◆ MuonHoughTransformer_xyz()
MuonHoughTransformer_xyz::MuonHoughTransformer_xyz |
( |
int |
nbins, |
|
|
int |
nbins_angle, |
|
|
double |
detectorsize, |
|
|
double |
detectorsize_angle, |
|
|
double |
threshold_histo, |
|
|
int |
number_of_sectors = 1 |
|
) |
| |
|
protected |
◆ ~MuonHoughTransformer_xyz()
virtual MuonHoughTransformer_xyz::~MuonHoughTransformer_xyz |
( |
| ) |
|
|
virtualdefault |
◆ associateHitsToBinnumber()
std::unique_ptr< MuonHoughPattern > MuonHoughTransformer::associateHitsToBinnumber |
( |
const MuonHoughHitContainer & |
event, |
|
|
int |
binnumber, |
|
|
double |
maximum_residu_mm, |
|
|
double |
maximum_residu_angle, |
|
|
int |
sector = 0 |
|
) |
| const |
|
inherited |
◆ associateHitsToCoords()
std::unique_ptr< MuonHoughPattern > MuonHoughTransformer::associateHitsToCoords |
( |
const MuonHoughHitContainer & |
event, |
|
|
std::pair< double, double > |
coords, |
|
|
double |
residu_mm, |
|
|
double |
residu_angle, |
|
|
int |
sector = 0 |
|
) |
| const |
|
inherited |
◆ associateHitsToMaximum()
associate hits to certain maximum number of histograms
Definition at line 63 of file MuonHoughTransformer.cxx.
65 std::unique_ptr<MuonHoughPattern> houghpattern{};
66 std::pair<double, double> coordsmaximum;
67 std::pair<int, int> maximumbin;
70 int sector = maximumbin.first;
74 if (maximumbin.second == -1){
80 ATH_MSG_VERBOSE(
" coordinates: " << coordsmaximum.first <<
" second " << coordsmaximum.second<<
" sector: "<<
sector);
◆ calculateAngle()
double MuonHoughTransformer_xyz::calculateAngle |
( |
double |
hitx, |
|
|
double |
hity, |
|
|
double |
r0 |
|
) |
| |
|
static |
calcalates the phi angle for a given hit and r0
Definition at line 103 of file MuonHoughTransformer_xyz.cxx.
105 double height_squared = hitx * hitx + hity * hity -
r0 *
r0;
106 if (height_squared >= 0) {
107 double height = std::sqrt(height_squared);
108 phi = std::atan2(hity, hitx) + std::atan2(
r0, height);
112 phi = std::atan2(hity, hitx);
◆ fill()
fill histograms with hitcontainer
Definition at line 47 of file MuonHoughTransformer.cxx.
54 for (
unsigned int hitid = 0; hitid <
m_eventsize; hitid++) {
55 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
◆ fillHisto()
int MuonHoughTransformer_xyz::fillHisto |
( |
double |
r0, |
|
|
double |
phi, |
|
|
double |
weight, |
|
|
int |
sector |
|
) |
| |
|
finaloverridevirtual |
fill transformed values in histogram
Implements MuonHoughTransformer.
Definition at line 46 of file MuonHoughTransformer_xyz.cxx.
53 bool butterfly =
true;
57 double third_weight =
weight / 3.;
69 double half_weight = 0.5 *
weight;
71 histo->fill(filled_binnumber - 1, half_weight);
72 histo->fill(filled_binnumber + 1, half_weight);
79 histo->fill(upperright, half_weight);
82 histo->fill(upperright - 2, -half_weight);
85 histo->fill(lowerleft, half_weight);
88 histo->fill(lowerleft + 2, -half_weight);
92 histo->fill(lowerleft, half_weight);
93 histo->fill(upperright, half_weight);
95 histo->fill(lowerleft + 2, -half_weight);
96 histo->fill(upperright - 2, -half_weight);
100 return filled_binnumber;
◆ fillHit()
void MuonHoughTransformer_xyz::fillHit |
( |
const std::shared_ptr< MuonHoughHit > & |
hit, |
|
|
double |
weight |
|
) |
| |
|
finaloverridevirtual |
◆ getEndPointsFillLoop()
std::pair< double, double > MuonHoughTransformer::getEndPointsFillLoop |
( |
double |
radius, |
|
|
double |
stepsize, |
|
|
int |
sector |
|
) |
| const |
|
protectedinherited |
◆ getHitPos()
◆ getMaxima()
std::vector< std::pair< int, int > > MuonHoughTransformer::getMaxima |
( |
int |
max_patterns | ) |
const |
|
inherited |
return the first certain number of maxima of histograms
Definition at line 122 of file MuonHoughTransformer.cxx.
123 std::vector<std::pair<int, int> > maximumbins;
125 std::vector<std::pair<std::pair<int, int>,
double> > maxima;
130 std::pair<std::pair<int, int>,
double> maximum;
131 maximum.first.first =
sector;
132 maximum.first.second = maximumbin.first;
133 maximum.second = maximumbin.second;
134 maxima.push_back(maximum);
137 sort(maxima.begin(), maxima.end(), maximaCompare());
139 unsigned int count_maxima = 0;
140 int number_of_patterns = 0;
141 std::set<int> sectors;
142 const unsigned int size = maxima.size();
143 while (count_maxima !=
size && number_of_patterns != max_patterns) {
144 std::pair<int, int> maximumbin = maxima[count_maxima].first;
147 int sector = maximumbin.first;
149 if (sectors.find(
sector) != sectors.end()) {
check =
false; }
152 maximumbins.push_back(maximumbin);
153 sectors.insert(maximumbin.first);
155 int sectormin =
sector - 1;
156 int sectorplus =
sector + 1;
160 sectors.insert(sectormin);
161 sectors.insert(sectorplus);
165 int sectorminmin = sectormin - 1;
166 int sectorplusplus = sectorplus + 1;
167 sectors.insert(sectorminmin);
168 sectors.insert(sectorplusplus);
172 number_of_patterns++;
◆ histos()
◆ hookAssociateHitsToMaximum()
std::unique_ptr< MuonHoughPattern > MuonHoughTransformer_xyz::hookAssociateHitsToMaximum |
( |
const MuonHoughHitContainer & |
event, |
|
|
std::pair< double, double > |
coordsmaximum, |
|
|
double |
residu_mm, |
|
|
double |
residu_grad, |
|
|
int |
sector |
|
) |
| const |
|
finaloverrideprotectedvirtual |
associate hits to maximum found
Implements MuonHoughTransformer.
Definition at line 121 of file MuonHoughTransformer_xyz.cxx.
125 ATH_MSG_DEBUG(
"MuonHoughTransformer_xyz::hookAssociateHitsToMaximum (start)");
128 double ephi{0.}, eradius{0.}, sin_phi{0.}, cos_phi{0.};
129 double dotprod{0.}, etheta{0.}, residu_distance{0.};
132 ATH_MSG_DEBUG(
"MuonHoughTransformer_xyz::found_maximum: r: " << coordsmaximum.first <<
" phi: " << coordsmaximum.second
133 <<
" sector: " << max_sector);
140 int max_secmax = max_sector + 1;
141 int max_secmin = max_sector - 1;
142 if (max_secmin < 0) max_secmin = max_sector;
145 for (
unsigned int i = 0;
i <
event.size();
i++) {
146 double hitx =
event.getHitx(
i);
147 double hity =
event.getHity(
i);
148 double hitz =
event.getHitz(
i);
150 double radiushit = std::sqrt(hitx * hitx + hity * hity);
153 if (sectorhit == max_sector || sectorhit == max_secmin || sectorhit == max_secmax) {
161 residu_distance = -coordsmaximum.first +
166 << sectorhit<<
",residu_distance: " << residu_distance);
168 if (std::abs(residu_distance) < max_residu_mm) {
169 houghpattern->addHit(
event.getHit(
i));
171 ATH_MSG_VERBOSE(
"MuonHoughTransformer_xyz::hit added to houghpattern!");
174 event.getHit(
i)->setAssociated(
true);
178 double thetah = std::atan2(radiushit, hitz);
180 <<
" phi_calc: " <<
phi <<
" phi all " << phimax <<
" theta hit " << thetah );
197 eradius = eradius / (houghpattern->size() + 0.0001);
198 etheta = etheta / (houghpattern->size() + 0.0001);
199 ephi = std::atan2(sin_phi, cos_phi);
201 ATH_MSG_VERBOSE(
"ephi: " << ephi <<
" eradius: " << eradius <<
" etheta " << etheta);
204 houghpattern->setEPhi(ephi);
206 houghpattern->setEPhi(phimax);
209 houghpattern->setERPhi(coordsmaximum.first);
210 houghpattern->setETheta(etheta);
212 if (!houghpattern->empty() && std::abs(
std::sin(houghpattern->getEPhi() - phimax)) > 0.05) {
213 ATH_MSG_WARNING(
"MuonHoughTransformer_xyz:: Ephi calculation went wrong -- histo radius: "
214 << coordsmaximum.first <<
" phi: " << phimax <<
", ephi: " << ephi);
216 houghpattern->setERPhi(coordsmaximum.first);
220 houghpattern->updateParametersRPhi(
true);
222 ATH_MSG_VERBOSE(
"updateParameterstheta new phi (phi flipped Pi for cosmics): " << houghpattern->getEPhi()
223 <<
" old phi: " << phimax <<
" new r0: " << houghpattern->getERPhi()
224 <<
" old r0: " << coordsmaximum.first);
◆ initialiseHoughPattern()
virtual std::unique_ptr<MuonHoughPattern> MuonHoughTransformer_xyz::initialiseHoughPattern |
( |
| ) |
const |
|
pure virtual |
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ resetHisto()
void MuonHoughTransformer::resetHisto |
( |
| ) |
|
|
inherited |
◆ sector()
int MuonHoughTransformer_xyz::sector |
( |
const std::shared_ptr< MuonHoughHit > & |
hit | ) |
const |
|
finaloverridevirtual |
◆ setIP()
void MuonHoughTransformer::setIP |
( |
bool |
ip_setting | ) |
|
|
inlineinherited |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ useNegativeWeights()
void MuonHoughTransformer::useNegativeWeights |
( |
bool |
use_negative_weights | ) |
|
|
inlineinherited |
◆ weightHoughTransform()
float MuonHoughTransformer_xyz::weightHoughTransform |
( |
double |
r0 | ) |
const |
|
finaloverridevirtual |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_add_weight_angle
bool MuonHoughTransformer::m_add_weight_angle |
|
protectedinherited |
◆ m_add_weight_radius
bool MuonHoughTransformer::m_add_weight_radius |
|
protectedinherited |
◆ m_binwidthx
double MuonHoughTransformer::m_binwidthx |
|
protectedinherited |
◆ m_binwidthy
double MuonHoughTransformer::m_binwidthy |
|
protectedinherited |
◆ m_detectorsize
const double MuonHoughTransformer::m_detectorsize |
|
protectedinherited |
◆ m_detectorsize_angle
const double MuonHoughTransformer::m_detectorsize_angle |
|
protectedinherited |
◆ m_eventsize
unsigned int MuonHoughTransformer::m_eventsize |
|
protectedinherited |
◆ m_eventsize_weightfactor
double MuonHoughTransformer::m_eventsize_weightfactor |
|
protectedinherited |
◆ m_histos
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_ip_setting
bool MuonHoughTransformer::m_ip_setting |
|
protectedinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_muonhoughmathutils
◆ m_nbins
const int MuonHoughTransformer::m_nbins |
|
protectedinherited |
◆ m_nbins_angle
const int MuonHoughTransformer::m_nbins_angle |
|
protectedinherited |
◆ m_nbins_plus3
const int MuonHoughTransformer::m_nbins_plus3 |
|
protectedinherited |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_number_of_sectors
const int MuonHoughTransformer::m_number_of_sectors |
|
protectedinherited |
◆ m_stepsize
double MuonHoughTransformer::m_stepsize |
|
protectedinherited |
◆ m_stepsize_per_angle
double MuonHoughTransformer::m_stepsize_per_angle |
|
protectedinherited |
◆ m_threshold_histo
double MuonHoughTransformer::m_threshold_histo |
|
protectedinherited |
◆ m_use_negative_weights
bool MuonHoughTransformer::m_use_negative_weights |
|
protectedinherited |
◆ m_weight_constant_angle
double MuonHoughTransformer::m_weight_constant_angle |
|
protectedinherited |
◆ m_weight_constant_radius
double MuonHoughTransformer::m_weight_constant_radius |
|
protectedinherited |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
constexpr double degree_rad_conversion_factor
double getBinContent(int binnumber) const
returns x axis
MuonHoughHisto2D * getHisto(int id) const
return histogram at place id
Scalar phi() const
phi method
std::pair< int, double > getMax() const
returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold)
double getHitz() const
returns z position
void setMaximumIsValid(bool flag)
double getHitx() const
returns x position
Scalar theta() const
theta method
int size() const
returns size of container
#define ATH_MSG_VERBOSE(x)
double getHity() const
returns y position
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void reset() const
resets histograms
constexpr double rad_degree_conversion_factor
POOL::TEvent event(POOL::TEvent::kClassAccess)
static double angleFromMinusPiToPi(double angle)
computes angle in rad between -Pi and Pi
static double signedDistanceOfLineToOrigin2D(double x, double y, double phi)
signed distance of line with point (x,y) and angle phi to origin
const double r0
electron radius{cm}
double getRadius() const
returns radius
std::pair< double, double > binnumberToCoords(int binnumber, int printlevel=0) const
gives coordinates for certain binnumber
MsgStream & msg() const
The standard message stream.
double getWeight() const
returns weight in histogram after rescaling
double getXmax() const
returns max x axis
void setMaximumHistogram(double maximumhistogram)
set maximum of histogram used to generate pattern
std::pair< int, int > getMaximumBinnumber() const
return maximum of container gives first id histogram (sector) and then maximumbin
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
Helper to simultaneously calculate sin and cos of the same angle.
int fill(double x, double y, double weight=1.)
fill 2d histogram with point (x,y) with weight w, return binnumber filled
std::pair< double, double > getCoordsMaximum(unsigned int maximum_number=0)
returns coords of maximum number maximum_number
void initMessaging() const
Initialize our message level and MessageSvc.
double getXmin() const
returns min x axis
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
double angleFromGradToRadial(double angle) const
converts angle in degrees to rad
bool getAssociated() const
return if hit already associated to pattern
Histogram class, similar to Root's TH2D.