|
ATLAS Offline Software
|
#include <MuonHoughTransformer_CurvedAtACylinder.h>
|
| MuonHoughTransformer_CurvedAtACylinder (int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors=1) |
| constructor More...
|
|
| ~MuonHoughTransformer_CurvedAtACylinder ()=default |
| destructor More...
|
|
void | fillHit (const std::shared_ptr< MuonHoughHit > &hit, double weight) override final |
| fill hit in histogram More...
|
|
int | fillHisto (double xbin, double theta, double weight, int sector) override final |
| fill transformed values in histogram 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...
|
|
int | sector (const std::shared_ptr< MuonHoughHit > &hit) const override final |
| returns the phi sector More...
|
|
float | weightHoughTransform (double r0) const override final |
| not implemented for this transform 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...
|
|
|
std::unique_ptr< double[]> | m_invcurvature |
| array that stores the inverse curvatures that are scanned More...
|
|
std::unique_ptr< double[]> | m_weightcurvature |
|
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...
|
|
◆ MuonHoughTransformer_CurvedAtACylinder()
MuonHoughTransformer_CurvedAtACylinder::MuonHoughTransformer_CurvedAtACylinder |
( |
int |
nbins, |
|
|
int |
nbins_angle, |
|
|
double |
detectorsize, |
|
|
double |
detectorsize_angle, |
|
|
double |
threshold_histo, |
|
|
int |
number_of_sectors = 1 |
|
) |
| |
◆ ~MuonHoughTransformer_CurvedAtACylinder()
MuonHoughTransformer_CurvedAtACylinder::~MuonHoughTransformer_CurvedAtACylinder |
( |
| ) |
|
|
default |
◆ 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);
◆ 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_CurvedAtACylinder::fillHisto |
( |
double |
xbin, |
|
|
double |
theta, |
|
|
double |
weight, |
|
|
int |
sector |
|
) |
| |
|
finaloverridevirtual |
fill transformed values in histogram
Implements MuonHoughTransformer.
Definition at line 87 of file MuonHoughTransformer_CurvedAtACylinder.cxx.
90 const int filled_binnumber =
histo->fill(xbin, theta_in_grad,
weight);
96 const double reduced_weight = 0.8 *
weight;
111 const double fifth_weight = 0.2 *
weight;
116 histo->fill(upperright, fifth_weight);
120 histo->fill(lowerleft, fifth_weight);
123 histo->fill(upperright, fifth_weight);
124 histo->fill(lowerleft, fifth_weight);
126 histo->fill(upperright - 2, -fifth_weight);
127 histo->fill(lowerleft + 2, -fifth_weight);
130 return filled_binnumber;
◆ fillHit()
void MuonHoughTransformer_CurvedAtACylinder::fillHit |
( |
const std::shared_ptr< MuonHoughHit > & |
hit, |
|
|
double |
weight |
|
) |
| |
|
finaloverridevirtual |
fill hit in histogram
Implements MuonHoughTransformer.
Definition at line 41 of file MuonHoughTransformer_CurvedAtACylinder.cxx.
46 int sectorhit =
sector(hit);
53 if (!isbarrel && std::abs(
ratio) > 0.5)
break;
59 const double weight_curvature =
67 if (thetas[0] > 0. && thetas[0] <
M_PI) {
70 const double weight_curvature_theta = weight_curvature * (0.5 + 0.5 *
std::sin(thetas[0]));
72 fillHisto(
i + 0.5, theta_in_grad, weight_curvature_theta, 2 * sectorhit);
78 if (thetas[1] > 0. && thetas[1] <
M_PI) {
81 const double weight_curvature_theta = weight_curvature * (0.5 + 0.5 *
std::sin(thetas[1]));
82 fillHisto(-
i - 0.5, theta_in_grad, weight_curvature_theta, 2 * sectorhit);
◆ getEndPointsFillLoop()
std::pair< double, double > MuonHoughTransformer::getEndPointsFillLoop |
( |
double |
radius, |
|
|
double |
stepsize, |
|
|
int |
sector |
|
) |
| const |
|
protectedinherited |
◆ 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_CurvedAtACylinder::hookAssociateHitsToMaximum |
( |
const MuonHoughHitContainer & |
event, |
|
|
std::pair< double, double > |
coordsmaximum, |
|
|
double |
residu_mm, |
|
|
double |
residu_grad, |
|
|
int |
sector |
|
) |
| const |
|
finaloverridevirtual |
associate hits to maximum found
Implements MuonHoughTransformer.
Definition at line 133 of file MuonHoughTransformer_CurvedAtACylinder.cxx.
140 double etheta{0.}, sin_phi{0.}, cos_phi{0.}, sin_theta{0.}, cos_theta{0.}, ephi{0.};
142 double invcurvature{0.}, curvature{0.};
145 invcurvature = 1. / curvature;
148 int index =
static_cast<int>(std::floor(std::abs(coordsmaximum.first)));
154 curvature = 1. / invcurvature;
158 int sector_1 = maxsector / 2;
159 int sector_2 = sector_1 + 1;
160 int sector_3 = sector_1 - 1;
162 if (maxsector % 2 == 1) {
164 }
else if (sector_3 < 0) {
169 <<
" coordsmaximumfirst: " << coordsmaximum.first <<
" curvature: " << curvature
170 <<
" coordsmaximumsecond: " << coordsmaximum.second <<
" coordsmaximumsecondinrad: " <<
theta
171 <<
" MuonHoughTransformer_CurvedAtACylinder::size of event: " <<
event.size()
172 <<
" allowed sectors: " << sector_1 <<
" , " << sector_2 <<
" & " << sector_3 );
174 for (
unsigned int i = 0;
i <
event.size();
i++) {
175 std::shared_ptr<MuonHoughHit> hit =
event.getHit(
i);
176 int sectorhit =
sector(hit);
177 if (sectorhit == sector_1 || sectorhit == sector_2 || sectorhit == sector_3) {
182 double scale = radius3d / 5000.;
184 double residu_distance_mm = std::abs(sdis);
188 <<
" max_residu_mm*scale: " << max_residu_mm *
scale);
190 if (std::abs(residu_distance_mm) < max_residu_mm *
scale)
199 ATH_MSG_VERBOSE(
"hit added to houghpattern! Sector number: " << sectorhit
200 <<
" associated earlier "<<
event.getHit(
i)->getAssociated());
202 event.getHit(
i)->setAssociated(
true);
204 sin_theta += sctheta.sn;
205 cos_theta += sctheta.cs;
211 etheta = std::atan2(sin_theta, cos_theta);
213 ephi = std::atan2(sin_phi, cos_phi);
◆ 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_CurvedAtACylinder::sector |
( |
const std::shared_ptr< MuonHoughHit > & |
hit | ) |
const |
|
inlinefinaloverridevirtual |
◆ 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_CurvedAtACylinder::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_invcurvature
std::unique_ptr<double[]> MuonHoughTransformer_CurvedAtACylinder::m_invcurvature |
|
private |
◆ 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 |
◆ m_weightcurvature
std::unique_ptr<double[]> MuonHoughTransformer_CurvedAtACylinder::m_weightcurvature |
|
private |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
double getBinContent(int binnumber) const
returns x axis
void setETheta(double etheta)
set theta of pattern
double getMagneticTrackRatio() const
ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic f...
MuonHoughHisto2D * getHisto(int id) const
return histogram at place id
static int sgn(double d)
sign (-1 or 1) of a double
Scalar phi() const
phi method
std::pair< int, double > getMax() const
returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold)
const Amg::Vector3D & getPosition() const
return (x,y,z) vector
void setMaximumIsValid(bool flag)
bool isBarrel() const
hit is barrel or endcap (for curved track model)
Scalar theta() const
theta method
void setEPhi(double ephi)
set phi of pattern
int size() const
returns size of container
#define ATH_MSG_VERBOSE(x)
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 addHit(const std::shared_ptr< MuonHoughHit > &hit)
add hit to container
void setERTheta(double ertheta)
set z0 of pattern
void reset() const
resets histograms
static void thetasForCurvedHit(double ratio, MuonHoughHit *hit, double &theta1, double &theta2)
calculates theta at (x,y,z) for curved track model, for positive and negative curvature
constexpr double rad_degree_conversion_factor
void setECurvature(double curvature)
set curvature of pattern
POOL::TEvent event(POOL::TEvent::kClassAccess)
unsigned int size() const
returns size of hitcontainer
double getPhi() const
returns phi
std::pair< double, double > binnumberToCoords(int binnumber, int printlevel=0) const
gives coordinates for certain binnumber
@ hough_curved_at_a_cylinder
MsgStream & msg() const
The standard message stream.
double getAbs() const
returns radius
static double thetaForCurvedHit(double invcurvature, MuonHoughHit *hit)
calculates theta at (x,y,z) for curved track model
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
int phiSector() const
phi sector of hit
std::pair< int, int > getMaximumBinnumber() const
return maximum of container gives first id histogram (sector) and then maximumbin
std::string m_nm
Message source name.
double getTheta() const
returns theta
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
static double signedDistanceCurvedToHit(double z0, double theta, double invcurvature, const Amg::Vector3D &hit)
calculates distance of point (x,y,z) to curved track with z0, theta and invcurvature for curved track...
Histogram class, similar to Root's TH2D.