|
ATLAS Offline Software
|
#include <MuonHoughTransformer_rzcosmics.h>
|
| MuonHoughTransformer_rzcosmics (int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors=1) |
|
| ~MuonHoughTransformer_rzcosmics ()=default |
|
void | fillHit (const std::shared_ptr< MuonHoughHit > &hit, double weight) override final |
| fill histograms with hit More...
|
|
int | fillHisto (double rz0, double theta, double weight, int sector) override final |
| fill histogram with certain coordinate More...
|
|
float | weightHoughTransform (double r0) const override final |
| weight houghtransform, give more importance to houghtransforms close to origin More...
|
|
int | sector (const std::shared_ptr< MuonHoughHit > &hit) const override final |
| returns sector for coords 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...
|
|
◆ MuonHoughTransformer_rzcosmics()
MuonHoughTransformer_rzcosmics::MuonHoughTransformer_rzcosmics |
( |
int |
nbins, |
|
|
int |
nbins_angle, |
|
|
double |
detectorsize, |
|
|
double |
detectorsize_angle, |
|
|
double |
threshold_histo, |
|
|
int |
number_of_sectors = 1 |
|
) |
| |
◆ ~MuonHoughTransformer_rzcosmics()
MuonHoughTransformer_rzcosmics::~MuonHoughTransformer_rzcosmics |
( |
| ) |
|
|
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_rzcosmics::fillHisto |
( |
double |
coord1, |
|
|
double |
coord2, |
|
|
double |
weight, |
|
|
int |
sector |
|
) |
| |
|
finaloverridevirtual |
◆ fillHit()
void MuonHoughTransformer_rzcosmics::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 |
◆ 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_rzcosmics::hookAssociateHitsToMaximum |
( |
const MuonHoughHitContainer & |
event, |
|
|
std::pair< double, double > |
coordsmaximum, |
|
|
double |
residu_mm, |
|
|
double |
residu_angle, |
|
|
int |
sector |
|
) |
| const |
|
finaloverrideprotectedvirtual |
pure virtual method for derived class implementation of associateHitsToMaximum method
Implements MuonHoughTransformer.
Definition at line 88 of file MuonHoughTransformer_rzcosmics.cxx.
95 double eradius{0.}, er0{0.};
97 const double rz0 = coordsmaximum.first;
99 const double phimax =
m_phisec[maxsector];
101 ATH_MSG_VERBOSE(
"hookAssociateHitsToMaximum() -- sector: " << maxsector <<
" phimax: " << phimax
102 <<
" coordsmaximumfirst: " << rz0 <<
" coordsmaximumsecond: " << coordsmaximum.second
103 <<
" coordsmaximumsecondinrad: " <<
theta <<
", size of event: " <<
event.size());
104 for (
unsigned int i = 0;
i <
event.size();
i++) {
105 const double hitx =
event.getHitx(
i);
106 const double hity =
event.getHity(
i);
109 const double hitz =
event.getHitz(
i);
114 ATH_MSG_VERBOSE(
"MuonHoughTransformer_rzcosmics() -- hitx: " << hitx <<
" hity: " << hity <<
" hitz: " << hitz
115 <<
" perp: " <<
perp <<
", residu_distance: " << residu_distance );
117 if (std::abs(residu_distance) < maximum_residu_mm)
120 <<
" already associated "<<
event.getHit(
i)->getAssociated());
122 event.getHit(
i)->setAssociated(
true);
124 double rz0hit = residu_distance + rz0;
133 eradius = eradius / (houghpattern->
size() + 1
e-7);
134 er0 = er0 / (houghpattern->
size() + 1
e-7);
142 if (houghpattern->
empty()) {
146 else if (std::abs(eradius - rz0) > 500.) {
147 ATH_MSG_VERBOSE(
"Eradius or Etheta calc. WRONG -- rz0: " << rz0 <<
" theta: "
148 <<
theta<<
", eradius: " << eradius);
156 <<
" old phi: " << phimax <<
", new r0: " << houghpattern->
getERPhi()
157 <<
" old r0: " << er0 <<
" new theta: " << houghpattern->
getETheta()
158 <<
" old theta: " <<
theta <<
" new z0: " << houghpattern->
getERTheta()
159 <<
" old z0: " << eradius );
◆ 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_rzcosmics::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 |
◆ updateParameters()
void MuonHoughTransformer_rzcosmics::updateParameters |
( |
MuonHoughPattern * |
houghpattern | ) |
|
|
staticprivate |
recalculate trackparameters of pattern
Definition at line 191 of file MuonHoughTransformer_rzcosmics.cxx.
192 const unsigned int size = houghpattern->
size();
194 if (
size <= 1)
return;
200 double sum_radii = 0.;
203 for (
unsigned int i = 0;
i <
size;
i++) {
204 sum_radii += houghpattern->
getHitx(
i) * cosphi + houghpattern->
getHity(
i) * sinphi;
208 const double av_radii = sum_radii / (
size + 0.);
209 const double av_z = sum_z / (
size + 0.);
213 for (
unsigned int i = 0;
i <
size;
i++) {
215 double hitz = houghpattern->
getHitz(
i);
216 double r_offset =
radius - av_radii;
217 double z_offset = hitz - av_z;
218 double weight = r_offset * r_offset + z_offset * z_offset;
220 if (r_offset *
radius + z_offset * hitz < 0) {
sign = -1; }
225 if (std::abs(sumr) < 0.000001 || std::abs(sumz) < 0.000001) {
return; }
227 double theta = std::atan2(sumr, sumz);
◆ useNegativeWeights()
void MuonHoughTransformer::useNegativeWeights |
( |
bool |
use_negative_weights | ) |
|
|
inlineinherited |
◆ weightHoughTransform() [1/2]
float MuonHoughTransformer_rzcosmics::weightHoughTransform |
( |
double |
r0 | ) |
const |
|
finaloverridevirtual |
◆ weightHoughTransform() [2/2]
float MuonHoughTransformer_rzcosmics::weightHoughTransform |
( |
double |
r0, |
|
|
double |
sintheta, |
|
|
double |
sinphi, |
|
|
double |
dotprod |
|
) |
| const |
|
private |
weight in transform, dotprod is the phi angle between the normal and the phisector
Definition at line 171 of file MuonHoughTransformer_rzcosmics.cxx.
177 double dotprod_part = 0.5 + 0.5 * dotprod * dotprod;
178 double sintheta_part = 0.9 + 0.1 * sintheta * sintheta;
179 double sinphi_part = 0.75 + 0.25 * sinphi * sinphi;
180 float r_theta_weight = dotprod_part * sintheta_part * sinphi_part;
◆ 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_cosphisec
std::unique_ptr<double[]> MuonHoughTransformer_rzcosmics::m_cosphisec {} |
|
private |
◆ m_costheta
std::unique_ptr<double[]> MuonHoughTransformer_rzcosmics::m_costheta {} |
|
private |
◆ 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_phisec
std::unique_ptr<double[]> MuonHoughTransformer_rzcosmics::m_phisec {} |
|
private |
◆ m_sinphisec
std::unique_ptr<double[]> MuonHoughTransformer_rzcosmics::m_sinphisec {} |
|
private |
◆ m_sintheta
std::unique_ptr<double[]> MuonHoughTransformer_rzcosmics::m_sintheta {} |
|
private |
◆ m_stepsize
double MuonHoughTransformer::m_stepsize |
|
protectedinherited |
◆ m_stepsize_per_angle
double MuonHoughTransformer::m_stepsize_per_angle |
|
protectedinherited |
◆ m_theta_in_grad
std::unique_ptr<double[]> MuonHoughTransformer_rzcosmics::m_theta_in_grad {} |
|
private |
◆ 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.
void setERPhi(double erphi)
set r0 of pattern
constexpr double degree_rad_conversion_factor
double getBinContent(int binnumber) const
returns x axis
void setETheta(double etheta)
set theta of pattern
MuonHoughHisto2D * getHisto(int id) const
return histogram at place id
static double signedDistanceToLine(double x0, double y0, double r0, double phi)
distance from (x0,y0) to the line (r0,phi), phi in rad
double getHitz(unsigned int hitno) const
returns z position of hit hitno
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
Scalar perp() const
perp method - perpenticular length
void setMaximumIsValid(bool flag)
double getHitx() const
returns x position
double getEPhi() const
returns phi of pattern
Scalar theta() const
theta method
void setEPhi(double ephi)
set phi of pattern
int size() const
returns size of container
double getERTheta() const
returns z0 of pattern
#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 addHit(const std::shared_ptr< MuonHoughHit > &hit)
add hit to container
void setERTheta(double ertheta)
set z0 of pattern
void reset() const
resets histograms
void setECurvature(double curvature)
set curvature of pattern
POOL::TEvent event(POOL::TEvent::kClassAccess)
unsigned int size() const
returns size of hitcontainer
double getHity(unsigned int hitno) const
returns y position of hit hitno
double getETheta() const
returns theta of pattern
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
bool empty() const
returns if hitcontainer is empty
std::string m_nm
Message source name.
double getERPhi() const
returns r0/d0 of pattern
Helper to simultaneously calculate sin and cos of the same angle.
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
double getHitx(unsigned int hitno) const
returns x position of hit hitno
bool getAssociated() const
return if hit already associated to pattern
Histogram class, similar to Root's TH2D.